ifgen.svd package#

Subpackages#

Submodules#

ifgen.svd.cpu module#

A module implementing a ‘cpu’ SVD-element processor.

ifgen.svd.cpu.process_cpu(elem: Element, task: SvdProcessingTask, logger: Logger | LoggerAdapter[Any]) None[source]#

Process a SVD cpu element.

ifgen.svd.device module#

A module implementing a ‘device’ SVD-element processor.

ifgen.svd.device.process_device(elem: Element, task: SvdProcessingTask, logger: Logger | LoggerAdapter[Any]) None[source]#

Process a SVD device element.

ifgen.svd.peripherals module#

A module implementing a ‘peripherals’ SVD-element processor.

ifgen.svd.peripherals.process_peripheral(elem: Element, task: SvdProcessingTask, logger: Logger | LoggerAdapter[Any]) None[source]#

Process a SVD peripheral element.

ifgen.svd.peripherals.process_peripherals(elem: Element, task: SvdProcessingTask, logger: Logger | LoggerAdapter[Any]) None[source]#

Process a SVD peripherals element.

ifgen.svd.process module#

A module implementing interfaces for processing registers and clusters.

ifgen.svd.process.cluster(element: Element, cluster_map: dict[str, Cluster], peripheral: Peripheral, register_map: dict[str, Register] = None) Cluster[source]#

Create a Cluster instance from an SVD element.

ifgen.svd.process.handle_registers(registers: Element, peripheral: Peripheral, cluster_map: dict[str, Cluster] = None, register_map: dict[str, Register] = None) list[Register | Cluster][source]#

Handle the ‘registers’ element.

ifgen.svd.process.register(element: Element, register_map: dict[str, Register], peripheral: Peripheral) Register[source]#

Create a Register instance from an SVD element.

ifgen.svd.string module#

A module implementing interfaces for string-data elements.

class ifgen.svd.string.StringKeyVal(key: str, required: bool = True)[source]#

Bases: object

Name of key and whether or not it’s required.

key: str#
required: bool = True#
class ifgen.svd.string.StringKeyValueMixin[source]#

Bases: ABC

A mixin for SVD data model classes.

classmethod create(elem: Element, *args, **kwargs) T[source]#

Create a device instance from an element.

classmethod get_values(elem: Element) dict[str, str][source]#

Get string values for this instance.

handle_description(data: dict[str, Any] = None, prefix: str = None) dict[str, Any][source]#

Handle a possible description entry.

log(elem: Element, logger: Logger | LoggerAdapter[Any] | None) None[source]#

Log information from this instance’s raw data.

raw(elem: Element) dict[str, str][source]#

Get raw data for this instance based on string keys.

raw_data: dict[str, str]#
abstractmethod classmethod string_keys() Iterable[StringKeyVal][source]#

Get string keys for this instance type.

ifgen.svd.string.get_string_values(elem: Element, keys: Iterable[StringKeyVal]) dict[str, str][source]#

Get string values from an element’s children.

ifgen.svd.task module#

A module implementing an SVD-processing task interface.

class ifgen.svd.task.SvdProcessingTask(model: SvdModel, min_enum_width: int)[source]#

Bases: object

A container for SVD-processing state.

generate_configs(path: Path, config: SvdConfig) None[source]#

Generate output configuration files.

min_enum_width: int#
model: SvdModel#
process(elem: Element) None[source]#

Process a single element.

static svd(path: Path, min_enum_width: int) SvdProcessingTask[source]#

Process a single SVD file.

ifgen.svd.task.filter_includes(config: SvdConfig, model: SvdModel, paths: Iterable[Path], filtered: dict[str, str]) Iterator[str][source]#

Filter includes based on configuration.

Module contents#

A module implementing interfaces for working with ARM CMSIS-SVD files.

ifgen.svd.register_processors() None[source]#

Register tag-processing methods.