Skip to content
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

Huge increase in resources from 5.0-r2 to current master #66

Closed
stffrdhrn opened this issue Jan 2, 2019 · 7 comments
Closed

Huge increase in resources from 5.0-r2 to current master #66

stffrdhrn opened this issue Jan 2, 2019 · 7 comments

Comments

@stffrdhrn
Copy link
Member

Found when building de0_nano-multicore. The design no longer fits on the de0_nano cyclone IV. It used to be 18210 logic cells no it has increased to 46111 logic cells.

BEFORE

$ fusesoc build ::de0_nano-multicore:1.0

...
INFO: Preparing ::mor1kx:5.0-r2
...


Info (21057): Implemented 19257 device resources after synthesis - the final resource count might be different
    Info (21058): Implemented 7 input pins
    Info (21059): Implemented 26 output pins
    Info (21060): Implemented 24 bidirectional pins
    Info (21061): Implemented 18210 logic cells
    Info (21064): Implemented 976 RAM segments
    Info (21065): Implemented 1 PLLs
    Info (21062): Implemented 12 DSP elements

NOW

Info (21057): Implemented 46990 device resources after synthesis - the final resource count might be different
    Info (21058): Implemented 7 input pins
    Info (21059): Implemented 26 output pins
    Info (21060): Implemented 24 bidirectional pins
    Info (21061): Implemented 46111 logic cells
    Info (21064): Implemented 808 RAM segments
    Info (21065): Implemented 1 PLLs
    Info (21062): Implemented 12 DSP elements
@stffrdhrn
Copy link
Member Author

Note, I see the number of ram segments has gone down. I am guessing that synthesis is failing to infer ram due to some changes and is using logic cells instead.

stffrdhrn added a commit to stffrdhrn/mor1kx that referenced this issue Jan 2, 2019
Itroduced with commit 73bf629 (true_dpram: Use a single sequential block).
Revert it back to fix the resource issue.
@imphil
Copy link
Contributor

imphil commented Jan 3, 2019

That's pretty annoying, but inferring primitives in various tools is always a error-prone game. The problem is that Synopsys DC gives an error (not a warning) and fails to synthesize the mor1kx design with the two blocks.

I'd take the following path:

  1. Try to find a solution which infers the right blocks and works on Synopsys DC. Could you double-check what Verilog code template the Xilinx and Altera suggest to generate a single-clock true dual-port RAM? (For Xilinx its UG901)
  2. If 1 doesn't work out with reasonable effort: Revert true_dpram: Use a single sequential block #63 for now to get back to the previous state where FPGA targets are working well, and follow up with a more flexible solution to pick a different SRAM implementation depending on the implementation target.

@stffrdhrn
Copy link
Member Author

stffrdhrn commented Jan 3, 2019 via email

@stffrdhrn
Copy link
Member Author

Hello, I am not sure if I found the most formal documentation. But it seems the differences are these:

Altera: http://www.gstitt.ece.ufl.edu/courses/spring10/eel4712/lectures/vhdl/qts_qii51007.pdf
Xilinx: https://www.xilinx.com/support/documentation/sw_manuals/xilinx2017_1/ug901-vivado-synthesis.pdf

On Xilinx there are 2 blocks with 2 separate clocks, on Altera/Intel they have 2 blocks but only require a single clock.

Let me try with 2 clocks into the top level true dual port ram module and see if it causes Atera issues. If its works ok, then I hope it will work on Synopsys DC. However, I checked and I cannot get a copy of Synopsys DC.

@imphil
Copy link
Contributor

imphil commented Jan 3, 2019

The Xilinx example is dual-clock, our module has only a single clock, so the examples are more or less identical. Since the FPGA tools seem to insist on the coding with two blocks we probably need to to go option 2. So for now please simply back out #63 and I'll look into a more permanent solution once I find time for it (not in the next couple of weeks though). This should at least unblock FPGA work.

@stffrdhrn
Copy link
Member Author

stffrdhrn commented Jan 3, 2019 via email

stffrdhrn added a commit to stffrdhrn/mor1kx that referenced this issue Jan 3, 2019
Introduced with commit 73bf629 (true_dpram: Use a single sequential block).

Change to use 2 clocks to better match what xilinx expects when
inferring true dual port RAM.  Tested and works on quartus/altera/intel.
@stffrdhrn
Copy link
Member Author

stffrdhrn commented Jan 5, 2019

Will close for now. Let's open another issue if synopsys DC fails with the new code.

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

No branches or pull requests

2 participants