Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start Tcl design inspection methods #4678

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

povik
Copy link
Member

@povik povik commented Oct 21, 2024

What are the reasons/motivation for this change?

Allow inspection and altering of the design from Tcl scripts for use-cases which are too specific to write a Yosys command for.

This is in addition to the existing ways of obtaining information about a design by

[yosys tee -q -s result.json stat -json]

and variations thereof.

See sample usage here: https://github.com/povik/OpenROAD-flow-scripts/blob/72b084f68275aaefec903fbc8e4f8613679e52e0/flow/scripts/synth_preamble.tcl#L122

Another use case of the new API is replacing this Python script called from Tcl to process a JSON export with a direct Tcl implementation: https://github.com/The-OpenROAD-Project/OpenROAD-flow-scripts/blob/master/flow/scripts/mem_dump.py (Cc @oharboe, feel free to comment)

Explain how this is achieved.

We introduce a set of Tcl functions prefixed with rtlil:: to query attributes and parameters.

Tcl bindings in other projects sometimes use text-formatted pointers as the Tcl-side handles, but for a RTLIL binding we can consistently use IDs of objects to refer to them from the Tcl side.

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

Successfully merging this pull request may close these issues.

1 participant