Forum Discussion

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

tcl script to modify origin of a region

Hi,

I need a way of modifying the result of the following line using tcl scripting.

set ORIGIN [get_logiclock -region $region -origin]

The previous line gives the origin of a LogicLock region which I want to modify using arithmetic operations. The return is of the following form

X#_Y# where# are x and y locations

How can I extract those numbers and let's say add 2 to the x coordinate using tcl?

Thank you,

-Adrian

2 Replies

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

    Lookup "regexp". It will be something like:

    regexp {^(X)([0-9]+)(_Y)([0-9]+)$} $ORIGIN all x x_coord y y_coord

    I would run a few experiments with different ORIGIN values, then the regexp, and then dump it with:

    puts "all=$all x=$x, x_coord=$x_coord, y=$y y_coord=$y_coord"