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

Improved regex for finding violated slack

parent cf16c3cb
No related branches found
No related tags found
No related merge requests found
......@@ -35,7 +35,6 @@ PERIODS=(10.0 5.0 3.333 2.5 2.0 1.666 1.428 1.25 1.111 1.0)
GENERICS=( "float_ip=0,pipe_stages=1" "float_ip=0,pipe_stages=2"
"float_ip=1,pipe_stages=1" "float_ip=1,pipe_stages=2" )
# Design clock name to be sweept. The design MUST have a clock signal.
CLOCK_NAME="clk"
......@@ -45,9 +44,9 @@ CLOCK_NAME="clk"
RETIME_ENABLE="YES"
# Set EXCLUDE_NEGATIVE_SLACK to 'YES' if you want to exclude sweep points which
# had their timing requirement unmet, i.e., sweep points with negative slack. If
# set to 'NO', sweep points with negative slack are keept in the resulting CSV
# file, but are still distinguishible through the slack column which will be
# had their timing requirement violated, i.e., sweep points with negative slack.
# If set to 'NO', sweep points with negative slack are kept in the resulting
# CSV file, but are still distinguishible through the slack column which will be
# negative. Set to 'YES' or 'NO' (note the CAPITALIZATION).
EXCLUDE_NEGATIVE_SLACK="YES"
......@@ -87,8 +86,10 @@ function sweep_to_csv() {
local timing_files
if [ "${EXCLUDE_NEGATIVE_SLACK}" = "YES" ]; then
# Extract non-slack violated 'timing.txt' files.
timing_files=$(grep -riL "(VIOLATED)" "${sweep_data_dir}"/*/timing.txt)
# Extract non-slack violated 'timing.txt' files. Files with violated
# slack should contain the term "(VIOLATED", not necessary with ending
# parentheses.
timing_files=$(grep -riL "(VIOLATED" "${sweep_data_dir}"/*/timing.txt)
else # ${EXCLUDE_NEGATIVE_SLACK} -eq "NO"
# Extract all all 'timing.txt' files.
timing_files=$(echo "${sweep_data_dir}"/*/timing.txt)
......@@ -109,7 +110,8 @@ function sweep_to_csv() {
power=$(awk '/Total\s+[0-9\.e-]+\s[a-z]{0,1}W/{print $(NF-1)}' \
"${cur_dir}/power.txt")
area=$(awk '/Total cell area:/{print $NF}' "${cur_dir}/area.txt")
slack=$(awk '/slack (\(MET\))|(\(VIOLATED\))/{print $3}' "${cur_dir}/timing.txt")
# "(MET" and "(VIOLATED" does not necessary contain parentheses ending
slack=$(awk '/slack (\(MET)|(\(VIOLATED)/{print $(NF)}' "${cur_dir}/timing.txt")
# Append to CSV.
echo "${period}, ${area}, ${power}, ${slack}" >> "${csv_out}"
......
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