Hot take: The proper Verilog template for synchronously reset flip-flops looks like this. always @(posedge clk) begin [non-reset code here] if (reset) begin [reset code here] end end
-
-
Oh dear, I think you're right, but not "foo <= 42" I think: "reg foo = 0; always @(...) begin foo <= 42; foo <= foo; end" So the 2nd assignment gets 0, not 42?
-
Yes. That's putting `foo <= 42;` followed by `foo <= 0;` on the queue. They are then executed in that order, effectively assigning 0 to foo.
- Show replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.