Skip to content

Commit 236e7db

Browse files
axiotiskQuentin Berthet
authored andcommitted
Setup emu in Makefile and edit tb_input_features in host
1 parent f69a950 commit 236e7db

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

hls4ml/templates/vitis_accelerator/Makefile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ PWD := $(shell pwd)
2525
# Target (hw, hw_emu, sw_emu)
2626
TARGET ?= hw
2727

28+
# Define emulation mode variable
29+
ifneq($(TARGET), hw)
30+
XCL_EMULATION_MODE=$(TARGET)
31+
endif
32+
2833
# Accelerator card configuration file
2934
CARD_CFG ?= accelerator_card.cfg
3035

@@ -121,7 +126,9 @@ host: $(KERNEL_NAME)_host_cl.cpp libs/xcl2.cpp
121126
# Execute program #############################################################
122127

123128
run: ./host $(BUILD_DIR)/$(WRAPPER_NAME).xclbin
129+
cd firmware
124130
./host $(BUILD_DIR)/$(WRAPPER_NAME).xclbin
131+
cd ..
125132

126133
# Cleanup #####################################################################
127134

hls4ml/templates/vitis_accelerator/myproject_host_cl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ int main(int argc, char **argv) {
3535
fpga.allocateHostMemory(NUM_CHANNEL);
3636

3737
std::cout << "Loading input data from tb_data/tb_input_features.dat" << std::endl;
38-
std::ifstream fin("tb_data/tb_input_features.dat");
38+
std::ifstream fin("../tb_data/tb_input_features.dat");
3939
if (!fin.is_open()) {
4040
std::cerr << "Error: Could not open tb_input_features.dat" << std::endl;
4141
}

0 commit comments

Comments
 (0)