-
Notifications
You must be signed in to change notification settings - Fork 248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Sipeed Tangnano9k and Tangnano20k boards #121
base: master
Are you sure you want to change the base?
Conversation
Necessary changes have been made to support these two boards with GOWIN chips, but still WIP. Signed-off-by: YRabbit <[email protected]>
But I'm stuck on the fact that iverilog doesn't like registers being declared after they are used. ~/src/learn-fpga/FemtoRV$ make TANGNANO9K
BOARD=tangnano9k TOOLS/make_config.sh -DTANGNANO9K
./PROCESSOR/femtorv32_quark.v:63: error: Unable to bind wire/reg/memory `instr['sd11:'sd7]' in `FemtoRV32'
./PROCESSOR/femtorv32_quark.v:198: : A symbol with that name was declared here. Check for declaration after use.
./PROCESSOR/femtorv32_quark.v:63: error: Unable to elaborate r-value: instr['sd11:'sd7]
./PROCESSOR/femtorv32_quark.v:68: error: Unable to bind wire/reg/memory `instr['sd14:'sd12]' in `FemtoRV32'
./PROCESSOR/femtorv32_quark.v:198: : A symbol with that name was declared here. Check for declaration after use.
./PROCESSOR/femtorv32_quark.v:68: error: Unable to elaborate r-value: (8'd1)<<(instr['sd14:'sd12])
./PROCESSOR/femtorv32_quark.v:71: error: Unable to bind wire/reg/memory `instr['sd31]' in `FemtoRV32'
./PROCESSOR/femtorv32_quark.v:198: : A symbol with that name was declared here. Check for declaration after use.
./PROCESSOR/femtorv32_quark.v:71: error: Unable to bind wire/reg/memory `instr['sd30:'sd12]' in `FemtoRV32'
./PROCESSOR/femtorv32_quark.v:198: : A symbol with that name was declared here. Check for declaration after use.
./PROCESSOR/femtorv32_quark.v:72: error: Unable to bind wire/reg/memory `instr['sd31]' in `FemtoRV32'
./PROCESSOR/femtorv32_quark.v:198: : A symbol with that name was declared here. Check for declaration after use.
./PROCESSOR/femtorv32_quark.v:72: error: Concatenation/replication may not have zero width in this context.
./PROCESSOR/femtorv32_quark.v:72: error: Unable to bind wire/reg/memory `instr['sd30:'sd20]' in `FemtoRV32'
./PROCESSOR/femtorv32_quark.v:198: : A symbol with that name was declared here. Check for declaration after use.
./PROCESSOR/femtorv32_quark.v:72: error: Concatenation/replication may not have zero width in this context.
./PROCESSOR/femtorv32_quark.v:72: error: Unable to elaborate r-value: {{'sd21{instr['sd31]}}, instr['sd30:'sd20]}
./PROCESSOR/femtorv32_quark.v:74: error: Unable to bind wire/reg/memory `instr['sd31]' in `FemtoRV32'
./PROCESSOR/femtorv32_quark.v:198: : A symbol with that name was declared here. Check for declaration after use. |
@yrabbit mind me taking a look? I was gonna fork the original repo to add 9k/20k projects, but I can work from yours |
Absolutely no objections are even welcomed. Let me know when you pick it up and I'll close this Draft. |
Hello ! |
@yrabbit I've been playing with all the So, in
What we'd like, is to infer I guess because of this code block:
the synth uses shadow RAM to keep a READ version of MEM before writing back, bacause of the code being implemented as byte-writeable. I checked |
Well, no such problem has been noticed - yosys uses BSRAM properly. And it seems to have been working for a long time, try the master branch of yosys. Mine is Yosys 0.43+11 (git sha1 81df8557d94c7e1ff734f2f90adcf00a67632302, c++ 8.3 -O2 -fno-strict-aliasing -fPIC -Os) rabbit@fly ~/var/learn-fpga_GOWIN/FemtoRV/TUTORIALS/FROM_BLINKER_TO_RISCV% BOARDS/run_tangnano9k.sh step17.v
Info: Using uarch 'gowin' for device 'GW1NR-LV9QN88PC6/I5'
Info: Reading constraints...
Info: Create constant nets...
Info: Modify LUTs...
Info: Pack IOBs...
Info: Pack diff IOBs...
Info: Pack IO logic...
Info: Pack DESER16 logic...
Info: Pack GSR...
Info: Pack HCLK cells...
Info: Pack wide LUTs...
Info: Packed MUX2_LUT8:19, MUX2_LU7:9, MUX2_LUT6:71, MUX2_LUT5:172
Info: Pack ALUs...
Info: Pack PLL...
Info: Pack RAMs...
Info: Pack BSRAMs...
Info: Pack DSP...
Info: Pack INV...
Info: Pack buffered nets...
Info: Pack UserFlash cells...
Info: Pack DQCE cells...
Info: Pack DCS cells...
Info: Checksum: 0x6c88cd50
Info: Device utilisation:
Info: VCC: 1/ 1 100%
Info: IOB: 9/ 274 3%
Info: LUT4: 1717/ 8640 19%
Info: OSER16: 0/ 80 0%
Info: IDES16: 0/ 80 0%
Info: IOLOGICI: 0/ 276 0%
Info: IOLOGICO: 0/ 276 0%
Info: MUX2_LUT5: 502/ 4320 11%
Info: MUX2_LUT6: 165/ 2160 7%
Info: MUX2_LUT7: 47/ 1080 4%
Info: MUX2_LUT8: 19/ 1080 1%
Info: ALU: 182/ 6480 2%
Info: GND: 1/ 1 100%
Info: DFF: 169/ 6480 2%
Info: RAM16SDP4: 32/ 270 11%
Info: BSRAM: 4/ 26 15%
Info: ALU54D: 0/ 10 0%
Info: MULTADDALU18X18: 0/ 10 0%
Info: MULTALU18X18: 0/ 10 0%
Info: MULTALU36X18: 0/ 10 0%
Info: MULT36X36: 0/ 5 0%
Info: MULT18X18: 0/ 20 0%
Info: MULT9X9: 0/ 40 0%
Info: PADD18: 0/ 20 0%
Info: PADD9: 0/ 40 0%
Info: GSR: 1/ 1 100%
Info: OSC: 0/ 1 0%
Info: rPLL: 1/ 2 50%
Info: BUFG: 0/ 22 0%
Info: DQCE: 0/ 24 0%
Info: DCS: 0/ 8 0%
Info: CLKDIV: 0/ 8 0%
Info: CLKDIV2: 0/ 16 0%
|
@fjpolo
There are no BSRAM tricks in there - everything just compiles. https://github.com/YosysHQ/apicula/blob/master/examples/himbaechel/femto-riscv-18.v |
@yrabbit thank you very much kind sir! Edit: Actually @yrabbit what's the correct way to Make the projects I'm using the following script I made:
But I'm still getting |
maybe it's the Yosys version. I would like to have a look at your out.log file - there is a piece after synthesis:
I used your commands (almost) by writing them into a script (~/tmp/a.sh). The apicula version is Release 0.13 , the nextpnr version is master (releases are so rare that it almost never makes sense to use something other than the nextpnr master branch). cd ~/src/apicula/examples/himbaechel
~/tmp/a.sh femto-riscv-18 >~/tmp/out.log 2>&1 a.sh: #!/bin/sh
DEVICE='GW1NR-LV9QN88PC6/I5'
BOARD='tangnano9k'
BOARD_FREQ=27
CPU_FREQ=40
BAUD_RATE=115200
PROJECT=$1
# FIRMWARE='riscv-dsp-firmware/mult9x9.hex'
cat $0
#
yosys -DLEDS_NR=6 -DCPU_FREQ=$CPU_FREQ -DBAUD_RATE=$BAUD_RATE -DFIRMWARE=$FIRMWARE -DINV_BTN=0 -p "read_verilog $PROJECT.v; synth_gowin -json $PROJECT-$BOARD-synth.json"
nextpnr-himbaechel --json $PROJECT-$BOARD-synth.json --write $PROJECT-$BOARD-pnr.json --device $DEVICE --vopt family=GW1N-9C --vopt cst=$BOARD.cst
gowin_pack -d GW1N-9C -o pack.fs $PROJECT-$BOARD-pnr.json
sudo openFPGALoader -b $BOARD pack.fs |
Necessary changes have been made to support these two boards with GOWIN chips, but still WIP.