diff --git a/.gitignore b/.gitignore index b69497d4307031b10fc1639305e8aae64abadaf9..74191db36c706675b10113046d8af8c24300aa4d 100644 --- a/.gitignore +++ b/.gitignore @@ -15,5 +15,4 @@ system/testcodes/*/*.lst system/testcodes/*/*.o # Bootrom removal -/system/src/bootrom/verilog/* -/system/src/bootrom/bintxt/* +/system/src/bootrom/ \ No newline at end of file diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 118d0ed484399d980343c74b71bb652391f30249..e964a4756fe0e710ee6ce68a0755facae916ab31 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -35,6 +35,9 @@ build-job-Z2: # This job runs in the build stage, which runs first. - tar -xf PL230-r0p0-02rel2-1.tar.gz # move to fpga_imp directory and run the fpga build script for pynq z2 - cd ../../nanosoc/system/fpga_imp/ + - source ../../set_env.sh + - mkdir -p $NANOSOC_TECH_DIR/system/src/bootrom + - make -C $NANOSOC_TECH_DIR/system bootrom BOOTROM_BUILD_DIR=$NANOSOC_TECH_DIR/system/src/bootrom - if source ./build_fpga_pynq_z2.scr; then echo "Vivado Finished"; fi - FILE=./pynq_export/pz2/pynq/overlays/soclabs/design_1.bit - if test -f "$FILE"; then @@ -68,6 +71,9 @@ build-job-ZCU104: # This job runs in the build stage, which runs first. - tar -xf PL230-r0p0-02rel2-1.tar.gz # move to fpga_imp directory and run the fpga build script for pynq z2 - cd ../../nanosoc/system/fpga_imp/ + - source ../../set_env.sh + - mkdir -p $NANOSOC_TECH_DIR/system/src/bootrom + - make -C $NANOSOC_TECH_DIR/system bootrom BOOTROM_BUILD_DIR=$NANOSOC_TECH_DIR/system/src/bootrom - if source ./build_fpga_pynq_zcu104.scr; then echo "Vivado Finished"; fi - FILE=./pynq_export/pz104/pynq/overlays/soclabs/design_1.bit - if test -f "$FILE"; then diff --git a/system/makefile b/system/makefile index d709815dfc2c3518dc19e1f0e59415190c66a7dd..a2e8dfa8ab94884610891a78b3b0623df71258c1 100644 --- a/system/makefile +++ b/system/makefile @@ -74,8 +74,10 @@ ADP_PATH := $(shell realpath $(ADP_FILE)) ADP_OPTIONS := -define ADP_FILE=\"$(ADP_PATH)\" # Bootrom Parameters: +# Boot Loader image +BOOTLOADER ?= bootloader BOOTROM_ADDRW ?= 8 -BOOTROM_HEX ?= $(NANOSOC_TECH_DIR)/system/testcodes/bootloader/bootloader.hex +BOOTROM_HEX ?= $(NANOSOC_TECH_DIR)/system/testcodes/bootloader/$(BOOTLOADER).hex BOOTROM_BUILD_DIR ?= $(PROJ_SYS_DIR)/bootrom @@ -111,8 +113,7 @@ VCS_VC_OPTIONS = -f $(TBENCH_VC) $(ACCELERATOR_VC) XMSIM_OPTIONS = -unbuffered -status -LICQUEUE -f xmsim.args -cdslib cds.lib -hdlvar hdl.var -NBASYNC XM_VC_OPTIONS = $(TBENCH_VC) $(ACCELERATOR_VC) $(ADP_OPTIONS) -# Boot Loader image -BOOTLOADER = bootloader + # Debug Tester image DEBUGTESTER = debugtester @@ -277,26 +278,21 @@ bootrom: echo Compile done ;\ ls > /dev/null ;\ echo Copy $(BOOTLOADER).hex ;\ - if [ -e $(BOOTLOADER).hex ] ; then \ - cp $(BOOTLOADER).hex $(SIM_DIR)/$(BOOTLOADER).hex ;\ - else \ - while [ ! -e $(BOOTLOADER).hex ] ; do \ - echo Wait for hex file ...; \ - ls > /dev/null; \ - sleep 5; \ - done; \ - if [ -e $(BOOTLOADER).hex ] ; then \ - cp $(BOOTLOADER).hex $(SIM_DIR)/$(BOOTLOADER).hex ;\ - else \ - echo Problem reading hex file ;\ - exit 1; \ - fi ;\ + while [ ! -e $(BOOTLOADER).hex ] ; do \ + echo Wait for hex file ...; \ + ls > /dev/null; \ + sleep 5; \ + done; \ + if [ ! -e $(BOOTLOADER).hex ] ; then \ + echo Problem reading hex file ;\ + exit 1; \ fi ;\ - cp $(BOOTLOADER).hex $(SIM_DIR)/$(BOOTLOADER).hex ;\ - mkdir -p $(PROJ_SYS_DIR)/bootrom/verilog/ ;\ - mkdir -p $(PROJ_SYS_DIR)/bootrom/bintxt/ ;\ - python3 bootrom_gen.py -a $(BOOTROM_ADDRW) -i $(BOOTLOADER).hex -v $(BOOTROM_BUILD_DIR)/verilog/bootrom.v -b $(BOOTROM_BUILD_DIR)/bintxt/bootrom.bintxt ;\ - cd $(SIM_DIR) ) + mkdir -p $(BOOTROM_BUILD_DIR)/verilog/ ;\ + mkdir -p $(BOOTROM_BUILD_DIR)/bintxt/ ;\ + python3 bootrom_gen.py -a $(BOOTROM_ADDRW) -i $(BOOTLOADER).hex -v $(BOOTROM_BUILD_DIR)/verilog/bootrom.v -b $(BOOTROM_BUILD_DIR)/bintxt/bootrom.bintxt ) +ifneq ($(PROJECT_DIR),) + cp $(BOOTROM_HEX) $(SIM_DIR)/$(BOOTLOADER).hex +endif # Compile test code # Note : The use of ls after compile allows the computing server to sync up @@ -409,14 +405,14 @@ v2html: # Remove all software compilation results clean_all_code: - @(cd $(NANOSOC_SW_DIR)/debug_tester ; make clean; cd $(SIM_DIR); ) - @(cd $(TESTCODES_DIR)/$(BOOTLOADER) ; make clean; cd $(SIM_DIR); ) + @(cd $(NANOSOC_SW_DIR)/debug_tester ; make clean; ) + @(cd $(TESTCODES_DIR)/$(BOOTLOADER) ; make clean; ) for thistest in $(TEST_LIST) ; do \ echo Cleaning $$thistest ... ; \ cd $(TESTCODES_DIR)/$$thistest ; \ make clean; \ - cd $(SIM_DIR); \ done + @rm -rf $(BOOTROM_BUILD_DIR) # Remove only bootloader and default selected test clean_code: