-
Notifications
You must be signed in to change notification settings - Fork 609
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dual-port RAM is not synthesized correctly while Single-port does #1788
Comments
Thanks for the report, @carlosedp! We will need to improve the way that we emit memories to Verilog. |
One thing I noticed is that your
|
However, if I make them mutually exclusive, the memory is still inferred as having 4 ports. I believe that there might be some problems with correctly inferring combined read/write ports on Chisel memories. @albert-magyar has been working on fixing some of these issue: chipsalliance/firrtl#1821 |
This is actually a separate issue that is not related to CHIRRTL memories. Since the beginning of the Chisel3/FIRRTL compiler project, FIRRTL has lowered readwrite ports to separate read and write ports. Therefore, it is unfortunately a known limitation that is is not possible to productively use a true dual-port (TDP) BRAM with native FIRRTL memories. I have implemented various workarounds for this, and I would be happy to add them to the emitter (i.e., allow certain memories to bypass Ultimately, I think the question is whether there is sufficient buy-in for adding special cases (not necessarily specific to BRAM use) to the emitter for synchronous-read memories vs. the status quo of having users rely on |
@carlosedp : Do you have any example Verilog code of a 2 R/W port memory that gets successfully mapped to a BRAM by yosys? I am having trouble generating such an example. All I found was this yosys issue which seems to indicate that maybe inferring combined R/W ports might not actually work: YosysHQ/yosys#1959 |
There is also this comment on a yosys issue: YosysHQ/yosys#1802 (comment)
|
Yep, also this comment from David: YosysHQ/yosys#1101 (comment) It hink it's a Yosys issue and not Chisel. |
Thanks for the follow up @carlosedp, should we close this issue? |
Ah yes, sure. |
If I add a second set of ports to a BRAM module, the synthesized verilog does not infer as BRAM (in Yosys for example).
Single port:
Generates:
While Dual port:
Generates:
With no DP16KD cells.
The logic is the same between both. I'm using Chisel3 3.4.2.
Found this reference on StackOverflow: https://stackoverflow.com/questions/54789756/vivado-cant-recognize-the-double-port-ram-while-using-syncreadmem
The text was updated successfully, but these errors were encountered: