BrunoLevy / learn-fpga

Learning FPGA, yosys, nextpnr, and RISC-V
BSD 3-Clause "New" or "Revised" License
2.53k stars 242 forks source link

Error when running make ARTY #96

Closed JamesTimothyMeech closed 1 year ago

JamesTimothyMeech commented 1 year ago

When I run make ARTY I get this error:

==== Generated femtorv32 libs.
make[1]: Leaving directory '/home/james/Desktop/Casino/learn-fpga/FemtoRV/learn-fpga/FemtoRV/FIRMWARE'
yosys -DARTY -p "scratchpad -set xilinx_dsp.multonly 1" -p "synth_xilinx -nowidelut -flatten -abc9 -arch xc7 -top femtosoc; write_json femtosoc.json" RTL/femtosoc.v > log.txt
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 7) >= this->size() (which is 4)
Aborted
make: *** [BOARDS/arty35_yosys_nextpnr.mk:14: ARTY.synth] Error 134

What would be the best way to go about debugging it?

JamesTimothyMeech commented 1 year ago

I tried to install the tools again on a different Ubuntu machine but I was unable to untangle this error when running make ARTY:


==== Generated femtorv32 libs.
make[1]: Leaving directory '/home/meechy/Casino/learn-fpga/FemtoRV/FIRMWARE'
yosys -DARTY -p "scratchpad -set xilinx_dsp.multonly 1" -p "synth_xilinx -nowidelut -flatten -abc9 -arch xc7 -top femtosoc; write_json femtosoc.json" RTL/femtosoc.v > log.txt
nextpnr-xilinx --chipdb /usr/share/nextpnr/xilinx-chipdb/xc7a35t.bin --xdc BOARDS/arty.xdc --json femtosoc.json --write femtosoc_routed.json --fasm femtosoc.fasm
ERROR: Unable to read chipdb /usr/share/nextpnr/xilinx-chipdb/xc7a35t.bin
0 warnings, 1 error
make: *** [BOARDS/arty35_yosys_nextpnr.mk:15: ARTY.synth] Error 255```
JamesTimothyMeech commented 1 year ago

To fix the above error I had to edit the BOARDS/arty35_yosys_nextpnr.mk file variables DB_DIR and CHIPDB_DIR to point to the databases in the nextpnr-xilinx directory.

JamesTimothyMeech commented 1 year ago

I am now running into this error ERROR: port TXD has no IOSTANDARD property0 warnings, 1 error:

nextpnr-xilinx --chipdb /home/meechy/Casino/nextpnr-xilinx/xilinx/xc7a35t.bin --xdc BOARDS/arty.xdc --json femtosoc.json --write femtosoc_routed.json --fasm femtosoc.fasm
Info: Packing constants..
Info: Inserting IO buffers..
Info:     IO port 'pclk' driven by IBUF '$iopadmap$femtosoc.pclk'
Info:     IO port 'oled_RST' driven by OBUF '$iopadmap$femtosoc.oled_RST'
Info:     IO port 'oled_DIN' driven by OBUF '$iopadmap$femtosoc.oled_DIN'
Info:     IO port 'oled_DC' driven by OBUF '$iopadmap$femtosoc.oled_DC'
Info:     IO port 'oled_CS' driven by OBUF '$iopadmap$femtosoc.oled_CS'
Info:     IO port 'oled_CLK' driven by OBUF '$iopadmap$femtosoc.oled_CLK'
Info:     IO port 'TXD' driven by OBUF '$iopadmap$femtosoc.TXD'
Info:     IO port 'RXD' driven by IBUF '$iopadmap$femtosoc.RXD'
Info:     IO port 'RESET' driven by IBUF '$iopadmap$femtosoc.RESET'
Info:     IO port 'D5' driven by OBUF '$iopadmap$femtosoc.D5'
Info:     IO port 'D4' driven by OBUF '$iopadmap$femtosoc.D4'
Info:     IO port 'D3' driven by OBUF '$iopadmap$femtosoc.D3'
Info:     IO port 'D2' driven by OBUF '$iopadmap$femtosoc.D2'
Info:     IO port 'D1' driven by OBUF '$iopadmap$femtosoc.D1'
Info:     Constraining 'pclk' to site 'IOB_X1Y76'
Info:     Tile 'RIOB33_X43Y75'
Info:     Constraining 'oled_RST' to site 'IOB_X0Y99'
Info:     Tile 'LIOB33_SING_X0Y99'
Info:     Constraining 'oled_DIN' to site 'IOB_X0Y50'
Info:     Tile 'LIOB33_SING_X0Y50'
Info:     Constraining 'oled_DC' to site 'IOB_X0Y87'
Info:     Tile 'LIOB33_X0Y87'
Info:     Constraining 'oled_CS' to site 'IOB_X0Y80'
Info:     Tile 'LIOB33_X0Y79'
Info:     Constraining 'oled_CLK' to site 'IOB_X0Y79'
Info:     Tile 'LIOB33_X0Y79'
Info:     Constraining 'RESET' to site 'IOB_X1Y68'
Info:     Tile 'RIOB33_X43Y67'
Info:     Constraining 'D4' to site 'IOB_X0Y1'
Info:     Tile 'LIOB33_X0Y1'
Info:     Constraining 'D3' to site 'IOB_X0Y2'
Info:     Tile 'LIOB33_X0Y1'
Info:     Constraining 'D2' to site 'IOB_X1Y50'
Info:     Tile 'RIOB33_SING_X43Y50'
Info:     Constraining 'D1' to site 'IOB_X1Y51'
Info:     Tile 'RIOB33_X43Y51'
Info: Generating input buffer for '$iopadmap$femtosoc.pclk'
Info: Generating output buffer for '$iopadmap$femtosoc.oled_RST'
Info: Generating output buffer for '$iopadmap$femtosoc.oled_DIN'
Info: Generating output buffer for '$iopadmap$femtosoc.oled_DC'
Info: Generating output buffer for '$iopadmap$femtosoc.oled_CS'
Info: Generating output buffer for '$iopadmap$femtosoc.oled_CLK'
Info: Generating output buffer for '$iopadmap$femtosoc.TXD'
Info: Generating input buffer for '$iopadmap$femtosoc.RXD'
Info: Generating input buffer for '$iopadmap$femtosoc.RESET'
Info: Generating output buffer for '$iopadmap$femtosoc.D5'
Info: Generating output buffer for '$iopadmap$femtosoc.D4'
Info: Generating output buffer for '$iopadmap$femtosoc.D3'
Info: Generating output buffer for '$iopadmap$femtosoc.D2'
Info: Generating output buffer for '$iopadmap$femtosoc.D1'
Info:     Created 14 PAD cells from:
Info:             14x PAD
ERROR: port TXD has no IOSTANDARD property0 warnings, 1 error
make: *** [BOARDS/arty35_yosys_nextpnr.mk:15: ARTY.synth] Error 255
JamesTimothyMeech commented 1 year ago

I had to uncomment the lines about the pins that it complained about in the BOARDS/arty.xdc file to fix this error.

JamesTimothyMeech commented 1 year ago

I am now running into problems with fasm2frames that I am struggling to understand:

Info: Program finished normally.
fasm2frames --part xc7a35tcsg324-1 --db-root /home/meechy/Casino/nextpnr-xilinx/xilinx/external/prjxray-db/artix7 femtosoc.fasm > femtosoc.frames
/usr/local/lib/python3.10/dist-packages/fasm/parser/__init__.py:30: RuntimeWarning: Unable to import fast Antlr4 parser implementation.
  ImportError: cannot import name 'antlr_to_tuple' from partially initialized module 'fasm.parser' (most likely due to a circular import) (/usr/local/lib/python3.10/dist-packages/fasm/parser/__init__.py)

  Falling back to the much slower pure Python textX based parser
  implementation.

  Getting the faster antlr parser can normally be done by installing the
  required dependencies and then reinstalling the fasm package with:
    pip uninstall
    pip install -v fasm

  warn(
Traceback (most recent call last):
  File "/usr/local/bin/fasm2frames", line 33, in <module>
    sys.exit(load_entry_point('prjxray', 'console_scripts', 'fasm2frames')())
  File "/home/meechy/Casino/prjxray/utils/fasm2frames.py", line 304, in main
    run(
  File "/home/meechy/Casino/prjxray/utils/fasm2frames.py", line 189, in run
    assembler.parse_fasm_filename(filename_in, extra_features=extra_features)
  File "/home/meechy/Casino/prjxray/prjxray/fasm_assembler.py", line 190, in parse_fasm_filename
    raise FasmLookupError('\n'.join(missing_features))
prjxray.fasm_assembler.FasmLookupError: Segment DB CMT_TOP_L_LOWER_B, key CMT_TOP_L_LOWER_B.MMCM_CLK_FREQ_BB_REBUF2_NS.MMCM_CLK_FREQ_BB_NS2 not found from line 'CMT_TOP_L_LOWER_B_X106Y61.MMCM_CLK_FREQ_BB_REBUF2_NS.MMCM_CLK_FREQ_BB_NS2'
Segment DB CMT_TOP_L_UPPER_T, key CMT_TOP_L_UPPER_T.PLL_CLK_FREQ_BB2_NS.PLL_CLK_FREQ_BB_BUFOUT_NS2 not found from line 'CMT_TOP_L_UPPER_T_X106Y44.PLL_CLK_FREQ_BB2_NS.PLL_CLK_FREQ_BB_BUFOUT_NS2'
make: *** [BOARDS/arty35_yosys_nextpnr.mk:16: ARTY.synth] Error 1
JamesTimothyMeech commented 1 year ago

The above problem is solved if I edit RTL/CONFIGS/arty_config.v to use define NRV_FEMTORV32_ELECTRON instead of define NRV_FEMTORV32_QUARK

JamesTimothyMeech commented 1 year ago

When I run make ARTY I get this error:

==== Generated femtorv32 libs.
make[1]: Leaving directory '/home/james/Desktop/Casino/learn-fpga/FemtoRV/learn-fpga/FemtoRV/FIRMWARE'
yosys -DARTY -p "scratchpad -set xilinx_dsp.multonly 1" -p "synth_xilinx -nowidelut -flatten -abc9 -arch xc7 -top femtosoc; write_json femtosoc.json" RTL/femtosoc.v > log.txt
terminate called after throwing an instance of 'std::out_of_range'
  what():  vector::_M_range_check: __n (which is 7) >= this->size() (which is 4)
Aborted
make: *** [BOARDS/arty35_yosys_nextpnr.mk:14: ARTY.synth] Error 134

What would be the best way to go about debugging it?

Building the most recent version of yosys from github from source fixed this