From 37289d9b4c8833cbde4dd1ac613ce81ef561b748 Mon Sep 17 00:00:00 2001 From: kanade-k-1228 Date: Tue, 20 Jun 2023 19:25:50 +0900 Subject: [PATCH 1/2] add simulation --- examples/picosoc/Makefile | 36 +++++- examples/picosoc/firmware.c | 5 +- examples/picosoc/picosoc.v | 2 +- examples/picosoc/simulation/.gitignore | 6 + examples/picosoc/{ => simulation}/spiflash.v | 2 +- examples/picosoc/simulation/testbench.v | 109 +++++++++++++++++++ examples/picosoc/simulation/zeropadding.sh | 9 ++ 7 files changed, 161 insertions(+), 8 deletions(-) create mode 100644 examples/picosoc/simulation/.gitignore rename examples/picosoc/{ => simulation}/spiflash.v (99%) create mode 100644 examples/picosoc/simulation/testbench.v create mode 100755 examples/picosoc/simulation/zeropadding.sh diff --git a/examples/picosoc/Makefile b/examples/picosoc/Makefile index d174349..87fe3c1 100644 --- a/examples/picosoc/Makefile +++ b/examples/picosoc/Makefile @@ -1,3 +1,5 @@ +CROSS=riscv32-unknown-elf- + upload: hardware.bin firmware.bin tinyprog -p hardware.bin -u firmware.bin @@ -15,16 +17,40 @@ hardware.bin: hardware.asc firmware.elf: sections.lds start.S firmware.c - riscv32-unknown-elf-gcc -march=rv32imc -nostartfiles -Wl,-Bstatic,-T,sections.lds,--strip-debug,-Map=firmware.map,--cref -ffreestanding -nostdlib -o firmware.elf start.S firmware.c + $(CROSS)gcc -march=rv32imc -nostartfiles -Wl,-Bstatic,-T,sections.lds,--strip-debug,-Map=firmware.map,--cref -ffreestanding -nostdlib -o $@ start.S firmware.c firmware.bin: firmware.elf - riscv32-unknown-elf-objcopy -O binary firmware.elf /dev/stdout > firmware.bin + $(CROSS)objcopy -O binary $^ /dev/stdout > $@ -clean: - rm -f firmware.elf firmware.hex firmware.bin firmware.o firmware.map \ - hardware.blif hardware.log hardware.asc hardware.rpt hardware.bin +simulation/firmware.elf: sections.lds start.S firmware.c + $(CROSS)gcc -march=rv32imc -mabi=ilp32 -nostartfiles -Wl,-Bstatic,-T,sections.lds,--strip-debug,-Map=firmware.map,--cref -ffreestanding -nostdlib -o $@ start.S firmware.c -DSIMU + +simulation/firmware.bin: simulation/firmware.elf + $(CROSS)objcopy -O binary $^ /dev/stdout > $@ + +simulation/firmware.hex: simulation/firmware.bin + xxd $^ > $@ + +simulation/flash.bin: simulation/firmware.bin + simulation/zeropadding.sh $^ > $@ +simulation/flash.hex: simulation/flash.bin + xxd -c 1 -p $^ > $@ +simulation/testbench.vvp: simulation/flash.hex simulation/testbench.v simulation/spiflash.v hardware.v spimemio.v simpleuart.v picosoc.v picorv32.v + iverilog -s testbench -o $@ simulation/testbench.v simulation/spiflash.v hardware.v spimemio.v simpleuart.v picosoc.v picorv32.v `yosys-config --datdir/ice40/cells_sim.v` -DNO_ICE40_DEFAULT_ASSIGNMENTS -DDEBUG -DDEBUGNETS -DDEBUGREGS +simulation/testbench.vcd: simulation/testbench.vvp + vvp $^ + +simulate: simulation/testbench.vcd + gtkwave $^ + + +clean: + rm -f firmware.elf firmware.hex firmware.bin firmware.o firmware.map \ + hardware.blif hardware.log hardware.asc hardware.rpt hardware.bin\ + simulation/firmware.elf simulation/firmware.bin simulation/firmware.hex simulation/flash.bin simulation/flash.hex\ + simulation/testbench.vvp simulation/testbench.vcd diff --git a/examples/picosoc/firmware.c b/examples/picosoc/firmware.c index b36463f..8cff04c 100644 --- a/examples/picosoc/firmware.c +++ b/examples/picosoc/firmware.c @@ -31,8 +31,11 @@ void main() { } // switch to dual IO mode + // Dual IO mode is not supported by 'spiflash.v' +#ifndef SIMU reg_spictrl = (reg_spictrl & ~0x007F0000) | 0x00400000; - +#endif + // blink the user LED uint32_t led_timer = 0; diff --git a/examples/picosoc/picosoc.v b/examples/picosoc/picosoc.v index 7b3cfbd..b5c95e0 100644 --- a/examples/picosoc/picosoc.v +++ b/examples/picosoc/picosoc.v @@ -21,7 +21,7 @@ `error "picosoc.v must be read before picorv32.v!" `endif -`define PICORV32_REGS picosoc_regs +// `define PICORV32_REGS picosoc_regs module picosoc ( input clk, diff --git a/examples/picosoc/simulation/.gitignore b/examples/picosoc/simulation/.gitignore new file mode 100644 index 0000000..233d9de --- /dev/null +++ b/examples/picosoc/simulation/.gitignore @@ -0,0 +1,6 @@ +firmware.bin +firmware.elf +flash.bin +flash.hex +testbench.vcd +testbench.vvp diff --git a/examples/picosoc/spiflash.v b/examples/picosoc/simulation/spiflash.v similarity index 99% rename from examples/picosoc/spiflash.v rename to examples/picosoc/simulation/spiflash.v index 63d21dc..1f56723 100644 --- a/examples/picosoc/spiflash.v +++ b/examples/picosoc/simulation/spiflash.v @@ -99,7 +99,7 @@ module spiflash ( reg [7:0] memory [0:16*1024*1024-1]; initial begin - $readmemh("firmware.hex", memory); + $readmemh("simulation/flash.hex", memory); end task spi_action; diff --git a/examples/picosoc/simulation/testbench.v b/examples/picosoc/simulation/testbench.v new file mode 100644 index 0000000..266d494 --- /dev/null +++ b/examples/picosoc/simulation/testbench.v @@ -0,0 +1,109 @@ +/* + * PicoSoC - A simple example SoC using PicoRV32 + * + * Copyright (C) 2017 Claire Xenia Wolf + * + * Permission to use, copy, modify, and/or distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES + * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF + * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR + * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF + * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + */ + +`timescale 1 ns / 1 ps + +module testbench; + reg clk; + always #5 clk = (clk === 1'b0); + + localparam ser_half_period = 53; + event ser_sample; + + initial begin + $dumpfile("simulation/testbench.vcd"); + $dumpvars(0, testbench); + + repeat (6) begin + repeat (50000) @(posedge clk); + $display("+50000 cycles"); + end + $finish; + end + + integer cycle_cnt = 0; + + always @(posedge clk) begin + cycle_cnt <= cycle_cnt + 1; + end + + wire led; + + wire ser_rx; + wire ser_tx; + + wire flash_csb; + wire flash_clk; + wire flash_io0; + wire flash_io1; + wire flash_io2; + wire flash_io3; + + // always @(led) begin + // #1 $display("%b", led); + // end + + hardware hardware ( + .clk_16mhz(clk), + + .pin_1(ser_rx), + .pin_2(ser_tx), + + .user_led(led), + + .flash_csb(flash_csb), + .flash_clk(flash_clk), + .flash_io0(flash_io0), + .flash_io1(flash_io1), + .flash_io2(flash_io2), + .flash_io3(flash_io3) + ); + + spiflash spiflash ( + .csb(flash_csb), + .clk(flash_clk), + .io0(flash_io0), + .io1(flash_io1), + .io2(flash_io2), + .io3(flash_io3) + ); + + reg [7:0] buffer; + + always begin + @(negedge ser_tx); + + repeat (ser_half_period) @(posedge clk); + ->ser_sample; // start bit + + repeat (8) begin + repeat (ser_half_period) @(posedge clk); + repeat (ser_half_period) @(posedge clk); + buffer = {ser_tx, buffer[7:1]}; + ->ser_sample; // data bit + end + + repeat (ser_half_period) @(posedge clk); + repeat (ser_half_period) @(posedge clk); + ->ser_sample; // stop bit + + if (buffer < 32 || buffer >= 127) $display("Serial data: %d", buffer); + else $display("Serial data: '%c'", buffer); + end +endmodule diff --git a/examples/picosoc/simulation/zeropadding.sh b/examples/picosoc/simulation/zeropadding.sh new file mode 100755 index 0000000..3c43948 --- /dev/null +++ b/examples/picosoc/simulation/zeropadding.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +HEAD_PADDING=327680 +FOOT_PADDING=$((720896 - $(wc -c $1 | awk '{print $1}'))) + +head -c $HEAD_PADDING /dev/zero > head.bin +head -c $FOOT_PADDING /dev/zero > foot.bin +cat head.bin $1 foot.bin +rm head.bin foot.bin From 4cda5091816cc30494ef84ecb03836011506c2ec Mon Sep 17 00:00:00 2001 From: kanade-k-1228 Date: Tue, 20 Jun 2023 20:37:46 +0900 Subject: [PATCH 2/2] change directory structure --- examples/picosoc/.gitignore | 16 +--- examples/picosoc/Makefile | 57 ++++++------ examples/picosoc/firmware.map | 80 ----------------- examples/picosoc/{ => firmware}/custom_ops.S | 0 examples/picosoc/{ => firmware}/firmware.c | 0 examples/picosoc/firmware/firmware.map | 87 +++++++++++++++++++ .../picosoc/{ => firmware}/riscv_flash.ld | 0 examples/picosoc/{ => firmware}/sections.lds | 0 examples/picosoc/{ => firmware}/start.S | 0 examples/picosoc/{ => hardware}/hardware.pcf | 0 examples/picosoc/{ => hardware}/hardware.v | 0 .../picosoc/{ => hardware/modules}/picorv32.v | 0 .../{ => hardware/modules}/simpleuart.v | 0 .../picosoc/{ => hardware/modules}/spimemio.v | 0 examples/picosoc/{ => hardware}/picosoc.v | 0 examples/picosoc/simulation/.gitignore | 6 -- examples/picosoc/simulation/spiflash.v | 2 +- examples/picosoc/simulation/testbench.v | 2 +- 18 files changed, 116 insertions(+), 134 deletions(-) delete mode 100644 examples/picosoc/firmware.map rename examples/picosoc/{ => firmware}/custom_ops.S (100%) rename examples/picosoc/{ => firmware}/firmware.c (100%) create mode 100644 examples/picosoc/firmware/firmware.map rename examples/picosoc/{ => firmware}/riscv_flash.ld (100%) rename examples/picosoc/{ => firmware}/sections.lds (100%) rename examples/picosoc/{ => firmware}/start.S (100%) rename examples/picosoc/{ => hardware}/hardware.pcf (100%) rename examples/picosoc/{ => hardware}/hardware.v (100%) rename examples/picosoc/{ => hardware/modules}/picorv32.v (100%) rename examples/picosoc/{ => hardware/modules}/simpleuart.v (100%) rename examples/picosoc/{ => hardware/modules}/spimemio.v (100%) rename examples/picosoc/{ => hardware}/picosoc.v (100%) delete mode 100644 examples/picosoc/simulation/.gitignore diff --git a/examples/picosoc/.gitignore b/examples/picosoc/.gitignore index bc71324..378eac2 100644 --- a/examples/picosoc/.gitignore +++ b/examples/picosoc/.gitignore @@ -1,15 +1 @@ -/spiflash_tb.vcd -/spiflash_tb.vvp -/firmware.elf -/firmware.hex -/firmware.bin -/hardware.asc -/hardware.bin -/hardware.blif -/hardware.log -/hardware.rpt -/hardware_syn.v -/hardware_syn_tb.vvp -/hardware_tb.vvp -/testbench.vcd -/cmos.log +build diff --git a/examples/picosoc/Makefile b/examples/picosoc/Makefile index 87fe3c1..636ea0b 100644 --- a/examples/picosoc/Makefile +++ b/examples/picosoc/Makefile @@ -1,56 +1,51 @@ -CROSS=riscv32-unknown-elf- +CROSS = riscv32-unknown-elf- +HARDWARE = hardware/*.v hardware/modules/*.v +TESTBENCH = simulation/*.v +upload: hardware/build/hardware.bin firmware/build/firmware.bin + tinyprog -p hardware/build/hardware.bin -u firmware/build/firmware.bin -upload: hardware.bin firmware.bin - tinyprog -p hardware.bin -u firmware.bin +hardware/build/hardware.blif: $(HARDWARE) + yosys -ql hardware/build/hardware.log -p 'synth_ice40 -top hardware -blif $@' $^ -hardware.blif: hardware.v spimemio.v simpleuart.v picosoc.v picorv32.v - yosys -ql hardware.log -p 'synth_ice40 -top hardware -blif hardware.blif' $^ +hardware/build/hardware.asc: hardware/hardware.pcf hardware/build/hardware.blif + arachne-pnr -d 8k -P cm81 -o $@ -p $^ -hardware.asc: hardware.pcf hardware.blif - arachne-pnr -d 8k -P cm81 -o hardware.asc -p hardware.pcf hardware.blif +hardware/build/hardware.bin: hardware/build/hardware.asc + icetime -d lp8k -c 12 -mtr hardware/build/hardware.rpt $^ + icepack $^ $@ -hardware.bin: hardware.asc - icetime -d hx8k -c 12 -mtr hardware.rpt hardware.asc - icepack hardware.asc hardware.bin +firmware/build/firmware.elf: firmware/sections.lds firmware/start.S firmware/firmware.c + $(CROSS)gcc -march=rv32imc -mabi=ilp32 -nostartfiles -Wl,-Bstatic,-T,firmware/sections.lds,--strip-debug,-Map=firmware/firmware.map,--cref -ffreestanding -nostdlib -o $@ firmware/start.S firmware/firmware.c -firmware.elf: sections.lds start.S firmware.c - $(CROSS)gcc -march=rv32imc -nostartfiles -Wl,-Bstatic,-T,sections.lds,--strip-debug,-Map=firmware.map,--cref -ffreestanding -nostdlib -o $@ start.S firmware.c - -firmware.bin: firmware.elf +firmware/build/firmware.bin: firmware/build/firmware.elf $(CROSS)objcopy -O binary $^ /dev/stdout > $@ -simulation/firmware.elf: sections.lds start.S firmware.c - $(CROSS)gcc -march=rv32imc -mabi=ilp32 -nostartfiles -Wl,-Bstatic,-T,sections.lds,--strip-debug,-Map=firmware.map,--cref -ffreestanding -nostdlib -o $@ start.S firmware.c -DSIMU +simulation/build/firmware.elf: firmware/sections.lds firmware/start.S firmware/firmware.c + $(CROSS)gcc -march=rv32imc -mabi=ilp32 -nostartfiles -Wl,-Bstatic,-T,firmware/sections.lds,--strip-debug,-Map=firmware/firmware.map,--cref -ffreestanding -nostdlib -o $@ firmware/start.S firmware/firmware.c -DSIMU -simulation/firmware.bin: simulation/firmware.elf +simulation/build/firmware.bin: simulation/build/firmware.elf $(CROSS)objcopy -O binary $^ /dev/stdout > $@ -simulation/firmware.hex: simulation/firmware.bin +simulation/build/firmware.hex: simulation/build/firmware.bin xxd $^ > $@ -simulation/flash.bin: simulation/firmware.bin +simulation/build/flash.bin: simulation/build/firmware.bin simulation/zeropadding.sh $^ > $@ -simulation/flash.hex: simulation/flash.bin +simulation/build/flash.hex: simulation/build/flash.bin xxd -c 1 -p $^ > $@ -simulation/testbench.vvp: simulation/flash.hex simulation/testbench.v simulation/spiflash.v hardware.v spimemio.v simpleuart.v picosoc.v picorv32.v - iverilog -s testbench -o $@ simulation/testbench.v simulation/spiflash.v hardware.v spimemio.v simpleuart.v picosoc.v picorv32.v `yosys-config --datdir/ice40/cells_sim.v` -DNO_ICE40_DEFAULT_ASSIGNMENTS -DDEBUG -DDEBUGNETS -DDEBUGREGS +simulation/build/testbench.vvp: simulation/build/flash.hex $(TESTBENCH) $(HARDWARE) + iverilog -s testbench -o $@ $(TESTBENCH) $(HARDWARE) `yosys-config --datdir/ice40/cells_sim.v` -DNO_ICE40_DEFAULT_ASSIGNMENTS -DDEBUG -DDEBUGNETS -DDEBUGREGS -simulation/testbench.vcd: simulation/testbench.vvp +simulation/build/testbench.vcd: simulation/build/testbench.vvp vvp $^ -simulate: simulation/testbench.vcd +simulate: simulation/build/testbench.vcd gtkwave $^ - -clean: - rm -f firmware.elf firmware.hex firmware.bin firmware.o firmware.map \ - hardware.blif hardware.log hardware.asc hardware.rpt hardware.bin\ - simulation/firmware.elf simulation/firmware.bin simulation/firmware.hex simulation/flash.bin simulation/flash.hex\ - simulation/testbench.vvp simulation/testbench.vcd - +.PHONY: upload simulate diff --git a/examples/picosoc/firmware.map b/examples/picosoc/firmware.map deleted file mode 100644 index 657ca3c..0000000 --- a/examples/picosoc/firmware.map +++ /dev/null @@ -1,80 +0,0 @@ - -Memory Configuration - -Name Origin Length Attributes -FLASH 0x0000000000050000 0x0000000000100000 xr -RAM 0x0000000000000000 0x0000000000002000 xrw -*default* 0x0000000000000000 0xffffffffffffffff - -Linker script and memory map - - -.text 0x0000000000050000 0x1dc - 0x0000000000050000 . = ALIGN (0x4) - *(.text) - .text 0x0000000000050000 0x16a /tmp/ccBvQ25N.o - .text 0x000000000005016a 0x72 /tmp/cchneX8U.o - 0x000000000005016a set_irq_mask - 0x0000000000050170 main - *(.text*) - *(.rodata) - *(.rodata*) - *(.srodata) - *(.srodata*) - *(.eh_frame) - *(.eh_frame*) - 0x00000000000501dc . = ALIGN (0x4) - 0x00000000000501dc _etext = . - 0x00000000000501dc _sidata = _etext - -.rela.dyn 0x00000000000501dc 0x0 - .rela.text 0x00000000000501dc 0x0 /tmp/ccBvQ25N.o - -.data 0x0000000000000000 0x14 load address 0x00000000000501dc - 0x0000000000000000 . = ALIGN (0x4) - 0x0000000000000000 _sdata = . - 0x0000000000000000 _ram_start = . - *(.data) - .data 0x0000000000000000 0x14 /tmp/ccBvQ25N.o - .data 0x0000000000000014 0x0 /tmp/cchneX8U.o - *(.data*) - *(.sdata) - *(.sdata*) - *(.init_array) - *(.init_array*) - 0x0000000000000014 . = ALIGN (0x4) - 0x0000000000000014 _edata = . - -.bss 0x0000000000000014 0x0 load address 0x00000000000501f0 - 0x0000000000000014 . = ALIGN (0x4) - 0x0000000000000014 _sbss = . - *(.bss) - .bss 0x0000000000000014 0x0 /tmp/ccBvQ25N.o - .bss 0x0000000000000014 0x0 /tmp/cchneX8U.o - *(.bss*) - *(.sbss) - *(.sbss*) - *(COMMON) - 0x0000000000000014 . = ALIGN (0x4) - 0x0000000000000014 _ebss = . - -.heap 0x0000000000000014 0x0 - 0x0000000000000014 . = ALIGN (0x4) - 0x0000000000000014 _heap_start = . -LOAD /tmp/ccBvQ25N.o -LOAD /tmp/cchneX8U.o -OUTPUT(firmware.elf elf32-littleriscv) - -.comment 0x0000000000000000 0x11 - .comment 0x0000000000000000 0x11 /tmp/cchneX8U.o - 0x12 (size before relaxing) - -Cross Reference Table - -Symbol File -_ebss /tmp/cchneX8U.o -_sbss /tmp/cchneX8U.o -debug /tmp/ccBvQ25N.o -main /tmp/cchneX8U.o - /tmp/ccBvQ25N.o -set_irq_mask /tmp/cchneX8U.o diff --git a/examples/picosoc/custom_ops.S b/examples/picosoc/firmware/custom_ops.S similarity index 100% rename from examples/picosoc/custom_ops.S rename to examples/picosoc/firmware/custom_ops.S diff --git a/examples/picosoc/firmware.c b/examples/picosoc/firmware/firmware.c similarity index 100% rename from examples/picosoc/firmware.c rename to examples/picosoc/firmware/firmware.c diff --git a/examples/picosoc/firmware/firmware.map b/examples/picosoc/firmware/firmware.map new file mode 100644 index 0000000..041cc8b --- /dev/null +++ b/examples/picosoc/firmware/firmware.map @@ -0,0 +1,87 @@ + +Memory Configuration + +Name Origin Length Attributes +FLASH 0x00050000 0x00100000 xr +RAM 0x00000000 0x00002000 xrw +*default* 0x00000000 0xffffffff + +Linker script and memory map + + +.text 0x00050000 0x1ac + 0x00050000 . = ALIGN (0x4) + *(.text) + .text 0x00050000 0x13a /tmp/cck7Jikq.o + .text 0x0005013a 0x72 /tmp/ccLqa5rJ.o + 0x0005013a set_irq_mask + 0x00050140 main + *(.text*) + *(.rodata) + *(.rodata*) + *(.srodata) + *(.srodata*) + *(.eh_frame) + *(.eh_frame*) + 0x000501ac . = ALIGN (0x4) + 0x000501ac _etext = . + 0x000501ac _sidata = _etext + +.rela.dyn 0x000501ac 0x0 + .rela.text 0x000501ac 0x0 /tmp/cck7Jikq.o + +.data 0x00000000 0x14 load address 0x000501ac + 0x00000000 . = ALIGN (0x4) + 0x00000000 _sdata = . + 0x00000000 _ram_start = . + *(.data) + .data 0x00000000 0x14 /tmp/cck7Jikq.o + .data 0x00000014 0x0 /tmp/ccLqa5rJ.o + *(.data*) + *(.sdata) + *(.sdata*) + *(.init_array) + *(.init_array*) + 0x00000014 . = ALIGN (0x4) + 0x00000014 _edata = . + +.bss 0x00000014 0x0 load address 0x000501c0 + 0x00000014 . = ALIGN (0x4) + 0x00000014 _sbss = . + *(.bss) + .bss 0x00000014 0x0 /tmp/cck7Jikq.o + .bss 0x00000014 0x0 /tmp/ccLqa5rJ.o + *(.bss*) + *(.sbss) + *(.sbss*) + *(COMMON) + 0x00000014 . = ALIGN (0x4) + 0x00000014 _ebss = . + +.heap 0x00000014 0x0 + 0x00000014 . = ALIGN (0x4) + 0x00000014 _heap_start = . +LOAD /tmp/cck7Jikq.o +LOAD /tmp/ccLqa5rJ.o +OUTPUT(firmware/build/firmware.elf elf32-littleriscv) + +.riscv.attributes + 0x00000000 0x2f + .riscv.attributes + 0x00000000 0x2d /tmp/cck7Jikq.o + .riscv.attributes + 0x0000002d 0x2f /tmp/ccLqa5rJ.o + +.comment 0x00000000 0x1b + .comment 0x00000000 0x1b /tmp/ccLqa5rJ.o + 0x1c (size before relaxing) + +Cross Reference Table + +Symbol File +_ebss /tmp/ccLqa5rJ.o +_sbss /tmp/ccLqa5rJ.o +debug /tmp/cck7Jikq.o +main /tmp/ccLqa5rJ.o + /tmp/cck7Jikq.o +set_irq_mask /tmp/ccLqa5rJ.o diff --git a/examples/picosoc/riscv_flash.ld b/examples/picosoc/firmware/riscv_flash.ld similarity index 100% rename from examples/picosoc/riscv_flash.ld rename to examples/picosoc/firmware/riscv_flash.ld diff --git a/examples/picosoc/sections.lds b/examples/picosoc/firmware/sections.lds similarity index 100% rename from examples/picosoc/sections.lds rename to examples/picosoc/firmware/sections.lds diff --git a/examples/picosoc/start.S b/examples/picosoc/firmware/start.S similarity index 100% rename from examples/picosoc/start.S rename to examples/picosoc/firmware/start.S diff --git a/examples/picosoc/hardware.pcf b/examples/picosoc/hardware/hardware.pcf similarity index 100% rename from examples/picosoc/hardware.pcf rename to examples/picosoc/hardware/hardware.pcf diff --git a/examples/picosoc/hardware.v b/examples/picosoc/hardware/hardware.v similarity index 100% rename from examples/picosoc/hardware.v rename to examples/picosoc/hardware/hardware.v diff --git a/examples/picosoc/picorv32.v b/examples/picosoc/hardware/modules/picorv32.v similarity index 100% rename from examples/picosoc/picorv32.v rename to examples/picosoc/hardware/modules/picorv32.v diff --git a/examples/picosoc/simpleuart.v b/examples/picosoc/hardware/modules/simpleuart.v similarity index 100% rename from examples/picosoc/simpleuart.v rename to examples/picosoc/hardware/modules/simpleuart.v diff --git a/examples/picosoc/spimemio.v b/examples/picosoc/hardware/modules/spimemio.v similarity index 100% rename from examples/picosoc/spimemio.v rename to examples/picosoc/hardware/modules/spimemio.v diff --git a/examples/picosoc/picosoc.v b/examples/picosoc/hardware/picosoc.v similarity index 100% rename from examples/picosoc/picosoc.v rename to examples/picosoc/hardware/picosoc.v diff --git a/examples/picosoc/simulation/.gitignore b/examples/picosoc/simulation/.gitignore deleted file mode 100644 index 233d9de..0000000 --- a/examples/picosoc/simulation/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -firmware.bin -firmware.elf -flash.bin -flash.hex -testbench.vcd -testbench.vvp diff --git a/examples/picosoc/simulation/spiflash.v b/examples/picosoc/simulation/spiflash.v index 1f56723..f118968 100644 --- a/examples/picosoc/simulation/spiflash.v +++ b/examples/picosoc/simulation/spiflash.v @@ -99,7 +99,7 @@ module spiflash ( reg [7:0] memory [0:16*1024*1024-1]; initial begin - $readmemh("simulation/flash.hex", memory); + $readmemh("simulation/build/flash.hex", memory); end task spi_action; diff --git a/examples/picosoc/simulation/testbench.v b/examples/picosoc/simulation/testbench.v index 266d494..3df2de3 100644 --- a/examples/picosoc/simulation/testbench.v +++ b/examples/picosoc/simulation/testbench.v @@ -27,7 +27,7 @@ module testbench; event ser_sample; initial begin - $dumpfile("simulation/testbench.vcd"); + $dumpfile("simulation/build/testbench.vcd"); $dumpvars(0, testbench); repeat (6) begin