matrixofdynamism
Advanced Member level 2
In verilog what is the difference between using "always @" vs "@" on its own?
The book states that "The @ symbol is used to specify an event control". It then gives the following examples:
If this is possible then why do we write "always @"?
Finally how do these two compare with using the forever loop as in "forever @".
Is it that in synthesis code we can only used "always @" but all three of them basically do the same thing?
The book states that "The @ symbol is used to specify an event control". It then gives the following examples:
@(clock) q = d; //q = d is executed whenever signal clock changes value
@(posedge clock) q = d; //q = d is executed whenever signal clock does a positive transition ( 0 to 1,x or z, // X to 1, z to 1 )
@(negedge clock) q = d; //q = d is executed whenever signal clock does a negative transition ( 1 to 0,x or z, X to 0, z to 0)
q = @(posedge clock) d; //d is evaluated immediately and assigned to q at the positive edge of clockIf this is possible then why do we write "always @"?
Finally how do these two compare with using the forever loop as in "forever @".
Is it that in synthesis code we can only used "always @" but all three of them basically do the same thing?