Skip to content

Conversation

@yrabbit
Copy link
Contributor

@yrabbit yrabbit commented Oct 21, 2025

All supported (and planned to be supported) GW5A series chips do not have the mode 2: Read-before-Write write mode.

Here, we prohibit the generation of BSRAM with this mode.

To verify this, you can run the script from the attached archive.
The old version generated mode 2.

 ./go.sh
===============
  defparam \vram_mem.0.0 .WRITE_MODE0 = 0;
  defparam \vram_mem.0.0 .WRITE_MODE1 = 2;
  defparam \vram_mem.0.1 .WRITE_MODE0 = 0;
  defparam \vram_mem.0.1 .WRITE_MODE1 = 2;
  defparam \vram_mem.0.10 .WRITE_MODE0 = 0;
....

The new version should not do this.
test.tar.gz

All supported (and planned to be supported) GW5A series chips do not
support the 2: Read-before-Write write mode.

Here, we prohibit the generation of BSRAM with this mode.

Signed-off-by: YRabbit <[email protected]>
@yrabbit
Copy link
Contributor Author

yrabbit commented Oct 21, 2025

Excerpt from BSRAM documentation:
bsram-mode

@Ravenslofty
Copy link
Collaborator

The PR as-is is fine, and I can merge it if you want me to, but I think there's a more concise way to do this: memory_libmap supports "defines", and so instead of switching out the default bram file for a gw5a one, you can gate read-first under a define.

@yrabbit
Copy link
Contributor Author

yrabbit commented Oct 23, 2025

Let's merge it as is and I'll come back to a more concise way later - that way yosys will generate the correct design while I finish investigating another problematic element of BSRAM - a semidual port with a large data width - it doesn't work without a lot of auxiliary elements and I really don't want to lose my train of thought right now :)

@Ravenslofty Ravenslofty merged commit 64700de into YosysHQ:main Oct 23, 2025
27 checks passed
yrabbit added a commit to yrabbit/yosys that referenced this pull request Oct 25, 2025
Process the WRITE_MODE in the GW5A series in a more concise manner.

You can check it in the same way as in
YosysHQ#5440

Signed-off-by: YRabbit <[email protected]>
Ravenslofty pushed a commit that referenced this pull request Oct 25, 2025
Process the WRITE_MODE in the GW5A series in a more concise manner.

You can check it in the same way as in
#5440

Signed-off-by: YRabbit <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants