Skip to content

Commit f2ff8d5

Browse files
authored
Merge pull request #854 from os-fpga/custom_target_and_copy_vpr_latest
vpr_latest: custom cmake target, copy vpr_latest exec
2 parents 9e3a6d6 + b4b4512 commit f2ff8d5

File tree

3 files changed

+30
-17
lines changed

3 files changed

+30
-17
lines changed

CMakeLists.txt

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -307,22 +307,19 @@ add_subdirectory(OpenFPGA)
307307
set(IPO_LINK_WARN_SUPRESS_FLAGS " ")
308308

309309

310-
# Sub-project 'planning' (aka planner)
311-
add_subdirectory(planning)
312-
add_dependencies(planning vpr)
313-
314310
# Script to build vpr_latest.
315311
# We cannot add vpr_latest as cmake dependency because VPR external utilities
316312
# cmake-targets conflict with OpenFPGA versions of the same targets.
317-
message(STATUS "\n------------\n")
318-
message(STATUS "-- begin vpr_latest build script: VPR_LATEST_DEST_DIR= ${VPR_LATEST_DEST_DIR}\n")
319-
set(SCRIPT_STATUS 111)
320-
execute_process(
313+
314+
add_custom_target(build_vpr_latest)
315+
add_custom_command(
316+
TARGET build_vpr_latest
321317
COMMAND bash build_vpr_latest.sh
322318
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/vpr_latest
323-
RESULT_VARIABLE SCRIPT_STATUS
324-
)
325-
message(STATUS "")
326-
message(STATUS "-- end vpr_latest build script: SCRIPT_STATUS= ${SCRIPT_STATUS}\n")
327-
message(STATUS "--------------\n")
319+
)
320+
321+
322+
# Sub-project 'planning' (aka planner)
323+
add_subdirectory(planning)
324+
add_dependencies(planning vpr build_vpr_latest)
328325

planning/src/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
static const char* _pln_VERSION_STR = "pln0339";
1+
static const char* _pln_VERSION_STR = "pln0340";
22

33
#include "RS/rsEnv.h"
44
#include "util/pln_log.h"

vpr_latest/build_vpr_latest.sh

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
#!/bin/bash
22

3-
printf "\n building vpr_latest in $(pwd)\n"
3+
cur_dir=$(pwd)
4+
printf "\n building vpr_latest in $cur_dir\n"
45

56
hw_num_cores=`grep -F "model name" /proc/cpuinfo | wc -l`
67

78
export CPU_CORES=${CPU_CORES:="$hw_num_cores"}
89

9-
printf " CPU_CORES= $CPU_CORES hw_num_cores= $hw_num_cores\n\n"
10+
printf " CPU_CORES= $CPU_CORES hw_num_cores= $hw_num_cores\n"
11+
12+
vpr_latest_bin_dir="$cur_dir/vtr/build/vpr"
13+
printf "\n vpr_latest_bin_dir= $vpr_latest_bin_dir\n\n"
14+
1015

1116
cd vtr && make -j $CPU_CORES
1217

18+
1319
vtr_make_status=$?
1420

1521
printf "\n vtr_make_status= $vtr_make_status\n"
16-
printf "\n done building vpr_latest in $(pwd)\n\n"
22+
printf " vpr_latest_bin_dir= $vpr_latest_bin_dir\n"
23+
24+
printf "\n "
25+
ls -1 "$vpr_latest_bin_dir/vpr"
26+
file_status=$?
27+
if (( $file_status == 0 )); then
28+
printf "\ncopying to vpr_latest..\n"
29+
cp -v "$vpr_latest_bin_dir/vpr" "$cur_dir/vpr_latest"
30+
fi
31+
32+
printf "\n done building vpr_latest in $cur_dir\n\n"
1733

0 commit comments

Comments
 (0)