[verilog] How is a always@* block synthesized

Status
Not open for further replies.

pigtwo

Member level 4
Joined
Jul 16, 2015
Messages
70
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
2,771
Hello all,

I have a basic question about how a certain block is synthesized. Take for example the code below:

Code Verilog - [expand]
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module blah(input wire clk);
 
   reg state, state_next;
 
   always @(posedge clk)
   begin
      state <= state_next;
   end
 
   always@*
   begin
      state_next = state + 1;
   end
endmodule



I understand that the first always block will produce a register that is clocked by 'clk' but what does the second always block synthesize to? Does it just become pure combination logic(IE even though state_next is declared a reg it would really synthesize as a wire)?

For clarification I don't mean how is an incrementer synthesized(this is just an example) but more generally how registers in a always@* block are handled.

Thank you for the help!
 

A always @* block will never produce a flip-flop in a design it might produce a latch if there is feedback, otherwise you get a combinational blob.

The reg keyword does not by definition produce flip-flops it only means the signal will hold state until changed by an assignment. This is part of the reason for changing it to logic in SV. Wire on the otherhand is just that interconnection wires like you would put on a prototype board.
 
That makes perfect sense, thank you. I think it was just the terminology was confusing me.
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…