Forum Discussion

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

need more infomation about TimeQuest

Hi,

I hope to implement the following calculation in TimeQuest's *.sdc file, set ad_clock_period 80

set ad_sclk_board_delay_max 5

set ad_sclk_board_delay_min 3

set ad_data_board_delay_max 5

set ad_data_board_delay_min 3

set ad_data_tco_max 2

set ad_data_tco_min 1

set max_delay $ad_clock_period/2 + $ad_sclk_board_delay_max + $ad_data_board_delay_max + $ad_data_tco_max

set min_delay $ad_clock_period/2 + $ad_sclk_board_delay_min + $ad_data_board_delay_min + $ad_data_tco_min

But after *.sdc being reading into TimeQuest, error occur:

Error: wrong# args: should be "set varName ?newValue?"

while executing

"set max_delay $ad_clock_period/2 + $ad_sclk_board_delay_max + $ad_data_board_delay_max + $ad_data_tco_max"

(file "E:/Altera_Project/QuartusII/FreqMeasure/FreqMeasure_AvalonInterface.sdc" line 190)

Any response will be very appreciated.

2 Replies

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

    To do calculations you have to use the expr command within square brackets:

    set a 2.0

    set b 3.0

    set c [expr $a + $b]

    So expr calculates the value, and the square brackets mean execute the commands inside and use their returned value.

    Finally, I recommend using decimals for all numbers. In Tcl, integer types are handled differently than decimals, so:

    expr 5 / 2

    will return 2, not 2.5. (Dumb, I know, but it's part of the Tcl language...)