amaranth
amaranth copied to clipboard
add Lattice Nexus vendor platform (using nextpnr-nexus and prjoxide)
sorry, github newb. Won't do that again. Tested again with blinking all LEDs. Output:
python3 -m amaranth_boards.lifcl_evn
init..
IDCODE: 0x110f1043 (LIFCL-40)
NX Status Register: 0x0000150100400100
reset..
NX Status Register: 0x0000150100400e50
programming..
NX Status Register: 0x0000150100400100
Bye.
Notes:
--Removed mention of ECP5 in lattice_nexus.py
--Removed OSC
Codecov Report
All modified and coverable lines are covered by tests :white_check_mark:
Project coverage is 89.44%. Comparing base (
b36e7e0) to head (51f5769). Report is 9 commits behind head on main.
:exclamation: Current head 51f5769 differs from pull request most recent head 8ccc083. Consider uploading reports for the commit 8ccc083 to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## main #759 +/- ##
==========================================
- Coverage 89.94% 89.44% -0.50%
==========================================
Files 44 43 -1
Lines 10647 9066 -1581
Branches 2595 2150 -445
==========================================
- Hits 9576 8109 -1467
+ Misses 882 781 -101
+ Partials 189 176 -13
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
FWIW I've been using amaranth with radiant and a nexus LFD2NX-40 part, and intend to contribute a platform definition when I'm happy with it (likely in a few weeks). I'll check back to see what the status of this is then.
I'm currently waiting on a LIFCL-EVN board so that I can do regression testing for this platform.
Good news: I've received the devboard I can test this on! I'll merge it soon.
@richardeoin how's your platform file looking?
@slagernate Here's the platform file I'm using with LFD2NX-40 + Radiant. I tweaked my formatting to make it somewhat more diff-able against yours.
Some differences
- Adds a two-stage FF sync into
i_GSR_NofGSR(is this necessary?) - Adds an
OSCAifself.default_clk == "OSCA" - Specifies
p_GSR="DISABLED"onIDDRX1andIDDRX2instances 😱 Probably don't do this - Less tortured templating syntax for generating the
.pdcconstraints
I initially tested without triggering a GSR after startup and observed some very unexpected behaviour from IDDR ODDR and BB primitives. After that I assume that triggering a GSR after startup is mandatory for correct operation on these parts. Skip my workaround of putting p_GSR="DISABLED" on IDDRX instances.
I've only tested with radiant and didn't use radiant's programmer tool at all.
See latest suggested commit where I've pulled in your platform file @richardeoin . This works for the Radiant and Oxide / NextPnr tool chain with the LIFCL-40-EVN (Crosslink-NX Eval Board).
The current plan is to go through the backlog of PRs after https://github.com/amaranth-lang/rfcs/pull/2 gets merged.
There have been subsequent improvements to amaranth/vendor and this PR needs at a minimum to be updated to include those.
@slagernate are you willing to maintain this PR (no is an ok answer!! :) )? It would be great to see it merged, and if you can't I'd happy to do the work (and have my own LFD2NX-40 test hardware).
@richardeoin more than willing to update the PR, just need to find some spare time (perhaps in the next week). Have been using Amaranth + Radiant quite a bit (the PCLKDIV primitive in Oxide is missing :| ). But also totally happy if you'd like to take the reins!
This PR has languished for a bit too long--I'll add it to the 0.5 milestone to make sure it's merged before then.
Should be compatible with RFC#18 now.
Updated to use tcl_quote instead of tcl_escape.
Superseded by #1342, since recent internal refactoring made this PR unmergeable. However, #1342 is based on this work--thank you!