SIM_load_binary — read an executable file into memory
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
physical_address_t
SIM_load_binary(conf_object_t *NOTNULL obj, const char *NOTNULL file,
physical_address_t offset, bool use_pa, bool verbose);
import simics
simics.SIM_load_binary(...)
Read a binary file (ELF, Motorola S-Record, PE32, PE32+, or TI COFF format) into memory and return the code entry point.
The file will be loaded at the address formed by adding the virtual load address from the file, with the offset offset. If the flag use_pa is set, the ELF physical load address is used instead. The verbose flag will cause Simics to print info about the binary to the console.
The memory space to load into is given in the obj parameter. If the given space is a CPU object, its current virtual address space will be used, and addresses will be translated before writing to the physical memory space attached to the CPU.
If the file is not found in the current directory, the search path (see add-directory) is used to find the file.
SimExc_IOError Thrown if there was a problem reading the file.
SimExc_General Thrown if binary cannot be read into memory.
The code entry address.
Global Context
SIM_load_file — read a file into memory
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
void
SIM_load_file(conf_object_t *NOTNULL obj, const char *NOTNULL file,
physical_address_t base_address, bool verbose);
import simics
simics.SIM_load_file(...)
Loads the contents of file into memory starting at address base_address. The obj argument can either be a processor, a memory-space, or an image object. In case of a processor, the address is interpreted as a virtual address.
The file can be either a raw binary file or a file in the craff format.
The verbose flag will cause Simics to print some information about the load.
SimExc_IOError Thrown if there was a problem reading the file.
SimExc_General Thrown if file cannot be read into memory.
Cell Context
SIM_read_byte, SIM_write_byte — read/write byte from a memory space
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
uint8
SIM_read_byte(conf_object_t *NOTNULL obj, generic_address_t paddr);
void
SIM_write_byte(conf_object_t *NOTNULL obj,
generic_address_t paddr, uint8 value);
import simics
simics.SIM_read_byte(...)
simics.SIM_write_byte(...)
Read or write a byte from a given address in the memory space obj.
SimExc_Memory Thrown if the memory space threw an exception
SimExc_General Thrown if the object does not implement the memory space interface.
The byte read.
Cell Context
SIM_read_phys_memory — read data from a physical address
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
uint64
SIM_read_phys_memory(conf_object_t *NOTNULL cpu,
physical_address_t paddr,
int length);
import simics
simics.SIM_read_phys_memory(...)
Reads length bytes from address paddr in the physical memory space associated with the processor cpu.
Up to 8 bytes can be read in one call. The memory access will be of inquiry type, i.e. no timing-model or snoop device will be called.
For non-inquiry accesses, use the memory_space interface directly.
SimExc_Memory Thrown if no memory defined at paddr.
SimExc_Attribute Thrown if length is out of range.
SimExc_General Thrown if the processors physical memory does not implement the necessary interface methods.
The read data, zero-extended.
Cell Context
SIM_read_phys_memory_tags, SIM_write_phys_memory_tags — access auxiliary bits in physical memory
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
uint64
SIM_read_phys_memory_tags(conf_object_t *NOTNULL mem_space,
physical_address_t paddr, unsigned ntags);
void
SIM_write_phys_memory_tags(conf_object_t *NOTNULL mem_space,
physical_address_t paddr,
uint64 tag_bits, unsigned ntags);
import simics
simics.SIM_read_phys_memory_tags(...)
simics.SIM_write_phys_memory_tags(...)
Reads or writes ntags auxiliary bits starting at paddr in the physical memory space mem_space. Up to 64 bits can be accessed at once. The bits are specified and returned right-aligned, least significant bit corresponding to the lowest address.
Cell Context
SIM_write_phys_memory — write data to a physical address
#include <simics/simulator-api.h> // in C
import "simics/simulator-api.dml"; // in DML
void
SIM_write_phys_memory(conf_object_t *NOTNULL cpu,
physical_address_t paddr,
uint64 value, int length);
import simics
simics.SIM_write_phys_memory(...)
Writes length bytes to address paddr in the physical memory space associated with the processor cpu.
Up to 8 bytes can be written in one call. The memory access will be of inquiry type, i.e. no timing-model or snoop device will be called.
SimExc_Memory Thrown if no memory defined at paddr.
SimExc_Attribute Thrown if length is out of range.
SimExc_General Thrown if the processors physical memory does not implement the necessary interface methods.
Cell Context