Verilog: Can you put “assign” statements within always@ or begin/end statements?

后端 未结 7 2121
北海茫月
北海茫月 2020-12-18 10:34

Is this allowed?

input w;
     input [8:0]y;
     output reg [8:0]x;
     always@(w)
     begin


     //x[0] or A is never on in any next state
     as         


        
7条回答
  •  萌比男神i
    2020-12-18 10:52

    You can, it's called a "Procedural Continuous Assignment". It overrides ordinary procedural assignments, there doesn't seem to be a call for them in the code you've posted. I'm not sure if they're synthesisable, but I never have cause to use them anyway.

    A note on your code - you're missing y from your sensitivity list: eg always @( w or y ) or always @(*) is safer.

提交回复
热议问题