amaranth icon indicating copy to clipboard operation
amaranth copied to clipboard

add Lattice Nexus vendor platform (using nextpnr-nexus and prjoxide)

Open slagernate opened this issue 2 years ago • 12 comments

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

slagernate avatar Mar 02 '23 04:03 slagernate

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.

codecov[bot] avatar Mar 02 '23 04:03 codecov[bot]

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.

richardeoin avatar Mar 06 '23 20:03 richardeoin

I'm currently waiting on a LIFCL-EVN board so that I can do regression testing for this platform.

whitequark avatar Mar 07 '23 05:03 whitequark

Good news: I've received the devboard I can test this on! I'll merge it soon.

whitequark avatar May 12 '23 15:05 whitequark

@richardeoin how's your platform file looking?

slagernate avatar May 16 '23 18:05 slagernate

@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_N of GSR (is this necessary?)
  • Adds an OSCA if self.default_clk == "OSCA"
  • Specifies p_GSR="DISABLED" on IDDRX1 and IDDRX2 instances 😱 Probably don't do this
  • Less tortured templating syntax for generating the .pdc constraints

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.

richardeoin avatar May 17 '23 21:05 richardeoin

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).

slagernate avatar May 28 '23 05:05 slagernate

The current plan is to go through the backlog of PRs after https://github.com/amaranth-lang/rfcs/pull/2 gets merged.

whitequark avatar Jun 27 '23 12:06 whitequark

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 avatar Jan 27 '24 22:01 richardeoin

@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!

slagernate avatar Jan 30 '24 08:01 slagernate

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.

whitequark avatar Jan 30 '24 12:01 whitequark

Should be compatible with RFC#18 now.

slagernate avatar Jan 30 '24 21:01 slagernate

Updated to use tcl_quote instead of tcl_escape.

slagernate avatar Mar 12 '24 22:03 slagernate

Superseded by #1342, since recent internal refactoring made this PR unmergeable. However, #1342 is based on this work--thank you!

whitequark avatar Apr 19 '24 16:04 whitequark