techlibs/lattice: add missing clock muxes to ECP5 block ram blackboxes #5045
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What are the reasons/motivation for this change?
Fixes #3952 , missing parameters on ECP5 EBR blackboxes.
Explain how this is achieved.
prjtrellis documentation shows that EBR clock inputs have optional inverters. The bram techmap outputs those parameters, and nextpnr consumes them. But for whatever reason, Diamond doesn't include those parameters in its blackbox models. This makes synth_lattice fail when targeting ECP5 with a design that maps block RAMs.
This change fixes up the ECP5 bram blackbox models at generation time, by adding in the missing parameters.
If applicable, please suggest to reviewers how they can test the change.
Grab this
synth.v
https://gist.github.com/danderson/3e80ce79da41673de1ee0dff22e0e596 . The Verilog is a bit verbose, but it's just a basic 1kiB block RAM with registered output.With yosys@main:
yosys -p 'read_verilog -sv -defer synth.v; hierarchy -top mkTop; synth_lattice -family ecp5'
Observe synthesis failure with error:
yosys -p 'read_verilog -sv -defer synth.v; hierarchy -top mkTop; synth_lattice -family ecp5'
Observe synthesis now succeeds.
-abc9
tosynth_lattice
before and after. Before:After: synthesis succeeds.