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
self.comb+= [
# Always validself.tx.tvalid_i.eq(1),
# Throw away receiver dataself.rx.tready_i.eq(1),
# Clear an error if one occursself.rx.error_clear_i.eq(self.rx.error_o),
# If we get input from our RTIO interface and our receiver is locked, write# it to the transmitter. Otherwise, just continually write /IDLE/.If(self.rtlink.o.stb&self.rx.lock_o,
# D-code if address is 0xDC, else K-codeIf(self.rtlink.o.address==0xDC, self.tx.tid_i.eq(0)
).Else(self.tx.tid_i.eq(1)),
# Connect RTIO data directly to transmitterself.tx.tdata_i.eq(self.rtlink.o.data),
).Else(
self.tx.tid_i.eq(1),
self.tx.tdata_i.eq(0b0010_0010)
),
]
The important part is the If at the bottom. All the inputs to self.rx and self.tx are registered within those modules.
When translated to Verilog, this module produces the following output:
always @(*) begin
ustransmitter_tid_i <=1'd0;
ustransmitter_tdata_i <=8'd0;
if ((ointerface_stb & usreceiver_lock_o)) beginif ((ointerface_address ==8'd220)) begin
ustransmitter_tid_i <=1'd0;
endelsebegin
ustransmitter_tid_i <=1'd1;
end
ustransmitter_tdata_i <= ointerface_data;
endelsebegin
ustransmitter_tdata_i <=6'd34;
end// synthesis translate_off
dummy_d_84 <= dummy_s;
// synthesis translate_onend
This is wrong—the assignment self.tx.tid_i.eq(1) in the .Else() has been elided, which produces different behaviour (self.tx.tid_i now has the value '0 when there is no RTIO input instead of 1'b1). I'm also suspicious of the generated Verilog using the nonblocking assignment when it should be combinatorial.
I have the following in a Migen module:
The important part is the
Ifat the bottom. All the inputs toself.rxandself.txare registered within those modules.When translated to Verilog, this module produces the following output:
This is wrong—the assignment
self.tx.tid_i.eq(1)in the.Else()has been elided, which produces different behaviour (self.tx.tid_inow has the value'0when there is no RTIO input instead of1'b1). I'm also suspicious of the generated Verilog using the nonblocking assignment when it should be combinatorial.