Chapter

Section

Use

find_crit_path input_file

Description

Script uses the information in files input_file.vst and input_file.xsc to print out the netlist critical path. It follows the red line that shows the critical path in XSCH.

Arguments

input_file

The structural VHDL netlist input_file.vst and XSCH timing file input_file.xsc.

Depends on

The GNU Project's implementation of the AWK programming language gawk rather than a really old version mawk which is shipped with some Linux distributions (esp. Ubuntu). To check,

1 $ which awk
/usr/bin/awk
2 $ ls -gG /usr/bin/awk | cut -f4-8 -d' '
2007-01-28 14:24 /usr/bin/awk -> /etc/alternatives/awk
3 $ ls -gG /etc/alternatives/awk | cut -f4-8 -d' '
2007-12-05 20:51 /etc/alternatives/awk -> /usr/bin/gawk

Bugs

Doesn't handle irregularities in the vst or xsc files gracefully.
Needs a clean VHDL file syntax as produced by LOON.

Operation

Script find_crit_path identifies the critical output net as the one coloured red in the xsc file, or 32 in field 3. Afterwards the path is traced backwards through instance names which are also coloured red. Each instance is labelled with its delay, and by grepping through the instance names we can pick up the cell and net names along the critical path, as shown below.

The fanout of each instance along the critical path is calculated from the netlist by simply counting the number of occurences of the net name string.

The rest of the script is concerning with formatting details to produce a result like the one in the example on the right.

$ grep '^C' in_file.xsc
C:r 15:32:3493 ps
C:y 1:32:526 ps
$ grep -n 'r 15' in_file.xsc
669:N:r 15:-1:3493 ps
2485:C:r 15:32:3493 ps
2521:P:r_15_ins_q:r 15:r 15:32:416 ps
$ grep -n ':r_15_ins_q:' in_file.xsc
1332:B:r_15_ins_q:32:3493 ps
2520:P:r_15_ins_nd:r_15_ins_nd:r_15_ins_q:32:416 ps
2521:P:r_15_ins_q:r 15:r 15:32:416 ps
$ grep -n ':r_15_ins_nd:' in_file.xsc
671:N:r_15_ins_nd:-1:3312 ps
1333:B:r_15_ins_nd:32:3312 ps
2519:P:a2_x2_15_ins:a2_x2_15_sig:r_15_ins_nd:32:416 ps
2520:P:r_15_ins_nd:r_15_ins_nd:r_15_ins_q:32:416 ps
$ grep -n ':a2_x2_15_ins:' in_file.xsc
1337:B:a2_x2_15_ins:32:3232 ps

Download find_crit_path
Example
$ ./find_crit_path in_file
#     y 1          23                  526
#  1  inv_x8       41  i->nq     718   192   not_y_1_ins             not_y_1
#  2  no2_x1        1  i1->nq    805    87   no2_x1_254_ins          no2_x1_254_sig
#  3  xr2_x1        1  i0->q     921   116   xr2_x1_302_ins          xr2_x1_302_sig
#  4  nxr2_x1       1  i0->nq   1023   102   nxr2_x1_20_ins          nxr2_x1_20_sig
#  5  no2_x1        2  i1->nq   1143   120   rtlcarry_6_3_ins        rtlcarry_6_3
#  6  oa2ao222_x2   4  i4->q    1327   184   rtlcarry_6_4_ins        rtlcarry_6_4
#  7  oa2ao222_x4   9  i4->q    1562   235   rtlcarry_6_5_ins        rtlcarry_6_5
#  8  noa2ao222_x1  4  i1->nq   1785   223   not_rtlcarry_6_6_ins    not_rtlcarry_6_6  
#  9  noa2ao222_x4  6  i1->nq   2044   259   rtlcarry_6_7_ins_nq     rtlcarry_6_7
# 10  oa2ao222_x2   5  i4->q    2250   206   rtlcarry_6_8_ins        rtlcarry_6_8
# 11  oa2ao222_x4   6  i4->q    2448   198   rtlcarry_6_9_ins        rtlcarry_6_9
# 12  oa22_x4       6  i1->q    2669   221   rtlcarry_6_10_ins       rtlcarry_6_10
# 13  nxr2_x1       1  i0->nq   2772   103   nxr2_x1_9_ins           nxr2_x1_9_sig
# 14  o2_x2         1  i1->q    2885   113   o2_x2_ins               o2_x2_sig
# 15  oa2ao222_x2   1  i4->q    3023   138   oa2ao222_x2_ins         oa2ao222_x2_sig
# 16  noa22_x1      2  i1->nq   3136   113   rtlcarry_0_13_ins       rtlcarry_0_13
# 17  a2_x2         1  i0->q    3232    96   a2_x2_15_ins            a2_x2_15_sig
# 18  na2_x1        1  i1->nq   3312    80   r_15_ins_nd             r_15_ins_nd
# 19  nxr2_x4       0  i0->nq   3493   181   r_15_ins_q              r(15)
#     r 15
#
# 1st critical path is r 15 at 3493
# 2nd critical path is r 14 at 3472
  • The script is in the working directory and run by prefixing it with ./ .
  • Each cell along the critical path is listed with its fanout, in->out path, delay and cumulative delay, instance name and output net name.
  • The path matches the one in red whcih can be viewed in XSCH
    $ xsch -l in_file
  • Files in_file.vst and in_file.xsc are written by loon with a command like
    $ loon -l loon_1500_300_1 fred in_file
XSCH critical path example