From c466c62969ce9cfaac5c33903b7ef334ecaa3fc7 Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Tue, 19 Sep 2023 02:57:26 +0000 Subject: [PATCH] Resolve "Organize Project Better" --- hw/efinix_fpga/Makefile | 21 +++ .../{ => constraints}/super6502.pt.sdc | 0 hw/efinix_fpga/debug_profile.wizard.json | 2 +- hw/efinix_fpga/init_env.sh | 27 +++ hw/efinix_fpga/{ => src}/addr_decode.sv | 0 hw/efinix_fpga/{ => src}/crc7.sv | 0 hw/efinix_fpga/{ => src}/divider_wrapper.sv | 0 .../{ => src}/interrupt_controller.sv | 0 hw/efinix_fpga/{ => src}/leds.sv | 0 hw/efinix_fpga/{ => src}/multiplier.sv | 0 hw/efinix_fpga/{ => src}/rom.sv | 0 hw/efinix_fpga/{ => src}/sd_controller.sv | 0 hw/efinix_fpga/{ => src}/sdram_adapter.sv | 0 hw/efinix_fpga/{ => src}/spi_controller.sv | 0 hw/efinix_fpga/{ => src}/super6502.sv | 0 hw/efinix_fpga/{ => src}/timer.sv | 0 hw/efinix_fpga/{ => src}/uart_wrapper.sv | 0 hw/efinix_fpga/super6502.xml | 167 +++++++++--------- 18 files changed, 132 insertions(+), 85 deletions(-) create mode 100644 hw/efinix_fpga/Makefile rename hw/efinix_fpga/{ => constraints}/super6502.pt.sdc (100%) create mode 100644 hw/efinix_fpga/init_env.sh rename hw/efinix_fpga/{ => src}/addr_decode.sv (100%) rename hw/efinix_fpga/{ => src}/crc7.sv (100%) rename hw/efinix_fpga/{ => src}/divider_wrapper.sv (100%) rename hw/efinix_fpga/{ => src}/interrupt_controller.sv (100%) rename hw/efinix_fpga/{ => src}/leds.sv (100%) rename hw/efinix_fpga/{ => src}/multiplier.sv (100%) rename hw/efinix_fpga/{ => src}/rom.sv (100%) rename hw/efinix_fpga/{ => src}/sd_controller.sv (100%) rename hw/efinix_fpga/{ => src}/sdram_adapter.sv (100%) rename hw/efinix_fpga/{ => src}/spi_controller.sv (100%) rename hw/efinix_fpga/{ => src}/super6502.sv (100%) rename hw/efinix_fpga/{ => src}/timer.sv (100%) rename hw/efinix_fpga/{ => src}/uart_wrapper.sv (100%) diff --git a/hw/efinix_fpga/Makefile b/hw/efinix_fpga/Makefile new file mode 100644 index 0000000..f6287d5 --- /dev/null +++ b/hw/efinix_fpga/Makefile @@ -0,0 +1,21 @@ +PROJECT=super6502 +BITSTREAM=outflow/$(PROJECT).bit + +SRCS=$(shell find src/ -type f -name "*.sv") + +all: $(BITSTREAM) + +$(BITSTREAM): $(PROJECT).peri.xml $(SRCS) + efx_run.py $(PROJECT).xml + +install: $(BITSTREAM) + efx_run.py $(PROJECT).xml --flow program --pgm_opts mode=jtag + +install_spi: $(BITSTREAM) + efx_run.py $(PROJECT).xml --flow program --pgm_opts + +clean: + rm -rf work_pnr + rm -rf work_syn + rm -rf work_pt + rm -rf outflow diff --git a/hw/efinix_fpga/super6502.pt.sdc b/hw/efinix_fpga/constraints/super6502.pt.sdc similarity index 100% rename from hw/efinix_fpga/super6502.pt.sdc rename to hw/efinix_fpga/constraints/super6502.pt.sdc diff --git a/hw/efinix_fpga/debug_profile.wizard.json b/hw/efinix_fpga/debug_profile.wizard.json index 19ea65c..2dd2cd2 100644 --- a/hw/efinix_fpga/debug_profile.wizard.json +++ b/hw/efinix_fpga/debug_profile.wizard.json @@ -3,7 +3,7 @@ { "name": "la0", "type": "la", - "uuid": "d9fdd9521e234ab2a085f0e0ef437289", + "uuid": "426fe3342997403e8dbac6dd07d86e1e", "trigin_en": false, "trigout_en": false, "auto_inserted": true, diff --git a/hw/efinix_fpga/init_env.sh b/hw/efinix_fpga/init_env.sh new file mode 100644 index 0000000..22ec0d4 --- /dev/null +++ b/hw/efinix_fpga/init_env.sh @@ -0,0 +1,27 @@ +# # This stuff will install efinity per machine, per project. +# # That would be a lot of wasted storage + +# ENV=".env/$HOSTNAME" + +# if [ ! -d "$ENV" ]; then +# mkdir -p "$ENV" +# fi + +# if [ ! -f "$ENV/efinity-2023.1.150-rhe-x64.tar.bz2" ]; then +# scp 192.168.50.101:/export/scratch/efinity-2023.1.150-rhe-x64.tar.bz2 "$ENV" +# fi + +# if [ ! -d "$ENV/efinity" ]; then +# pv "$ENV/efinity-2023.1.150-rhe-x64.tar.bz2" | tar xj --directory "$ENV" +# scp 192.168.50.101:/export/scratch/libffi.so.6 "$ENV/efinity/2023.1/lib/" +# fi + +# source "$ENV/efinity/2023.1/bin/setup.sh" +# export PATH=$PATH:"$EFXPT_HOME/bin" + +source $EFX_SETUP + +# python -m venv .user_venv --system-site-packages +# . .user_venv/bin/activate + +# pip install -r requirements.txt diff --git a/hw/efinix_fpga/addr_decode.sv b/hw/efinix_fpga/src/addr_decode.sv similarity index 100% rename from hw/efinix_fpga/addr_decode.sv rename to hw/efinix_fpga/src/addr_decode.sv diff --git a/hw/efinix_fpga/crc7.sv b/hw/efinix_fpga/src/crc7.sv similarity index 100% rename from hw/efinix_fpga/crc7.sv rename to hw/efinix_fpga/src/crc7.sv diff --git a/hw/efinix_fpga/divider_wrapper.sv b/hw/efinix_fpga/src/divider_wrapper.sv similarity index 100% rename from hw/efinix_fpga/divider_wrapper.sv rename to hw/efinix_fpga/src/divider_wrapper.sv diff --git a/hw/efinix_fpga/interrupt_controller.sv b/hw/efinix_fpga/src/interrupt_controller.sv similarity index 100% rename from hw/efinix_fpga/interrupt_controller.sv rename to hw/efinix_fpga/src/interrupt_controller.sv diff --git a/hw/efinix_fpga/leds.sv b/hw/efinix_fpga/src/leds.sv similarity index 100% rename from hw/efinix_fpga/leds.sv rename to hw/efinix_fpga/src/leds.sv diff --git a/hw/efinix_fpga/multiplier.sv b/hw/efinix_fpga/src/multiplier.sv similarity index 100% rename from hw/efinix_fpga/multiplier.sv rename to hw/efinix_fpga/src/multiplier.sv diff --git a/hw/efinix_fpga/rom.sv b/hw/efinix_fpga/src/rom.sv similarity index 100% rename from hw/efinix_fpga/rom.sv rename to hw/efinix_fpga/src/rom.sv diff --git a/hw/efinix_fpga/sd_controller.sv b/hw/efinix_fpga/src/sd_controller.sv similarity index 100% rename from hw/efinix_fpga/sd_controller.sv rename to hw/efinix_fpga/src/sd_controller.sv diff --git a/hw/efinix_fpga/sdram_adapter.sv b/hw/efinix_fpga/src/sdram_adapter.sv similarity index 100% rename from hw/efinix_fpga/sdram_adapter.sv rename to hw/efinix_fpga/src/sdram_adapter.sv diff --git a/hw/efinix_fpga/spi_controller.sv b/hw/efinix_fpga/src/spi_controller.sv similarity index 100% rename from hw/efinix_fpga/spi_controller.sv rename to hw/efinix_fpga/src/spi_controller.sv diff --git a/hw/efinix_fpga/super6502.sv b/hw/efinix_fpga/src/super6502.sv similarity index 100% rename from hw/efinix_fpga/super6502.sv rename to hw/efinix_fpga/src/super6502.sv diff --git a/hw/efinix_fpga/timer.sv b/hw/efinix_fpga/src/timer.sv similarity index 100% rename from hw/efinix_fpga/timer.sv rename to hw/efinix_fpga/src/timer.sv diff --git a/hw/efinix_fpga/uart_wrapper.sv b/hw/efinix_fpga/src/uart_wrapper.sv similarity index 100% rename from hw/efinix_fpga/uart_wrapper.sv rename to hw/efinix_fpga/src/uart_wrapper.sv diff --git a/hw/efinix_fpga/super6502.xml b/hw/efinix_fpga/super6502.xml index 5f9b3c7..674cb88 100644 --- a/hw/efinix_fpga/super6502.xml +++ b/hw/efinix_fpga/super6502.xml @@ -1,106 +1,105 @@ - - + - - - + + + - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - + + - - + + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - + + + + + + + - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + - - - + + + - + \ No newline at end of file