C H A P T E R  1

Configuration API

This chapter describes the components and functions of the Configuration API. Topics include:


Hardware Architecture API

You can use the hardware architecture API to describe the target hardware architecture of the application.

The file teja_hardware_architecture.h file contains the declaration of the data types and API functions.

Hardware Architecture API Data Types

The hardware architecture definitions use the following data types.


TABLE 1-1 Hardware Architecture API Data Types

Data Type

Description

teja_architecture_t

Hardware architecture. An architecture might contain processors, memories, buses, hardware objects, and other architectures.

teja_processor_t

Processor. A processor is a target for an OS (teja_os_t).

teja_memory_t

Memory. A memory is a target for mapping variables declared in user-application source code.

teja_bus_t

Bus connecting objects with each other.

teja_bus_visibility_t

Buses have two types of visibility:

  • TEJA_INTERNAL_BUS - bus not visible outside its containing architecture
  • TEJA_EXPORTED_BUS - bus made visible outside its containing architecture

Example:

typedef enum {TEJA_INTERNAL_BUS, TEJA_EXPORTED_BUS} teja_bus_visibility_t;
teja_hardware_object_t

Generic hardware module that is not a processor, a memory, or a bus.

teja_port_t

Hardware port.

teja_address_space_t

Address space. An address space is used as context for allocating address ranges.

teja_address_range_t

Address range. An address range is a (lo, hi) range obtained from an address space.


Hardware Architecture API Functions

teja_architecture_create

Description

Creates a new architecture with the specified name. The new architecture is contained in the container architecture. The top-level architecture is created by passing NULL as value for container. Legal values for the type parameter are found in the chip support package (CSP) specific properties, characterized by the TEJA_ARCHITECTURE_ prefix. Most of the types result in a read-only, preconfigured architecture. To create custom architectures, use the TEJA_ARCHITECTURE_USER_DEFINED value for type.

Syntax

teja_architecture_t teja_architecture_create(teja_architecture_t container,
const char *
name, const char *type);

Parameters

container - Container for the new architecture.

name - Name of the new architecture.

type - Type of the architecture.

Return Values

teja_architecture_t - value that can be used as handle for the new architecture

teja_architecture_set_property

Description

Sets the value of the property for the architecture object.

Syntax

int teja_architecture_set_property(teja_architecture_t arch,
const char *
property-name, const char *value);

Parameters

arch - Architecture object.

property-name - Name of the property.

value - Value of the property.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_architecture_get_property

Description

Returns the value of the property for the architecture object. If the returned value+1 is greater than the size of the passed buffer, the returned value is truncated. The user must allocate a buffer with enough space to hold the value (returned value+1) and call the function again.

Syntax

int teja_architecture_get_property(teja_architecture_t arch,
const char *
property-name, char *value, int buf-size);

Parameters

arch - Architecture object.

property-name - Name of the property.

value - Returned value of the property.

buf-size - Size of the character buffer that was passed for the return value.

Return Values

int - Returns the length of the current value of the property.

teja_architecture_set_read_only

Description

Prevents modification of given architecture by subsequent processing.

Syntax

int teja_architecture_set_read_only(teja_architecture_t arch);

Parameters

arch - Architecture object.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_processor_create

Description

Creates a processor object.

Syntax

teja_processor_t teja_processor_create(teja_architecture_t container,
const char *
name, const char *type);

Parameters

container - Container of the new processor.

name - Name of the new processor.

type - Type of the new processor.

Return Values

teja_processor_t - Returns newly created processor object.

teja_processor_set_property

Description

Sets the value of the property for the processor object.

Syntax

int teja_processor_set_property(teja_processor_t processor,
const char *
property-name, const char *value);

Parameters

processor - Processor object.

property-name - Name of the property.

value - Value of the property.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_processor_get_property

Description

Returns the value of the property for the processor object. If the returned value+1 is greater than the size of the passed buffer, the returned value is truncated. The user must allocate a buffer with enough space to hold the value (returned value+1) and call the function again.

Syntax

int teja_processor_get_property(teja_processor_t processor,
const char *
property-name, char *value, int buf-size);

Parameters

processor - Processor object.

property-name - Name of the property.

value - Value of the property.

buf-size - Size of the character buffer that was passed for the return value.

Return Values

int - Returns the length of the current value of the property.

teja_processor_add_preprocessor_symbol

Description

Adds a preprocessor symbol to the processor. All of the processes running on the processor have the same symbol defined. The function adds convenience when passing values from the hardware architecture code into the user code.

Syntax

int teja_processor_add_preprocessor_symbol(teja_processor_t processor,
const char *
symbol, const char *value);

Parameters

processor - Processor instance to which the symbol is added.

symbol - Name of the symbol.

value - Value of the symbol.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_memory_create

Description

Creates a memory object

Syntax

teja_memory_t teja_memory_create(teja_architecture_t container,
const char *
name, const char *type);

Parameters

container - Container of the new memory.

name - Name of the new memory.

type - Type of the new memory.

Return Values

teja_memory_t - Returns the newly created memory object.

teja_memory_set_property

Description

Sets the value of the property for the memory object.

Syntax

int teja_memory_set_property(teja_memory_t memory,
const char *
property-name, const char *value);

Parameters

memory - Memory object.

property-name - Name of the property.

value - Value of the property.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_memory_get_property

Description

Returns the value of the property for the memory object. If the returned value+1 is greater than the size of the passed buffer, the returned value is truncated. The user must allocate a buffer with enough space to hold the value (returned value+1) and call the function again.

Syntax

int teja_memory_get_property(teja_memory_t memory,
const char *
property-name, char *value, int buf-size);

Parameters

memory - Memory object.

property-name - Name of the property.

value - Returned value of the property.

buf-size - Size of the character buffer that was passed for the return value.

Return Values

int - Returns the length of the current value of the property.

teja_bus_create

Description

Creates a bus object.

Syntax

teja_bus_t teja_bus_create(teja_architecture_t container,
const char *
name, const char *type, teja_bus_visibility_t v);

Parameters

container - Container of the new bus.

name - Name of the new bus.

type - Type of the new bus.

Return Values

teja_bus_t - Returns newly created bus object.

teja_bus_set_property

Description

Sets the value of the property for the bus object.

Syntax

int teja_bus_set_property(teja_bus_t bus, const char *property-name,
const char *
value);

Parameters

bus - Bus object.

property-name - Name of the property.

value - Value of the property.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_bus_get_property

Description

Returns the value of the property for the bus object. If the returned value+1 is greater than the size of the passed buffer, the returned value is truncated. The user must allocate a buffer with enough space to hold the value (returned value+1) and call the function again.

Syntax

int teja_bus_get_property(teja_bus_t bus, const char *property-name,
char *
value, int buf-size);

Parameters

bus - Bus object.

property-name - Name of the property.

value - Returned value of the property.

buf-size - Size of the character buffer that was passed for the return value.

Return Values

int - Returns the length of the current value of the property.

teja_hardware_object_create

Description

Creates a hardware object.

Syntax

teja_hardware_object_t teja_hardware_object_create(
teja_architecture_t
container, const char *name, const char *type);

Parameters

container - Container of the new hardware object.

name - Name of the new hardware object.

type - Type of the new hardware object.

Return Values

teja_hardware_object_t - Returns newly created hardware object.

teja_hardware_object_set_property

Description

Sets the value of the property for the hardware object.

Syntax

int teja_hardware_object_set_property(teja_hardware_object_t hardware-object,
const char *
property-name, const char *value);

Parameters

hardware-object - Hardware object.

property-name - Name of the property.

value - Value of the property.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_hardware_object_get_property

Description

Returns the value of the property for the hardware_object. If the returned value+1 is greater than the size of the passed buffer, the returned value is truncated. The user must allocate a buffer with enough space to hold the value (returned value+1) and call the function again.

Syntax

int teja_hardware_object_get_property(teja_hardware_object_t hardware-object,
const char *
property-name, char *value, int buf-size);

Parameters

hardware-object - Hardware object.

property-name - Name of the property.

value - Returned value of the property.

buf-size - Size of the character buffer that was passed for the return value.

Return Values

int - Returns the length of the current value of the property.

teja_architecture_connect

Description

Connects an architecture to a bus.

Syntax

int teja_architecture_connect(teja_architecture_t architecture,
const char *
bus-name, teja_bus_t bus);

Parameters

architecture - Architecture object that needs to be connected.

bus-name - Name of the bus inside the architecture that is connected to the bus.

bus - Bus object that needs to be connected to the architecture.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_processor_connect

Description

Connects a processor to a bus.

Syntax

int teja_processor_connect(teja_processor_t processor, const char *bus-name,
teja_bus_t
bus);

Parameters

processor - Processor object that needs to be connected.

bus-name - Name of the bus inside the processor that is connected to the bus.

bus - Bus object that needs to be connected to the processor.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_memory_connect

Description

Connects a memory to a bus.

Syntax

int teja_memory_connect(
teja_memory_t
memory, const char *bus-name, teja_bus_t bus);

Parameters

memory - Memory object that needs to be connected.

bus-nam - Name of the bus inside the memory that is connected to the bus.

bus - Bus object that needs to be connected to the memory.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_hardware_object_connect

Description

Connects a hardware object to a bus.

Syntax

int teja_hardware_object_connect(teja_hardware_object_t
hardware-object, const char *bus-name, teja_bus_t bus);

Parameters

hardware-object - Hardware object that needs to be connected.

bus-name - Name of the bus inside the hardware object that is connected to the bus.

bus - Bus object that needs to be connected to the hardware object.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_lookup_architecture

Description

Looks up an architecture in the container.

Syntax

teja_architecture_t teja_lookup_architecture(teja_architecture_t architecture,
const char *
architecture-name);

Parameters

architecture - Container architecture in which the user wants to look up the architecture.

architecture-name - Name of the architecture to look up in the container.

Return Values

teja_architecture_t - The found architecture or NULL if not found.

teja_lookup_processor

Description

Looks up a processor in the container.

Syntax

teja_processor_t teja_lookup_processor(teja_architecture_t architecture,
const char *
processor-name);

Parameters

architecture - Container architecture in which the user wants to look up the processor.

processor-name - Name of the processor to look up in the container.

Return Values

teja_processor_t - The found processor or NULL if not found.

teja_lookup_memory

Description

Looks up a memory in the container.

Syntax

teja_memory_t teja_lookup_memory(teja_architecture_t architecture,
const char *
memory-name);

Parameters

architecture - Container architecture in which the user wants to look up the memory.

memory-name - Name of the memory to look up in the container.

Return Values

teja_memory_t - The found memory or NULL if not found.

teja_lookup_bus

Description

Looks up a bus in the container.

Syntax

teja_bus_t teja_lookup_bus(teja_architecture_t architecture,
const char *
bus-name);

Parameters

architecture - Container architecture in which the user wants to look up the bus.

bus-name - Name of the bus to look up in the container.

Return Values

teja_bus_t - The found bus or NULL if not found.

teja_lookup_hardware_object

Description

Looks up a hardware object in the container.

Syntax

teja_hardware_object_t teja_lookup_hardware_object(teja_architecture_t architecture,
const char *
hardware-object-name);

Parameters

architecture - Container architecture in which the user wants to look up the hardware object.

hardware-object-name - Name of the hardware object to look up in the container.

Return Values

teja_hardware_object_t - The found hardware object or NULL if not found.

teja_port_create

Description

Creates a port in an hardware architecture. The port can be connected externally to ports of objects in the containing architecture, or ports of the containing architecture itself. See teja_architecture_set_port_internal. The port can also be connected internally to objects contained in this architecture. See teja_architecture_set_port.

Syntax

teja_port_t teja_port_create(teja_architecture_t arch,
const char *
port-name, const char *dir);

Parameters

arch - Container architecture in which the port is created.

port-name - Name of the port.

dir - Direction of the port. Legal values are IN and OUT.

Return Values

teja_port_t - Returns the newly created port.

teja_architecture_set_port

Description

Assigns a value externally to an architecture port. If a port of another object in the architecture containing arch is assigned with the same value, the two ports are connected. Also, if ports belonging to the architecture containing arch are assigned internally with the same value, the two ports are connected. The value represents the name of a wire connecting the ports.

Syntax

int teja_architecture_set_port(teja_architecture_t arch,
const char *
port-name, const char *value);

Parameters

arch - Architecture containing the port.

port-name - Name of the architecture port.

value - Value to be assigned externally to the port.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_architecture_set_port_internal

Description

Assigns a value internally to an architecture port. If a port of another object contained in arch is assigned with the same value, the two ports are connected. The value represents the name of a wire connecting the ports.

Syntax

int teja_architecture_set_port_internal(teja_architecture_t arch,
const char *
port-name, const char *value);

Parameters

arch - Architecture containing the port.

port-name - Name of the architecture port.

value - Value to be assigned internally to the port.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_processor_set_port

Description

Assigns a value to a processor port. If a port of another object in the architecture containing the processor is assigned with the same value, the two ports are connected. Also, if ports belonging to the architecture containing the processor are assigned internally with the same value, the two ports are connected. The value represents the name of a wire connecting the ports.

Syntax

int teja_processor_set_port(teja_processor_t proc,
const char *
port-name, const char *value);

Parameters

proc - Processor containing the port.

port-name - Name of the port.

value - Value to be assigned to the port.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_memory_set_port

Description

Assigns a value to a memory port. If a port of another object in the architecture containing the memory is assigned with the same value, the two ports are connected. Also, if ports belonging to the architecture containing the memory are assigned internally with the same value, the two ports are connected. The value represents the name of a wire connecting the ports.

Syntax

int teja_memory_set_port(teja_memory_t memory,
const char *
port-name, const char *value);

Parameters

memory - Memory containing the port.

port-name - Name of the port.

value - Value to be assigned to the port.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_hardware_object_set_port

Description

Assigns a value to a hardware object port. If a port of another object in the architecture containing the hardware object is assigned with the same value, the two ports are connected. Also, if ports belonging to the architecture containing the hardware object are assigned internally with the same value, the two ports are connected. The value represents the name of a wire connecting the ports.

Syntax

int teja_hardware_object_set_port(teja_hardware_object_t hardware-object,
const char *
port-name, const char *value);

Parameters

hardware-object - Hardware object containing the port.

port-name - Name of the port.

value - Value to be assigned to the port.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_bus_set_port

Description

Assigns a value to a bus port. If a port of another object in the architecture containing the bus is assigned with the same value, the two ports are connected. Also, if ports belonging to the architecture containing the bus are assigned internally with the same value, the two ports are connected. The value represents the name of a wire connecting the ports.

Syntax

int teja_bus_set_port(teja_bus_t bus, const char *port-name,
const char *
value);

Parameters

bus - Bus containing the port.

port-name - Name of the port.

value - Value to be assigned to the port.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_port_add_property

Description

Associates a new key=value pair to a port. This allows association of target-specific properties to ports.

Syntax

int teja_port_add_property(teja_port_t port, const char *property-name,
const char *
value, const char *description);

Parameters

port - Port to which the property is added.

property-name - Name of the new property.

value - Value of the new property.

description - Description associated to the property.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_architecture_get_parent

Description

Returns the parent architecture for the specified architecture. If the specified architecture has no parent (for example, the top level architecture), NULL is returned.

Syntax

teja_architecture_t teja_architecture_get_parent(teja_architecture_t architecture);

Parameters

architecture - An architecture.

Return Values

teja_architecture_t - The architecture containing the one passed as parameter, or NULL if such architecture is the top-level one.

teja_processor_get_parent

Description

Returns the architecture containing the specified processor.

Syntax

teja_architecture_t teja_processor_get_parent(
teja_processor_t
processor);

Parameters

processor - A processor.

Return Values

teja_architecture_t - The architecture containing the processor.

teja_bus_get_parent

Description

Returns the architecture containing the specified processor.

Syntax

teja_architecture_t teja_bus_get_parent(teja_bus_t bus);

Parameters

bus - A bus.

Return Values

teja_architecture_t - The architecture containing the bus.

teja_memory_get_parent

Description

Returns the architecture containing the specified memory.

Syntax

teja_architecture_t teja_memory_get_parent(teja_memory_t memory);

Parameters

memory - A memory.

Return Values

teja_architecture_t - The architecture containing the memory.

teja_hardware_object_get_parent

Description

Returns the architecture containing the specified hardware object.

Syntax

teja_architecture_t teja_hardware_object_get_parent(teja_hardware_object_t hardware-object);

Parameters

hardware-object - A hardware object.

Return Values

teja_architecture_t - The architecture containing the hardware object.

teja_architecture_get_processors

Description

Returns an array of processors contained in the architecture. If the architecture contains N processors, the array contains N+1 entries, with entry N set to NULL. The user must deallocate the array by calling free() on it.

Syntax

teja_processor_t *teja_architecture_get_processors(teja_architecture_t arch);

Parameters

arch - An architecture.

Return Values

teja_processor_t * - The null-terminated array of processors contained in the architecture.

teja_architecture_get_memories

Description

Returns an array of memories contained in the architecture. If the architecture contains N memories, the array contains N+1 entries, with entry N set to NULL. The user must deallocate the array by calling free() on it.

Syntax

teja_memory_t *teja_architecture_get_memories(teja_architecture_t arch);

Parameters

arch - An architecture.

Return Values

teja_memory_t * - The null-terminated array of memories contained in the architecture.

teja_architecture_get_hardware_objects

Description

Returns an array of hardware objects contained in the architecture. If the architecture contains N objects, the array contains N+1 entries, with entry N set to NULL. The user must deallocate the array by calling free() on it.

Syntax

teja_hardware_object_t *teja_architecture_get_hardware_objects(teja_architecture_t arch);

Parameters

arch - An architecture.

Return Values

teja_hardware_object_t * - The null-terminated array of hardware objects contained in the architecture.

teja_architecture_get_busses

Description

Returns an array of buses contained in the architecture. If the architecture contains N buses, the array contains N+1 entries, with entry N set to NULL. The user must deallocate the array by calling free() on it.

Syntax

teja_bus_t *teja_architecture_get_busses(
teja_architecture_t
arch);

Parameters

arch - An architecture.

Return Values

teja_bus_t * - The null-terminated array of buses contained in the architecture.

teja_architecture_get_architectures

Description

Returns an array of architectures contained in the architecture. If the architecture contains N architectures, the array contains N+1 entries, with entry N set to NULL. The user must deallocate the array by calling free() on it.

Syntax

teja_architecture_t *teja_architecture_get_architectures(teja_architecture_t arch);

Parameters

arch - An architecture.

Return Values

teja_architecture_t * - The null-terminated array of architectures contained in the architecture.

teja_processor_get_connected_bus

Description

Returns the bus connected to the specified internal processor, or NULL. For example, a bus b contained in the same architecture as a processor and connected to such processor, actually connects to an bus contained inside the processor. Given the processor and the name of the bus contained in it (internal-bus-name), this function returns b (teja_bus_t). If no bus is connected to the specified internal bus, NULL is returned.

Syntax

teja_bus_t teja_processor_get_connected_bus(
teja_processor_t
processor, const char *internal-bus-name);

Parameters

processor - A processor.

internal-bus-name - Name of a bus internal to the processor.

Return Values

teja_bus_t - The bus connected to the specified internal processor bus, or NULL.

teja_memory_get_connected_bus

Description

Returns the bus connected to the specified memory, or NULL. For example, a bus b contained in the same architecture as a processor and connected to such memory, actually connects to an bus contained inside the memory. Given the memory and the name of the bus contained in it (internal-bus-name), this function returns b (teja_bus_t). If no bus is connected to the specified internal bus, NULL is returned.

Syntax

teja_bus_t teja_memory_get_connected_bus(
teja_memory_t
memory, const char *internal-bus-name);

Parameters

memory - A memory.

internal-bus-name - Name to the bus internal to the memory.

Return Values

teja_bus_t - The bus connected to the specified internal memory bus, or NULL.

teja_hardware_object_get_connected_bus

Description

Returns the bus connected to the specified hardware object, or NULL. For example, a bus b contained in the same architecture as a hardware object and connected to such hardware object, actually connects to an bus contained inside the hardware object. Given the hardware object and the name of the bus contained in it (internal-bus-name), this function returns b (teja_bus_t). If no bus is connected to the specified internal bus, NULL is returned.

Syntax

teja_bus_t teja_hardware_object_get_connected_bus(
teja_hardware_object_t
hardware-object, const char *internal-bus-name);

Parameters

hardware-object - An hardware object.

internal-bus-name - Name of a bus internal to the hardware object.

Return Values

teja_bus_t - The bus connected to the specified internal hardware object bus, or NULL.

teja_architecture_get_connected_bus

Description

Returns the bus connected to the specified architecture bus, or NULL. For example, consider an architecture arch1 contained in an architecture arch2, a bus b1 contained in arch1, and a bus b2 contained in arch2. If b1 and b2 are connected, calling this function with arch2 as first parameter (architecture) and the name of b2 as the second (internal-bus-name) returns b1. If no bus is connected to b2, NULL is returned.

Syntax

teja_bus_t teja_architecture_get_connected_bus(teja_architecture_t architecture,
const char *
internal-bus-name);

Parameters

architecture - An architecture.

internal-bus-name - Name of a bus internal to the architecture.

Return Values

teja_bus_t - The bus connected to the specified internal architecture bus, or NULL.

teja_bus_get_connected_processors

Description

Returns an array of processors connected to the specified bus. If N processors are connected to the bus, the array contains N+1 entries, with entry N set to NULL. The user must deallocate the array by calling free() on it.

Syntax

teja_processor_t *teja_bus_get_connected_processors(
teja_bus_t
bus);

Parameters

bus - A bus.

Return Values

teja_processor_t * - A NULL-terminated array of processors connected to the bus.

teja_bus_get_connected_memories

Description

Returns an array of memories connected to the specified bus. If N memories are connected to the bus, the array contains N+1 entries, with entry N set to NULL. The user must deallocate the array by calling free() on it.

Syntax

teja_memory_t *teja_bus_get_connected_memories(teja_bus_t bus);

Parameters

bus - A bus.

Return Values

teja_memory_t * - A NULL-terminated array of memories connected to the bus.

teja_bus_get_connected_hardware_objects

Description

Returns an array of hardware objects connected to the specified bus. If N hardware objects are connected to the bus, the array contains N+1 entries, with entry N set to NULL. The user must deallocate the array by calling free() on it.

Syntax

teja_hardware_object_t *teja_bus_get_connected_hardware_objects(teja_bus_t bus);

Parameters

bus - A bus.

Return Values

teja_hardware_object_t * - A NULL-terminated array of hardware objects connected to the bus.

teja_bus_get_connected_architectures

Description

Returns an array of architectures connected to the specified bus. If N architectures are connected to the bus, the array contains N+1 entries, with entry N set to NULL. The user must deallocate the array by calling free() on it.

Syntax

teja_architecture_t *teja_bus_get_connected_architectures(teja_bus_t bus);

Parameters

bus - A bus.

Return Values

teja_architecture_t * - A NULL-terminated array of architectures connected to the bus.

teja_processor_get_busses

Description

Returns an array of buses contained the specified processor. If the processor contains N buses, the array contains N+1 entries, with entry N set to NULL. The user must deallocate the array by calling free() on it.

Syntax

teja_bus_t *teja_processor_get_busses(teja_processor_t processor);

Parameters

processor - A processor.

Return Values

teja_bus_t * - A NULL-terminated array of buses contained in the processor.

teja_memory_get_busses

Description

Returns an array of buses contained the specified memory. If the memory contains N buses, the array contains N+1 entries, with entry N set to NULL. The user must deallocate the array by calling free() on it.

Syntax

teja_bus_t *teja_memory_get_busses(teja_memory_t memory);

Parameters

memory - A memory.

Return Values

teja_bus_t * - A NULL-terminated array of buses contained in the memory.

teja_hardware_object_get_busses

Description

Returns an array of busses contained the specified hardware object. If the object contains N busses, the array contains N+1 entries, with entry N set to NULL. The user must deallocate the array by calling free() on it.

Syntax

teja_bus_t *teja_hardware_object_get_busses(teja_hardware_object_t hardware-object);

Parameters

hardware-object - A hardware object.

Return Values

teja_bus_t * - A NULL-terminated array of buses contained in the hardware object.

teja_address_space_create

Description

Allocates an address space with the specified name, base, and high address, and associated to the specified architecture. Requests for address ranges with various constraints are performed against an address space. At compile time all the request are resolved into actual address ranges within the space. Base and high address are specified as strings containing the hexadecimal address representation (for example, 0x100000000).

Syntax

teja_address_space_t teja_address_space_create(teja_architecture_t arch,
const char *
name, const char *base, const char *high);

Parameters

arch - An architecture.

name - Name of an address space to be created.

base - Base address for the space.

high - Highest address in the space.

Return Values

teja_address_space_t - The newly created address space.

teja_address_space_join

Description

Joins two address spaces. Address range requests performed against the two spaces is resolved as if the two addresses had been issued against a single space. The base-high range of the resulting address space is the union of the two original ranges.

Syntax

int teja_address_space_join(teja_address_space_t s1,
teja_address_space_t
s2);

Parameters

s1 - An address space.

s2 - An address space.

Return Values

int - TEJA_SUCCESS or error code for failure.

teja_address_range_create_absolute

Description

Creates an address range with the specified absolute address and size. The symbol has to be unique with respect to address ranges created against the same address space.

Syntax

teja_address_range_t teja_address_range_create_absolute(teja_address_space_t space, const char *sym, const char *base,
const char *
size,);

Parameters

space - An address space.

sym - A symbol to be associated to the range.

base - Base address for the range.

size - Size of the range.

Return Values

teja_address_range_t - The newly created address range.

teja_address_range_create_aligned

Description

Creates an address range with the specified size. When address range resolution is performed, this range is assigned a base address that is multiple of alignment, but not smaller than minaddr. The symbol has to be unique with respect to address ranges created against the same address space.

Syntax

teja_address_range_t teja_address_range_create_aligned(teja_address_space_t space,
const char *
sym, const char *alignment, const char *size, const char
*
minaddr);

Parameters

space - An address space.

sym - A symbol to be associated to the range.

alignment - An alignment constraint.

size - Size of the range.

minaddr - A lower bound to the base address for the range.

Return Values

teja_address_range_t - The newly created address range.

teja_address_range_create_generic

Description

Creates an address range with the specified size. When address range resolution is performed, this range is assigned a base address higher than minaddr. The symbol has to be unique with respect to address ranges created against the same address space.

Syntax

teja_address_range_t teja_address_range_create_generic(teja_address_space_t space,
const char *
sym, const char *size, const char *minaddr);

Parameters

space - An address space.

sym - A symbol to be associated to the range.

size - Size of the range.

minaddr - A lower bound to the base address for the range.

Return Values

teja_address_range_t - The newly created address range.

teja_address_range_get_lower_bound

Description

This function returns a handle for the lower bound of the address range. The handle can be set as value for any property. When address resolution is performed, tejacc replaces such value with the actual lower bound address assigned to the range. If the array passed as buffer to store the handle is not large enough, NULL is returned.

Syntax

char *teja_address_range_get_lower_bound(teja_address_range_t range,
char *
buf, int buf-size);

Parameters

range - An address range.

buf - An array of characters.

buf-size - Size of the array of characters.

Return Values

char * - The array of characters filled with the handle, or NULL in case of error.

teja_address_range_get_upper_bound

Description

Returns a handle for the upper bound of the address range. The handle can be set as value for any property. When address resolution is performed, tejacc replaces the value with the actual upper bound address assigned to the range. If the array passed as a buffer to store the handle is not large enough, NULL is returned.

Syntax

char *teja_address_range_get_upper_bound(teja_address_range_t range,
char *
buf, int buf-size);

Parameters

range - An address range.

buf - An array of characters.

buf-size - Size of the array of characters.

Return Values

char * - The array of characters filled with the handle, or NULL in case of error.


Software Architecture API

The software architecture API is used to describe the threads, processes, and OS composing the software part of the application, as well as Sun Netra DPS mutexes, queues, memory pools, and channels used by the various threads.

The teja_software_architecture.h file contains the declaration of the API functions.

Software Architecture API Data Types

The following data types are used in the software architecture definitions.


TABLE 1-2 Software Architecture API Data Types
teja_os_t

OS. An OS runs on one or more processors. These are the different OS types that are supported for different targets. Refer to the chip support package documentation for which operating systems are supported for that particular chip support package.

teja_process_t

Process. One or more processes run on an OS.

teja_thread_t

Thread. One or more threads run in a process.

teja_channel_t

Channel. Channels provide the communication facility to send structured data between two or more threads.

teja_memory_pool_t

Memory pool. A memory pool is a pool of same-sized nodes that are pre-allocated. The memory pool provides an efficient mechanism for memory allocation and deallocation at runtime without the cost of dynamic memory allocation.

teja_queue_t

Queue. A queue provides a facility to pass structured data between two or more threads.

teja_mutex_t

Mutex. A mutex provides a synchronization facility between two or more threads.


Software Architecture API Functions

teja_os_create

Description

Creates an OS instance. Return value can be used to set or get properties of the OS.

Syntax

teja_os_t teja_os_create(const char **processor-names,
const char *
name, const char *type);

Parameters

processor-names - NULL-terminated array of processor names on which the OS is running.

name - Name of the OS instance.

type - Type of the OS.

Return Values

teja_os_t - Returns an object that represents the OS instance.

teja_os_set_property

Description

Sets the specified value of the property for the OS instance.

Syntax

int teja_os_set_property(teja_os_t os, const char *property-name,
const char *
value);

Parameters

os - OS instance for which the property is being set.

property-name - Name of the property.

value - Value of the property to be set.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_os_get_property

Description

Returns the current value of the OS property. If the returned value+1 is greater than the size of the passed buffer, the returned value is truncated. The user must allocate a buffer with enough space to hold the value (returned value+1) and call the function again.

Syntax

int teja_os_get_property(teja_os_t os, const char *property-name,
const char *
value, int buf-size);

Parameters

os - OS instance for which the property is being read.

property-name - Name of the property.

value - Value that is read and returned.

buf-size - Size of the character buffer that was passed for the return value.

Return Values

int - Returns the length of the current value of the property.

teja_process_create

Description

Creates a process instance. One or more processes can be created per OS. The source files listed in the source sets comprise the sources for the process.

Syntax

teja_process_t teja_process_create(teja_os_t container,
const char *
name, const char **srcset);

Parameters

container - OS instance where the process is created.

name - Name of the instance.

srcset - NULL-terminated list of one or more source sets that are part of the process.

Return Values

teja_process_t - Returns created process instance.

teja_process_set_property

Description

Sets a process property.

Syntax

int teja_process_set_property(teja_process_t process,
const char *
property-name, const char *value);

Parameters

process - Process instance for which the property is being set.

property-name - Name of the property.

value - Value of the property.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_process_get_property

Description

Returns the current value of the process property. If the returned value+1 is greater than the size of the passed buffer, the returned value is truncated. The user must allocate a buffer with enough space to hold the value (returned value+1) and call the function again.

Syntax

int teja_process_get_property(teja_process_t process,
const char *
property-name, const char *value, int buf-size);

Parameters

process - Process instance for which the property is being read.

property-name - Name of the property.

value - Returned value of the property.

buf-size - Size of the character buffer that was passed for the return value.

Return Values

int - Returns the length of the current value of the property.

teja_processor_add_preprocessor_symbol

See teja_processor_add_preprocessor_symbol

teja_thread_create

Description

Creates a thread instance. One or more threads can be created per process.

Syntax

teja_thread_t teja_thread_create(teja_process_t container,
const char *
name);

Parameters

container - Process instance where the thread is created.

name - Name of the thread.

Return Values

teja_thread_t - Returns thread instance.

teja_thread_set_property

Description

Sets a thread property.

Syntax

int teja_thread_set_property(teja_thread_t thread,
const char *
property-name, const char *value);

Parameters

thread - Thread instance for which the property is being set.

property-name - Name of the property.

value - Value of the property.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_thread_get_property

Description

Returns the current value of a thread property. If the returned value+1 is greater than the size of the passed buffer, the returned value is truncated. The user must allocate a buffer with enough space to hold the value (returned value+1) and call the function again.

Syntax

int teja_thread_get_property(teja_thread_t thread,
const char *
property-name, const char *value, int buf-size);

Parameters

thread - Thread instance for which the property is being read.

property-name - Name of the property.

value - Returned value of the property.

buf-size - Size of the character buffer that was passed for the return value.

Return Values

int - Returns the length of the current value of the property.

teja_lookup_os

Description

Looks up an OS from its name in the software architecture.

Syntax

teja_os_t teja_lookup_os(const char *os-name);

Parameters

os-name - Name of the OS.

Return Values

teja_os_t - Returns the found os instance or NULL.

teja_lookup_process

Description

Looks up a process from its name in the software architecture.

Syntax

teja_process_t teja_lookup_process(const char *process-name);

Parameters

process-name - Name of the process.

Return Values

teja_process_t - Returns the found process instance or NULL.

teja_lookup_thread

Description

Looks up a thread from its name in the software architecture.

Syntax

teja_thread_t teja_lookup_thread(const char *thread-name);

Parameters

thread-name - Name of the thread.

Return Values

teja_thread_t - Returns the found thread instance or NULL.

teja_channel_declare

Description

Creates a new channel instance in the software architecture. The instance is accessed in the user-application code as a C preprocessor symbol with the same name as specified in this function.

Syntax

teja_channel_t teja_channel_declare(const char *name, const char *type, teja_thread_t *producers, teja_thread_t *consumers);

Parameters

name - Name of the channel.

type - Type of the channel.

producers - NULL-terminated list of producer thread instances.

consumers - NULL-terminated list of consumer thread instances.

Return Values

teja_channel_t - Returns the created channel instance.

teja_channel_set_property

Description

Sets a new value for a channel property.

Syntax

int teja_channel_set_property(teja_channel_t channel, const char *property-name,
const char *
value);

Parameters

channel - Channel instance for which the property is being set.

property-name - Name of the property.

value - Value of the property.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_channel_get_property

Description

Returns the current value of a channel property. If the returned value+1 is greater than the size of the passed buffer, the returned value is truncated. The user must allocate a buffer with enough space to hold the value (returned value+1) and call the function again.

Syntax

int teja_channel_get_property(teja_channel_t channel, const char *property-name,
const char *
value, int buf-size);

Parameters

channel - Channel instance for which the property is read.

property-name - Name of the property.

value - Returned value of the property.

buf-size - Size of the character buffer that was passed for the return value.

Return Values

int - Returns the length of the current value of the property.

teja_memory_pool_declare

Description

Creates a new memory pool instance in the software architecture.

Syntax

teja_memory_pool_t teja_memory_pool_declare(const char *name, const char *type, int num-nodes, long node-size, teja_thread_t *getters, teja_thread_t *setters, const char *memory-bank);

Parameters

name - Name of the memory pool.

type - Type of the memory pool.

num-nodes - Number of nodes to allocate in the memory pool.

node-size - Size in bytes for each node.

getters - NULL-terminated list of getter threads.

setters - NULL-terminated list of setter threads.

memory-bank - Name of the memory bank (in the hardware architecture) from which the memory is allocated.

Return Values

teja_memory_pool_t - Returns the memory pool instance.

teja_memory_pool_set_property

Description

Sets a new value for a memory pool property.

Syntax

int teja_memory_pool_set_property(teja_memory_pool_t memory-pool,
const char *property-name, const char *value);

Parameters

memory-pool - Memory pool instance for which the property is being set.

property-name - Name of the property.

value - Value of the property.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_memory_pool_get_property

Description

Returns the current value of a memory pool property. If the returned value+1 is greater than the size of the passed buffer, the returned value is truncated. The user must allocate a buffer with enough space to hold the value (returned value+1) and call the function again.

Syntax

int teja_memory_pool_get_property(teja_memory_pool_t memory-pool,
const char *property-name, const char *value, int buf-size);

Parameters

memory-pool - Memory pool instance for which the property is being read.

property_name - Name of the property.

value - Value of the property.

buf-size - Size of the character buffer that was passed for the return value.

Return Values

int - Returns the length of the current value of the property.

teja_queue_declare

Description

Creates a new queue instance in the software architecture.

Syntax

teja_queue_t teja_queue_declare(const char *name,
const char
*type, teja_thread_t *enqueuers, teja_thread_t *dequeuers);

Parameters

name - Name of the queue.

type - Type of the queue.

enqueuers - NULL-terminated list of enqueuers threads.

dequeuers - NULL-terminated list of dequeuers threads.

Return Values

teja_queue_t - Returns queue instance.

teja_queue_set_property

Description

Sets a new value for a queue property.

Syntax

int teja_queue_set_property(teja_queue_t queue, const char *property-name,
const char *value);

Parameters

queue - Queue instance for which the property is being set.

property-name - Name of the property.

value - Value of the property.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_queue_get_property

Description

Returns current value of a queue property. If the returned value+1 is greater than the size of the passed buffer, the returned value is truncated. The user must allocate a buffer with enough space to hold the value (returned value+1) and call the function again.

Syntax

int teja_queue_get_property(teja_queue_t queue, const char *property-name,
const char *value, int buf-size);

Parameters

queue - Queue instance for which the property is being read.

property-name - Name of the property.

value - Returned value of the property.

buf-size - Size of the character buffer that was passed for the return value.

Return Values

int - Returns the length of the current value of the property.

teja_mutex_declare

Description

Creates a new mutex instance in the software architecture.

Syntax

teja_mutex_t teja_mutex_declare(const char *name,
const char *type, teja_thread_t *users);

Parameters

name - Name of the mutex.

type - Type of the mutex.

users - NULL-terminated list of user-threads.

Return Values

teja_mutex_t - Returns a new mutex instance.

teja_mutex_set_property

Description

Sets a new value for a mutex property.

Syntax

int teja_mutex_set_property(teja_mutex_t mutex, const char *property-name,
const char *value);

Parameters

mutex - Mutex instance for which the property is being set.

property-name - Name of the property.

value - Value of the property.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.

teja_mutex_get_property

Description

Returns a current value of a mutex property. If the returned value+1 is greater than the size of the passed buffer, the returned value is truncated. The user must allocate a buffer with enough space to hold the value (returned value+1) and call the function again.

Syntax

int teja_mutex_get_property(teja_mutex_t mutex, const char *property-name,
const char *value, int buf-size);

Parameters

mutex - Mutex instance for which the property is being read.

property-name - Name of the property.

value - Returned value of the property.

buf-size - Size of the character buffer that was passed for the return value.

Return Values

int - Returns the length of the current value of the property.

teja_lookup_channel

Description

Looks up the channel instance in the software architecture using the channel name as a key.

Syntax

teja_channel_t teja_lookup_channel(const char *channel-name);

Parameters

channel-name - Name of the channel.

Return Values

teja_channel_t - Returns the found channel instance or NULL.

teja_lookup_memory_pool

Description

Looks up the memory pool instance in the software architecture using the memory pool name as a key.

Syntax

teja_memory_pool_t teja_lookup_memory_pool(const char *memory-pool-name);

Parameters

memory-pool-name - Name of the memory pool.

Return Values

teja_memory_pool_t - Returns the found memory pool instance or NULL.

teja_lookup_queue

Description

Looks up the queue instance in the software architecture using the queue name as a key.

Syntax

teja_queue_t teja_lookup_queue(const char *queue-name);

Parameters

queue-name - Name of the queue.

Return Values

teja_queue_t - Returns the found queue instance or NULL.

teja_lookup_mutex

Description

Looks up the mutex instance in the software architecture using the mutex name as a key.

Syntax

teja_mutex_t teja_lookup_mutex(const char *mutex-name);

Parameters

mutex-name - Name of the mutex.

Return Values

teja_mutex_t - Returns the found mutex instance or NULL.

teja_process_add_symbol*

Description

Adds a definition of symbol in the process same as passing -D option on the command line.

Syntax

int teja_process_add_symbol(teja_process_t process, const char *symbol,
const char *value);

Parameters

process - Process instance for which the symbol is being defined.

symbol - String that represents the symbol.

value - String that represents the value for the symbol.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.


Map API

The map API is used to describe the mapping between user-application source objects (functions and variables) and hardware architecture or software architecture.

The teja_mapping.h file contains the declaration of the Map data types and API functions.

Map API Data Types

The following data type is used in the map definitions.


TABLE 1-3 Map API Data Type
teja_mapping_t

Every mapping returns a handle of type teja_mapping_t.


Map API Functions

teja_map_function_to_thread

Description

Maps a function to run on a thread.

Syntax

teja_mapping_t teja_map_function_to_thread(const char *function-name,
const char *thread-name);

Parameters

function-name - Name of the function from the source files.

thread-name - Name of the thread.

Return Values

teja_mapping_t - Returns a handle that represents this mapping.

teja_map_variable_to_memory

Description

Maps a variable to memory.

Syntax

teja_mapping_t teja_map_variable_to_memory(const char *var-name,
const char *memory-name);

Parameters

var-name - Name of the variable from the source files.

memory-name - Name of the memory bank.

Return Values

teja_mapping_t - Returns a handle that represents this mapping.

teja_alias_variable

Description

Creates an alias for a variable. This function helps in mapping two or more variables from different sources to the same location in memory. The user maps any one of these variables to a memory bank using teja_map_variable_to_memory. The remaining variables are mapped to that variable using this function.

Syntax

teja_mapping_t teja_alias_variable(const char *var-name,
const char
*target-var-name);

Parameters

var-name - Name of the variable from the source files.

target-var-name - Name of the variable that the var_name maps to.

Return Values

teja_mapping_t - Returns a handle that represents this mapping.

teja_map_variables_to_memory

Description

Maps one or more variables to memory using a regular expression. A regular expression can result in one or more variables from the source files. All the resultant variables are mapped to the memory bank.

Syntax

teja_mapping_t *teja_map_variables_to_memory(const char *var-regexp,
const char *memory-name);

Parameters

var-regexp - Regular expression that results in one or more variables from the source files.

memory-name - Name of the memory bank to map.

Return Values

teja_mapping_t * - Returns an array of handles that represents this mapping.

teja_map_initialization_function_to_process

Description

Maps an initialization function to the process. This function is executed before any thread starts execution.

Syntax

teja_mapping_t teja_map_initialization_function_to_process
(const char
*function, const char *process);

Parameters

function - Name of the function.

process - Name of the process as defined in the software architecture.

Return Values

teja_mapping_t - Returns a handle that represents this mapping.

teja_mapping_set_property

Description

Sets a new value for a mapping.

Syntax

int teja_mapping_set_property(teja_mapping_t mapping-handle,
const char *property-name, const char *value);

Parameters

mapping-handle - Mapping handle for which the property is being set.

property-name - Name of the property.

value - Value of the property.

Return Values

int - Returns TEJA_SUCCESS or error code for failure.


Error-Handling API

The error-handling API can be used to provide a user-defined function or behavior when an error occurs in the configuration API. The error-handling API is not available for the User API. The teja_error.h file contains the declaration of the error-handling data types and API functions.

Error-Handling API Data Types

The following data type is used in the error-handling definitions.


TABLE 1-4 Error-Handling Data Types
teja_error_handler_t

Represents a type for the error handler function.


Error-Handling API Functions

teja_abort

Description

When this function is called, the control is transferred to the caller of the library entry point function, which reports the error appropriately. When executed from the command line, tejacc terminates returning the provided error-code.

Syntax

void teja_abort(int error-code, const char *error-message,);

Parameters

error-code - Error code.

error-message - Error message.

Return Values

void - Aborts the execution of the hardware architecture, software architecture, or mapping definition.

teja_register_error_handler

Description

Enables the user to implement a custom behavior in case of errors. When an error is encountered during the execution of a Sun Netra DPS hardware architecture, software architecture, or mapping API function, the registered error handler function is called.

Syntax

teja_error_handler_t teja_register_error_handler(teja_error_handler_t handler);

Parameters

handler - Error handler function.

Return Values

teja_error_handler_t - The previously registered error handler.

Error-Handler Function Prototype

int fn(int error_code, const char *error_msg);

The handler function is called with an error code and message, and returns a value. The value returned by the handler is in turn returned by the Sun Netra DPS API function that encountered the error. The default error handler does not return a value, but invokes teja_abort(), with the effect of transferring the control immediately to the caller of the library entry point function. The user can replace the default error handler using the teja_register_error_handler() function. For example, the user can replace the default handler with one that just returns an error code as follows:


#define ERR_SHOULD_RETURN_NULL (TEJA_ERROR_CREATE_FAILED | 
                                TEJA_ERROR_LOOKUP_FAILED) 
int my_error_handler(int code, const char* msg) {
  if (code & ERR_SHOULD_RETURN_NULL) { 
    /* code is an error during creation or lookup, 
     * should return NULL rather than error code 
     */ 
    return (int)NULL; 
  else 
    return code; 
} 
  
void entry_fn(void) { 
  teja_register_error_handler(my_error_handler); 
  ...



Note - The software architecture, hardware architecture, and mapping have three independent error handlers, so if the user wants to replace the default error handler, the user must register the new one in each entry point function.



CMT-Specific Hardware Architecture Constants

The include/csp/sun/teja_cmt.h file lists all the hardware object types and properties that are supported by CMP CSP.

CMT-Specific Hardware Architecture Types


TABLE 1-5 CMT-Specific Hardware Architecture Types

Type

Name

Description

Architecture

TEJA_ARCHITECTURE_TYPE_CMT1_CHIP

Architecture type that represents the CMT 1 chip.

 

TEJA_ARCHITECTURE_TYPE_CMT2_CHIP

Architecture type that represents the CMT 2 chip.

 

TEJA_ARCHITECTURE_TYPE_CMT1_BOARD

Architecture type that represents a board containing the CMT 1 chip.

 

TEJA_ARCHITECTURE_TYPE_CMT2_BOARD

Architecture type that represents a board containing the CMT 2 chip.

 

TEJA_ARCHITECTURE_TYPE_USER_DEFINED_

Architecture that represents a user-defined architecture that is not known to tejacc.d

Processor

TEJA_PROCESSOR_TYPE_CMT1

Processor type that represents a single strand in the CMT 1 chip.

 

TEJA_PROCESSOR_TYPE_CMT2

Processor type that represents a single strand in the CMT 2 chip.

Memory

TEJA_MEMORY_TYPE_CMT1_DRAM

Memory type that represents the DRAM memory for the CMT 1 architecture.

 

TEJA_MEMORY_TYPE_CMT2_DRAM

Memory type that represents the DRAM memory for the CMT 2 architecture.

 

TEJA_MEMORY_TYPE_OS_BASED

Memory type that represents OS-based memory in the architecture.

Bus

TEJA_BUS_TYPE_CMT1_DRAM

Bus type that represents the DRAM bus for the CMT 1 architecture.

 

TEJA_BUS_TYPE_CMT2_DRAM

Bus type that represents the DRAM bus for the CMT 2 based shared memory stack implementation.

 

TEJA_BUS_TYPE_OS_BASED

Bus type that represents a bus that connects OS-based memory to other objects.

 

TEJA_BUS_TYPE_PCI

Bus type that represents PCI bus in the architecture.


CMT-Specific Hardware Architecture Properties


TABLE 1-6 CMT-Specific Hardware Architecture Properties

Property

Name

Description

Architecture

TEJA_PROPERTY_BSP_PATH

Sets the path to the board support package (BSP) located on the host machine. There is no default value set.

Processor

TEJA_PROPERTY_CLOCK_FREQUENCY

Sets the clock frequency of the processor. There is no default value set.

Memory

TEJA_PROPERTY_MEMORY_SIZE

Sets the size of the memory in bytes. The default value is 256.

 

TEJA_PROPERTY_MEMORY_OFFSET

Sets the offset from where the memory is available for the user application. The default value is 0.

 

TEJA_PROPERTY_MEMORY_PHYSICAL_ADDRESS

Sets the actual physical base address that is used to access the memory. The default value is 0.

 

TEJA_PROPERTY_MEMORY_BIT_ALIGNMENT

Sets the alignment of the memory in bits. The default value is 32.

 

TEJA_PROPERTY_MEMORY_RESERVE_WORD_0

When set to true, makes location 0 non writable. The default value is true.

 

TEJA_PROPERTY_MEMORY_IS_OS_BASED

When set to true, marks the memory OS-based. The default value is false.

 

TEJA_PROPERTY_MEMORY_NO_ADDRESS_CONVERSION

When set to true, hal conversion is necessary. The default value is true.



CMT-Specific Software Architecture Constants

CMT-Specific Software Architecture Types


TABLE 1-7 CMT-Specific Software Architecture Types

Type

Name

Description

OS

TEJA_OS_TYPE_RAW

The only type of OS that is supported for CMT CSP.

Channel

TEJA_GENERIC_CHANNEL_SHARED_MEMORY_OS_BASED

Channel type that uses OS-based shared memory implementation.

 

TEJA_GENERIC_CHANNEL_SHARED_MEMORY

Channel type that uses non-OS-based shared memory implementation.

Memory pool

TEJA_GENERIC_MEMORY_POOL_SHARED_MEMORY_OS_BASED

Memory pool type that uses OS-based shared memory implementation.

 

TEJA_GENERIC_MEMORY_POOL_SHARED_MEMORY

Memory pool type that uses non-OS-based shared memory implementation.

 

TEJA_GENERIC_MEMORY_POOL_SHARED_MEMORY_CIRCULAR_BUFFER_OS_BASED

Memory pool type that uses an OS based shared memory circular buffer implementation

 

TEJA_GENERIC_MEMORY_POOL_SHARED_MEMORY_CIRCULAR_BUFFER

Memory pool type that uses a non-OS-based shared memory circular buffer implementation

Queue

TEJA_GENERIC_QUEUE_SHARED_MEMORY_OS_BASED

Queue type that uses OS-based shared memory implementation.

 

TEJA_GENERIC_QUEUE_SHARED_MEMORY

Queue type that uses non-OS-based shared memory implementation.

Mutex

TEJA_GENERIC_MUTEX_SHARED_MEMORY_OS_BASED

Mutex type that uses OS-based shared memory implementation.

 

TEJA_CMT_MUTEX_SPINLOCK

Mutex type that uses spin lock implementation.


CMT-Specific Software Architecture Properties


TABLE 1-8 CMT-Specific Software Architecture Properties

Property

Name

Description

Thread

TEJA_PROPERTY_THREAD_ASSIGN_TO_PROCESSOR

Enables the user to assign a thread to a specific processor (hardware thread). Specify the processor using a fully qualified name from the hardware architecture. The default value for this property is NULL so the thread is not assigned to any specific processor by default.

Channel

TEJA_PROPERTY_CHANNEL_BUFFER_SIZE

Sets the buffer size for the circular buffer size. The default value is 1024.

Memory Pool

TEJA_PROPERTY_MEMORY_POOL_ALIGNMENT

Sets the alignment for the memory pool nodes. The default value is 32.