Source Reference

Every Component in a SystemRDL register model is capable of providing contextual information about where it originated:

Similarly, information about where in the source a property assignment occurred is available via: systemrdl.component.Component.property_src_ref

class systemrdl.source_ref.SourceRefBase

Base class for all source references

class systemrdl.source_ref.FileSourceRef(path: str)

Simple file source reference that is only capable of providing the path to the originating file.

Some register model importers may only be able to provide limited source context.

property path: str

Path of the originating file

class systemrdl.source_ref.DetailedFileSourceRef(path: str)

Detailed source reference that is capable of providing a context snippet from the originating source.

property line: int

Line number within the originating file

property line_selection: Tuple[int, int]

Start/end coordinates of the selection within line_text. If the actual selection spans multiple lines, it is clamped to the end of this line.

property line_text: str

Source text of the originating line

property path: str

Path of the originating file