You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Assigning .prev / .prev(1) to an OUT gives the expected result, but assigning it to a VAR doesn't. In the below example, the Verilog code has a being assigned to c directly instead of a_reg1. For higher orders, it works as expected, as shown by e.
Example
importdfhdl.*classFirstDF() extendsDFDesign:vala=Bit<>IN init 0valc=Bit<>VARvale=Bit<>VAR
c := a.prev(1)
e := a.prev(2)
vald=Bit<>OUT init 0
d := a.prev
@main defmain=FirstDF().compile
Output
moduleFirstDF(
inputwire logic clk,
inputwire logic rst,
inputwire logic a,
output logic d
);
logic c;
logic e;
logic a_reg1;
logic a_reg2;
always @(*)
begin
e = a_reg2;
d = a_reg1;
endalways @(posedge clk)
beginif (rst ==1'b1) begin
a_reg1 <=1'b0;
a_reg2 <=1'b0;
c <=1'b0;
endelsebegin
a_reg1 <= a;
a_reg2 <= a_reg1;
c <= a;
endendendmodule
The text was updated successfully, but these errors were encountered:
Technically, it is correct, as c assumes the value of a one cycle later. But c is in the clocked process, which is not the case for OUT or for higher orders and a bit unexpected.
In dataflow you can only assume dependency and insertion order. There are no clocks in DF. Although this could suggest something unplanned is happening there due to the different behavior, but there is no descrepency with DF rules in this example alone.
Description
Assigning .prev / .prev(1) to an OUT gives the expected result, but assigning it to a VAR doesn't. In the below example, the Verilog code has a being assigned to c directly instead of a_reg1. For higher orders, it works as expected, as shown by e.
Example
Output
The text was updated successfully, but these errors were encountered: