Skip to content
Snippets Groups Projects
Commit cdd052ec authored by Yaman Umuroglu's avatar Yaman Umuroglu
Browse files

[Alveo] fixes to runner script and driver template

parent 626428a0
No related branches found
No related tags found
No related merge requests found
...@@ -124,15 +124,14 @@ class FINNAccelDriver(): ...@@ -124,15 +124,14 @@ class FINNAccelDriver():
self.ol = Overlay(bitfile) self.ol = Overlay(bitfile)
# neuron folding factor of output = iterations per sample # neuron folding factor of output = iterations per sample
self.itersPerSample = self.oshape_packed[-2] self.itersPerSample = self.oshape_packed[-2]
# clock frequency as specified by user
self.fclk_mhz = $CLOCK_FREQ_MHZ$
if self.platform == "zynq": if self.platform == "zynq":
# clock frequency
self.fclk_mhz = $CLOCK_FREQ_MHZ$
# set the clock frequency as specified by user during transformations # set the clock frequency as specified by user during transformations
if self.fclk_mhz > 0: if self.fclk_mhz > 0:
Clocks.$CLK_NAME$ = self.fclk_mhz Clocks.$CLK_NAME$ = self.fclk_mhz
self.dma = self.ol.axi_dma_0 self.dma = self.ol.axi_dma_0
self.ctrl_regs = self.ol.resize_accel_0 self.ctrl_regs = self.ol.resize_accel_0
# AXI lite register offset for number of iterations # AXI lite register offset for number of iterations
# used by TLastMarker to signal end of transmission for AXI CDMA # used by TLastMarker to signal end of transmission for AXI CDMA
self.REG_OFFSET_NUM_ITERS = 0x10 self.REG_OFFSET_NUM_ITERS = 0x10
...@@ -144,8 +143,6 @@ class FINNAccelDriver(): ...@@ -144,8 +143,6 @@ class FINNAccelDriver():
elif self.platform == "zynq-iodma": elif self.platform == "zynq-iodma":
self.idma = self.ol.idma0 self.idma = self.ol.idma0
self.odma = self.ol.odma0 self.odma = self.ol.odma0
# clock frequency
self.fclk_mhz = $CLOCK_FREQ_MHZ$
# set the clock frequency as specified by user during transformations # set the clock frequency as specified by user during transformations
if self.fclk_mhz > 0: if self.fclk_mhz > 0:
Clocks.$CLK_NAME$ = self.fclk_mhz Clocks.$CLK_NAME$ = self.fclk_mhz
...@@ -289,7 +286,10 @@ if __name__ == "__main__": ...@@ -289,7 +286,10 @@ if __name__ == "__main__":
res["throughput[images/s]"] = N / runtime res["throughput[images/s]"] = N / runtime
res["DRAM_in_bandwidth[Mb/s]"] = np.prod(finnDriver.ishape_packed)*0.000001 / runtime res["DRAM_in_bandwidth[Mb/s]"] = np.prod(finnDriver.ishape_packed)*0.000001 / runtime
res["DRAM_out_bandwidth[Mb/s]"] = np.prod(finnDriver.oshape_packed)*0.000001 / runtime res["DRAM_out_bandwidth[Mb/s]"] = np.prod(finnDriver.oshape_packed)*0.000001 / runtime
res["fclk[mhz]"] = Clocks.fclk0_mhz if platform != "alveo":
res["fclk[mhz]"] = Clocks.fclk0_mhz
else:
res["fclk[mhz]"] = finnDriver.fclk_mhz
res["N"] = N res["N"] = N
file = open("nw_metrics.txt", "w") file = open("nw_metrics.txt", "w")
file.write(str(res)) file.write(str(res))
...@@ -429,10 +429,15 @@ open_run synth_1 -name synth_1 ...@@ -429,10 +429,15 @@ open_run synth_1 -name synth_1
report_utilization -hierarchical -hierarchical_depth 4 -file synth_report.xml -format xml report_utilization -hierarchical -hierarchical_depth 4 -file synth_report.xml -format xml
""" """
alveo_run_sh_template = """ alveo_run_sh_template = """#!/bin/bash
#!/bin/bash
if [ "$#" -ne 2 ]; then
echo "Usage: alveo_run.sh <exec_mode={execute, throughput_test}> <batch_size>"
exit -1
fi
cd $REMOTE_DEPLOY_DIR$ cd $REMOTE_DEPLOY_DIR$
eval "$(conda shell.bash hook)"
conda activate $CONDA_ENV_NAME$ conda activate $CONDA_ENV_NAME$
source $REMOTE_XRT$/packages/setenv.sh source $REMOTE_XRT$/packages/setenv.sh
export PLATFORM_REPO_PATHS=$REMOTE_PLATFORM_REPO_PATHS$ export PLATFORM_REPO_PATHS=$REMOTE_PLATFORM_REPO_PATHS$
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment