G
Giorgos Tzampanakis
Guest
I was under the impression that in Verilog nonblocking
assignments are evaluated in an arbitrary order. However, in
Quartus, I have noticed that if you use something like this:
always @(posedge clock) begin
a <= 1;
if (condition) a <= 0;
end
Then, if "condition" is true "a" will always be assigned the
value 0. Is this the way Verilog is described in the standard
or is it just an Altera convention?
Which bring us to my next question: Can I block multiple non-
blocking assignments together like so:
always @(posedge clock) begin
begin
a <= 1;
b <= 2;
end
begin
c <= a;
d <= b;
end
end
So that "c" will end up with value 1 and "d" will end up with
value 2? I know that if I had only "a" and "c" I could use
blocking assignments, but with two groups of variables it
wouldn't be possible. So does the above snippet work reliably?
assignments are evaluated in an arbitrary order. However, in
Quartus, I have noticed that if you use something like this:
always @(posedge clock) begin
a <= 1;
if (condition) a <= 0;
end
Then, if "condition" is true "a" will always be assigned the
value 0. Is this the way Verilog is described in the standard
or is it just an Altera convention?
Which bring us to my next question: Can I block multiple non-
blocking assignments together like so:
always @(posedge clock) begin
begin
a <= 1;
b <= 2;
end
begin
c <= a;
d <= b;
end
end
So that "c" will end up with value 1 and "d" will end up with
value 2? I know that if I had only "a" and "c" I could use
blocking assignments, but with two groups of variables it
wouldn't be possible. So does the above snippet work reliably?