get_source
Read the exact bounded source excerpt for a loaded design object, including upstream origins, without modifying files.
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.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"path": "<path>"
},
"name": "get_source"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| bit | No | Bus bit index, separate from the literal name; omit for the whole object. | |
| 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. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |