Home > Community > Forums > Logic Design > How to count number of paths in RTL-compiler group?

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 How to count number of paths in RTL-compiler group? 

Last post Sun, Nov 30 2008 10:37 AM by grasshopper. 5 replies.
Started by dkos 25 Nov 2008 08:55 AM. Topic has 5 replies and 4571 views
Page 1 of 1 (6 items)
Sort Posts:
  • Tue, Nov 25 2008 8:55 AM

    • dkos
    • Not Ranked
    • Joined on Wed, Nov 5 2008
    • Posts 6
    • Points 105
    How to count number of paths in RTL-compiler group? Reply

     Hello all!

     Does anybody knows how to count number of paths in group, created by 'path_group' command? Or, at least, determine is group empty or not?

    Thanks, dkos

    Filed under: ,
    • Post Points: 20
  • Wed, Nov 26 2008 6:51 AM

    • johannes
    • Top 500 Contributor
    • Joined on Wed, Sep 24 2008
    • Feldkirchen, Bavaria
    • Posts 15
    • Points 240
    Re: How to count number of paths in RTL-compiler group? Reply

    Hi dkos,

     Unfortunately, I currently have no idea how to count the number of paths in a group, but for checking if it's empty, you could do one of the following:

    1. report timing -lint 
    If the path_group is empty, it will be listed as exception, which is not affecting timing.

    2. report timing -paths [eval [get_attribute paths <path-group name>]]
    If you get "No paths found" the path group is empty.

    Not very elegant, but those are all the ideas I have at the moment ...

    Regards,
    Johannes

     

    • Post Points: 20
  • Thu, Nov 27 2008 5:25 AM

    • dkos
    • Not Ranked
    • Joined on Wed, Nov 5 2008
    • Posts 6
    • Points 105
    Re: How to count number of paths in RTL-compiler group? Reply

     Thanks for answer Johannes,

     This solution works. And do you have an idea how to detect if path group empty or not in tcl script? Let me clarify my problem a little:

     I automatically create cost groups between all clocks in design in script. If there are 2 clocks in design my script will create following cost groups:

        inputs_2_clk1, clk1_to_clk1,clk1_to_outputs, clk1_to_clk2,

        inputs_2_ clk2, clk2_to_clk2,clk2_to_outputs, clk2_to_clk1

    Althougth some groups are empty RTL compiler creates them. I suppose that this leads to memory usage increase and dramatically increase final output *.sdc file. So, I want to find a way to delete or not to create empty cost groups before synthesis starts...I have a feeling that I need to use linux 'grep' command on results of rc 'report timing -paths [eval [get_attribute paths <path-group name>]]' command, but I don't know how... 

    Thank, dkos 

     P.S. script that I use for cost group creation:

    #delete cost groups, created by create_clock commands
    puts "----------------------------------------------------------------------------"
    puts "Delete cost groups, created by create_clock commands and add own cost_groups"
    puts "----------------------------------------------------------------------------"
    rm [find / -cost *]

    set CLOCK_LIST [find / -clock *]
    #collect registers for all clocks
    set i 0
    foreach clock ${CLOCK_LIST} {
      set clock [basename $clock]
      puts "-- collect all regs for clock: ${clock}"
     
      set regs_of_clock($i) [all des seqs -clock ${clock}]
      set regs_col_clock [llength $regs_of_clock($i)]
      puts "-- number of regs: ${regs_col_clock}"
      incr i
    }
      set clock_num [llength ${CLOCK_LIST}]
      puts "-- number of clocks: $clock_num"

    #generate new cost groups
    set i 0
    foreach clock ${CLOCK_LIST} {
      set clock [basename $clock]
      puts "-- generate costgroups for clock: ${clock} --"
      puts "-------------------------------------------------------"

      set inList [all des inps -clock ${clock}]
      set outList [all des outs -clock ${clock}]
     
      if {[llength $regs_of_clock($i)] > 0} {
        #I2R paths
        if {[llength $inList] > 0} {
          puts "  -- generate costgroups for clock: I2${clock}"
          define_cost_group -name "I2${clock}"
          path_group -mode System -from $inList -to $regs_of_clock($i) -group I2${clock} -name I2${clock}
        }
        #R2O paths
        if {[llength $outList] > 0} {
          puts "  -- generate costgroups for clock: ${clock}2O"
          define_cost_group -name "${clock}2O"
          path_group -mode System -from $regs_of_clock($i) -to $outList -group ${clock}2O -name ${clock}2O
        }
        #R2R paths
        for {set j 0} {$j < $clock_num} {incr j} {
          set clockB [lindex ${CLOCK_LIST} $j]
          set clockB [basename $clockB]
          puts "  -- generate costgroups for clock: ${clock}->${clockB}"
       
          define_cost_group -name "${clock}2${clockB}"
          path_group -mode System -from $regs_of_clock($i) -to $regs_of_clock($j) -group ${clock}2${clockB} -name ${clock}2${clockB}
        }
      }
      incr i
    }

     

     

     

    Filed under: ,
    • Post Points: 20
  • Thu, Nov 27 2008 12:46 PM

    • johannes
    • Top 500 Contributor
    • Joined on Wed, Sep 24 2008
    • Feldkirchen, Bavaria
    • Posts 15
    • Points 240
    RE: How to count number of paths in RTL-compiler group? Reply
    Hi dkos,
     
    A little bit dirty, but it should work:
    report timing -paths [eval [get_attribute paths <path-group name>]] > xyz
    set TMP [exec egrep "slack|No paths found" xyz]
    if {$TMP eq "No paths found"} {
       ...
    }
     
     
    I have to use "egrep", because "grep" would give an error if it wouldn't find anything, while with egrep either "No path found" or "slack" will match.
    I hope this helps!
     
    Regards,
    Johannes
    • Post Points: 20
  • Fri, Nov 28 2008 7:33 AM

    • dkos
    • Not Ranked
    • Joined on Wed, Nov 5 2008
    • Posts 6
    • Points 105
    Re: RE: How to count number of paths in RTL-compiler group? Reply

    Again you helped me very much Johannes! Thanks a lot!

    One minor correction in order that code work correct.  Line

        if {$TMP eq "No paths found"} {

    should be replaced with

        if {$TMP eq "No paths found."} {

    i.e. dot must be added to expression.

      

    Filed under: ,
    • Post Points: 20
  • Sun, Nov 30 2008 10:37 AM

    • grasshopper
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • Chelmsford, MA
    • Posts 239
    • Points 3,190
    Re: RE: How to count number of paths in RTL-compiler group? Reply

     Hi dkos,

    another alternative if you are up to some scripting is to rely on the timing_info attribute associated with every startpoint and endpoint. In addition you can use the startpoint and endpoint attribute to identify which pins are which. This attribute will provide you with the cost_group information for every endpoint as well as all exception associated with it. Amonst all the exception is the path_group information. As you can tell, it is essential to be clear on the distinction between path_group and cost_group to get the script to work right. Another caveat I would keep in mind is the use of multi-mode constraints since different mode could result in different cost groups as well. Anyhow, hope this helped

    gh-

    • Post Points: 5
Page 1 of 1 (6 items)
Sort Posts:
Started by dkos at 25 Nov 2008 08:55 AM. Topic has 5 replies.