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
Please provide the steps to reproduce the problem:
Generate verilog for the code below using different values for the last parameter (ruw) of the SyncReadMem call
classMemTestextendsModule (){
valio=IO(newBundle {
valwrEn=Input(Bool())
valwrAddr=Input(UInt(8.W))
valwrData=Input(UInt(8.W))
valrdEn=Input(Bool())
valrdAddr=Input(UInt(8.W))
valrdData=Output(UInt(8.W))
})
/* try using SyncReadMem.ReadFirst or SyncReadMem.WriteFirst here */valm=SyncReadMem(256, UInt(8.W), SyncReadMem.Undefined)
when (io.wrEn) {
m.write(io.wrAddr, io.wrData)
}
io.rdData := m.read(io.rdAddr, io.rdEn)
}
What is the current behavior?
The generated verilog code always behaves as WriteFirst. If a memory entry is read and written in the same clock cycle, the read data gets the newly written value in the next cycle.
The important parts of the generated verilog code is:
What is the expected behavior?
The generated verilog should behave as specified by the ruw parameter, or as described in the Chisel Memories documentation when ruw is not specified.
Please tell us about your environment:
Chisel version: 6.5
SBT version 1.9.8
Other Information
What is the use case for changing the behavior?
It should be possible to simulate SRAMs with different read/write conflict behaviour without replacing the memories with vendor models.
The text was updated successfully, but these errors were encountered:
This was never implemented in CIRCT and, hence, this always incorrectly compiles to write first. There's an old tracking issue here: llvm/circt#787
CIRCT passes should handle this if we are going to support it or the option should be dropped from Chisel. It shouldn't be that bad to just support it in CIRCT.
Type of issue: Bug Report
Please provide the steps to reproduce the problem:
Generate verilog for the code below using different values for the last parameter (
ruw
) of theSyncReadMem
callWhat is the current behavior?
The generated verilog code always behaves as WriteFirst. If a memory entry is read and written in the same clock cycle, the read data gets the newly written value in the next cycle.
The important parts of the generated verilog code is:
What is the expected behavior?
The generated verilog should behave as specified by the
ruw
parameter, or as described in the Chisel Memories documentation whenruw
is not specified.Please tell us about your environment:
6.5
1.9.8
Other Information
What is the use case for changing the behavior?
It should be possible to simulate SRAMs with different read/write conflict behaviour without replacing the memories with vendor models.
The text was updated successfully, but these errors were encountered: