Component

Base classes

Component

class systemrdl.component.Component

Base class for all component types

Inheritance diagram of systemrdl.component
children

List of Component instances that are direct descendants of this component.

Child components are sorted as follows:

  • Signals first

  • All other components follow.

  • AddressableComponents are sorted by ascending base_addr

  • Fields are sorted by ascending low bit

def_src_ref

Source Reference for the component definition

external

True if instance type is external. False if internal.

get_scope_path(scope_separator: str = '::') Optional[str]

Generate a string that represents this component’s declaration namespace scope.

Returns None if scope is not known or not applicable.

For example, the following SystemRDL snippet:

reg my_reg_t {
    field {} x;
};

addrmap top {
    my_reg_t foo;
    reg my_other_reg_t {
        field {} y;
    } bar;
    reg {
        field {} z;
    } baz, xyz;
};

… results in:

  • Field x of hierarchical path top.foo.x was declared in the lexical scope my_reg_t

  • Field y of hierarchical path top.bar.y was declared in the lexical scope top::my_other_reg_t

  • Both fields z of hierarchical paths top.baz.z and top.xyz.z were declared in the same lexical scope top::baz

  • Register foo was declared in the root scope which is represented by an empty string.

Parameters:

scope_separator (str) – Override the separator between namespace scopes

inst_name

Name of instantiated element

inst_src_ref

Source Reference for the component instantiation.

is_instance

If instantiated, set to True

original_def

Reference to original Component definition this instance is derived from.

Importers may leave this as None if appropriate.

parent_scope

Reference to parent Component definition that lexically encloses this component type definition.

May remain None if scope is not known or not applicable.

Note

This represents the parent lexical scope! This does not refer to the hierarchical parent of this component.

property_src_ref

Source Reference for each explicit property assignment (if available)

type_name

Named definition identifier. If declaration was anonymous, instantiation type names inherit the first instance’s name. The type name of parameterized components is normalized based on the instance’s parameter values.

If this is a non-instantiated component (referenced via an instance’s original_def), then it will contain either the original type name, or None if the declaration was anonymous.

Importers may leave this as None if an appropriate type name cannot be imported.

AddressableComponent

class systemrdl.component.AddressableComponent

Base class for all components that can have an address

addr_align

Address alignment if explicitly assigned by user.

addr_offset

Address offset from the parent component. If left as None, compiler will resolve with inferred value.

array_dimensions

List of sizes for each array dimension. Last item in the list iterates the most frequently.

array_stride

Address offset between array elements. If left as None, compiler will resolve with inferred value.

is_array

If true, then array_dimensions and array_stride are valid.

property n_elements: int

Total number of array elements. If array is multidimensional, array is flattened. Returns 1 if not an array.

VectorComponent

class systemrdl.component.VectorComponent

Base class for all components that are vector-like

high

High index of bit range

low

Low index of bit range

lsb

Bit position of least significant bit

msb

Bit position of most significant bit

width

Width of vector in bits


Component Types

Signal

class systemrdl.component.Signal

Field

class systemrdl.component.Field

Reg

class systemrdl.component.Reg
alias_primary_inst

Reference to primary register Component instance

is_alias

If true, then alias_primary_inst is valid

is_msb0_order

If true, fields are to be arranged in msb0 order

New in version 1.7.

Regfile

class systemrdl.component.Regfile

Addrmap

class systemrdl.component.Addrmap

Mem

class systemrdl.component.Mem