Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

timeout on blocking function call

Status
Not open for further replies.

bartdiricx

Programmer
Feb 18, 2012
3
BE
Hello,

We're using TCL as our build script for our FPGA (= programmable HW) builds. This is done on top of xtclsh, a Xilinx (= FPGA vendor) specific command layer with support for TCL.

The problem is that an FPGA build can sometimes take several hours. An FPGA build has several steps, one of them is invoking the placer (to place the logic in the device) and router (to route the connections between the placed logic). This is done by executing the following call: process run "Place & Route"

Now this call is blocking, it only returns when the placer and router have finished (or failed). Normally this takes about 1 or 2 hours, but occasionally it takes over 20 hours. In this case I want to stop the placer and router, make some option changes and retry.

So how can I make sure that this call (process run "Place & Route") is interrupted after a given timeout?

Best regards,
Bart
 
I don't recognize "process" as a Tcl function so I suppose it's a proc inside XTCLSH. If you have access to that code, that would be where you would put the timer.

_________________
Bob Rashkin
 
It's indeed a proc inside XTCLSH, but I don't have access to that code. It is provided by the FPGA vendor (Xilinx)...
 
I did something similar now. I've launched a shell script with a time-out value and the current directory as arguments. This script will look up the matching linux process ID and kill it if it times out or just stop if the process stops without timing out...

Not the nicest way to do things, but quick to implement...

Thanks for your help.

Best regards,
Bart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top