hammer icon indicating copy to clipboard operation
hammer copied to clipboard

Invoking Python-based hooks from TCL tools

Open edwardcwang opened this issue 5 years ago • 3 comments

As hooks are right now tied to invocation of a particular HammerTool, there isn't an alternate way of invoking this script from within Innovus without calling it from TCL.

maybe something like process hooks -> determine TCL portions -> write TCL portions -> execute <TCL portions> <Python portions> <TCL portions> ... as per order of the TCL portions?

_Originally posted by @harrisonliew in #511

edwardcwang avatar Sep 28 '19 03:09 edwardcwang

Is the idea that you might have some kind of embedded method that can be called as a __main__() and some behind-the-scenes magic would produce the tcl that would call it?

jwright6323 avatar Sep 30 '19 18:09 jwright6323

Possibly. Another way to do it (and avoid the Python -> TCL -> Python loop) is to run the TCL tool until a Python step shows up, run the Python step, then continue running any remaining TCL steps.

edwardcwang avatar Oct 04 '19 19:10 edwardcwang

I like the second approach better as it avoids the environment issues I ran into running the Python script from within Innovus 18.1's TCL interpreter. Some issues I forsee are:

  1. Tool logs would be discontinuous
  2. Loss of database settings caused by #430

Getting this to work would be good for something like OpenROAD anyway, since a par action over there submits to more than 1 tool.

harrisonliew avatar Oct 04 '19 20:10 harrisonliew