diff --git a/Makefile b/Makefile index 867b1fdd2729db1f1c8e60fbe7cddf5a1aaf4f25..bf3e6a62c7a556817788542f6881d2f6b40fe9d0 100644 --- a/Makefile +++ b/Makefile @@ -288,7 +288,7 @@ cva6_ooc: $(ariane_pkg) $(util) $(src) $(fpga_src) @echo read_verilog -sv {$(fpga_src)} >> fpga/scripts/add_sources.tcl cd fpga && make cva6_ooc BOARD=$(BOARD) XILINX_PART=$(XILINX_PART) XILINX_BOARD=$(XILINX_BOARD) CLK_PERIOD_NS=$(CLK_PERIOD_NS) BATCH_MODE=$(BATCH_MODE) -.PHONY: cva6_ooc cva6_fpga program_cva6_fpga +.PHONY: cva6_ooc cva6_fpga program_cva6_fpga get_hs2_id cva6_fpga: $(ariane_pkg) $(util) $(src) $(fpga_src) $(uart_src) @echo "[FPGA] Generate sources" @@ -305,6 +305,11 @@ program_cva6_fpga: @echo "[FPGA] Program FPGA" cd fpga && make program_cva6_fpga BOARD=$(BOARD) XILINX_PART=$(XILINX_PART) XILINX_BOARD=$(XILINX_BOARD) CLK_PERIOD_NS=$(CLK_PERIOD_NS) BATCH_MODE=$(BATCH_MODE) + +get_hs2_sn: + @echo "[FPGA] Get HS2 serial number" + cd fpga && make get_hs2_sn + clean: rm -rf $(riscv-torture-dir)/output/test* rm -rf $(library)/ $(dpi-library)/ $(ver-library)/ diff --git a/README.md b/README.md index f8c81dd5f032f3937e15dfa7da91a52d3616f9ee..6189d3e48df26086fc0eb0f4f044652fe2fe6e10 100644 --- a/README.md +++ b/README.md @@ -230,6 +230,23 @@ This platform integrates a CV32A6 processor, a JTAG interface to run and debug s Below are described steps to run Coremark application on CV32A6 FPGA platform, steps are the same for Dhrystone application and other software applications. +The JTAG-HS2 programming cable is initially a cable that allows programming of Xilinx FPGAs (bitstream loading) from a host PC. +In our case, we use this cable to program software applications on the CV32A6 instantiated in the FPGA through a PMOD connector. +We do not use the HS2 Cable in its original function therfore there is a preliminary step which consists in retrieving the serial number of the HS2 cable. +To do this, connect the HS2 cable to the host PC (Zybo Z7-20 board must be disconnected from the host PC) and run the following command: +``` +make get_hs2_sn +``` +you should see: +``` +............... +############################### +# TARGEt: localhost:3121/xilinx_tcf/Digilent/<**HS2's serial number**> +############################### +...................... +``` +Replace the **HS2's serial number** in `fpga/openocd_digilent_hs2.cfg` file by the serial number of your HS2 cable. + ## Get started with Coremark application 1. First, make sure the Digilent **JTAG-HS2 debug adapter** is properly connected to the **PMOD JE** connector and that the USBUART adapter is properly connected to the **PMOD JB** connector of the Zybo Z7-20 board. diff --git a/fpga/Makefile b/fpga/Makefile index 250952f49b438af6b9be7efd6410f392783ab11b..7b7a9e623b416b35559545025ce7b5c1bbaf4aed 100644 --- a/fpga/Makefile +++ b/fpga/Makefile @@ -63,6 +63,11 @@ else $(VIVADO) -source scripts/program_cva6_fpga.tcl endif +get_hs2_sn: + $(VIVADO) -mode batch -source scripts/get_hs2_sn.tcl + + + $(ips): %.xci : mkdir -p $(work-dir) diff --git a/fpga/scripts/get_hs2_sn.tcl b/fpga/scripts/get_hs2_sn.tcl new file mode 100644 index 0000000000000000000000000000000000000000..e51859355f30fee083bf6fcdf0ee11b777d467e2 --- /dev/null +++ b/fpga/scripts/get_hs2_sn.tcl @@ -0,0 +1,8 @@ +open_hw_manager +connect_hw_server +foreach TARGET [get_hw_targets] { + puts "###############################" + puts "# TARGET: $TARGET" + puts "###############################" +} + diff --git a/fpga/scripts/program_cva6_fpga.tcl b/fpga/scripts/program_cva6_fpga.tcl index 4f4c9709bf879b0c07254a91913ad579fa18a06b..0fa97ab1eb2ff68e75657957667802d20f2f2918 100644 --- a/fpga/scripts/program_cva6_fpga.tcl +++ b/fpga/scripts/program_cva6_fpga.tcl @@ -1,6 +1,6 @@ open_hw_manager connect_hw_server -current_hw_target [get_hw_targets -filter {NAME!~"localhost:3121/xilinx_tcf/Digilent/210249A85F9B"}] +current_hw_target [get_hw_targets -filter {NAME!~"localhost:3121/xilinx_tcf/Digilent/<HS2's serial number>"}] open_hw_target set_property PROGRAM.FILE {cva6_fpga.runs/impl_1/cva6_zybo_z7_20.bit} [get_hw_devices xc7z020_1] current_hw_device [get_hw_devices xc7z020_1]