tool¶
Abstract base for external EDA tool wrappers.
Tool is the root of the tool catalogue. It is never instantiated: every tool is
used as a singleton through classmethods (e.g. YosysTool.run(...)). The base
owns the single subprocess entry point (run), so every concrete wrapper (Yosys,
OpenSTA, GHDL, and future tools such as nextpnr or OpenROAD) shares one place for
invocation and error handling, and no business-logic code calls subprocess
directly. Each subclass resolves its own executable from the FABulous context via
executable.
Classes¶
Abstract base for every external tool wrapper. |
Module Contents¶
Tool¶
- class Tool[source]¶
Bases:
ABCAbstract base for every external tool wrapper.
Tools are stateless singletons used through classmethods only; neither
Toolnor any subclass can be instantiated (see__new__). A subclass implementsexecutableto resolve its command, then builds its argument list and stdin and callsrun.Reject instantiation; tools are used only through their classmethods.
- Parameters:
- Raises:
TypeError – Always, because tool wrappers are stateless singletons.
Methods¶
- classmethod executable() Path | str[source]¶
- Abstractmethod:
Return the path to (or name of) this tool’s executable.
- Returns:
The resolved executable, typically read from the FABulous context.
- classmethod render_template(template_name, **context) str[source]¶
Render a tool script template into the command string to feed
run.
- classmethod run(args=None, stdin_data='') CompletedProcess[source]¶
Run the tool executable, capturing output and raising on failure.
- Parameters:
- Returns:
The completed subprocess result.
- Raises:
RuntimeError – If the command exits with a non-zero return code.