From 087e3dda89e59058ab2c169a70165814a97edc5b Mon Sep 17 00:00:00 2001 From: Charles Papon Date: Sat, 29 Jul 2017 22:43:43 +0200 Subject: [PATCH] Add Murax scripts --- README.md | 2 ++ scripts/Murax/makefile | 23 +++++++++++++++++++++ scripts/Murax/toplevel.pcf | 16 +++++++++++++++ scripts/Murax/toplevel.v | 41 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+) create mode 100644 scripts/Murax/makefile create mode 100644 scripts/Murax/toplevel.pcf create mode 100644 scripts/Murax/toplevel.v diff --git a/README.md b/README.md index f6a6fc2..a9030c7 100644 --- a/README.md +++ b/README.md @@ -264,6 +264,8 @@ Murax -> ICE40-HX -> 53 Mhz 2142 LC (icestorm) ``` +There is some scripts to generate the SoC and call the icestorm toolchain there : scripts/Murax/ + ## Build the RISC-V GCC To install in /opt/ the rv32i and rv32im gcc, do the following (will take hours): diff --git a/scripts/Murax/makefile b/scripts/Murax/makefile new file mode 100644 index 0000000..72827e8 --- /dev/null +++ b/scripts/Murax/makefile @@ -0,0 +1,23 @@ + + +VERILOG = ../../Murax.v toplevel.v + + +bin/toplevel.bin : toplevel.pcf ${VERILOG} + mkdir -p bin + yosys -v3 -p "synth_ice40 -top toplevel -blif bin/toplevel.blif" ${VERILOG} + arachne-pnr -p toplevel.pcf -d 8k --max-passes 600 -P ct256 bin/toplevel.blif -o bin/toplevel.asc + icepack bin/toplevel.asc bin/toplevel.bin + +generate : + (cd ../..; sbt "run-main vexriscv.demo.Murax") + + +compile : bin/toplevel.bin + +time: bin/toplevel.bin + icetime -tmd hx8k bin/toplevel.asc + +prog : bin/toplevel.bin + sudo iceprog -S bin/toplevel.bin + diff --git a/scripts/Murax/toplevel.pcf b/scripts/Murax/toplevel.pcf new file mode 100644 index 0000000..e2a956d --- /dev/null +++ b/scripts/Murax/toplevel.pcf @@ -0,0 +1,16 @@ +## ICE40-hx8k breakout board + +set_io io_J3 J3 +set_io io_H16 H16 +set_io io_G15 G15 +set_io io_G16 G16 +set_io io_F15 F15 +set_io io_led[0] B5 +set_io io_led[1] B4 +set_io io_led[2] A2 +set_io io_led[3] A1 +set_io io_led[4] C5 +set_io io_led[5] C4 +set_io io_led[6] B3 +set_io io_led[7] C3 + diff --git a/scripts/Murax/toplevel.v b/scripts/Murax/toplevel.v new file mode 100644 index 0000000..7724f5d --- /dev/null +++ b/scripts/Murax/toplevel.v @@ -0,0 +1,41 @@ +`timescale 1ns / 1ps + +module toplevel( + input io_J3, + input io_H16, + input io_G15, + output io_G16, + input io_F15, + output [7:0] io_led + ); + + wire [31:0] io_gpioA_read; + wire [31:0] io_gpioA_write; + wire [31:0] io_gpioA_writeEnable; + wire io_mainClk; + wire io_jtag_tck; + + SB_GB mainClkBuffer ( + .USER_SIGNAL_TO_GLOBAL_BUFFER (io_J3), + .GLOBAL_BUFFER_OUTPUT ( io_mainClk) + ); + + SB_GB jtagClkBuffer ( + .USER_SIGNAL_TO_GLOBAL_BUFFER (io_H16), + .GLOBAL_BUFFER_OUTPUT ( io_jtag_tck) + ); + + assign io_led = io_gpioA_write[7 : 0]; + + Murax murax ( + .io_asyncReset(0), + .io_mainClk (io_mainClk ), + .io_jtag_tck(io_jtag_tck), + .io_jtag_tdi(io_G15), + .io_jtag_tdo(io_G16), + .io_jtag_tms(io_F15), + .io_gpioA_read (io_gpioA_read), + .io_gpioA_write (io_gpioA_write), + .io_gpioA_writeEnable(io_gpioA_writeEnable) + ); +endmodule \ No newline at end of file