There should be no need to adapt anything for the CW305: there is already support for the CW305 (see e.g. the synth_cw305
target in ibex_demo_system.core
). It should just build, out of the box.
For programming firmware, you’ll need an external JTAG programmer connected to the “FPGA JTAG” header (lower left corner of the CW305).
I’ve done this successfully using Tigard and this openocd config file:
interface ftdi
ftdi_vid_pid 0x0403 0x6010
ftdi_channel 1
adapter_khz 500
ftdi_layout_init 0x0038 0x003b
ftdi_layout_signal nTRST -data 0x0010
ftdi_layout_signal nSRST -data 0x0020
transport select jtag
# Configure JTAG chain and the target processor
set _CHIPNAME riscv
# Configure JTAG expected ID: choose the correct device!
# xc7a100t:
set _EXPECTED_ID 0x0362D093
# xc7a35t:
#set _EXPECTED_ID 0x13631093
jtag newtap $_CHIPNAME cpu -irlen 6 -expected-id $_EXPECTED_ID -ignore-version
set _TARGETNAME $_CHIPNAME.cpu
target create $_TARGETNAME riscv -chain-position $_TARGETNAME
riscv set_ir idcode 0x09
riscv set_ir dtmcs 0x22
riscv set_ir dmi 0x23
riscv set_prefer_sba on
gdb_report_data_abort enable
gdb_report_register_access_error enable
gdb_breakpoint_override hard
reset_config none
init
halt
Also, in case you haven’t noticed, there are also some CW-style SimpleSerial applications (ibex-demo-system/sw/c/demo/simpleserial-aes at main · lowRISC/ibex-demo-system · GitHub)