From 3fcfa4d3acce50400654000b59bef553996fad17 Mon Sep 17 00:00:00 2001 From: Byron Lathi Date: Sun, 24 Sep 2023 10:34:07 -0700 Subject: [PATCH] Add REPO_TOP env var --- hw/efinix_fpga/simulation/Makefile | 6 ++++-- hw/efinix_fpga/init_env.sh => init_env.sh | 2 ++ sw/bios/Makefile | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) rename hw/efinix_fpga/init_env.sh => init_env.sh (93%) diff --git a/hw/efinix_fpga/simulation/Makefile b/hw/efinix_fpga/simulation/Makefile index 520865f..c9e6218 100644 --- a/hw/efinix_fpga/simulation/Makefile +++ b/hw/efinix_fpga/simulation/Makefile @@ -4,7 +4,9 @@ SRCS+=$(shell find ../src/ -type f -name "*.*v") INC=$(shell find include/ -type f) -TEST_PROGRAM=../../../sw/test_code/simple_mem_test/simple_mem_test.hex +TEST_PROGRAM_NAME=simple_mem_test + +TEST_PROGRAM=$(REPO_TOP)/sw/test_code/$(TEST_PROGRAM_NAME)/$(TEST_PROGRAM_NAME).hex #TODO implement something like sources.list @@ -22,4 +24,4 @@ $(INIT_MEM): .PHONY: clean clean: rm -rf $(TARGET) - rm $(INIT_MEM) \ No newline at end of file + rm -rf $(INIT_MEM) \ No newline at end of file diff --git a/hw/efinix_fpga/init_env.sh b/init_env.sh similarity index 93% rename from hw/efinix_fpga/init_env.sh rename to init_env.sh index 22ec0d4..46419d9 100644 --- a/hw/efinix_fpga/init_env.sh +++ b/init_env.sh @@ -20,6 +20,8 @@ # export PATH=$PATH:"$EFXPT_HOME/bin" source $EFX_SETUP +export REPO_TOP=$(git rev-parse --show-toplevel) + # python -m venv .user_venv --system-site-packages # . .user_venv/bin/activate diff --git a/sw/bios/Makefile b/sw/bios/Makefile index 3a9399a..3d489a2 100644 --- a/sw/bios/Makefile +++ b/sw/bios/Makefile @@ -7,7 +7,7 @@ NAME=bios BIN=$(NAME).bin HEX=$(NAME).hex -FPGA_IMG=../../hw/efinix_fpga/init_hex.mem +FPGA_IMG=$(REPO_TOP)/hw/efinix_fpga/init_hex.mem EFX_RUN=/home/byron/Software/efinity/2023.1/scripts/efx_run.py EFX_PRJ=/home/byron/Projects/super6502/hw/efinix_fpga/super6502.xml