Skip to content
This repository has been archived by the owner on Jan 26, 2021. It is now read-only.

OpenDB as a TCL package, rather than a standalone executable #50

Open
Colin-Holehouse opened this issue Nov 13, 2019 · 1 comment
Open

Comments

@Colin-Holehouse
Copy link
Contributor

The integration of OpenDB with Python provides it as a package that gets loaded into the Python interpreter.

The same can be done with TCL. Rather than having a separate executable, if opendbtcl is built as a shared object library, then it can be loaded into any TCL shell through the package loading mechanism.

Alongside the shared object library there would be a TCL file called pkgIndex.tcl, which would load the shared object library if required. This would look something like:

package ifneeded opendbtcl 1.0.0 [list load $dir/libopendbtcl.so]

The end user would add the path of the directory where the pkgIndex.tcl file could be found to the environment variable TCLLIBPATH so that all the packages are known (but not loaded) when the tclsh starts up.

More information on the TCL load command:
http://tmml.sourceforge.net/doc/tcl/load.html

To use the opendbtcl package, the end user would do the following:

% tclsh
> package require opendbtcl

Taking this approach will make the python/tcl approach more consistent and tidy up some loose ends in the current opendbtcl binary [e.g. the package mechanism not working]

@ahmed-agiza
Copy link
Contributor

The current build generates a library file too, it just was not set to SHARED by mistake (will fix that), we can also provide pkgIndex.tcl so the package require would work normally but we probably won't drop the standalone executable as it is the approach with most OpenROAD apps, and will be required for the top-level app to work, and we need it too to inject the TCL wrappers as SWIG currently does not support inline TCL code.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants