Path Profiling
API Reference Manual  /  Simulator API  /  Simulator API Functions  / 

Processor

SIM_clear_augmentation_bit, SIM_get_augmentation_bit, SIM_set_augmentation_bit

Name

SIM_clear_augmentation_bit, SIM_get_augmentation_bit, SIM_set_augmentation_bit — convenience functions to work with augmented memory bits

Synopsis

C and DML

#include <simics/processor-api.h> // in C
import "simics/processor-api.dml"; // in DML

FORCE_INLINE void
SIM_clear_augmentation_bit(uint8 *tag_page_data, unsigned pofs);

FORCE_INLINE int
SIM_get_augmentation_bit(uint8 *tag_page_data, unsigned pofs);

FORCE_INLINE void
SIM_set_augmentation_bit(uint8 *tag_page_data, unsigned pofs);

Description

The SIM_clear_augmentation_bit, SIM_get_augmentation_bit, and SIM_set_augmentation_bit functions are used to modify and read augmented memory bits. The direct_memory_tags interface supports augmented memory through the data field in the direct_memory_tags_t struct.

Execution Context

Cell Context

SIM_disassemble_address, tuple_int_string_t

Name

SIM_disassemble_address, tuple_int_string_t — disassemble address

Synopsis

C and DML

#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML

tuple_int_string_t
SIM_disassemble_address(conf_object_t *NOTNULL cpu, generic_address_t address,
                        int logical, int sub_operation);

#include <simics/device-api.h> // in C
// always available in DML

typedef struct {
        int integer;
        char *string;
} tuple_int_string_t;

Python

import simics

simics.SIM_disassemble_address(...)

Description

This function disassembles the instruction at the given address. Address is either a physical address (logical == 0) or a logical address (logical == 1). For VLIW architectures, sub_operation is used to select which sub-operation to disassemble. A request for a not present sub-operation (for example sub_operation != 0 for non-VLIW architectures) results in the int part of the return tuple being set to zero.

A tuple_int_string_t is returned which contains the disassembly string as well as the length of the instruction in bytes. For the Sparc and PowerPC targets the length is always 4 bytes.

This function can be more convenient to use than the disassemble function in the processor_info interface.

Exceptions

SimExc_General Thrown if arguments are invalid.

SimExc_Memory Thrown if the address is undefined or not mapped in the MMU (for logical addresses).

Execution Context

Cell Context

SIM_get_all_processors

Name

SIM_get_all_processors — get list of all processors

Synopsis

C and DML

#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML

attr_value_t
SIM_get_all_processors();

Python

import simics

simics.SIM_get_all_processors(...)

Description

Return a list of all processor objects.

Return Value

List of processors.

Execution Context

Cell Context

SIM_get_processor

Name

SIM_get_processor — get processor pointer from number

Synopsis

C and DML

#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML

conf_object_t *
SIM_get_processor(int proc_no);

Python

import simics

simics.SIM_get_processor(...)

Description

Converts processor id number to processor pointer. This function cannot be used until a configuration had been loaded successfully.

Exceptions

SimExc_Index Thrown if no processor with number proc_no exists.

Return Value

The processor pointer, nullptr on failure.

Execution Context

Cell Context

See Also

SIM_number_processors

SIM_get_processor_number

Name

SIM_get_processor_number — get the number of a processor

Synopsis

C and DML

#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML

int
SIM_get_processor_number(const conf_object_t *NOTNULL cpu);

Python

import simics

simics.SIM_get_processor_number(...)

Description

Returns the global processor number for a processor in Simics.

Return Value

The processor number

Execution Context

Cell Context

SIM_number_processors

Name

SIM_number_processors — number of processors

Synopsis

C and DML

#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML

int
SIM_number_processors();

Python

import simics

simics.SIM_number_processors(...)

Description

Returns the current total number of processors in the system.

Return Value

Number of processors.

Execution Context

Cell Context

See Also

SIM_get_processor

SIM_processor_privilege_level

Name

SIM_processor_privilege_level — return the current privilege level for a processor

Synopsis

C and DML

#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML

int
SIM_processor_privilege_level(conf_object_t *NOTNULL cpu);

Python

import simics

simics.SIM_processor_privilege_level(...)

Description

Return the current privilege level for a processor. The definition of privilege levels depends on the processor type.

Return Value

Exceptions

SimExc_General Thrown if cpu does not implement the privilege level interface function.

Execution Context

Cell Context

SIM_reset_processor

Name

SIM_reset_processor — reset the processor

Synopsis

C and DML

#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML

void
SIM_reset_processor(conf_object_t *NOTNULL cpu, int hard_reset);

Python

import simics

simics.SIM_reset_processor(...)

Description

Performs a reset on the processor, causing a System Reset exception to be taken when execution continues. cpu is the processor that should be reset. hard_reset indicates if a soft (0) or hard (1) (power-on type) reset should be performed. If a hard reset is requested, a number of register are initiated with default values.

Exceptions

SimExc_General Thrown if cpu does not implement reset.

Execution Context

Cell Context

Path Profiling