| 
    TEMU
    4.4
    
   The Terma Emulator 
   | 
 
#include <stdint.h>#include <stdlib.h>#include "temu-c/Support/Attributes.h"#include "temu-c/Support/Objsys.h"#include "temu-c/Memory/Memory.h"
Go to the source code of this file.
Data Structures | |
| struct | temu_FieldInfo | 
| struct | temu_RegisterInfo | 
| struct | temu_RegisterBankInfo | 
| struct | temu_ModelRegInfo | 
Macros | |
| #define | TEMU_FIELD_WR (1 << 0) | 
| #define | TEMU_FIELD_WARM_RESET (1 << 1) | 
| #define | TEMU_FIELD_INFO_NULL ((temu_FieldInfo){NULL, NULL, 0, 0}) | 
Typedefs | |
| typedef struct temu_RegisterBank | temu_RegisterBank | 
| typedef struct temu_Register | temu_Register | 
| typedef struct temu_Field | temu_Field | 
| #define TEMU_FIELD_INFO_NULL ((temu_FieldInfo){NULL, NULL, 0, 0}) | 
| #define TEMU_FIELD_WARM_RESET (1 << 1) | 
| #define TEMU_FIELD_WR (1 << 0) | 
| typedef struct temu_Field temu_Field | 
| typedef struct temu_Register temu_Register | 
| typedef struct temu_RegisterBank temu_RegisterBank | 
| TEMU_API void temu_addField | ( | temu_Register * | R, | 
| const char * | Name, | ||
| uint64_t | Mask, | ||
| uint64_t | Reset, | ||
| uint64_t | Flags, | ||
| const char * | Doc | ||
| ) | 
Add field to meta register
Adds a field to the meta register.
| R | Meta register pointer. | 
| Name | Name of of field (must be a C-compatible identifier) | 
| Mask | Mask identifying the bits in the register corresponding to the field. Mask must contain consecutive bits only. | 
| Reset | Reset value. | 
| Flags | Flags used: TEMU_FIELD_WR means field is writable, TEMU_FIELD_WARM_RESET means the field is subject to reset actions also on warm resets. | 
| Doc | Documentation string | 
| TEMU_API temu_Register* temu_addRegister | ( | temu_RegisterBank * | Bank, | 
| const char * | Name, | ||
| int | Offset, | ||
| temu_Type | Typ, | ||
| int | Count, | ||
| temu_PropWriter | Wr, | ||
| temu_PropReader | Rd, | ||
| const char * | Doc, | ||
| uint32_t | DeviceOffset, | ||
| uint32_t | Stride | ||
| ) | 
Add register property to class
Adds a register with the given name to a class. It returns a reference to a meta register which can be used to add fields.
| Bank | Register bank to add register to | 
| Name | Name of register (must be a valid C-identifier) | 
| Offset | Offset to storage element in the device struct. | 
| Typ | Type of register, note that registers are limited to unsigned integer types with fixed width. | 
| Count | Number of registers (normally 1) | 
| Wr | Register write function | 
| Rd | Register read function | 
| Doc | Documentation string for register. | 
| DeviceOffset | Offset of register in memory system. This is the same offset that is used in the memory transaction interface. | 
| Stride | In case the register is an array of registers, then the stride is used for the offset in physical address space between each register. | 
| TEMU_API temu_RegisterBank* temu_addRegisterBank | ( | temu_Class * | C, | 
| const char * | Name, | ||
| temu_MemAccessIface * | MemAccessIface | ||
| ) | 
Adds a register bank to a TEMU class
| C | Pointer to the TEMU class | 
| Name | Name of the register | 
| MemAccessIface | Pointer to the register memory access interface | 
| TEMU_API temu_Register* temu_addRegisterWithFields | ( | temu_RegisterBank * | Bank, | 
| const char * | Name, | ||
| int | Offset, | ||
| temu_Type | Typ, | ||
| int | Count, | ||
| temu_PropWriter | Wr, | ||
| temu_PropReader | Rd, | ||
| const char * | Doc, | ||
| uint32_t | DeviceOffset, | ||
| uint32_t | Stride, | ||
| temu_FieldInfo | Fields[] | ||
| ) | 
| TEMU_API uint64_t temu_getFieldValue | ( | temu_Object * | Obj, | 
| const char * | RegName, | ||
| unsigned | RegIdx, | ||
| const char * | FieldName | ||
| ) | 
Retrieve the value of a field in a register
| Obj | The object of the class the has the register | 
| RegName | Register name | 
| RegIdx | Register index | 
| FieldName | Field name | 
| const TEMU_API temu_ModelRegInfo* temu_getModelRegisterBankInfo | ( | temu_Class * | C | ) | 
Get list of class register banks The returned object is thread local. It will be destroyed on the next call in the current thread.
| C | The class object. | 
| TEMU_API temu_Register* temu_getRegister | ( | temu_RegisterBank * | Bank, | 
| const char * | Name | ||
| ) | 
Get a register from a register bank by name
| Bank | Pointer to the register bank object | 
| Name | Name of the register | 
| TEMU_API temu_RegisterBank* temu_getRegisterBank | ( | temu_Class * | C, | 
| const char * | Name | ||
| ) | 
Get a register bank from a class by name
| C | Pointer to the TEMU class | 
| Name | Name of the register bank | 
| const TEMU_API temu_RegisterBankInfo* temu_getRegisterBankInfo | ( | temu_Class * | C, | 
| const char * | RegBankName | ||
| ) | 
| const TEMU_API char* temu_getRegisterBankName | ( | temu_RegisterBank * | Bank | ) | 
Retrieves the register bank name from its object
| Bank | Pointer to the register bank name | 
| TEMU_API uint64_t temu_getRegisterColdResetValue | ( | temu_Register * | Reg | ) | 
Returns the cold reset value of the register (computed from the field info data). Cold reset is also known as a hard reset, and implies that the power has been off for some time.
| Reg | Pointer to the register | 
| const TEMU_API char* temu_getRegisterDocs | ( | temu_Register * | R | ) | 
Get the documentation of a register as a string
| R | Pointer to the register | 
| const TEMU_API temu_RegisterInfo* temu_getRegisterInfo | ( | temu_Class * | C, | 
| const char * | RegName | ||
| ) | 
Get register info for named register The returned object is thread local. It will be destroyed on the next call in the current thread.
| C | The class object. | 
| RegName | Register name. | 
| const TEMU_API char* temu_getRegisterName | ( | temu_Register * | R | ) | 
Retrieve register name from pointer
| R | Pointer to the register | 
| TEMU_API uint64_t temu_getRegisterReadMask | ( | temu_Register * | Reg | ) | 
Get the current read mask of a register
| Reg | Pointer to the register | 
| TEMU_API uint64_t temu_getRegisterWarmResetValue | ( | temu_Register * | Reg | ) | 
Returns the warm reset value of the register
| Reg | Pointer to the register | 
| TEMU_API uint64_t temu_getRegisterWriteMask | ( | temu_Register * | Reg | ) | 
Get the current write mask of a register
| Reg | Pointer to the register | 
| TEMU_API uint64_t temu_readFieldValue | ( | temu_Object * | Obj, | 
| const char * | RegName, | ||
| unsigned | RegIdx, | ||
| const char * | FieldName | ||
| ) | 
Retrieve the value of a field in a register with side-effects.
| Obj | The object of the class the has the register | 
| RegName | Register name | 
| RegIdx | Register index | 
| FieldName | Field name | 
| TEMU_API int temu_setFieldValue | ( | temu_Object * | Obj, | 
| const char * | RegName, | ||
| unsigned | RegIdx, | ||
| const char * | FieldName, | ||
| uint64_t | Value | ||
| ) | 
Set a field's value in a register
| Obj | The object that contains the register | 
| RegName | Register name | 
| RegIdx | Register index | 
| FieldName | Field name | 
| Value | The value to be set | 
| TEMU_API int temu_writeFieldValue | ( | temu_Object * | Obj, | 
| const char * | RegName, | ||
| unsigned | RegIdx, | ||
| const char * | FieldName, | ||
| uint64_t | Value | ||
| ) | 
Set a field's value in a register with side-effects
| Obj | The object that contains the register | 
| RegName | Register name | 
| RegIdx | Register index | 
| FieldName | Field name | 
| Value | The value to be set |