Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
21615 Discussions

tcl script to modify origin of a region

Altera_Forum
Honored Contributor II
1,156 Views

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
0 Kudos
2 Replies
Altera_Forum
Honored Contributor II
441 Views

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"
0 Kudos
Altera_Forum
Honored Contributor II
441 Views

Thank you, 

 

-Adrian
0 Kudos
Reply