xheep_gen.xheep module

class xheep_gen.xheep.XHeep(bus_type: BusType)

Bases: object

Represents the whole X-HEEP system.

An instance of this class is passed to the mako templates.

Parameters:

bus_type (BusType) – The bus type chosen for this mcu.

Raises:

TypeError – when parameters are of incorrect type.

IL_COMPATIBLE_BUS_TYPES = [<BusType.NtoM: 'NtoM'>]

Constant set of bus types that support interleaved memory banks

add_extension(name, extension)

Register an external extension or configuration (object, dict, etc.).

Parameters:
  • name (str) – Name of the extension.

  • extension (Any) – The extension object.

add_peripheral_domain(domain: PeripheralDomain)

Add a peripheral domain to the system. The domain should already contain all peripherals well configured. When adding a domain, a deepcopy is made to avoid side effects.

Parameters:

domain (PeripheralDomain) – The domain to add.

are_base_peripherals_configured() bool
Returns:

True if the base peripherals are configured, False otherwise.

Return type:

bool

are_peripherals_configured() bool
Returns:

True if both base and user peripherals are configured, False otherwise.

Return type:

bool

are_user_peripherals_configured() bool
Returns:

True if the user peripherals are configured, False otherwise.

Return type:

bool

build()

Makes the system ready to be used.

bus_type() BusType
Returns:

the configured bus type

Return type:

BusType

cpu() CPU
Returns:

the configured CPU

Return type:

CPU

get_base_peripheral_domain()

Returns a deepcopy of the base peripheral domain.

Returns:

The base peripheral domain.

Return type:

BasePeripheralDomain

get_extension(name)

Retrieve a previously registered extension.

Parameters:

name (str) – Name of the extension.

Returns:

The extension object.

Return type:

Any

get_padring()
get_user_peripheral_domain()

Returns a deepcopy of the user peripheral domain.

Returns:

The user peripheral domain.

Return type:

UserPeripheralDomain

is_extension_defined(name)

Check if an extension is defined.

Parameters:

name (str) – Name of the extension.

Returns:

True if the extension is defined, False otherwise.

Return type:

bool

memory_ss() MemorySS
Returns:

the configured memory subsystem

Return type:

MemorySS

set_bus_type(bus_type: BusType)

Sets the bus type of the system.

Parameters:

bus_type (BusType) – The bus type to set.

Raises:

TypeError – when bus_type is of incorrect type.

set_cpu(cpu: CPU)

Sets the CPU of the system.

Parameters:

cpu (CPU) – The CPU to set.

Raises:

TypeError – when cpu is of incorrect type.

set_memory_ss(memory_ss: MemorySS)

Sets the memory subsystem of the system.

Parameters:

memory_ss (MemorySS) – The memory subsystem to set.

Raises:

TypeError – when memory_ss is of incorrect type.

set_padring(pad_ring: PadRing)

Sets the pad ring of the system.

Parameters:

pad_ring (PadRing) – The pad ring to set.

Raises:

TypeError – when pad_ring is of incorrect type.

set_xif(xif: CvXIf)

Sets the configuration of the CORE-V eXtension Interface (CV-X-IF).

Parameters:

xif (CvXIf) – CV-X-IF instance with the desired paramters.

Raises:

TypeError – when xif is of incorrect type.

validate()

Does some basics checks on the configuration

This should be called before using the XHeep object to generate the project.

xif() CvXIf
Returns:

the configured CV-X-IF

Return type:

CvXIf