tinyfpga / TinyFPGA-BX

Other
268 stars 96 forks source link

Picosoc fusesoc #9

Open olofk opened 5 years ago

olofk commented 5 years ago

Add support for building and simulating picosoc for TinyFPGA-BX with FuseSoC

To test this the core libraries must first be available. Create a workspace directory and run

fusesoc library add picosoc https://github.com/cliffordwolf/picorv32
fusesoc library add tinyfpga-bx https://github.com/tinyfpga/TinyFPGA-BX

or, alternatively if the repos are already on disk and you want to use those instead, run

fusesoc library add picosoc /path/to/picorv32_repo
fusesoc library add tinyfpga-bx /path/to/TinyFPGA-BX_repo

Picosoc for TinyFPGA-BX can now be built with

fusesoc build tinyfpga:bx:picosoc

This uses nextpnr by default. To use arachne-pnr, change pnr : next to pnr : arachne in the .core file

To simulate, first create firmware.hex (make -C examples/picosoc/firmware.hex). It is recommended to decrease the blink period tme as simulation takes a long time otherwise (e.g. change to reg_leds = led_timer >> 6; in firmware.c. With the newly created firmware.hex run

fusesoc run --target=sim tinyfpga:bx:picosoc --spi_flash_file=/path/to/firmware.hex

To use modelsim instead of icarus add --tool=modelsim after --target=sim

To find out all available simulation options (e.g. to generate a VCD file or set a simulation timeout) run

fusesoc run --target=sim tinyfpga:bx:picosoc --help

FuseSoC 1.8.4 or later is required