Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

set_false_path -from {ModA:ModA_inst|reg_src[144..244]} -to {ModB:ModB_inst|*} ?

I have a 2048 bit register that has a range of signals that need to be part of a false path.

Instead of creating 100 lines like this:

set_false_path -from {ModA:ModA_inst|reg_src[144]} -to {ModB:ModB_inst|*}

set_false_path -from {ModA:ModA_inst|reg_src[145]} -to {ModB:ModB_inst|*}

...

set_false_path -from {ModA:ModA_inst|reg_src[243]} -to {ModB:ModB_inst|*}

set_false_path -from {ModA:ModA_inst|reg_src[244]} -to {ModB:ModB_inst|*}

Is there an SDC syntax to do something like this?

set_false_path -from {ModA:ModA_inst|reg_src[144..244]} -to {ModB:ModB_inst|*}

Thanks!

10 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    I have a 2048 bit register that has a range of signals that need to be part of a false path.

    Instead of creating 100 lines like this:

    set_false_path -from {ModA:ModA_inst|reg_src[144]} -to {ModB:ModB_inst|*}

    set_false_path -from {ModA:ModA_inst|reg_src[145]} -to {ModB:ModB_inst|*}

    ...

    set_false_path -from {ModA:ModA_inst|reg_src[243]} -to {ModB:ModB_inst|*}

    set_false_path -from {ModA:ModA_inst|reg_src[244]} -to {ModB:ModB_inst|*}

    Is there an SDC syntax to do something like this?

    set_false_path -from {ModA:ModA_inst|reg_src[144..244]} -to {ModB:ModB_inst|*}

    Thanks!

    --- Quote End ---

    Here's a quick snippet of my code for You to understand.

    
    set TOTAL_CHANNELS 8
    for {set i 0} {$i < $TOTAL_CHANNELS} {incr i} {
       create_clock -period 12.345 -name "TS_IN_CLK_${i}" "]
       set_input_delay -min 0.00  -clock  "]
       set_input_delay -max 0.00  -clock  "]
       set_input_delay -min 0.00  -clock  "]
       set_input_delay -max 0.00  -clock  "]
    }
    
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks. I have been trying to get a for loop working but could not figure out the correct syntax as the TCL syntax for me is a complete mystery!

    I'm now trying this:

    
    set maxval 158
    for {set i 0} {$i < $maxval} {incr i} 
    {
    	set_false_path -from {CommandRegisters:CommandRegisters_inst|reg_command_bits} -to {MetaDataGenerator:MetaDataGenerator_inst|*}
    }

    but Quartus II says this:

    
    Critical Warning (332008): Read_sdc failed due to errors in the SDC file
    

    For now i'm generating some 160 lines via a simple C application but surely the TCL loop must be a cleaner solution, should I figure out the correct syntax...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Hi, Yes TCL is "bizarre" :-)

    I correct your code :

    
    set maxval 158
    for {set i 0} {$i < $maxval} {incr i} {
    	set_false_path -from {CommandRegisters:CommandRegisters_inst|reg_command_bits} -to {MetaDataGenerator:MetaDataGenerator_inst|*}
    }
    

    The open accolade must be in the same line than the "for"
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    $ sign out of {}. Not {$i}, but ${i} instead. Plus beware of new lines...

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks for the info. It still doesn't work correctly. My SDC is now this:

    
    set maxval 158
    for {set i 0} {$i < $maxval} {incr i} {
    	set_false_path -from {CommandRegisters:CommandRegisters_inst|reg_command_bits} -to {MetaDataGenerator:MetaDataGenerator_inst|*}
    }
    

    But QII says this:

    
    Warning (332174): Ignored filter at PCIEA_Test_1.sdc(73): CommandRegisters:CommandRegisters_inst|reg_command_bits could not be matched with a clock or keeper or register or port or pin or cell or partition
    Warning (332049): Ignored set_false_path at PCIEA_Test_1.sdc(73): Argument <from> is not an object ID
    	Info (332050): set_false_path -from {CommandRegisters:CommandRegisters_inst|reg_command_bits} -to {MetaDataGenerator:MetaDataGenerator_inst|*}
    

    Are there any relevant books or PDFs that properly document all this? I have two books ("TCL/TK in a nutshell" and "Practical Programming in Tcl and Tk") but I have not yet been able to get a grip on the TCL/SDC file syntax...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Tcl will not interpret stuff inside {} ... try

    
    set_false_path -from CommandRegisters:CommandRegisters_inst|reg_command_bits -to {MetaDataGenerator:MetaDataGenerator_inst|*}
    

    and if that does not work

    
    set_false_path -from "CommandRegisters:CommandRegisters_inst|reg_command_bits" -to {MetaDataGenerator:MetaDataGenerator_inst|*}
    

    Tcl treats things inside {} as a list, except when it doesn't, eg., ${i} demarks the variable and is typically used in the case where it is ambiguous, eg. $ihatetcl is ambiguous, so it needs to be ${i}hatetcl.

    Tcl also treats [] as a request to execute a procedure, so in the string version above, you may need to use \[ and \] to stop Tcl interpreting the brackets.

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    Thanks. This version worked:

    set_false_path -from CommandRegisters:CommandRegisters_inst|reg_command_bits -to {MetaDataGenerator:MetaDataGenerator_inst|*}

    Having extensive programming experience, it is a mystery to me why anyone would come up with something as ugly as TCL. For example, adding in the {} around the 'from' path above should create a list with a single item but that fails. I'm sure this has to do with some string-substitution rule in TCL...

    The last time i looked at anything this ugly, i think it was C++ templates!

    Anyways, I now have a working solution. Thanks, all, for your help.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    Thanks. This version worked:

    set_false_path -from CommandRegisters:CommandRegisters_inst|reg_command_bits -to {MetaDataGenerator:MetaDataGenerator_inst|*}

    Having extensive programming experience, it is a mystery to me why anyone would come up with something as ugly as TCL. For example, adding in the {} around the 'from' path above should create a list with a single item but that fails. I'm sure this has to do with some string-substitution rule in TCL...

    --- Quote End ---

    It does create a list, but {} stops the interpretation of $i into an index, so the call fails ...

    Glad to hear you've got things working.

    Cheers,

    Dave
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    It does create a list, but {} stops the interpretation of $i into an index, so the call fails ...

    --- Quote End ---

    So where are these things documented? I wouldn't mind studying hundreds of pages in order to understand all this but the documentation I have so far found is either not covering the relevant details or is so fragmented that is is essentially useless. The Timequest handbook essentially documents the supported SDC commands but there's nothing mentioned about TCL which one apparently is just supposed to know...

    As mentioned, I have a couple of books. One is just a summary and the other one is so thick i have not yet figured out whether it covers what I need. The "thick book" starts out by declaring that TCL is so great because one can create a web server using it :rolleyes: It got hard to read from there on...
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    So where are these things documented?

    --- Quote End ---

    Tcl books :)

    The ones on my shelf are

    "Tcl and the Tk Toolkit", by John Ousterhout (the guy that created the language)

    "Effective Tcl/Tk Programming", Harrison and McLennan

    "Practical Programming in Tcl and Tk", Welch

    But I generally just look at Welch (which is probably the thick book with the web server ...)

    Cheers,

    Dave