get_source
Read the bounded source excerpt that produced an object (for example, an SV FF instance maps to its always_ff block; a netlist cell maps to its instantiation line).
Instructions
Read the bounded source excerpt that produced an object (for example,
an SV FF instance maps to its always_ff block; a netlist cell maps to its
instantiation line). Use when exact source text is needed; use get_intent
for typedef/enum/parameter semantics. When the response lists origins
(e.g. Yosys src attributes), call again with origin=N to read that RTL.
Returns object, file, start/end range, text, and truncation status without
modifying files; missing paths and source ranges return structured errors.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| path | Yes | Exact hierarchical path to a loaded design object. | |
| origin | No | Index into the object's `origins` list to read an upstream source (e.g. the RTL behind a Yosys netlist cell) instead of its declaration. | |
| context_lines | No | Extra lines before and after the source range; clamped to 0..20. |