Skip to content
Snippets Groups Projects
Commit d544bbfe authored by Mikael Henriksson's avatar Mikael Henriksson
Browse files

Added support for conditionaly excluding sweep ponits with negative slack (UNTESTED).

parent 1328322f
No related branches found
No related tags found
No related merge requests found
...@@ -63,7 +63,7 @@ MAX_CONCURRENCY=12 ...@@ -63,7 +63,7 @@ MAX_CONCURRENCY=12
WAIT_FOR_LICENSE="YES" WAIT_FOR_LICENSE="YES"
# String that will be appended to the top sweep directory name. Could, for # String that will be appended to the top sweep directory name. Could, for
# example, be used to append technology, corrner or other vital info to the # example, be used to append technology, corrner or other vital info to the
# sweep directory name. Leave blank if unused. # sweep directory name. Leave blank if unused.
TOP_DIR_APPEND="" TOP_DIR_APPEND=""
...@@ -82,15 +82,19 @@ AREA_DIM="um^2" ...@@ -82,15 +82,19 @@ AREA_DIM="um^2"
# Generate a CSV sweep result file from a sweep result. Only the sweeps whose # Generate a CSV sweep result file from a sweep result. Only the sweeps whose
# slack where not violated are extracted. # slack where not violated are extracted.
function sweep_to_csv() { function sweep_to_csv() {
local data_dir="${1}" local sweep_data_dir="${1}"
local csv_out="${2}" local csv_out="${2}"
# Extract non-slack violated resulting subdirectories and periods. local timing_files
local non_violated_dirs if [ "${EXCLUDE_NEGATIVE_SLACK}" -eq "YES" ]; then
local periods # Extract non-slack violated 'timing.txt' files.
non_violated_dirs=$(grep -riL "(VIOLATED)" "${data_dir}"/*/timing.txt) timing_files=$(grep -riL "(VIOLATED)" "${sweep_data_dir}"/*/timing.txt)
periods=$(perl -C -lne 'print for /(\d+\.\d+?)\/timing\.txt/ig' <<< \ else # ${EXCLUDE_NEGATIVE_SLACK} -eq "NO"
"${non_violated_dirs}" | sort -rh) # Extract all all 'timing.txt' files.
timing_files=$(echo "${sweep_data_dir}"/*/timing.txt)
fi
local periods=$(perl -C -lne 'print for /(\d+\.\d+?)\/timing\.txt/ig' <<< \
"${timing_files}" | sort -rh)
# Create CSV file and write CSV header. # Create CSV file and write CSV header.
touch "${csv_out}" touch "${csv_out}"
...@@ -101,7 +105,7 @@ function sweep_to_csv() { ...@@ -101,7 +105,7 @@ function sweep_to_csv() {
# constraints met. # constraints met.
while IFS='' read -r period; do while IFS='' read -r period; do
# Extract data. # Extract data.
cur_dir="${data_dir}/${period}" cur_dir="${sweep_data_dir}/${period}"
power=$(awk '/Total\s+[0-9\.e-]+\s[a-z]{0,1}W/{print $(NF-1)}' \ power=$(awk '/Total\s+[0-9\.e-]+\s[a-z]{0,1}W/{print $(NF-1)}' \
"${cur_dir}/power.txt") "${cur_dir}/power.txt")
area=$(awk '/Total cell area:/{print $NF}' "${cur_dir}/area.txt") area=$(awk '/Total cell area:/{print $NF}' "${cur_dir}/area.txt")
...@@ -227,12 +231,15 @@ for file in "${DESIGN_FILES[@]}"; do ...@@ -227,12 +231,15 @@ for file in "${DESIGN_FILES[@]}"; do
exit 1 exit 1
fi fi
done done
if [[ "${EXCLUDE_NEGATIVE_SLACK}" ~= ^(YES)|(NO)$ ]]; then
echo "Error: \${EXCLUDE_NEGATIVE_SLACK} not in { 'YES', 'NO' };"
fi
if ! [[ "$RETIME_ENABLE" =~ ^(YES)|(NO)$ ]]; then if ! [[ "$RETIME_ENABLE" =~ ^(YES)|(NO)$ ]]; then
echo "Error: \$RETIME_ENABLE not in { "YES", "NO" }." echo "Error: \$RETIME_ENABLE not in { 'YES', 'NO' }."
exit 1 exit 1
fi fi
if ! [[ "${WAIT_FOR_LICENSE}" =~ ^(YES)|(NO)$ ]]; then if ! [[ "${WAIT_FOR_LICENSE}" =~ ^(YES)|(NO)$ ]]; then
echo "Error: \$WAIT_FOR_LICENSE not in { "YES", "NO" }." echo "Error: \$WAIT_FOR_LICENSE not in { 'YES', 'NO' }."
exit 1 exit 1
fi fi
......
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