Following from a clean git checkout today, commands are run in a container with the latest versions of dependencies.
In short:
make hx8ksynsim, works: serial output
make hx8ksim, works: serial output
make icebsim, works(!): serial output
make icebsynsim, doesn't work: no serial output
I thought it might be due to using nextpnr-ice40 and json vs arachne-pnr and blif, but I changed that for hx8kdemo, and it still works (see diff + run at the end)
make hx8ksynsim, this works and gives serial output:
root@660aae5e3d01:/workdir/picosoc# make hx8ksynsim
yosys -ql hx8kdemo.log -p 'synth_ice40 -top hx8kdemo -blif hx8kdemo.blif' hx8kdemo.v spimemio.v simpleuart.v picosoc.v ../picorv32.v
yosys -p 'read_blif -wideports hx8kdemo.blif; write_verilog hx8kdemo_syn.v'
Yosys 0.9+3541 (git sha1 04d5692a, clang 6.0.0-1ubuntu2 -fPIC -Os)
-- Running command `read_blif -wideports hx8kdemo.blif; write_verilog hx8kdemo_syn.v' --
1. Executing BLIF frontend.
2. Executing Verilog backend.
Dumping module `\hx8kdemo'.
End of script. Logfile hash: 709401f83e, CPU: user 2.66s system 0.00s, MEM: 35.14 MB peak
Yosys 0.9+3541 (git sha1 04d5692a, clang 6.0.0-1ubuntu2 -fPIC -Os)
Time spent: 94% 2x write_verilog (2 sec), 5% 2x read_blif (0 sec)
iverilog -s testbench -o hx8kdemo_syn_tb.vvp hx8kdemo_tb.v hx8kdemo_syn.v spiflash.v `yosys-config --datdir/ice40/cells_sim.v`
riscv32-unknown-elf-cpp -P -DHX8KDEMO -o hx8kdemo_sections.lds sections.lds
riscv32-unknown-elf-gcc -DHX8KDEMO -march=rv32imc -Wl,-Bstatic,-T,hx8kdemo_sections.lds,--strip-debug -ffreestanding -nostdlib -o hx8kdemo_fw.elf start.s firmware.c
riscv32-unknown-elf-objcopy -O verilog hx8kdemo_fw.elf hx8kdemo_fw.hex
vvp -N hx8kdemo_syn_tb.vvp +firmware=hx8kdemo_fw.hex
VCD info: dumpfile testbench.vcd opened for output.
00000000
00000001
+50000 cycles
00000011
00000111
00001111
00011111
Serial data: 'B'
Serial data: 'o'
Serial data: 'o'
Serial data: 't'
Serial data: 'i'
Serial data: 'n'
+50000 cycles
Serial data: 'g'
Serial data: '.'
Serial data: '.'
Serial data: 13
Serial data: 10
00111111
+50000 cycles
01111111
11111111
Serial data: 'P'
Serial data: 'r'
+50000 cycles
Serial data: 'e'
Serial data: 's'
Serial data: 's'
Serial data: ' '
Serial data: 'E'
Serial data: 'N'
Serial data: 'T'
Serial data: 'E'
Serial data: 'R'
Serial data: ' '
Serial data: 't'
Serial data: 'o'
Serial data: ' '
Serial data: 'c'
Serial data: 'o'
Serial data: 'n'
Serial data: 't'
Serial data: 'i'
Serial data: 'n'
Serial data: 'u'
Serial data: 'e'
Serial data: '.'
Serial data: '.'
Serial data: 13
Serial data: 10
+50000 cycles
make icebsynsim, this runs, but gives no serial output
c:\Storage\fpga\picorv32>.\_shell.cmd
root@26bdd59bcffe:/workdir/picosoc# make icebsynsim
yosys -ql icebreaker.log -p 'synth_ice40 -top icebreaker -json icebreaker.json' icebreaker.v ice40up5k_spram.v spimemio.v simpleuart.v picosoc.v ../picorv32.v
yosys -p 'read_json icebreaker.json; write_verilog icebreaker_syn.v'
Yosys 0.9+3541 (git sha1 04d5692a, clang 6.0.0-1ubuntu2 -fPIC -Os)
-- Running command `read_json icebreaker.json; write_verilog icebreaker_syn.v' --
1. Executing JSON frontend.
Importing module icebreaker from JSON tree.
Importing module SB_WARMBOOT from JSON tree.
Importing module SB_SPRAM256KA from JSON tree.
Importing module SB_SPI from JSON tree.
Importing module SB_RGB_DRV from JSON tree.
Importing module SB_RGBA_DRV from JSON tree.
Importing module SB_RAM40_4KNW from JSON tree.
Importing module SB_RAM40_4KNRNW from JSON tree.
Importing module SB_RAM40_4KNR from JSON tree.
Importing module SB_RAM40_4K from JSON tree.
Importing module SB_PLL40_PAD from JSON tree.
Importing module SB_PLL40_CORE from JSON tree.
Importing module SB_PLL40_2_PAD from JSON tree.
Importing module SB_PLL40_2F_PAD from JSON tree.
Importing module SB_PLL40_2F_CORE from JSON tree.
Importing module SB_MAC16 from JSON tree.
Importing module SB_LUT4 from JSON tree.
Importing module SB_LFOSC from JSON tree.
Importing module SB_LED_DRV_CUR from JSON tree.
Importing module SB_LEDDA_IP from JSON tree.
Importing module SB_IO_OD from JSON tree.
Importing module SB_IO_I3C from JSON tree.
Importing module SB_IO from JSON tree.
Importing module SB_I2C from JSON tree.
Importing module SB_HFOSC from JSON tree.
Importing module SB_GB_IO from JSON tree.
Importing module SB_GB from JSON tree.
Importing module SB_FILTER_50NS from JSON tree.
Importing module SB_DFFSS from JSON tree.
Importing module SB_DFFSR from JSON tree.
Importing module SB_DFFS from JSON tree.
Importing module SB_DFFR from JSON tree.
Importing module SB_DFFNSS from JSON tree.
Importing module SB_DFFNSR from JSON tree.
Importing module SB_DFFNS from JSON tree.
Importing module SB_DFFNR from JSON tree.
Importing module SB_DFFNESS from JSON tree.
Importing module SB_DFFNESR from JSON tree.
Importing module SB_DFFNES from JSON tree.
Importing module SB_DFFNER from JSON tree.
Importing module SB_DFFNE from JSON tree.
Importing module SB_DFFN from JSON tree.
Importing module SB_DFFESS from JSON tree.
Importing module SB_DFFESR from JSON tree.
Importing module SB_DFFES from JSON tree.
Importing module SB_DFFER from JSON tree.
Importing module SB_DFFE from JSON tree.
Importing module SB_DFF from JSON tree.
Importing module SB_CARRY from JSON tree.
Importing module ICESTORM_RAM from JSON tree.
Importing module ICESTORM_LC from JSON tree.
2. Executing Verilog backend.
Dumping module `\icebreaker'.
End of script. Logfile hash: 5d1643821b, CPU: user 2.42s system 0.03s, MEM: 69.72 MB peak
Yosys 0.9+3541 (git sha1 04d5692a, clang 6.0.0-1ubuntu2 -fPIC -Os)
Time spent: 87% 2x write_verilog (2 sec), 12% 2x read_json (0 sec)
iverilog -s testbench -o icebreaker_syn_tb.vvp icebreaker_tb.v icebreaker_syn.v spiflash.v `yosys-config --datdir/ice40/cells_sim.v`
icebreaker_tb.v:69: warning: parameter MEM_WORDS not found in testbench.uut.
riscv32-unknown-elf-cpp -P -DICEBREAKER -o icebreaker_sections.lds sections.lds
riscv32-unknown-elf-gcc -DICEBREAKER -march=rv32ic -Wl,-Bstatic,-T,icebreaker_sections.lds,--strip-debug -ffreestanding -nostdlib -o icebreaker_fw.elf start.s firmware.c
riscv32-unknown-elf-objcopy -O verilog icebreaker_fw.elf icebreaker_fw.hex
vvp -N icebreaker_syn_tb.vvp +firmware=icebreaker_fw.hex
VCD info: dumpfile testbench.vcd opened for output.
0000000
+50000 cycles
+50000 cycles
+50000 cycles
+50000 cycles
+50000 cycles
+50000 cycles
The problem here is that the memory in the synthesized version isn't limited to 256 words, like it is in the non synthesized version.
So it's forever initializing memory.
Following from a clean git checkout today, commands are run in a container with the latest versions of dependencies. In short:
I thought it might be due to using nextpnr-ice40 and json vs arachne-pnr and blif, but I changed that for hx8kdemo, and it still works (see diff + run at the end)
make hx8ksynsim, this works and gives serial output:
make icebsynsim, this runs, but gives no serial output
make hx8ksynsim with diff applied, this works and gives serial output: