Skip to content

WIP: Equivalent tiles VTR feature #36

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

Expand Down
3 changes: 3 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

Expand Down
25 changes: 25 additions & 0 deletions .github/ISSUE_TEMPLATE/vtr-change.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
name: VTR change
about: Describe purpose and lifecycle of a local change we made to VTR
title: ''
labels: ''
assignees: ''

---

### Why did we need this? (what does this change enable us to do)
<!--- i.e. what does this change enable us to do? -->

### What did it change?
<!--- i.e. technical description what the change does -->

### Should it be merged upstream - if not, when can we delete it?

### What is needed to get this merged / deleted?

* [ ] is the implementation work to make suitable for merging / deletion completed?
* [ ] Is there an associated test? <!--- i.e. how will we prevent it from regressing? -->
* [ ] is this currently part of the Conda package?
* [ ] is this properly cleaned up in our local repositories? <!--- add subtasks here if needed) -->

### Tracker / branch / PR & other useful links
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ addons:
- libxml++2.6-dev
- perl
- python
- python-lxml
- texinfo
- time
- valgrind
Expand Down
115 changes: 63 additions & 52 deletions ODIN_II/verify_odin.sh
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ function exit_program() {
if [ -f ${NEW_RUN_DIR}/test_failures.log ]; then
FAIL_COUNT=$(wc -l ${NEW_RUN_DIR}/test_failures.log | cut -d ' ' -f 1)
fi

FAILURE=$(( ${FAIL_COUNT} ))

if [ "_${FAILURE}" != "_0" ]
then
echo "Failed ${FAILURE} benchmarks"
Expand Down Expand Up @@ -107,10 +107,8 @@ _prt_cur_arg() {
function help() {

printf "Called program with $INPUT
Usage:
Usage:
${THIS_SCRIPT_EXEC} [ OPTIONS / FLAGS ]


OPTIONS:
-h|--help $(_prt_cur_arg off) print this
-t|--test < test name > $(_prt_cur_arg ${_TEST}) Test name is one of ( ${TEST_DIR_LIST} heavy_suite light_suite full_suite vtr_basic vtr_strong pre_commit failures debug_sim debug_synth)
Expand All @@ -121,7 +119,6 @@ printf "Called program with $INPUT
-a|--adder_def < /abs/path > $(_prt_cur_arg ${_ADDER_DEF}) Use template to build adders
-n|--simulation_count < N > $(_prt_cur_arg ${_SIM_COUNT}) Allow to run the simulation N times to benchmark the simulator
-d|--output_dir < /abs/path > $(_prt_cur_arg ${_RUN_DIR_OVERRIDE}) Change the run directory output

FLAGS:
-g|--generate_bench $(_prt_cur_arg ${_GENERATE_BENCH}) Generate input and output vector for test
-o|--generate_output $(_prt_cur_arg ${_GENERATE_OUTPUT}) Generate output vector for test given its input vector
Expand All @@ -132,7 +129,6 @@ printf "Called program with $INPUT
-b|--batch_sim $(_prt_cur_arg ${_BATCH_SIM}) Use Batch mode multithreaded simulation
-p|--perf $(_prt_cur_arg ${_USE_PERF}) Use Perf for monitoring execution
-f|--force_simulate $(_prt_cur_arg ${_FORCE_SIM}) Force the simulation to be executed regardless of the config

"
}

Expand Down Expand Up @@ -209,7 +205,7 @@ function cleanup_temp() {
fi

for runs in ${OUTPUT_DIRECTORY}/run*
do
do
rm -Rf ${runs}
done

Expand Down Expand Up @@ -267,14 +263,14 @@ function mv_failed() {
# Helper Functions
function flag_is_number() {
case "_$2" in
_)
_)
echo "Passed an empty value for $1"
help
exit 120
;;
*)
case $2 in
''|*[!0-9]*)
''|*[!0-9]*)
echo "Passed a non number value [$2] for $1"
help
exit 120
Expand Down Expand Up @@ -312,7 +308,7 @@ function _set_flag() {
_batch_sim_flag=$(_set_if ${_BATCH_SIM} "--batch")
_use_best_coverage_flag=$(_set_if ${_BEST_COVERAGE_OFF} "--best_coverage")
_perf_flag=$(_set_if ${_USE_PERF} "--tool perf")

_vector_flag="-g ${_VECTORS}"
_timeout_flag="--time_limit ${_TIMEOUT}s"
_simulation_threads_flag=$([ "${_SIM_THREADS}" != "1" ] && echo "-j ${_SIM_THREADS}")
Expand All @@ -323,20 +319,20 @@ function _set_flag() {

function parse_args() {
while [[ "$#" > 0 ]]
do
case $1 in
do
case $1 in

# Help Desk
-h|--help)
echo "Printing Help information"
help
exit_program

## directory in benchmark
;;-t|--test)
# this is handled down stream
if [ "_$2" == "_" ]
then
then
echo "empty argument for $1"
exit 120
fi
Expand All @@ -349,11 +345,11 @@ function parse_args() {
;;-a|--adder_def)

if [ "_$2" == "_" ]
then
then
echo "empty argument for $1"
exit 120
fi

_ADDER_DEF=$2

if [ "${_ADDER_DEF}" != "default" ] && [ "${_ADDER_DEF}" != "optimized" ] && [ ! -f "$(readlink -f ${_ADDER_DEF})" ]
Expand All @@ -367,11 +363,11 @@ function parse_args() {
;;-d|--output_dir)

if [ "_$2" == "_" ]
then
then
echo "empty argument for $1"
exit 120
fi

_RUN_DIR_OVERRIDE=$2

if [ ! -d "${_RUN_DIR_OVERRIDE}" ]
Expand Down Expand Up @@ -409,45 +405,45 @@ function parse_args() {
shift

# Boolean flags
;;-g|--generate_bench)
;;-g|--generate_bench)
_GENERATE_BENCH="on"
echo "generating output vector for test given predefined input"

;;-o|--generate_output)
;;-o|--generate_output)
_GENERATE_OUTPUT="on"
echo "generating input and output vector for test"

;;-c|--clean)
;;-c|--clean)
echo "Cleaning temporary run in directory"
cleanup_temp

;;-l|--limit_ressource)
;;-l|--limit_ressource)
_LIMIT_RESSOURCE="on"
echo "limiting ressources for benchmark, this can help with small hardware"

;;-v|--valgrind)
;;-v|--valgrind)
_VALGRIND="on"
echo "Using Valgrind for benchmarks"

;;-B|--best_coverage_off)
;;-B|--best_coverage_off)
_BEST_COVERAGE_OFF="off"
echo "turning off using best coverage for benchmark vector generation"

;;-b|--batch_sim)
;;-b|--batch_sim)
_BATCH_SIM="on"
echo "Using Batch multithreaded simulation with -j threads"

;;-p|--perf)
_USE_PERF="on"
echo "Using perf for synthesis and simulation"
;;-f|--force_simulate)

;;-f|--force_simulate)
_FORCE_SIM="on"
echo "Forcing Simulation"
echo "Forcing Simulation"

;;*)
;;*)
echo "Unknown parameter passed: $1"
help
help
ctrl_c
esac
shift
Expand Down Expand Up @@ -477,9 +473,9 @@ function sim() {
shift

while [[ "$#" > 0 ]]
do
do
case $1 in
--custom_args_file)
--custom_args_file)
with_custom_args=1
;;

Expand Down Expand Up @@ -517,7 +513,7 @@ function sim() {

*)
echo "Unknown internal parameter passed: $1"
config_help
config_help
ctrl_c
;;
esac
Expand Down Expand Up @@ -553,15 +549,15 @@ function sim() {
${_timeout_flag}
${_low_ressource_flag}
${_valgrind_flag}"

if [ "${_USE_PERF}" == "on" ]
then
wrapper_odin_command="${wrapper_odin_command} ${_perf_flag} ${DIR}/perf.data"
fi

odin_command="${DEFAULT_CMD_PARAM}
$(cat ${dir}/odin.args | tr '\n' ' ')
-o ${blif_file}
$(cat ${dir}/odin.args | tr '\n' ' ')
-o ${blif_file}
-sim_dir ${DIR}"

echo $(echo "${wrapper_odin_command} ${odin_command}" | tr '\n' ' ' | tr -s ' ' ) > ${DIR}/odin_param
Expand Down Expand Up @@ -608,12 +604,6 @@ function sim() {
for arches in ${arch_list}
do

arch_cmd=""
if [ -e ${arches} ]
then
arch_cmd="-a ${arches}"
fi

arch_basename=${arches%.xml}
arch_name=${arch_basename##*/}

Expand All @@ -622,10 +612,18 @@ function sim() {
DIR="${NEW_RUN_DIR}/${TEST_FULL_REF}"
blif_file="${DIR}/odin.blif"


#build commands
mkdir -p $DIR

arch_cmd=""
if [ -e ${arches} ]
then
tiles_cmd="../vtr_flow/scripts/add_tiles.py"
arch_file="${arch_name}.xml"
${tiles_cmd} --arch_xml ${arches} > $DIR/${arch_name}.xml
arch_cmd="-a $DIR/${arch_name}.xml"
fi

###############################
# Synthesis
if [ "${_SYNTHESIS}" == "on" ]
Expand Down Expand Up @@ -712,7 +710,7 @@ function sim() {

#run the simulation
find ${NEW_RUN_DIR}/${bench_type}/ -name sim_param | xargs -n1 -P$threads -I sim_cmd ${SHELL} -c '$(cat sim_cmd)'

# move the log
for sim_log in $(find ${NEW_RUN_DIR}/${bench_type}/ -name "simulation.log")
do
Expand All @@ -722,7 +720,7 @@ function sim() {
disable_failed ${global_simulation_failure}

done

mkdir -p ${NEW_RUN_DIR}/${bench_type}/vectors

# move the vectors
Expand All @@ -733,7 +731,7 @@ function sim() {

cp ${sim_input_vectors} ${NEW_RUN_DIR}/${bench_type}/vectors/${BM_NAME}
mv ${sim_input_vectors} ${BM_DIR}/${BM_NAME}

done


Expand Down Expand Up @@ -803,7 +801,7 @@ function debug_failures() {

echo "Which benchmark would you like to debug (type 'quit' or 'q' to exit)?"
echo "============"
echo "${FAILURES_LIST}"
echo "${FAILURES_LIST}"
echo "============"
printf "enter a substring: "

Expand All @@ -813,7 +811,7 @@ function debug_failures() {
echo "exiting"
break
;;
*)
*)
BM="${FAILED_RUN_DIR}/$(echo "${FAILURES_LIST}" | grep ${INPUT_BM} | tail -n 1)"

if [ "_${BM}" != "_" ] && [ -f "${BM}/${CMD_FILE_NAME}" ]
Expand Down Expand Up @@ -854,7 +852,7 @@ LIGHT_LIST=(
"operators"
"arch"
"other"
"micro"
"micro"
"syntax"
"FIR"
)
Expand Down Expand Up @@ -934,8 +932,8 @@ case ${_TEST} in

full_suite)
run_all
;;
;;

heavy_suite)
run_heavy_suite
;;
Expand Down Expand Up @@ -971,3 +969,16 @@ print_time_since $START

exit_program
### end here
© 2019 GitHub, Inc.
Terms
Privacy
Security
Status
Help
Contact GitHub
Pricing
API
Training
Blog
About

Loading