mirror of
https://github.com/vortexgpgpu/vortex.git
synced 2025-04-23 05:17:45 -04:00
xrt build scripts
This commit is contained in:
parent
a5079c16d9
commit
4b477fe9e5
29 changed files with 504 additions and 761 deletions
|
@ -110,6 +110,9 @@ case $DRIVER in
|
|||
simx)
|
||||
DRIVER_PATH=$VORTEX_HOME/runtime/simx
|
||||
;;
|
||||
xrt)
|
||||
DRIVER_PATH=$VORTEX_HOME/runtime/xrt
|
||||
;;
|
||||
*)
|
||||
echo "invalid driver: $DRIVER"
|
||||
exit -1
|
||||
|
|
|
@ -207,7 +207,7 @@ FPU_CORE=FPU_FPNEW ./ci/blackbox.sh --driver=rtlsim --cores=1 --app=dogfood
|
|||
AXI_BUS=1 ./ci/blackbox.sh --driver=rtlsim --cores=1 --app=demo
|
||||
|
||||
# adjust l1 block size to match l2
|
||||
CONFIGS="-DL1_BLOCK_SIZE=64" ./ci/blackbox.sh --driver=rtlsim --cores=2 --l2cache --app=io_addr --args="-n1"
|
||||
CONFIGS="-DL1_LINE_SIZE=64" ./ci/blackbox.sh --driver=rtlsim --cores=2 --l2cache --app=io_addr --args="-n1"
|
||||
|
||||
# test cache banking
|
||||
CONFIGS="-DSMEM_NUM_BANKS=4 -DDCACHE_NUM_BANKS=1" ./ci/blackbox.sh --driver=rtlsim --app=sgemm
|
||||
|
|
|
@ -75,7 +75,7 @@ module VX_afu_control #(
|
|||
ADDR_ISR = 6'h0c,
|
||||
ADDR_MEM_0 = 6'h10,
|
||||
ADDR_MEM_1 = 6'h14,
|
||||
ADDR_MEM_CTRL = 6'h18
|
||||
ADDR_MEM_CTRL = 6'h18,
|
||||
ADDR_DCR_0 = 6'h1C,
|
||||
ADDR_DCR_1 = 6'h20,
|
||||
ADDR_DCR_CTRL = 6'h24;
|
||||
|
|
|
@ -74,9 +74,7 @@ module vortex_afu #(
|
|||
output wire interrupt
|
||||
);
|
||||
|
||||
`STATIC_ASSERT((C_M_AXI_GMEM_ID_WIDTH == `VX_MEM_TAG_WIDTH), ("invalid memory tag size: current=%0d, expected=%0d", C_M_AXI_GMEM_ID_WIDTH, `VX_MEM_TAG_WIDTH))
|
||||
|
||||
// Register and invert reset signal.
|
||||
// Register and invert reset signal.
|
||||
reg reset;
|
||||
always @(posedge ap_clk) begin
|
||||
reset <= ~ap_rst_n;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
`ifndef VX_PLATFORM_VH
|
||||
`define VX_PLATFORM_VH
|
||||
|
||||
`ifndef SIMULATION
|
||||
`ifndef NOGLOBALS
|
||||
`include "globals.vh"
|
||||
`endif
|
||||
|
||||
|
|
|
@ -71,6 +71,8 @@ module Vortex_axi #(
|
|||
// Status
|
||||
output wire busy
|
||||
);
|
||||
`STATIC_ASSERT((AXI_TID_WIDTH == `VX_MEM_TAG_WIDTH), ("invalid memory tag size: current=%0d, expected=%0d", AXI_TID_WIDTH, `VX_MEM_TAG_WIDTH))
|
||||
|
||||
wire mem_req_valid;
|
||||
wire mem_req_rw;
|
||||
wire [`VX_MEM_BYTEEN_WIDTH-1:0] mem_req_byteen;
|
||||
|
|
|
@ -1,10 +1,12 @@
|
|||
DEVICE_FAMILY ?= arria10
|
||||
BUILD_DIR ?= build
|
||||
PREFIX ?= build
|
||||
RTL_DIR = ../../../rtl
|
||||
DPI_DIR = ../../../dpi
|
||||
AFU_DIR = ../../../afu/opae
|
||||
IP_DIR = ../../../ip/altera
|
||||
|
||||
BUILD_DIR = $(PREFIX)_$(DEVICE_FAMILY)
|
||||
|
||||
ifeq ($(shell which qsub-synth),)
|
||||
RUN_SYNTH=$(OPAE_PLATFORM_ROOT)/bin/run.sh > build.log 2>&1 &
|
||||
else
|
||||
|
@ -89,35 +91,35 @@ all: vortex_afu.h ase-1c
|
|||
vortex_afu.h: vortex_afu.json
|
||||
afu_json_mgr json-info --afu-json=$^ --c-hdr=$@
|
||||
|
||||
$(BUILD_DIR)_$(DEVICE_FAMILY)_ase_1c/Makefile:
|
||||
afu_sim_setup -s setup.cfg $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_1c
|
||||
$(BUILD_DIR)_ase_1c/Makefile:
|
||||
afu_sim_setup -s setup.cfg $(BUILD_DIR)_ase_1c
|
||||
|
||||
$(BUILD_DIR)_$(DEVICE_FAMILY)_ase_2c/Makefile:
|
||||
afu_sim_setup -s setup.cfg $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_2c
|
||||
$(BUILD_DIR)_ase_2c/Makefile:
|
||||
afu_sim_setup -s setup.cfg $(BUILD_DIR)_ase_2c
|
||||
|
||||
$(BUILD_DIR)_$(DEVICE_FAMILY)_ase_4c/Makefile:
|
||||
afu_sim_setup -s setup.cfg $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_4c
|
||||
$(BUILD_DIR)_ase_4c/Makefile:
|
||||
afu_sim_setup -s setup.cfg $(BUILD_DIR)_ase_4c
|
||||
|
||||
$(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_1c/build/dcp.qpf:
|
||||
afu_synth_setup -s setup.cfg $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_1c
|
||||
$(BUILD_DIR)_fpga_1c/build/dcp.qpf:
|
||||
afu_synth_setup -s setup.cfg $(BUILD_DIR)_fpga_1c
|
||||
|
||||
$(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_2c/build/dcp.qpf:
|
||||
afu_synth_setup -s setup.cfg $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_2c
|
||||
$(BUILD_DIR)_fpga_2c/build/dcp.qpf:
|
||||
afu_synth_setup -s setup.cfg $(BUILD_DIR)_fpga_2c
|
||||
|
||||
$(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_4c/build/dcp.qpf:
|
||||
afu_synth_setup -s setup.cfg $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_4c
|
||||
$(BUILD_DIR)_fpga_4c/build/dcp.qpf:
|
||||
afu_synth_setup -s setup.cfg $(BUILD_DIR)_fpga_4c
|
||||
|
||||
$(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_8c/build/dcp.qpf:
|
||||
afu_synth_setup -s setup.cfg $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_8c
|
||||
$(BUILD_DIR)_fpga_8c/build/dcp.qpf:
|
||||
afu_synth_setup -s setup.cfg $(BUILD_DIR)_fpga_8c
|
||||
|
||||
$(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_16c/build/dcp.qpf:
|
||||
afu_synth_setup -s setup.cfg $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_16c
|
||||
$(BUILD_DIR)_fpga_16c/build/dcp.qpf:
|
||||
afu_synth_setup -s setup.cfg $(BUILD_DIR)_fpga_16c
|
||||
|
||||
$(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_32c/build/dcp.qpf:
|
||||
afu_synth_setup -s setup.cfg $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_32c
|
||||
$(BUILD_DIR)_fpga_32c/build/dcp.qpf:
|
||||
afu_synth_setup -s setup.cfg $(BUILD_DIR)_fpga_32c
|
||||
|
||||
$(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_64c/build/dcp.qpf:
|
||||
afu_synth_setup -s setup.cfg $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_64c
|
||||
$(BUILD_DIR)_fpga_64c/build/dcp.qpf:
|
||||
afu_synth_setup -s setup.cfg $(BUILD_DIR)_fpga_64c
|
||||
|
||||
gen-sources-ase-1c:
|
||||
./gen_sources.sh $(CFLAGS) $(CONFIG1) -DSIMULATION > sources.txt
|
||||
|
@ -151,91 +153,91 @@ gen-sources-fpga-64c:
|
|||
|
||||
# setup
|
||||
|
||||
setup-ase-1c: $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_1c/Makefile
|
||||
setup-ase-1c: $(BUILD_DIR)_ase_1c/Makefile
|
||||
|
||||
setup-ase-2c: $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_2c/Makefile
|
||||
setup-ase-2c: $(BUILD_DIR)_ase_2c/Makefile
|
||||
|
||||
setup-ase-4c: $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_4c/Makefile
|
||||
setup-ase-4c: $(BUILD_DIR)_ase_4c/Makefile
|
||||
|
||||
setup-fpga-1c: $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_1c/build/dcp.qpf
|
||||
setup-fpga-1c: $(BUILD_DIR)_fpga_1c/build/dcp.qpf
|
||||
|
||||
setup-fpga-2c: $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_2c/build/dcp.qpf
|
||||
setup-fpga-2c: $(BUILD_DIR)_fpga_2c/build/dcp.qpf
|
||||
|
||||
setup-fpga-4c: $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_4c/build/dcp.qpf
|
||||
setup-fpga-4c: $(BUILD_DIR)_fpga_4c/build/dcp.qpf
|
||||
|
||||
setup-fpga-8c: $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_8c/build/dcp.qpf
|
||||
setup-fpga-8c: $(BUILD_DIR)_fpga_8c/build/dcp.qpf
|
||||
|
||||
setup-fpga-16c: $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_16c/build/dcp.qpf
|
||||
setup-fpga-16c: $(BUILD_DIR)_fpga_16c/build/dcp.qpf
|
||||
|
||||
setup-fpga-32c: $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_32c/build/dcp.qpf
|
||||
setup-fpga-32c: $(BUILD_DIR)_fpga_32c/build/dcp.qpf
|
||||
|
||||
setup-fpga-64c: $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_64c/build/dcp.qpf
|
||||
setup-fpga-64c: $(BUILD_DIR)_fpga_64c/build/dcp.qpf
|
||||
|
||||
# build
|
||||
|
||||
ase-1c: gen-sources-ase-1c setup-ase-1c
|
||||
make -C $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_1c
|
||||
cp $(RTL_DIR)/fpu_unit/altera/$(DEVICE_FAMILY)/*.hex $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_1c/work
|
||||
make -C $(BUILD_DIR)_ase_1c
|
||||
cp $(RTL_DIR)/fpu_unit/altera/$(DEVICE_FAMILY)/*.hex $(BUILD_DIR)_ase_1c/work
|
||||
|
||||
ase-2c: gen-sources-ase-2c setup-ase-2c
|
||||
make -C $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_2c
|
||||
cp $(RTL_DIR)/fpu_unit/altera/$(DEVICE_FAMILY)/*.hex $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_2c/work
|
||||
make -C $(BUILD_DIR)_ase_2c
|
||||
cp $(RTL_DIR)/fpu_unit/altera/$(DEVICE_FAMILY)/*.hex $(BUILD_DIR)_ase_2c/work
|
||||
|
||||
ase-4c: gen-sources-ase-4c setup-ase-4c
|
||||
make -C $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_4c
|
||||
cp $(RTL_DIR)/fpu_unit/altera/$(DEVICE_FAMILY)/*.hex $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_4c/work
|
||||
make -C $(BUILD_DIR)_ase_4c
|
||||
cp $(RTL_DIR)/fpu_unit/altera/$(DEVICE_FAMILY)/*.hex $(BUILD_DIR)_ase_4c/work
|
||||
|
||||
fpga-1c: gen-sources-fpga-1c setup-fpga-1c
|
||||
cd $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_1c && $(RUN_SYNTH)
|
||||
cd $(BUILD_DIR)_fpga_1c && $(RUN_SYNTH)
|
||||
|
||||
fpga-2c: gen-sources-fpga-2c setup-fpga-2c
|
||||
cd $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_2c && $(RUN_SYNTH)
|
||||
cd $(BUILD_DIR)_fpga_2c && $(RUN_SYNTH)
|
||||
|
||||
fpga-4c: gen-sources-fpga-4c setup-fpga-4c
|
||||
cd $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_4c && $(RUN_SYNTH)
|
||||
cd $(BUILD_DIR)_fpga_4c && $(RUN_SYNTH)
|
||||
|
||||
fpga-8c: gen-sources-fpga-8c setup-fpga-8c
|
||||
cd $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_8c && $(RUN_SYNTH)
|
||||
cd $(BUILD_DIR)_fpga_8c && $(RUN_SYNTH)
|
||||
|
||||
fpga-16c: gen-sources-fpga-16c setup-fpga-16c
|
||||
cd $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_16c && $(RUN_SYNTH)
|
||||
cd $(BUILD_DIR)_fpga_16c && $(RUN_SYNTH)
|
||||
|
||||
fpga-32c: gen-sources-fpga-32c setup-fpga-32c
|
||||
cd $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_32c && $(RUN_SYNTH)
|
||||
cd $(BUILD_DIR)_fpga_32c && $(RUN_SYNTH)
|
||||
|
||||
fpga-64c: gen-sources-fpga-64c setup-fpga-64c
|
||||
cd $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_64c && $(RUN_SYNTH)
|
||||
cd $(BUILD_DIR)_fpga_64c && $(RUN_SYNTH)
|
||||
|
||||
# cleanup
|
||||
|
||||
clean-ase-1c:
|
||||
rm -rf $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_1c sources.txt
|
||||
rm -rf $(BUILD_DIR)_ase_1c sources.txt
|
||||
|
||||
clean-ase-2c:
|
||||
rm -rf $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_2c sources.txt
|
||||
rm -rf $(BUILD_DIR)_ase_2c sources.txt
|
||||
|
||||
clean-ase-4c:
|
||||
rm -rf $(BUILD_DIR)_$(DEVICE_FAMILY)_ase_4c sources.txt
|
||||
rm -rf $(BUILD_DIR)_ase_4c sources.txt
|
||||
|
||||
clean-fpga-1c:
|
||||
rm -rf $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_1c sources.txt
|
||||
rm -rf $(BUILD_DIR)_fpga_1c sources.txt
|
||||
|
||||
clean-fpga-2c:
|
||||
rm -rf $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_2c sources.txt
|
||||
rm -rf $(BUILD_DIR)_fpga_2c sources.txt
|
||||
|
||||
clean-fpga-4c:
|
||||
rm -rf $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_4c sources.txt
|
||||
rm -rf $(BUILD_DIR)_fpga_4c sources.txt
|
||||
|
||||
clean-fpga-8c:
|
||||
rm -rf $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_8c sources.txt
|
||||
rm -rf $(BUILD_DIR)_fpga_8c sources.txt
|
||||
|
||||
clean-fpga-16c:
|
||||
rm -rf $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_16c sources.txt
|
||||
rm -rf $(BUILD_DIR)_fpga_16c sources.txt
|
||||
|
||||
clean-fpga-32c:
|
||||
rm -rf $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_32c sources.txt
|
||||
rm -rf $(BUILD_DIR)_fpga_32c sources.txt
|
||||
|
||||
clean-fpga-64c:
|
||||
rm -rf $(BUILD_DIR)_$(DEVICE_FAMILY)_fpga_64c sources.txt
|
||||
rm -rf $(BUILD_DIR)_fpga_64c sources.txt
|
||||
|
||||
clean: vortex_afu.h clean-ase-1c clean-ase-2c clean-ase-4c clean-fpga-1c clean-fpga-2c clean-fpga-4c clean-fpga-8c clean-fpga-16c clean-fpga-32c clean-fpga-64c
|
|
@ -1,5 +1,6 @@
|
|||
+define+SYNTHESIS
|
||||
+define+QUARTUS
|
||||
+define+NOGLOBALS
|
||||
|
||||
vortex_afu.json
|
||||
QI:vortex_afu.qsf
|
||||
|
|
|
@ -6,6 +6,7 @@ set_global_assignment -name VERILOG_INPUT_VERSION SYSTEMVERILOG_2009
|
|||
set_global_assignment -name ADD_PASS_THROUGH_LOGIC_TO_INFERRED_RAMS ON
|
||||
set_global_assignment -name VERILOG_MACRO QUARTUS
|
||||
set_global_assignment -name VERILOG_MACRO SYNTHESIS
|
||||
set_global_assignment -name VERILOG_MACRO NOGLOBALS
|
||||
set_global_assignment -name MESSAGE_DISABLE 16818
|
||||
set_global_assignment -name TIMEQUEST_DO_REPORT_TIMING ON
|
||||
set_global_assignment -name TIMEQUEST_MULTICORNER_ANALYSIS ON
|
||||
|
|
|
@ -1,85 +1,85 @@
|
|||
BUILD_DIR ?= build
|
||||
PREFIX ?= build
|
||||
|
||||
BUILD_DIR_X=$(BUILD_DIR)_$(DEVICE_FAMILY)
|
||||
BUILD_DIR=$(PREFIX)_$(DEVICE_FAMILY)
|
||||
|
||||
.PHONY: dogfood unittest pipeline smem cache fpu_unit tex_unit raster_unit rop_unit core vortex vortex-gfx top top-gfx texunit test
|
||||
|
||||
dogfood:
|
||||
mkdir -p dogfood/$(BUILD_DIR_X)
|
||||
cp dogfood/Makefile dogfood/$(BUILD_DIR_X)
|
||||
$(MAKE) -C dogfood/$(BUILD_DIR_X) clean && $(MAKE) -C dogfood/$(BUILD_DIR_X) > dogfood/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p dogfood/$(BUILD_DIR)
|
||||
cp dogfood/Makefile dogfood/$(BUILD_DIR)
|
||||
$(MAKE) -C dogfood/$(BUILD_DIR) clean && $(MAKE) -C dogfood/$(BUILD_DIR) > dogfood/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
unittest:
|
||||
mkdir -p unittest/$(BUILD_DIR_X)
|
||||
cp unittest/Makefile unittest/$(BUILD_DIR_X)
|
||||
$(MAKE) -C unittest/$(BUILD_DIR_X) clean && $(MAKE) -C unittest/$(BUILD_DIR_X) > unittest/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p unittest/$(BUILD_DIR)
|
||||
cp unittest/Makefile unittest/$(BUILD_DIR)
|
||||
$(MAKE) -C unittest/$(BUILD_DIR) clean && $(MAKE) -C unittest/$(BUILD_DIR) > unittest/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
pipeline:
|
||||
mkdir -p pipeline/$(BUILD_DIR_X)
|
||||
cp pipeline/Makefile pipeline/$(BUILD_DIR_X)
|
||||
$(MAKE) -C pipeline/$(BUILD_DIR_X) clean && $(MAKE) -C pipeline/$(BUILD_DIR_X) > pipeline/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p pipeline/$(BUILD_DIR)
|
||||
cp pipeline/Makefile pipeline/$(BUILD_DIR)
|
||||
$(MAKE) -C pipeline/$(BUILD_DIR) clean && $(MAKE) -C pipeline/$(BUILD_DIR) > pipeline/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
smem:
|
||||
mkdir -p smem/$(BUILD_DIR_X)
|
||||
cp smem/Makefile smem/$(BUILD_DIR_X)
|
||||
$(MAKE) -C smem/$(BUILD_DIR_X) clean && $(MAKE) -C smem/$(BUILD_DIR_X) > smem/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p smem/$(BUILD_DIR)
|
||||
cp smem/Makefile smem/$(BUILD_DIR)
|
||||
$(MAKE) -C smem/$(BUILD_DIR) clean && $(MAKE) -C smem/$(BUILD_DIR) > smem/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
cache:
|
||||
mkdir -p cache/$(BUILD_DIR_X)
|
||||
cp cache/Makefile cache/$(BUILD_DIR_X)
|
||||
$(MAKE) -C cache/$(BUILD_DIR_X) clean && $(MAKE) -C cache/$(BUILD_DIR_X) > cache/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p cache/$(BUILD_DIR)
|
||||
cp cache/Makefile cache/$(BUILD_DIR)
|
||||
$(MAKE) -C cache/$(BUILD_DIR) clean && $(MAKE) -C cache/$(BUILD_DIR) > cache/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
fpu_unit:
|
||||
mkdir -p fpu_unit/$(BUILD_DIR_X)
|
||||
cp fpu_unit/Makefile fpu_unit/$(BUILD_DIR_X)
|
||||
$(MAKE) -C fpu_unit/$(BUILD_DIR_X) clean && $(MAKE) -C fpu_unit/$(BUILD_DIR_X) > fpu_unit/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p fpu_unit/$(BUILD_DIR)
|
||||
cp fpu_unit/Makefile fpu_unit/$(BUILD_DIR)
|
||||
$(MAKE) -C fpu_unit/$(BUILD_DIR) clean && $(MAKE) -C fpu_unit/$(BUILD_DIR) > fpu_unit/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
tex_unit:
|
||||
mkdir -p tex_unit/$(BUILD_DIR_X)
|
||||
cp tex_unit/Makefile tex_unit/$(BUILD_DIR_X)
|
||||
$(MAKE) -C tex_unit/$(BUILD_DIR_X) clean && $(MAKE) -C tex_unit/$(BUILD_DIR_X) > tex_unit/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p tex_unit/$(BUILD_DIR)
|
||||
cp tex_unit/Makefile tex_unit/$(BUILD_DIR)
|
||||
$(MAKE) -C tex_unit/$(BUILD_DIR) clean && $(MAKE) -C tex_unit/$(BUILD_DIR) > tex_unit/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
rop_unit:
|
||||
mkdir -p rop_unit/$(BUILD_DIR_X)
|
||||
cp rop_unit/Makefile rop_unit/$(BUILD_DIR_X)
|
||||
$(MAKE) -C rop_unit/$(BUILD_DIR_X) clean && $(MAKE) -C rop_unit/$(BUILD_DIR_X) > rop_unit/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p rop_unit/$(BUILD_DIR)
|
||||
cp rop_unit/Makefile rop_unit/$(BUILD_DIR)
|
||||
$(MAKE) -C rop_unit/$(BUILD_DIR) clean && $(MAKE) -C rop_unit/$(BUILD_DIR) > rop_unit/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
raster_unit:
|
||||
mkdir -p raster_unit/$(BUILD_DIR_X)
|
||||
cp raster_unit/Makefile raster_unit/$(BUILD_DIR_X)
|
||||
$(MAKE) -C raster_unit/$(BUILD_DIR_X) clean && $(MAKE) -C raster_unit/$(BUILD_DIR_X) > raster_unit/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p raster_unit/$(BUILD_DIR)
|
||||
cp raster_unit/Makefile raster_unit/$(BUILD_DIR)
|
||||
$(MAKE) -C raster_unit/$(BUILD_DIR) clean && $(MAKE) -C raster_unit/$(BUILD_DIR) > raster_unit/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
core:
|
||||
mkdir -p core/$(BUILD_DIR_X)
|
||||
cp core/Makefile core/$(BUILD_DIR_X)
|
||||
$(MAKE) -C core/$(BUILD_DIR_X) clean && $(MAKE) -C core/$(BUILD_DIR_X) > core/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p core/$(BUILD_DIR)
|
||||
cp core/Makefile core/$(BUILD_DIR)
|
||||
$(MAKE) -C core/$(BUILD_DIR) clean && $(MAKE) -C core/$(BUILD_DIR) > core/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
vortex:
|
||||
mkdir -p vortex/$(BUILD_DIR_X)
|
||||
cp vortex/Makefile vortex/$(BUILD_DIR_X)
|
||||
$(MAKE) -C vortex/$(BUILD_DIR_X) clean && $(MAKE) -C vortex/$(BUILD_DIR_X) > vortex/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p vortex/$(BUILD_DIR)
|
||||
cp vortex/Makefile vortex/$(BUILD_DIR)
|
||||
$(MAKE) -C vortex/$(BUILD_DIR) clean && $(MAKE) -C vortex/$(BUILD_DIR) > vortex/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
vortex-gfx:
|
||||
mkdir -p vortex-gfx/$(BUILD_DIR_X)
|
||||
cp vortex-gfx/Makefile vortex-gfx/$(BUILD_DIR_X)
|
||||
$(MAKE) -C vortex-gfx/$(BUILD_DIR_X) clean && $(MAKE) -C vortex-gfx/$(BUILD_DIR_X) > vortex-gfx/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p vortex-gfx/$(BUILD_DIR)
|
||||
cp vortex-gfx/Makefile vortex-gfx/$(BUILD_DIR)
|
||||
$(MAKE) -C vortex-gfx/$(BUILD_DIR) clean && $(MAKE) -C vortex-gfx/$(BUILD_DIR) > vortex-gfx/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
top:
|
||||
mkdir -p top/$(BUILD_DIR_X)
|
||||
cp top/Makefile top/$(BUILD_DIR_X)
|
||||
$(MAKE) -C top/$(BUILD_DIR_X) clean && $(MAKE) -C top/$(BUILD_DIR_X) > top/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p top/$(BUILD_DIR)
|
||||
cp top/Makefile top/$(BUILD_DIR)
|
||||
$(MAKE) -C top/$(BUILD_DIR) clean && $(MAKE) -C top/$(BUILD_DIR) > top/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
top-gfx:
|
||||
mkdir -p top-gfx/$(BUILD_DIR_X)
|
||||
cp top-gfx/Makefile top-gfx/$(BUILD_DIR_X)
|
||||
$(MAKE) -C top-gfx/$(BUILD_DIR_X) clean && $(MAKE) -C top-gfx/$(BUILD_DIR_X) > top-gfx/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p top-gfx/$(BUILD_DIR)
|
||||
cp top-gfx/Makefile top-gfx/$(BUILD_DIR)
|
||||
$(MAKE) -C top-gfx/$(BUILD_DIR) clean && $(MAKE) -C top-gfx/$(BUILD_DIR) > top-gfx/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
texunit:
|
||||
mkdir -p texunit/$(BUILD_DIR_X)
|
||||
cp texunit/Makefile texunit/$(BUILD_DIR_X)
|
||||
$(MAKE) -C texunit/$(BUILD_DIR_X) clean && $(MAKE) -C texunit/$(BUILD_DIR_X) > texunit/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p texunit/$(BUILD_DIR)
|
||||
cp texunit/Makefile texunit/$(BUILD_DIR)
|
||||
$(MAKE) -C texunit/$(BUILD_DIR) clean && $(MAKE) -C texunit/$(BUILD_DIR) > texunit/$(BUILD_DIR)/build.log 2>&1 &
|
||||
|
||||
test:
|
||||
mkdir -p test/$(BUILD_DIR_X)
|
||||
cp test/Makefile test/$(BUILD_DIR_X)
|
||||
$(MAKE) -C test/$(BUILD_DIR_X) clean && $(MAKE) -C test/$(BUILD_DIR_X) > test/$(BUILD_DIR_X)/build.log 2>&1 &
|
||||
mkdir -p test/$(BUILD_DIR)
|
||||
cp test/Makefile test/$(BUILD_DIR)
|
||||
$(MAKE) -C test/$(BUILD_DIR) clean && $(MAKE) -C test/$(BUILD_DIR) > test/$(BUILD_DIR)/build.log 2>&1 &
|
|
@ -1,5 +1,5 @@
|
|||
## Xilinx Build and Ecosystem Setup
|
||||
|
||||
make all TARGET=hw_emu PLATFORM=xilinx_u280_xdma_201920_3 > build.log 2>&1
|
||||
vivado -mode batch -source scripts/gen_ip.tcl -tclargs ip/xilinx_u280_xdma_201920_3
|
||||
|
||||
vivado -mode batch -source scripts/gen_ips.tcl -tclargs ../../../ip/xilinx/xilinx_u280_xdma_201920_3
|
||||
make all TARGET=hw_emu PLATFORM=xilinx_u280_xdma_201920_3 > build.log 2>&1
|
1
hw/syn/xilinx/xrt/.gitignore
vendored
Normal file
1
hw/syn/xilinx/xrt/.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
build*/
|
160
hw/syn/xilinx/xrt/Makefile
Executable file → Normal file
160
hw/syn/xilinx/xrt/Makefile
Executable file → Normal file
|
@ -1,111 +1,121 @@
|
|||
.PHONY: help
|
||||
|
||||
help::
|
||||
ifneq ($(findstring Makefile, $(MAKEFILE_LIST)), Makefile)
|
||||
help:
|
||||
$(ECHO) "Makefile Usage:"
|
||||
$(ECHO) " make all TARGET=<sw_emu/hw_emu/hw> PLATFORM=<FPGA platform>"
|
||||
$(ECHO) " Command to generate the design for specified Target and Device."
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make clean "
|
||||
$(ECHO) " make clean"
|
||||
$(ECHO) " Command to remove the generated non-hardware files."
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make cleanall"
|
||||
$(ECHO) " Command to remove all the generated files."
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make check TARGET=<sw_emu/hw_emu/hw> PLATFORM=<FPGA platform>"
|
||||
$(ECHO) " Command to run application in emulation."
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make run_nimbix PLATFORM=<FPGA platform>"
|
||||
$(ECHO) " Command to run application on Nimbix Cloud."
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make aws_build PLATFORM=<FPGA platform>"
|
||||
$(ECHO) " Command to build AWS xclbin application on AWS Cloud."
|
||||
$(ECHO) ""
|
||||
endif
|
||||
|
||||
TARGET := hw
|
||||
PLATFORM :=
|
||||
XCLBIN := ./xclbin
|
||||
PREFIX := build
|
||||
|
||||
VPP := $(XILINX_VITIS)/bin/v++
|
||||
RTL_DIR = ../../../rtl
|
||||
AFU_DIR = ../../../afu/xrt
|
||||
IP_DIR = ../../../ip/xilinx
|
||||
|
||||
# Control RTL debug tracing states
|
||||
DBG_TRACE_FLAGS += -DDBG_TRACE_CORE_PIPELINE
|
||||
DBG_TRACE_FLAGS += -DDBG_TRACE_CORE_ICACHE
|
||||
DBG_TRACE_FLAGS += -DDBG_TRACE_CORE_DCACHE
|
||||
DBG_TRACE_FLAGS += -DDBG_TRACE_CORE_MEM
|
||||
DBG_TRACE_FLAGS += -DDBG_TRACE_CACHE_BANK
|
||||
DBG_TRACE_FLAGS += -DDBG_TRACE_CACHE_MSHR
|
||||
DBG_TRACE_FLAGS += -DDBG_TRACE_CACHE_TAG
|
||||
DBG_TRACE_FLAGS += -DDBG_TRACE_CACHE_DATA
|
||||
DBG_TRACE_FLAGS += -DDBG_TRACE_AFU
|
||||
DBG_TRACE_FLAGS += -DDBG_TRACE_TEX
|
||||
DBG_TRACE_FLAGS += -DDBG_TRACE_RASTER
|
||||
DBG_TRACE_FLAGS += -DDBG_TRACE_ROP
|
||||
|
||||
DBG_FLAGS += $(DBG_TRACE_FLAGS)
|
||||
|
||||
FPU_INCLUDE = -I$(RTL_DIR)/fpu_unit
|
||||
TEX_INCLUDE = -I$(RTL_DIR)/tex_unit
|
||||
RASTER_INCLUDE = -I$(RTL_DIR)/raster_unit
|
||||
ROP_INCLUDE = -I$(RTL_DIR)/rop_unit
|
||||
RTL_INCLUDE = -I$(RTL_DIR) -I$(RTL_DIR)/libs -I$(RTL_DIR)/interfaces -I$(RTL_DIR)/cache -I$(AFU_DIR) -I$(IP_DIR)
|
||||
RTL_INCLUDE += $(FPU_INCLUDE) $(TEX_INCLUDE) $(RASTER_INCLUDE) $(ROP_INCLUDE)
|
||||
|
||||
CONFIGS += -DEXT_GFX_ENABLE
|
||||
CONFIGS += -DSYNTHESIS -DVIVADO -DNDEBUG -DMEM_BLOCK_SIZE=16
|
||||
|
||||
# Debugigng
|
||||
ifdef DEBUG
|
||||
CONFIGS += $(DBG_FLAGS)
|
||||
else
|
||||
CONFIGS += -DNDEBUG
|
||||
endif
|
||||
|
||||
# Enable perf counters
|
||||
ifdef PERF
|
||||
CONFIGS += -DPERF_ENABLE
|
||||
endif
|
||||
|
||||
VIVADO = $(XILINX_VIVADO)/bin/vivado
|
||||
|
||||
VPP = $(XILINX_VITIS)/bin/v++
|
||||
|
||||
CP = cp -rf
|
||||
RMDIR = rm -rf
|
||||
|
||||
ECHO:= @echo
|
||||
ECHO = @echo
|
||||
|
||||
XO_CONTAINER = $(XCLBIN)/vortex_afu.$(TARGET).xo
|
||||
BUILD_DIR = $(PREFIX)_$(PLATFORM)_$(TARGET)
|
||||
BIN_DIR = $(BUILD_DIR)/bin
|
||||
|
||||
XCLBIN_CONTAINER = $(XCLBIN)/vortex_afu.$(TARGET).xclbin
|
||||
XO_CONTAINER = $(BUILD_DIR)/vortex_afu.xo
|
||||
|
||||
XCLBIN_CONTAINER = $(BIN_DIR)vortex_afu.xclbin
|
||||
|
||||
# Kernel compiler global settings
|
||||
CLFLAGS += -t $(TARGET) --platform $(PLATFORM) --save-temps
|
||||
VPP_CFLAGS += -t $(TARGET) --platform $(PLATFORM) --save-temps
|
||||
VPP_CFLAGS += --temp_dir $(BUILD_DIR) --log_dir $(BUILD_DIR) --report_dir $(BUILD_DIR)
|
||||
VPP_LDFLAGS +=
|
||||
|
||||
##########################################################################
|
||||
# The below commands generate a XO file from a pre-exsisitng RTL kernel.
|
||||
###########################################################################
|
||||
|
||||
VIVADO := $(XILINX_VIVADO)/bin/vivado
|
||||
$(XO_CONTAINER): ./scripts/package_kernel.tcl ./scripts/gen_xo.tcl
|
||||
mkdir -p $(XCLBIN)
|
||||
$(VIVADO) -mode batch -source scripts/gen_xo.tcl -tclargs $(XO_CONTAINER) vortex_afu $(TARGET) $(PLATFORM)
|
||||
|
||||
###########################################################################
|
||||
#END OF GENERATION OF XO
|
||||
##########################################################################
|
||||
|
||||
.PHONY: all clean cleanall emconfig
|
||||
.PHONY: all clean gen-sources emconfig
|
||||
|
||||
all: check-devices $(XCLBIN_CONTAINER) emconfig
|
||||
|
||||
# Building kernel
|
||||
gen-sources: $(BUILD_DIR)/sources.txt
|
||||
$(BUILD_DIR)/sources.txt:
|
||||
mkdir -p $(BUILD_DIR)
|
||||
./scripts/gen_sources.sh $(RTL_INCLUDE) $(CONFIGS) > $(BUILD_DIR)/sources.txt
|
||||
|
||||
$(XO_CONTAINER): $(BUILD_DIR)/sources.txt
|
||||
mkdir -p $(BUILD_DIR)
|
||||
$(VIVADO) -log $(BUILD_DIR)/vivado.log -journal $(BUILD_DIR)/vivado.jou -tempDir $(BUILD_DIR) -mode batch -source scripts/gen_xo.tcl -tclargs $(XO_CONTAINER) vortex_afu $(BUILD_DIR)/sources.txt $(BUILD_DIR)
|
||||
|
||||
$(XCLBIN_CONTAINER): $(XO_CONTAINER)
|
||||
mkdir -p $(XCLBIN)
|
||||
$(VPP) $(CLFLAGS) $(LDCLFLAGS) -lo $(XCLBIN_CONTAINER) $(XO_CONTAINER)
|
||||
mkdir -p $(BIN_DIR)
|
||||
$(VPP) $(VPP_CFLAGS) $(VPP_LDFLAGS) -lo $(XCLBIN_CONTAINER) $(XO_CONTAINER)
|
||||
|
||||
emconfig: $(XCLBIN)/emconfig.json
|
||||
$(XCLBIN)/emconfig.json:
|
||||
emconfigutil --platform $(PLATFORM) --od $(XCLBIN)
|
||||
emconfig: $(BIN_DIR)/emconfig.json
|
||||
$(BIN_DIR)/emconfig.json:
|
||||
mkdir -p $(BIN_DIR)
|
||||
emconfigutil --platform $(PLATFORM) --od $(BIN_DIR)
|
||||
|
||||
# Cleaning stuff
|
||||
clean:
|
||||
-$(RMDIR) $(XCLBIN)/{*sw_emu*,*hw_emu*}
|
||||
-$(RMDIR) TempConfig system_estimate.xtxt *.rpt
|
||||
-$(RMDIR) src/*.ll _v++_* .Xil emconfig.json dltmp* xmltmp* *.log *.jou
|
||||
-$(RMDIR) $(BUILD_DIR)
|
||||
|
||||
cleanall: clean
|
||||
-$(RMDIR) $(XCLBIN)
|
||||
-$(RMDIR) _x.*
|
||||
-$(RMDIR) ./tmp_kernel_pack* ./packaged_kernel* _x/
|
||||
|
||||
#######################################################################
|
||||
# RTL Kernel only supports Hardware and Hardware Emulation.
|
||||
# THis line is to check that
|
||||
#########################################################################
|
||||
ifneq ($(TARGET),$(findstring $(TARGET), hw hw_emu))
|
||||
$(warning WARNING:Application supports only hw hw_emu TARGET. Please use the target for running the application)
|
||||
$(warning WARNING:Application supports only hw hw_emu TARGET. Please use the target for running the application)
|
||||
endif
|
||||
|
||||
###################################################################
|
||||
#check the devices avaiable
|
||||
########################################################################
|
||||
|
||||
# Check the devices avaiable
|
||||
check-devices:
|
||||
ifndef PLATFORM
|
||||
$(error PLATFORM not set. Please set the PLATFORM properly and rerun. Run "make help" for more details.)
|
||||
endif
|
||||
|
||||
############################################################################
|
||||
# check the VITIS environment
|
||||
#############################################################################
|
||||
|
||||
ifndef XILINX_VITIS
|
||||
$(error XILINX_VITIS variable is not set, please set correctly and rerun)
|
||||
$(error XILINX_VITIS variable is not set, please set correctly and rerun)
|
||||
endif
|
||||
|
||||
|
||||
#################################################################
|
||||
# Enable profiling if needed
|
||||
#####################################################################a
|
||||
|
||||
REPORT := no
|
||||
PROFILE := no
|
||||
DEBUG := no
|
||||
|
@ -113,16 +123,16 @@ DEBUG := no
|
|||
#'estimate' for estimate report generation
|
||||
#'system' for system report generation
|
||||
ifneq ($(REPORT), no)
|
||||
CLFLAGS += --report estimate
|
||||
CLLDFLAGS += --report system
|
||||
VPP_CFLAGS += --report estimate
|
||||
endif
|
||||
|
||||
#Generates profile summary report
|
||||
# Generates profile summary report
|
||||
ifeq ($(PROFILE), yes)
|
||||
LDCLFLAGS += --profile_kernel data:all:all:all
|
||||
VPP_CFLAGS += --profile_kernel data:all:all:all
|
||||
endif
|
||||
|
||||
#Generates debug summary report
|
||||
# Generates debug summary report
|
||||
ifeq ($(DEBUG), yes)
|
||||
CLFLAGS += --dk protocol:all:all:all
|
||||
VPP_CFLAGS += --dk protocol:all:all:all
|
||||
VPP_CFLAGS += --dk list_ports
|
||||
endif
|
||||
|
|
|
@ -1,139 +0,0 @@
|
|||
User Managed IP (RTL Kernel)
|
||||
============================
|
||||
|
||||
Simple example of user managed RTL Kernel.
|
||||
|
||||
**KEY CONCEPTS:** `User-Managed RTL Kernel <https://docs.xilinx.com/r/en-US/ug1393-vitis-application-acceleration/Creating-User-Managed-RTL-Kernels>`__
|
||||
|
||||
**KEYWORDS:** `package_xo <https://docs.xilinx.com/r/en-US/ug1393-vitis-application-acceleration/package_xo-Command>`__, `ctrl_protocol <https://docs.xilinx.com/r/en-US/ug1393-vitis-application-acceleration/package_xo-Command>`__, `user_managed <https://docs.xilinx.com/r/en-US/ug1393-vitis-application-acceleration/Creating-User-Managed-RTL-Kernels>`__, `xrt::ip <https://docs.xilinx.com/r/en-US/ug1393-vitis-application-acceleration/Setting-Up-User-Managed-Kernels-and-Argument-Buffers>`__, `xrt::xclbin <https://docs.xilinx.com/r/en-US/ug1393-vitis-application-acceleration/Specifying-the-Device-ID-and-Loading-the-XCLBIN>`__, xrt::kernel::get_kernels, xrt::kernel::get_cus, xrt::kernel::get_args, xrt::arg::get_offset, xrt::ip::write_register, xrt::ip::read_register
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<details>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
<summary>
|
||||
|
||||
<b>EXCLUDED PLATFORMS:</b>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
</summary>
|
||||
|
|
||||
..
|
||||
|
||||
- All NoDMA Platforms, i.e u50 nodma etc
|
||||
|
||||
.. raw:: html
|
||||
|
||||
</details>
|
||||
|
||||
.. raw:: html
|
||||
|
||||
DESIGN FILES
|
||||
------------
|
||||
|
||||
Application code is located in the src directory. Accelerator binary files will be compiled to the xclbin directory. The xclbin directory is required by the Makefile and its contents will be filled during compilation. A listing of all the files in this example is shown below
|
||||
|
||||
::
|
||||
|
||||
src/hdl/krnl_vadd_rtl.v
|
||||
src/hdl/krnl_vadd_rtl_adder.sv
|
||||
src/hdl/krnl_vadd_rtl_axi_read_master.sv
|
||||
src/hdl/krnl_vadd_rtl_axi_write_master.sv
|
||||
src/hdl/krnl_vadd_rtl_control_s_axi.v
|
||||
src/hdl/krnl_vadd_rtl_counter.sv
|
||||
src/hdl/krnl_vadd_rtl_int.sv
|
||||
src/host.cpp
|
||||
|
||||
COMMAND LINE ARGUMENTS
|
||||
----------------------
|
||||
|
||||
Once the environment has been configured, the application can be executed by
|
||||
|
||||
::
|
||||
|
||||
./rtl_user_managed -x <vadd XCLBIN>
|
||||
|
||||
DETAILS
|
||||
-------
|
||||
|
||||
This example demonstrates how a user can create a User-Managed RTL IP. The RTL IP here does simple vector addition where two vectors are transferred from host to kernel, added and the result is written back to the host and verified. The IP's control protocol is mentioned as user_managed by adding ``-ctrl_protocol user_managed`` to the package command as below:
|
||||
|
||||
::
|
||||
|
||||
package_xo -ctrl_protocol user_managed -xo_path ${xoname} -kernel_name krnl_vadd_rtl -ip_directory ./packaged_kernel_${suffix}
|
||||
|
||||
The IP is first created, the CU information fetched and the memory index determined as below:
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
std::vector<xrt::xclbin::ip> cu;
|
||||
auto ip = xrt::ip(device, uuid, "krnl_vadd_rtl");
|
||||
auto xclbin = xrt::xclbin(binaryFile);
|
||||
std::cout << "Fetch compute Units" << std::endl;
|
||||
for (auto& kernel : xclbin.get_kernels()) {
|
||||
if (kernel.get_name() == "krnl_vadd_rtl") {
|
||||
cu = kernel.get_cus();
|
||||
}
|
||||
}
|
||||
|
||||
if (cu.empty()) throw std::runtime_error("IP krnl_vadd_rtl not found in the provided xclbin");
|
||||
|
||||
std::cout << "Determine memory index\n";
|
||||
for (auto& mem : xclbin.get_mems()) {
|
||||
if (mem.get_used()) {
|
||||
mem_used = mem;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
All the IP settings are achieved using the ``write_register`` and ``read_register`` calls as below:
|
||||
|
||||
.. code:: cpp
|
||||
|
||||
std::cout << "INFO: Setting IP Data" << std::endl;
|
||||
|
||||
auto args = cu[0].get_args();
|
||||
|
||||
std::cout << "Setting the 1st Register \"a\" (Input Address)" << std::endl;
|
||||
ip.write_register(args[0].get_offset(), buf_addr[0]);
|
||||
ip.write_register(args[0].get_offset() + 4, buf_addr[0] >> 32);
|
||||
|
||||
std::cout << "Setting the 2nd Register \"b\" (Input Address)" << std::endl;
|
||||
ip.write_register(args[1].get_offset(), buf_addr[1]);
|
||||
ip.write_register(args[1].get_offset() + 4, buf_addr[1] >> 32);
|
||||
|
||||
std::cout << "Setting the 3rd Register \"c\" (Output Address)" << std::endl;
|
||||
ip.write_register(args[2].get_offset(), buf_addr[2]);
|
||||
ip.write_register(args[2].get_offset() + 4, buf_addr[2] >> 32);
|
||||
|
||||
std::cout << "Setting the 4th Register \"length_r\"" << std::endl;
|
||||
ip.write_register(args[3].get_offset(), DATA_SIZE);
|
||||
|
||||
uint32_t axi_ctrl = 0;
|
||||
|
||||
std::cout << "INFO: IP Start" << std::endl;
|
||||
axi_ctrl = IP_START;
|
||||
ip.write_register(CSR_OFFSET, axi_ctrl);
|
||||
|
||||
// Wait until the IP is DONE
|
||||
|
||||
axi_ctrl = 0;
|
||||
while ((axi_ctrl & IP_IDLE) != IP_IDLE) {
|
||||
axi_ctrl = ip.read_register(CSR_OFFSET);
|
||||
}
|
||||
|
||||
std::cout << "INFO: IP Done" << std::endl;
|
||||
|
||||
RTL kernels can be integrated to Vitis using ``RTL Kernel Wizard``.
|
||||
These kernels have the same software interface model as OpenCL and C/C++
|
||||
kernels. That is, they are seen by the host application as functions
|
||||
with a void return value, scalar arguments, and pointer arguments.
|
||||
|
||||
The RTL Kernel Wizard automates some of the steps that need to be taken
|
||||
to ensure that the RTL IP is packaged into a kernel that can be
|
||||
integrated into a system in Vitis environment.
|
||||
|
||||
For more comprehensive documentation, `click here <http://xilinx.github.io/Vitis_Accel_Examples>`__.
|
|
@ -1,103 +0,0 @@
|
|||
{
|
||||
"name": "User Managed IP (RTL Kernel)",
|
||||
"description": [
|
||||
"Simple example of user managed RTL Kernel."
|
||||
],
|
||||
"flow": "vitis",
|
||||
"key_concepts": [
|
||||
"User-Managed RTL Kernel"
|
||||
],
|
||||
"keywords": [
|
||||
"package_xo",
|
||||
"ctrl_protocol",
|
||||
"user_managed",
|
||||
"xrt::ip",
|
||||
"xrt::xclbin",
|
||||
"xrt::kernel::get_kernels",
|
||||
"xrt::kernel::get_cus",
|
||||
"xrt::kernel::get_args",
|
||||
"xrt::arg::get_offset",
|
||||
"xrt::ip::write_register",
|
||||
"xrt::ip::read_register"
|
||||
],
|
||||
"platform_blocklist": [
|
||||
"nodma"
|
||||
],
|
||||
"targets": [
|
||||
"hw",
|
||||
"hw_emu"
|
||||
],
|
||||
"os": [
|
||||
"Linux"
|
||||
],
|
||||
"runtime": [
|
||||
"OpenCL"
|
||||
],
|
||||
"gui": false,
|
||||
"host": {
|
||||
"host_exe": "rtl_user_managed",
|
||||
"compiler": {
|
||||
"sources": [
|
||||
"REPO_DIR/common/includes/cmdparser/cmdlineparser.cpp",
|
||||
"REPO_DIR/common/includes/logger/logger.cpp",
|
||||
"src/host.cpp"
|
||||
],
|
||||
"includepaths": [
|
||||
"REPO_DIR/common/includes/cmdparser",
|
||||
"REPO_DIR/common/includes/logger"
|
||||
]
|
||||
},
|
||||
"linker" : {
|
||||
"libraries" : ["uuid",
|
||||
"xrt_coreutil"
|
||||
]
|
||||
}
|
||||
},
|
||||
"containers": [
|
||||
{
|
||||
"accelerators": [
|
||||
{
|
||||
"kernel_type": "RTL",
|
||||
"name": "vadd"
|
||||
}
|
||||
],
|
||||
"name": "vadd"
|
||||
}
|
||||
],
|
||||
"launch": [
|
||||
{
|
||||
"cmd_args": "-x BUILD/vadd.xclbin",
|
||||
"name": "generic launch for all flows"
|
||||
}
|
||||
],
|
||||
"config_make": "config.mk",
|
||||
"output_files": [
|
||||
"tmp_kernel_pack*",
|
||||
"packaged_kernel*"
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"url": "http://www.xilinx.com",
|
||||
"group": "Xilinx"
|
||||
}
|
||||
],
|
||||
"testinfo": {
|
||||
"disable": false,
|
||||
"profile": "no",
|
||||
"jobs": [
|
||||
{
|
||||
"index": 0,
|
||||
"dependency": [],
|
||||
"env": "",
|
||||
"cmd": "",
|
||||
"max_memory_MB": 32768,
|
||||
"max_time_min": 300
|
||||
}
|
||||
],
|
||||
"targets": [
|
||||
"vitis_hw_emu",
|
||||
"vitis_hw"
|
||||
],
|
||||
"category": "canary"
|
||||
}
|
||||
}
|
|
@ -1,100 +0,0 @@
|
|||
#
|
||||
# Copyright 2019-2021 Xilinx, Inc.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
# makefile-generator v1.0.3
|
||||
#
|
||||
|
||||
################################ Help Section #################################
|
||||
|
||||
ifneq ($(findstring Makefile, $(MAKEFILE_LIST)), Makefile)
|
||||
help:
|
||||
$(ECHO) "Makefile Usage:"
|
||||
$(ECHO) " make all TARGET=<sw_emu/hw_emu/hw> PLATFORM=<FPGA platform>"
|
||||
$(ECHO) " Command to generate the design for specified Target and Shell."
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make clean "
|
||||
$(ECHO) " Command to remove the generated non-hardware files."
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make cleanall"
|
||||
$(ECHO) " Command to remove all the generated files."
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make test PLATFORM=<FPGA platform>"
|
||||
$(ECHO) " Command to run the application. This is same as 'run' target but does not have any makefile dependency."
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make run TARGET=<sw_emu/hw_emu/hw> PLATFORM=<FPGA platform>"
|
||||
$(ECHO) " Command to run application in emulation."
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make build TARGET=<sw_emu/hw_emu/hw> PLATFORM=<FPGA platform>"
|
||||
$(ECHO) " Command to build xclbin application."
|
||||
$(ECHO) ""
|
||||
$(ECHO) " make host"
|
||||
$(ECHO) " Command to build host application."
|
||||
$(ECHO) ""
|
||||
endif
|
||||
|
||||
###################### Setting up Project Variables ###########################
|
||||
|
||||
TARGET := hw
|
||||
include utils.mk
|
||||
|
||||
VIVADO := $(XILINX_VIVADO)/bin/vivado
|
||||
|
||||
TEMP_DIR := ./_x.$(TARGET).$(XSA)
|
||||
BUILD_DIR := ./build_dir.$(TARGET).$(XSA)
|
||||
|
||||
LINK_OUTPUT := $(BUILD_DIR)/$(KERNEL_NAME).link.xclbin
|
||||
PACKAGE_OUT = ./package.$(TARGET)
|
||||
|
||||
VPP_PFLAGS :=
|
||||
CMD_ARGS = -x $(BUILD_DIR)/$(KERNEL_NAME).xclbin
|
||||
|
||||
######################## Setting up Kernel Variables ##########################
|
||||
|
||||
# Kernel compiler global settings
|
||||
VPP_FLAGS += -t $(TARGET) --platform $(PLATFORM) --save-temps
|
||||
|
||||
############################## Setting Targets ################################
|
||||
|
||||
.PHONY: all clean cleanall
|
||||
all: check-platform check-device check-vitis $(BUILD_DIR)/$(KERNEL_NAME).xclbin
|
||||
|
||||
.PHONY: build
|
||||
build: check-vitis check-device $(BUILD_DIR)/$(KERNEL_NAME).xclbin
|
||||
|
||||
.PHONY: xclbin
|
||||
xclbin: build
|
||||
|
||||
# Building kernel
|
||||
$(TEMP_DIR)/$(KERNEL_NAME).xo: scripts/package_kernel.tcl scripts/gen_xo.tcl
|
||||
mkdir -p $(TEMP_DIR)
|
||||
$(VIVADO) -mode batch -source scripts/gen_xo.tcl -tclargs $(TEMP_DIR)/$(KERNEL_NAME).xo $(KERNEL_NAME) $(TARGET) $(PLATFORM) $(XSA)
|
||||
|
||||
$(BUILD_DIR)/$(KERNEL_NAME).xclbin: $(TEMP_DIR)/$(KERNEL_NAME).xo
|
||||
mkdir -p $(BUILD_DIR)
|
||||
v++ $(VPP_FLAGS) -l $(VPP_LDFLAGS) --temp_dir $(TEMP_DIR) -o'$(LINK_OUTPUT)' $(+)
|
||||
v++ -p $(LINK_OUTPUT) -t $(TARGET) --platform $(PLATFORM) --package.out_dir $(PACKAGE_OUT) -o $(BUILD_DIR)/$(KERNEL_NAME).xclbin
|
||||
|
||||
############################## Cleaning Rules #################################
|
||||
|
||||
# Cleaning stuff
|
||||
clean:
|
||||
-$(RMDIR) $(EXECUTABLE) $(XCLBIN)/{*sw_emu*,*hw_emu*}
|
||||
-$(RMDIR) profile_* TempConfig system_estimate.xtxt *.rpt *.csv
|
||||
-$(RMDIR) src/*.ll *v++* .Xil dltmp* xmltmp* *.log *.jou *.wcfg *.wdb
|
||||
|
||||
cleanall: clean
|
||||
-$(RMDIR) build_dir*
|
||||
-$(RMDIR) package.*
|
||||
-$(RMDIR) _x* *xclbin.run_summary qemu-memory-_* emulation _vimage pl* start_simulation.sh *.xclbin
|
||||
-$(RMDIR) ./tmp_kernel_pack* ./packaged_kernel*
|
|
@ -1,8 +0,0 @@
|
|||
{
|
||||
"containers": [
|
||||
{
|
||||
"meet_system_timing": "true",
|
||||
"name": "vadd"
|
||||
}
|
||||
]
|
||||
}
|
27
hw/syn/xilinx/xrt/scripts/gen_ip.tcl
Normal file
27
hw/syn/xilinx/xrt/scripts/gen_ip.tcl
Normal file
|
@ -0,0 +1,27 @@
|
|||
if { $::argc != 1 } {
|
||||
puts "ERROR: Program \"$::argv0\" requires 1 arguments!\n"
|
||||
puts "Usage: $::argv0 <ip_dir>\n"
|
||||
exit
|
||||
}
|
||||
|
||||
set ip_dir [lindex $::argv 0]
|
||||
|
||||
# IP folder does not exist. Create IP folder
|
||||
file mkdir ${ip_dir}
|
||||
|
||||
# create_ip requires that a project is open in memory.
|
||||
# Create project but don't do anything with it
|
||||
create_project -in_memory
|
||||
|
||||
create_ip -name floating_point -vendor xilinx.com -library ip -version 7.1 -module_name xil_fdiv -dir ${ip_dir}
|
||||
set_property -dict [list CONFIG.Component_Name {xil_fdiv} CONFIG.Operation_Type {Divide} CONFIG.Flow_Control {NonBlocking} CONFIG.Has_ACLKEN {true} CONFIG.C_Has_UNDERFLOW {true} CONFIG.C_Has_OVERFLOW {true} CONFIG.C_Has_INVALID_OP {true} CONFIG.C_Has_DIVIDE_BY_ZERO {true} CONFIG.A_Precision_Type {Single} CONFIG.C_A_Exponent_Width {8} CONFIG.C_A_Fraction_Width {24} CONFIG.Result_Precision_Type {Single} CONFIG.C_Result_Exponent_Width {8} CONFIG.C_Result_Fraction_Width {24} CONFIG.C_Mult_Usage {No_Usage} CONFIG.Has_RESULT_TREADY {false} CONFIG.C_Latency {28} CONFIG.C_Rate {1}] [get_ips xil_fdiv]
|
||||
|
||||
create_ip -name floating_point -vendor xilinx.com -library ip -version 7.1 -module_name xil_fsqrt -dir ${ip_dir}
|
||||
set_property -dict [list CONFIG.Component_Name {xil_fsqrt} CONFIG.Operation_Type {Square_root} CONFIG.Flow_Control {NonBlocking} CONFIG.Has_ACLKEN {true} CONFIG.C_Has_INVALID_OP {true} CONFIG.A_Precision_Type {Single} CONFIG.C_A_Exponent_Width {8} CONFIG.C_A_Fraction_Width {24} CONFIG.Result_Precision_Type {Single} CONFIG.C_Result_Exponent_Width {8} CONFIG.C_Result_Fraction_Width {24} CONFIG.C_Mult_Usage {No_Usage} CONFIG.Has_RESULT_TREADY {false} CONFIG.C_Latency {28} CONFIG.C_Rate {1}] [get_ips xil_fsqrt]
|
||||
|
||||
create_ip -name floating_point -vendor xilinx.com -library ip -version 7.1 -module_name xil_fma -dir ${ip_dir}
|
||||
set_property -dict [list CONFIG.Component_Name {xil_fma} CONFIG.Operation_Type {FMA} CONFIG.Add_Sub_Value {Add} CONFIG.Flow_Control {NonBlocking} CONFIG.Has_ACLKEN {true} CONFIG.C_Has_UNDERFLOW {true} CONFIG.C_Has_OVERFLOW {true} CONFIG.C_Has_INVALID_OP {true} CONFIG.Has_A_TUSER {false} CONFIG.A_Precision_Type {Single} CONFIG.C_A_Exponent_Width {8} CONFIG.C_A_Fraction_Width {24} CONFIG.Result_Precision_Type {Single} CONFIG.C_Result_Exponent_Width {8} CONFIG.C_Result_Fraction_Width {24} CONFIG.C_Mult_Usage {Medium_Usage} CONFIG.Has_RESULT_TREADY {false} CONFIG.C_Latency {16} CONFIG.C_Rate {1} CONFIG.A_TUSER_Width {1}] [get_ips xil_fma]
|
||||
|
||||
generate_target all [get_ips]
|
||||
|
||||
close_project -delete
|
46
hw/syn/xilinx/xrt/scripts/gen_sources.sh
Executable file
46
hw/syn/xilinx/xrt/scripts/gen_sources.sh
Executable file
|
@ -0,0 +1,46 @@
|
|||
#!/bin/bash
|
||||
|
||||
exclude_list="VX_fpu_fpnew.sv"
|
||||
macros=()
|
||||
includes=()
|
||||
|
||||
# parse command arguments
|
||||
while getopts D:I:h flag
|
||||
do
|
||||
case "${flag}" in
|
||||
D) macros+=( ${OPTARG} );;
|
||||
I) includes+=( ${OPTARG} );;
|
||||
h) echo "Usage: [-D macro] [-I include] [-h help]"
|
||||
exit 0
|
||||
;;
|
||||
\?)
|
||||
echo "Invalid option: -$OPTARG" 1>&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# dump macros
|
||||
for value in ${macros[@]}; do
|
||||
echo "+define+$value"
|
||||
done
|
||||
|
||||
# dump include directories
|
||||
for dir in ${includes[@]}; do
|
||||
echo "+incdir+$dir"
|
||||
done
|
||||
|
||||
# dump source files
|
||||
for dir in ${includes[@]}; do
|
||||
for file in $(find $dir -maxdepth 1 -name '*.v' -o -name '*.sv' -type f); do
|
||||
exclude=0
|
||||
for fe in $exclude_list; do
|
||||
if [[ $file =~ $fe ]]; then
|
||||
exclude=1
|
||||
fi
|
||||
done
|
||||
if [[ $exclude == 0 ]]; then
|
||||
echo $file
|
||||
fi
|
||||
done
|
||||
done
|
41
hw/syn/xilinx/xrt/scripts/gen_xo.tcl
Executable file → Normal file
41
hw/syn/xilinx/xrt/scripts/gen_xo.tcl
Executable file → Normal file
|
@ -1,37 +1,26 @@
|
|||
#
|
||||
# Copyright (C) 2019-2021 Xilinx, Inc
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
# not use this file except in compliance with the License. A copy of the
|
||||
# License is located at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
if { $::argc != 5 } {
|
||||
puts "ERROR: Program \"$::argv0\" requires 5 arguments!\n"
|
||||
puts "Usage: $::argv0 <xoname> <krnl_name> <target> <xpfm_path> <device>\n"
|
||||
if { $::argc != 4 } {
|
||||
puts "ERROR: Program \"$::argv0\" requires 4 arguments!\n"
|
||||
puts "Usage: $::argv0 <xoname> <krnl_name> <vcs_file> <build_dir>\n"
|
||||
exit
|
||||
}
|
||||
|
||||
set xoname [lindex $::argv 0]
|
||||
set krnl_name [lindex $::argv 1]
|
||||
set target [lindex $::argv 2]
|
||||
set xpfm_path [lindex $::argv 3]
|
||||
set device [lindex $::argv 4]
|
||||
set vcs_file [lindex $::argv 2]
|
||||
set build_dir [lindex $::argv 3]
|
||||
|
||||
set suffix "${krnl_name}_${target}_${device}"
|
||||
|
||||
source -notrace ./scripts/package_kernel.tcl
|
||||
set script_path [ file dirname [ file normalize [ info script ] ] ]
|
||||
|
||||
if {[file exists "${xoname}"]} {
|
||||
file delete -force "${xoname}"
|
||||
}
|
||||
|
||||
package_xo -ctrl_protocol user_managed -xo_path ${xoname} -kernel_name vortex_afu -ip_directory ./packaged_kernel_${suffix}
|
||||
set argv [list ${build_dir}/ip]
|
||||
set argc 1
|
||||
source -notrace ${script_path}/gen_ip.tcl
|
||||
|
||||
set argv [list ${krnl_name} ${build_dir}]
|
||||
set argc 2
|
||||
source -notrace ${script_path}/package_kernel.tcl
|
||||
|
||||
package_xo -ctrl_protocol user_managed -xo_path ${xoname} -kernel_name ${krnl_name} -ip_directory "${build_dir}/packaged_kernel"
|
||||
|
|
84
hw/syn/xilinx/xrt/scripts/package_kernel.tcl
Executable file → Normal file
84
hw/syn/xilinx/xrt/scripts/package_kernel.tcl
Executable file → Normal file
|
@ -1,33 +1,67 @@
|
|||
#
|
||||
# Copyright (C) 2019-2021 Xilinx, Inc
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"). You may
|
||||
# not use this file except in compliance with the License. A copy of the
|
||||
# License is located at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
if { $::argc != 2 } {
|
||||
puts "ERROR: Program \"$::argv0\" requires 2 arguments!\n"
|
||||
puts "Usage: $::argv0 <krnl_name> <build_dir>\n"
|
||||
exit
|
||||
}
|
||||
|
||||
set path_to_hdl_vx "../../../rtl"
|
||||
set path_to_hdl_afu "../../../afu/xrt"
|
||||
set path_to_hdl_ip "../../../ip/xilinx/alveo"
|
||||
set krnl_name [lindex $::argv 0]
|
||||
set build_dir [lindex $::argv 1]
|
||||
|
||||
set path_to_packaged "./packaged_kernel_${suffix}"
|
||||
set path_to_tmp_project "./tmp_kernel_pack_${suffix}"
|
||||
set script_path [ file dirname [ file normalize [ info script ] ] ]
|
||||
|
||||
set path_to_packaged "${build_dir}/packaged_kernel"
|
||||
set path_to_tmp_project "${build_dir}/tmp_project"
|
||||
|
||||
source "${script_path}/parse_vcs_list.tcl"
|
||||
set vlist [parse_vcs_list "${vcs_file}"]
|
||||
|
||||
set vsources_list [lindex $vlist 0]
|
||||
set vincludes_list [lindex $vlist 1]
|
||||
set vdefines_list [lindex $vlist 2]
|
||||
|
||||
#puts ${vsources_list}
|
||||
#puts ${vdefines_list}
|
||||
|
||||
# dump defines into globals.vh
|
||||
set fh [open "${build_dir}/globals.vh" w]
|
||||
foreach def $vdefines_list {
|
||||
set fields [split $def "="]
|
||||
set len [llength $fields]
|
||||
puts -nonewline $fh "`define "
|
||||
if {$len > 1} {
|
||||
puts -nonewline $fh [lindex $fields 0]
|
||||
puts -nonewline $fh " "
|
||||
puts $fh [lindex $fields 1]
|
||||
} else {
|
||||
puts $fh [lindex $fields 0]
|
||||
}
|
||||
}
|
||||
close $fh
|
||||
|
||||
create_project -force kernel_pack $path_to_tmp_project
|
||||
|
||||
add_files -verbose [glob globals.vh $path_to_hdl_vx $path_to_hdl_afu $path_to_hdl_ip]
|
||||
add_files -norecurse ${vsources_list}
|
||||
|
||||
set_property include_dirs ${vincludes_list} [current_fileset]
|
||||
set_property include_dirs ${build_dir} [current_fileset]
|
||||
#set_property verilog_define ${vdefines_list} [current_fileset]
|
||||
|
||||
set obj [get_filesets sources_1]
|
||||
set files [list \
|
||||
[file normalize "${build_dir}/ip/xil_fdiv/xil_fdiv.xci"] \
|
||||
[file normalize "${build_dir}/ip/xil_fma/xil_fma.xci"] \
|
||||
[file normalize "${build_dir}/ip/xil_fsqrt/xil_fsqrt.xci"] \
|
||||
]
|
||||
add_files -verbose -norecurse -fileset $obj $files
|
||||
|
||||
set obj [get_filesets sources_1]
|
||||
set_property -verbose -name "top" -value ${krnl_name} -objects $obj
|
||||
|
||||
update_compile_order -fileset sources_1
|
||||
update_compile_order -fileset sim_1
|
||||
|
||||
ipx::package_project -root_dir $path_to_packaged -vendor xilinx.com -library RTLKernel -taxonomy /KernelIP -import_files -set_current false
|
||||
|
||||
ipx::unload_core $path_to_packaged/component.xml
|
||||
ipx::edit_ip_in_project -upgrade true -name tmp_edit_project -directory $path_to_packaged $path_to_packaged/component.xml
|
||||
|
||||
|
@ -105,9 +139,15 @@ set reg [::ipx::add_register "IP_ISR" $addr_block]
|
|||
set_property address_offset 0x00C $reg
|
||||
set_property size 32 $reg
|
||||
|
||||
set reg [::ipx::add_register -quiet "DCR" $addr_block]
|
||||
set reg [::ipx::add_register -quiet "MEM" $addr_block]
|
||||
set_property address_offset 0x010 $reg
|
||||
set_property size [expr {8*8}] $reg
|
||||
set regparam [::ipx::add_register_parameter -quiet {ASSOCIATED_BUSIF} $reg]
|
||||
set_property value m_axi_gmem $regparam
|
||||
|
||||
set reg [::ipx::add_register -quiet "DCR" $addr_block]
|
||||
set_property address_offset 0x01C $reg
|
||||
set_property size [expr {8*8}] $reg
|
||||
|
||||
set_property slave_memory_map_ref "s_axi_control" [::ipx::get_bus_interfaces -of $core "s_axi_control"]
|
||||
|
||||
|
|
33
hw/syn/xilinx/xrt/scripts/parse_vcs_list.tcl
Normal file
33
hw/syn/xilinx/xrt/scripts/parse_vcs_list.tcl
Normal file
|
@ -0,0 +1,33 @@
|
|||
proc parse_vcs_list {flist_path} {
|
||||
set f [split [string trim [read [open $flist_path r]]] "\n"]
|
||||
set flist [list ]
|
||||
set dir_list [list ]
|
||||
set def_list [list ]
|
||||
foreach x $f {
|
||||
if {![string match "" $x]} {
|
||||
# If the item starts with +incdir+, directory files need to be added
|
||||
if {[string match "#*" $x]} {
|
||||
# get rid of comment line
|
||||
} elseif {[string match "+incdir+*" $x]} {
|
||||
set trimchars "+incdir+"
|
||||
set temp [string trimleft $x $trimchars]
|
||||
set expanded [subst $temp]
|
||||
lappend dir_list $expanded
|
||||
} elseif {[string match "+define+*" $x]} {
|
||||
set trimchars "+define+"
|
||||
set temp [string trimleft $x $trimchars]
|
||||
set expanded [subst $temp]
|
||||
lappend def_list $expanded
|
||||
} else {
|
||||
set expanded [subst $x]
|
||||
lappend flist $expanded
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#puts $flist
|
||||
#puts $dir_list
|
||||
#puts $def_list
|
||||
|
||||
return [list $flist $dir_list $def_list]
|
||||
}
|
|
@ -1,113 +0,0 @@
|
|||
#+-------------------------------------------------------------------------------
|
||||
# The following parameters are assigned with default values. These parameters can
|
||||
# be overridden through the make command line
|
||||
#+-------------------------------------------------------------------------------
|
||||
|
||||
DEBUG := no
|
||||
|
||||
#Generates debug summary report
|
||||
ifeq ($(DEBUG), yes)
|
||||
VPP_LDFLAGS += --dk list_ports
|
||||
endif
|
||||
|
||||
ifneq ($(TARGET), hw)
|
||||
VPP_FLAGS += -g
|
||||
endif
|
||||
|
||||
############################## Setting up Project Variables ##############################
|
||||
# Points to top directory of Git repository
|
||||
MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
|
||||
COMMON_REPO ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%rtl_kernels/rtl_user_managed/*}')
|
||||
PWD = $(shell readlink -f .)
|
||||
XF_PROJ_ROOT = $(shell readlink -f $(COMMON_REPO))
|
||||
|
||||
#Setting PLATFORM
|
||||
ifeq ($(PLATFORM),)
|
||||
ifneq ($(DEVICE),)
|
||||
$(warning WARNING: DEVICE is deprecated in make command. Please use PLATFORM instead)
|
||||
PLATFORM := $(DEVICE)
|
||||
endif
|
||||
endif
|
||||
|
||||
#Checks for XILINX_VITIS
|
||||
check-vitis:
|
||||
ifndef XILINX_VITIS
|
||||
$(error XILINX_VITIS variable is not set, please set correctly using "source <Vitis_install_path>/Vitis/<Version>/settings64.sh" and rerun)
|
||||
endif
|
||||
|
||||
#Checks for XILINX_XRT
|
||||
check-xrt:
|
||||
ifndef XILINX_XRT
|
||||
$(error XILINX_XRT variable is not set, please set correctly using "source /opt/xilinx/xrt/setup.sh" and rerun)
|
||||
endif
|
||||
|
||||
check-device:
|
||||
@set -eu; \
|
||||
inallowlist=False; \
|
||||
inblocklist=False; \
|
||||
if [ "$(PLATFORM_ALLOWLIST)" = "" ]; \
|
||||
then inallowlist=True; \
|
||||
fi; \
|
||||
for dev in $(PLATFORM_ALLOWLIST); \
|
||||
do if [[ $$(echo $(PLATFORM) | grep $$dev) != "" ]]; \
|
||||
then inallowlist=True; fi; \
|
||||
done ;\
|
||||
for dev in $(PLATFORM_BLOCKLIST); \
|
||||
do if [[ $$(echo $(PLATFORM) | grep $$dev) != "" ]]; \
|
||||
then inblocklist=True; fi; \
|
||||
done ;\
|
||||
if [[ $$inblocklist == True ]]; \
|
||||
then echo "[ERROR]: This example is not supported for $(PLATFORM)."; exit 1;\
|
||||
fi; \
|
||||
if [[ $$inallowlist == False ]]; \
|
||||
then echo "[Warning]: The platform $(PLATFORM) not in allowlist."; \
|
||||
fi;
|
||||
|
||||
gen_run_app:
|
||||
rm -rf run_app.sh
|
||||
$(ECHO) 'export LD_LIBRARY_PATH=/mnt:/tmp:$$LD_LIBRARY_PATH' >> run_app.sh
|
||||
$(ECHO) 'export PATH=$$PATH:/sbin' >> run_app.sh
|
||||
$(ECHO) 'export XILINX_XRT=/usr' >> run_app.sh
|
||||
ifeq ($(TARGET),$(filter $(TARGET),sw_emu hw_emu))
|
||||
$(ECHO) 'export XILINX_VITIS=$$PWD' >> run_app.sh
|
||||
$(ECHO) 'export XCL_EMULATION_MODE=$(TARGET)' >> run_app.sh
|
||||
endif
|
||||
$(ECHO) '$(EXECUTABLE) -x vadd.xclbin' >> run_app.sh
|
||||
$(ECHO) 'return_code=$$?' >> run_app.sh
|
||||
$(ECHO) 'if [ $$return_code -ne 0 ]; then' >> run_app.sh
|
||||
$(ECHO) 'echo "ERROR: host run failed, RC=$$return_code"' >> run_app.sh
|
||||
$(ECHO) 'fi' >> run_app.sh
|
||||
$(ECHO) 'echo "INFO: host run completed."' >> run_app.sh
|
||||
check-platform:
|
||||
ifndef PLATFORM
|
||||
$(error PLATFORM not set. Please set the PLATFORM properly and rerun. Run "make help" for more details.)
|
||||
endif
|
||||
|
||||
# device2xsa - create a filesystem friendly name from device name
|
||||
# $(1) - full name of device
|
||||
device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(PLATFORM))))
|
||||
|
||||
XSA :=
|
||||
ifneq ($(PLATFORM), )
|
||||
XSA := $(call device2xsa, $(PLATFORM))
|
||||
endif
|
||||
|
||||
############################## Deprecated Checks and Running Rules ##############################
|
||||
check:
|
||||
$(ECHO) "WARNING: \"make check\" is a deprecated command. Please use \"make run\" instead"
|
||||
make run
|
||||
|
||||
exe:
|
||||
$(ECHO) "WARNING: \"make exe\" is a deprecated command. Please use \"make host\" instead"
|
||||
make host
|
||||
|
||||
# Cleaning stuff
|
||||
RM = rm -f
|
||||
RMDIR = rm -rf
|
||||
|
||||
ECHO:= @echo
|
||||
|
||||
docs: README.rst
|
||||
|
||||
README.rst: description.json
|
||||
$(XF_PROJ_ROOT)/common/utility/readme_gen/readme_gen.py description.json
|
|
@ -1,16 +1,23 @@
|
|||
CXXFLAGS += -std=c++17 -O2 -Wall -Wextra -pedantic -Wfatal-errors
|
||||
CXXFLAGS += -std=c++11 -Wall -Wextra -Wfatal-errors
|
||||
|
||||
CXXFLAGS += -I../include -I../common -I../../hw -I$(XILINX_XRT)/include
|
||||
|
||||
CXXFLAGS += -fPIC
|
||||
|
||||
LDFLAGS += -shared -pthread
|
||||
LDFLAGS += -L$(XILINX_XRT)/lib -lxrt_core
|
||||
LDFLAGS += -L$(XILINX_XRT)/lib -luuid -lxrt_coreutil
|
||||
|
||||
SRCS = vortex.cpp ../common/vx_utils.cpp
|
||||
|
||||
PROJECT = libvortex.so
|
||||
|
||||
# Debugigng
|
||||
ifdef DEBUG
|
||||
CXXFLAGS += -g -O0
|
||||
else
|
||||
CXXFLAGS += -O2 -DNDEBUG
|
||||
endif
|
||||
|
||||
all: $(PROJECT)
|
||||
|
||||
$(PROJECT): $(SRCS)
|
||||
|
|
|
@ -10,14 +10,37 @@
|
|||
#include "experimental/xrt_device.h"
|
||||
#include "experimental/xrt_kernel.h"
|
||||
#include "experimental/xrt_xclbin.h"
|
||||
#include "experimental/xrt_error.h"
|
||||
|
||||
#define RAM_PAGE_SIZE 4096
|
||||
|
||||
#define DEFAULT_DEVICE_INDEX 0
|
||||
|
||||
#define DEFAULT_XCLBIN_PATH "vortex_kernel.xclbin"
|
||||
#define DEFAULT_XCLBIN_PATH "vortex_afu.xclbin"
|
||||
|
||||
#define KERNEL_NAME "vortex_kernel"
|
||||
#define KERNEL_NAME "vortex_afu"
|
||||
|
||||
#define CHECK_HANDLE(handle, _expr) \
|
||||
do { \
|
||||
handle = _expr; \
|
||||
if (handle !== 0) \
|
||||
break; \
|
||||
printf("[VXDRV] Error: '%s' returned NULL!\n", #_expr); \
|
||||
return -1; \
|
||||
} while (false)
|
||||
|
||||
#define CHECK_XERR(_expr) \
|
||||
do { \
|
||||
xrtErrorCode err = _expr; \
|
||||
if (err == 0) \
|
||||
break; \
|
||||
size_t len = 0; \
|
||||
xrtErrorGetString(xrtDevice, err, nullptr, 0, &len); \
|
||||
std::vector<char> buf(len); \
|
||||
xrtErrorGetString(xrtDevice, err, buf.data(), buf.size(), nullptr); \
|
||||
printf("[VXDRV] Error: '%s' returned %d, %s!\n", #_expr, (int)err, buf.data()); \
|
||||
return -1; \
|
||||
} while (false)
|
||||
|
||||
using namespace vortex;
|
||||
|
||||
|
@ -25,19 +48,16 @@ using namespace vortex;
|
|||
|
||||
class vx_device {
|
||||
public:
|
||||
vx_device(xrtDeviceHandle xrtdevice_,
|
||||
xrtXclbinHandle xclbin_,
|
||||
xrtKernelHandle xrtkernel_)
|
||||
: xrtdevice(xrtdevice_)
|
||||
, xclbin(xclbin_)
|
||||
, xrtkernel(xrtkernel_)
|
||||
vx_device(xrtDeviceHandle device,
|
||||
xrtKernelHandle kernel)
|
||||
: xrtDevice(device)
|
||||
, xrtKernel(kernel)
|
||||
{}
|
||||
|
||||
~vx_device() {}
|
||||
|
||||
xrtDeviceHandle xrtdevice;
|
||||
xrtXclbinHandle xclbin;
|
||||
xrtKernelHandle xrtkernel;
|
||||
xrtDeviceHandle xrtDevice;
|
||||
xrtKernelHandle xrtKernel;
|
||||
|
||||
DeviceConfig dcrs;
|
||||
unsigned version;
|
||||
|
@ -51,20 +71,11 @@ public:
|
|||
|
||||
class vx_buffer {
|
||||
public:
|
||||
vx_buffer(vx_device& vx_device, size_t size) : bo(device, size, mem_used.get_index())
|
||||
{
|
||||
|
||||
}
|
||||
vx_buffer(xrtBufferHandle buffer) : xrtBuffer(buffer) {}
|
||||
|
||||
~vx_buffer() {}
|
||||
|
||||
xrt::bo bo;
|
||||
|
||||
uint64_t wsid;
|
||||
void* host_ptr;
|
||||
uint64_t io_addr;
|
||||
vx_device_h hdevice;
|
||||
uint64_t size;
|
||||
xrtBufferHandle xrtBuffer;
|
||||
};
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
@ -113,6 +124,8 @@ extern int vx_dev_caps(vx_device_h hdevice, uint32_t caps_id, uint64_t *value) {
|
|||
}
|
||||
|
||||
extern int vx_dev_open(vx_device_h* hdevice) {
|
||||
int err;
|
||||
|
||||
if (nullptr == hdevice)
|
||||
return -1;
|
||||
|
||||
|
@ -127,33 +140,65 @@ extern int vx_dev_open(vx_device_h* hdevice) {
|
|||
xlbin_path_s = DEFAULT_XCLBIN_PATH;
|
||||
}
|
||||
|
||||
xrtDeviceHandle xrtdevice;
|
||||
xrtXclbinHandle xclbin;
|
||||
xrtKernelHandle xrtkernel;
|
||||
const char* emul_mode_s = getenv("XCL_EMULATION_MODE");
|
||||
if (emul_mode_s != nullptr) {
|
||||
printf("XCL_EMULATION_MODE=%s\n", emul_mode_s);
|
||||
}
|
||||
|
||||
xrtdevice = xrtDeviceOpen(device_index);
|
||||
if (!xrtdevice)
|
||||
xrtDeviceHandle xrtDevice;
|
||||
xrtKernelHandle xrtKernel;
|
||||
|
||||
xrtDevice = xrtDeviceOpen(device_index);
|
||||
if (nullptr == xrtDevice)
|
||||
return -1;
|
||||
|
||||
xclbin = xrtXclbinAllocFilename(xlbin_path_s);
|
||||
if (!xclbin) {
|
||||
xrtDeviceClose(xrtdevice);
|
||||
printf("part1\n");
|
||||
|
||||
err = xrtDeviceLoadXclbinFile(xrtDevice, xlbin_path_s);
|
||||
if (err != 0) {
|
||||
xrtDeviceClose(xrtDevice);
|
||||
return -1;
|
||||
}
|
||||
|
||||
xrtDeviceLoadXclbinHandle(xrtdevice, xclbin);
|
||||
printf("part2\n");
|
||||
|
||||
xuid_t uuid;
|
||||
xrtXclbinGetUUID(xclbin, uuid);
|
||||
|
||||
xrtkernel = xrtPLKernelOpen(xrtdevice, uuid, KERNEL_NAME);
|
||||
if (!xrtkernel) {
|
||||
err = xrtDeviceGetXclbinUUID(xrtDevice, uuid);
|
||||
if (err != 0) {
|
||||
xrtDeviceClose(xrtDevice);
|
||||
return -1;
|
||||
}
|
||||
|
||||
auto device = new vx_device(xrtdevice, xclbin, xrtKernelHandle);
|
||||
if (nullptr == device)
|
||||
return -1;
|
||||
printf("part3\n");
|
||||
|
||||
xrtKernel = xrtPLKernelOpen(xrtDevice, uuid, KERNEL_NAME);
|
||||
if (nullptr == xrtKernel) {
|
||||
xrtDeviceClose(xrtDevice);
|
||||
return -1;
|
||||
}
|
||||
|
||||
auto device = new vx_device(xrtDevice, xrtKernel);
|
||||
if (nullptr == device) {
|
||||
xrtKernelClose(xrtKernel);
|
||||
xrtDeviceClose(xrtDevice);
|
||||
return -1;
|
||||
}
|
||||
|
||||
auto xrtBuffer2 = xrtBOAlloc(xrtDevice, 0x100000, 0, 1);
|
||||
if (nullptr == xrtBuffer2) {
|
||||
return -1;
|
||||
}
|
||||
auto phyaddr2 = xrtBOAddress(xrtBuffer2);
|
||||
|
||||
// 32 banks * 256 MB
|
||||
auto xrtBuffer1 = xrtBOAlloc(xrtDevice, 0x100000 * 256, 0, 0);
|
||||
if (nullptr == xrtBuffer1) {
|
||||
return -1;
|
||||
|
||||
}
|
||||
auto phyaddr1 = xrtBOAddress(xrtBuffer1);
|
||||
|
||||
|
||||
|
||||
dcr_initialize(device);
|
||||
|
||||
|
@ -172,11 +217,9 @@ extern int vx_dev_close(vx_device_h hdevice) {
|
|||
|
||||
auto device = (vx_device*)hdevice;
|
||||
|
||||
xrtXclbinFreeHandle(device->xclbin);
|
||||
|
||||
xrtKernelClose(device->xrtkernel);
|
||||
xrtKernelClose(device->xrtKernel);
|
||||
|
||||
xrtDeviceClose(device->xrtdevice);
|
||||
xrtDeviceClose(device->xrtDevice);
|
||||
|
||||
delete device;
|
||||
|
||||
|
@ -189,7 +232,7 @@ extern int vx_mem_alloc(vx_device_h hdevice, uint64_t size, uint64_t* dev_maddr)
|
|||
|
||||
auto device = (vx_device*)hdevice;
|
||||
|
||||
device_handle = xrtBOAlloc(device, size, XRT_BO_FLAGS_NONE, (xrtMemoryGroup) xrtKernelArgGroupId(kernel, 4)));
|
||||
auto handle = xrtBOAlloc(device, size, XRT_BO_FLAGS_NONE, (xrtMemoryGroup) xrtKernelArgGroupId(device->xrtKernel, 4));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -209,7 +252,7 @@ extern int vx_buf_alloc(vx_device_h hdevice, uint64_t size, vx_buffer_h* hbuffer
|
|||
|
||||
auto device = (vx_device*)hdevice;
|
||||
|
||||
auto handle = xrtBOAlloc(device, size, XRT_BO_FLAGS_NONE, (xrtMemoryGroup) xrtKernelArgGroupId(kernel, 4)));
|
||||
auto handle = xrtBOAlloc(device, size, XRT_BO_FLAGS_NONE, (xrtMemoryGroup) xrtKernelArgGroupId(device->xrtKernel, 4));
|
||||
|
||||
auto buffer = new vx_buffer(handle);
|
||||
|
||||
|
@ -220,11 +263,11 @@ extern int vx_buf_alloc(vx_device_h hdevice, uint64_t size, vx_buffer_h* hbuffer
|
|||
|
||||
extern void* vx_host_ptr(vx_buffer_h hbuffer) {
|
||||
if (nullptr == hbuffer)
|
||||
return -1;
|
||||
return nullptr;
|
||||
|
||||
auto buffer = (vx_buffer*)hbuffer;
|
||||
|
||||
return reinterpret_cast<void*>(xrtBOMap(buffer->xrtbo));
|
||||
return reinterpret_cast<void*>(xrtBOMap(buffer->xrtBuffer));
|
||||
}
|
||||
|
||||
extern int vx_buf_free(vx_buffer_h hbuffer) {
|
||||
|
@ -233,20 +276,20 @@ extern int vx_buf_free(vx_buffer_h hbuffer) {
|
|||
|
||||
auto buffer = (vx_buffer*)hbuffer;
|
||||
|
||||
xrtBOFree(buffer->xrtbo);
|
||||
xrtBOFree(buffer->xrtBuffer);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern int vx_copy_to_dev(vx_buffer_h hbuffer, uint64_t dev_maddr, uint64_t size, uint64_t src_offset) {
|
||||
rtBOWrite(device_handle, host_ptr, size, device_offset);
|
||||
xrtBOSync(device_handle, XCL_BO_SYNC_BO_TO_DEVICE, size, device_offset);
|
||||
//rtBOWrite(device_handle, host_ptr, size, device_offset);
|
||||
//xrtBOSync(device_handle, XCL_BO_SYNC_BO_TO_DEVICE, size, device_offset);
|
||||
return 0;
|
||||
}
|
||||
|
||||
extern int vx_copy_from_dev(vx_buffer_h hbuffer, uint64_t dev_maddr, uint64_t size, uint64_t dest_offset) {
|
||||
rtBOWrite(device_handle, host_ptr, size, device_offset);
|
||||
xrtBOSync(device_handle, XCL_BO_SYNC_BO_TO_DEVICE, size, device_offset);
|
||||
//rtBOWrite(device_handle, host_ptr, size, device_offset);
|
||||
//xrtBOSync(device_handle, XCL_BO_SYNC_BO_TO_DEVICE, size, device_offset);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -256,7 +299,7 @@ extern int vx_start(vx_device_h hdevice) {
|
|||
|
||||
auto device = (vx_device*)hdevice;
|
||||
|
||||
auto run = xrtKernelRun(kernel, s0, s1, s2, s3, axi00 != NULL ? axi00 : dummy_buffers[0], axi01 != NULL ? axi01 : dummy_buffers[1]);
|
||||
//auto run = xrtKernelRun(device->xrtKernel, s0, s1, s2, s3, axi00 != nullptr ? axi00 : dummy_buffers[0], axi01 != nullptr ? axi01 : dummy_buffers[1]);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -267,15 +310,15 @@ extern int vx_ready_wait(vx_device_h hdevice, uint64_t timeout) {
|
|||
|
||||
auto device = (vx_device*)hdevice;
|
||||
|
||||
while (true) {
|
||||
res = xrtRunWait(run);
|
||||
/*while (true) {
|
||||
auto res = xrtRunWait(run);
|
||||
if (res != ERT_CMD_STATE_COMPLETED)
|
||||
printf("%s: error: %llu\n", __FUNCTION__, res);
|
||||
else
|
||||
break;
|
||||
}
|
||||
|
||||
xrtRunClose(run);
|
||||
xrtRunClose(run);*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -286,7 +329,7 @@ extern int vx_dcr_write(vx_device_h hdevice, uint32_t addr, uint64_t value) {
|
|||
|
||||
auto device = (vx_device*)hdevice;
|
||||
|
||||
xrtKernelWriteRegister(device->xrtkernel, addr, value);
|
||||
//xrtKernelWriteRegister(device->xrtKernel, addr, value);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -51,7 +51,7 @@ VL_FLAGS = --exe --cc $(TOP) --top-module $(TOP)
|
|||
VL_FLAGS += --language 1800-2009 --assert -Wall -Wpedantic
|
||||
VL_FLAGS += -Wno-DECLFILENAME -Wno-REDEFMACRO
|
||||
VL_FLAGS += --x-initial unique --x-assign unique
|
||||
VL_FLAGS += -DSIMULATION
|
||||
VL_FLAGS += -DSIMULATION -DNOGLOBALS
|
||||
VL_FLAGS += verilator.vlt
|
||||
VL_FLAGS += $(RTL_INCLUDE)
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@ Cluster::Cluster(uint32_t cluster_id, uint32_t cores_per_cluster, ProcessorImpl*
|
|||
icaches_ = CacheCluster::Create(sname, cores_per_cluster, NUM_ICACHES, CacheSim::Config{
|
||||
!ICACHE_ENABLED,
|
||||
log2ceil(ICACHE_SIZE), // C
|
||||
log2ceil(L1_BLOCK_SIZE),// B
|
||||
log2ceil(L1_LINE_SIZE),// B
|
||||
log2ceil(sizeof(uint32_t)), // W
|
||||
log2ceil(ICACHE_NUM_WAYS),// A
|
||||
32, // address bits
|
||||
|
@ -56,7 +56,7 @@ Cluster::Cluster(uint32_t cluster_id, uint32_t cores_per_cluster, ProcessorImpl*
|
|||
dcaches_ = CacheCluster::Create(sname, cores_per_cluster, NUM_DCACHES, CacheSim::Config{
|
||||
!DCACHE_ENABLED,
|
||||
log2ceil(DCACHE_SIZE), // C
|
||||
log2ceil(L1_BLOCK_SIZE),// B
|
||||
log2ceil(L1_LINE_SIZE),// B
|
||||
log2ceil(sizeof(Word)), // W
|
||||
log2ceil(DCACHE_NUM_WAYS),// A
|
||||
32, // address bits
|
||||
|
@ -77,7 +77,7 @@ Cluster::Cluster(uint32_t cluster_id, uint32_t cores_per_cluster, ProcessorImpl*
|
|||
tcaches_ = CacheCluster::Create(sname, NUM_TEX_UNITS, NUM_TCACHES, CacheSim::Config{
|
||||
!TCACHE_ENABLED,
|
||||
log2ceil(TCACHE_SIZE), // C
|
||||
log2ceil(L1_BLOCK_SIZE),// B
|
||||
log2ceil(L1_LINE_SIZE),// B
|
||||
log2ceil(sizeof(uint32_t)), // W
|
||||
log2ceil(TCACHE_NUM_WAYS),// A
|
||||
32, // address bits
|
||||
|
|
|
@ -49,7 +49,7 @@ VL_FLAGS = --exe --cc $(TOP) --top-module $(TOP)
|
|||
VL_FLAGS += -O2 --language 1800-2009 --assert -Wall -Wpedantic
|
||||
VL_FLAGS += -Wno-DECLFILENAME -Wno-REDEFMACRO
|
||||
VL_FLAGS += --x-initial unique --x-assign unique
|
||||
VL_FLAGS += -DSIMULATION
|
||||
VL_FLAGS += -DSIMULATION -DNOGLOBALS
|
||||
VL_FLAGS += verilator.vlt
|
||||
VL_FLAGS += $(RTL_INCLUDE)
|
||||
|
||||
|
|
|
@ -64,6 +64,9 @@ run-vlsim: $(PROJECT) kernel.bin
|
|||
run-rtlsim: $(PROJECT) kernel.bin
|
||||
LD_LIBRARY_PATH=$(POCL_RT_PATH)/lib:$(VORTEX_RT_PATH)/rtlsim:$(LD_LIBRARY_PATH) ./$(PROJECT) $(OPTS)
|
||||
|
||||
run-xrt: $(PROJECT) kernel.bin
|
||||
XCL_EMULATION_MODE=hw_emu XRT_DEVICE_INDEX=0 XRT_XCLBIN_PATH=../../../hw/syn/xilinx/xrt/build_dir.hw_emu.xilinx_u280_xdma_201920_3/vortex_afu.xclbin LD_LIBRARY_PATH=$(XILINX_XRT)/lib:$(POCL_RT_PATH)/lib:$(VORTEX_RT_PATH)/xrt:$(LD_LIBRARY_PATH) ./$(PROJECT) $(OPTS)
|
||||
|
||||
.depend: $(SRCS)
|
||||
$(CXX) $(CXXFLAGS) -MM $^ > .depend;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue