Open zhutmost opened 1 year ago
I think this is stemming from this being recently allowed in CIRCT and this specific code path never being possible before.
This used to not be a candidate for memory replacement, but is after https://github.com/llvm/circt/pull/4850.
CC: @sequencer, @SpriteOvO. Is this something that affects you and can take a look?
I have discussed this with @sequencer and there are indeed some bugs. I'm investigating it :/
For the expected behaviors in the OP, we think it shouldn't throw an error, the second behavior makes more sense.
To be more specific, The main problem is the second read doesn't know which port should bind to? I think in the future we should resolve this with intrinsic
To be more specific, The main problem is the second read doesn't know which port should bind to? I think in the future we should resolve this with intrinsic
Hi @sequencer . The read port looks good. the masked write port is generated wrongly.
Yes, but which port should this read bind to?
@seldridge Hi, I revert my PR llvm/circt/pull/4850 locally, and the problem from OP is still reproducible (2 unused masks), seems like it was not introduced from my PR.
Should we continue to fix it or wait for the new memory model? If we go to the former, and if I understand correctly, the fix will be applied in LoweringMemory
pass?
I'm facing the same issue here in Chisel 6.4.0. Since Chisel does not restrict the usage of SyncReadMem to single-port only, I think Chisel should at least ensure the correct semantics of generated Verilog. Even if the generated code is mostly not possible for ASIC, users may use SyncReadMem to construct simulation models. Is this issue expected to be fixed in the near future?
A temporary workaround seems adding a mask Wire with dontTouch
and connecting it to the unmasked write port.
@sequencer @SpriteOvO Any progress on this issue? Or, is there any plan on getting this fixed? Probably https://github.com/chipsalliance/chisel/issues/3542 is a similar issue. Thank you.
I personally think --repl-seq-mem
should not be used in the designs, and need to be marked as deprecated.
Type of issue: Bug Report
Please provide the steps to reproduce the problem:
I have attached two write ports to a
ReadSyncMem
. One write port has a mask, and the other one does not have a mask.What is the current behavior?
The generated Verilog is shown as follows. The input signal mask_X are totally dropped and unused. The generate circuits and the original chisel code have different functions.
The generated --repl-seq-mem conf file "MyChipTop.sv.conf" as well as metadata/seq_mems.json are also wrong.
What is the expected behavior?
mask
, and the other is set to 0 ( means always enable ).Please tell us about your environment: Firtool 1.40 Chisel 5.0.0-RC2 on macOS, OpenJDK17.
Other Information
What is the use case for changing the behavior?