S
Steve Glow
Guest
I'm fairly new to verilog and have a very simple question which none of
my verilog books have answered:
What happens when the same register is assigned twice (using
non-blocking assignments) with different values? For example:
always @(posedge some_clock) begin
// Set the default value for the register
somereg <= 0;
// Override this later if some condition is true
if( something )
somereg <= 1;
end
Does the register end up with the first or second assignment?
Is this even considered a legal assignment, or is it undefined?
If it is legal, is this considered 'bad form' by more experienced
verilog designers?
Thanks,
Steve
my verilog books have answered:
What happens when the same register is assigned twice (using
non-blocking assignments) with different values? For example:
always @(posedge some_clock) begin
// Set the default value for the register
somereg <= 0;
// Override this later if some condition is true
if( something )
somereg <= 1;
end
Does the register end up with the first or second assignment?
Is this even considered a legal assignment, or is it undefined?
If it is legal, is this considered 'bad form' by more experienced
verilog designers?
Thanks,
Steve