openXC7 / demo-projects

Demo projects for various Kintex FPGA boards
BSD 3-Clause "New" or "Revised" License
41 stars 15 forks source link

Litex build not reproducible #3

Open nmk456 opened 1 year ago

nmk456 commented 1 year ago

Can you add the script/command used to generate the litex builds? I can't my own builds to work with the toolchain.

hansfbaier commented 1 year ago

Which ones in particular?

nmk456 commented 1 year ago

I'm specifically interested in litex-ddr-stlv7325 but all of them would be nice.

hansfbaier commented 1 year ago

I just committed this. I used almost the original litex target file, I only reduced the DDR3 pads to use only the first two modules, and I had to run the build with 80MHz sys-clk. Since that runs vivado, I copy the .v and the .init files from the build directory (.xdc only first time and then commenting out the parts that nextpnr-xilinx does not understand).

https://github.com/openXC7/demo-projects/blob/main/litex-ddr-stlv7325/sitlinv_stlv7325.py

hansfbaier commented 1 year ago

Very similar procedure with the other boards.

hansfbaier commented 1 year ago

Eventually we are going to add the toolchain to LiteX, but the toolchain packaging is not final yet, so I am hesitating with that at the moment.

tommythorn commented 1 year ago

Slightly off topic, but on the same design - I can build it and get the LED chasers, but is there supposed to be a serial console somewhere? The USB-C (between the SFP and RJ ports) claims to be a serial adapter (auto recognized by both macOS and Linux) but I'm not seeing anything there.

hansfbaier commented 1 year ago

Maybe the port changed in the new board revision, can you check if the pins in the xdc rile still match the schematic or board doc?

On Tue, May 2, 2023, 05:37 Tommy Thorn @.***> wrote:

Slightly off topic, but on the same design - I can build get and get the LED chasers, but is there supposed to be a serial console somewhere? The USB-C (between the SFP and RJ ports) claims to be a serial adapter (auto recognized by both macOS and Linux) but I'm not seeing anything there.

— Reply to this email directly, view it on GitHub https://github.com/openXC7/demo-projects/issues/3#issuecomment-1530463384, or unsubscribe https://github.com/notifications/unsubscribe-auth/AABEI74UILLZ5UHP7KXMBDLXEA3J5ANCNFSM6AAAAAAWYSWO24 . You are receiving this because you commented.Message ID: @.***>

tommythorn commented 1 year ago

(Updated to be more readable)

Ok, I finally got a schematic and a lot has changed, to the point where stlv7325, which refers to the blue version 1.0 which isn't sold anymore, is really a different board than the current red, version 2.0. I see LiteX calls the latter "stlv7325_v2" which is clear. However the demos here will not probably not work with the v2 board. The seller shared a relevant link: https://github.com/litex-hub/litex-boards/pull/498?spm=a2g0s.imconversation.0.0.77483e5fm821sF which also has the schematic in the first comment.

FWIW, I succeed in getting a serial loopback design working using PIN L23 as FPGA TX/PC RX and K21 as PC TX/FPGA RX.

hansemro commented 1 year ago

Had to make the following litex-board changes for KC705 (similar for other boards as well):

  1. Drop _T_DCI (for digitally controlled impedance with tristate support; referred to as 3-state DCI in UG471) from IOStandard constraints under litex_boards/platforms/<board>.py
  2. Replace S7MMCM with S7PLL under litex_boards/targets/<board>.py

After updating litex-boards package, I can generate the necessary litex files with:

python3 -m litex_boards.targets.<board> --build --no-compile-gateware [OPTION]...

--no-compile-gateware avoids running vivado, but still generates everything needed for open source flow (gateware + bios).

Relevant fork: https://github.com/hansemro/litex-boards/commits/kc705_nextpnr

EDIT: added correction for T_DCI meaning

hansfbaier commented 1 year ago

Great, can you put this in a README of your contribution?

hansemro commented 1 year ago

Sure, I will get to it when I can.