Provided by
Simics Core
Class Hierarchy
Interfaces Implemented
log_object, map_demap, breakpoint, translate, memory_space
Instances of the memory-space class provide linear address spaces into which devices and memory can be mapped.


Attributes inherited from class conf-object
attributes, classname, component, iface, name, object_id, queue
Attributes inherited from class log-object
access_count, log_buffer, log_buffer_last, log_buffer_size, log_group_mask, log_groups, log_level, log_type_mask
Attribute List
Session attribute; read/write access; type: [[i+]*]; integer indexed; indexed type: [i*].

((id, start, stop)*) Tells which breakpoints (identified by their id) are set for the space object. start and stop specifies the interval for the breakpoint.

Optional attribute; read/write access; type: [oiio|n]|n.

(object, function, offset, target). An access not targeting any object in the map attribute will be forwarded to the default target. target should be non-nil if and only if object is a translation object.

Optional attribute; read/write access; type: [[ioiii]|[ioiiio|n]|[ioiiio|ni]|[ioiiio|nii]|[ioiiio|niii]*].

((base, object, function, offset, length, target, priority, align-size, byte-swap)*). Maps zero or more objects in the memory space. object must implement one of the translate, bridge, ram, io_memory, port_space,or rom interfaces, searched for in that order. (Some of these interfaces are Simics internal and can not be implemented by user-defined classes).
If object implements the translate or bridge interface, then the target field must be set to an object, which in turn must implement either the memory_space, ram or rom interface, target should be NIL otherwise.
object is mapped in the address space from base to base + length − 1 (inclusive). Both function and offset are handed on to the mapped object through the appropriate interface. The function number, that is device specific, provides a way for devices with multiple mappings to figure out which mapping that is accessed. The priority (0 – 255) is used when multiple mappings exist on the same address. The mapping with the lowest number has the highest priority.
If the map target does not support large accesses, then align-size can be set to the maximum allowed size. Accesses spanning align boundaries will be split into several smaller transactions. By default, the align size is set to 4 for port space devices, 8 for other devices and 8192 for memory. Mappings with an align-size of 2, 4, and 8 may set the byte-swap field to 1. This can be used to model bridges that perform byte swapping on a specific bus width. It is also possible to set byte-swap to 3 to swap all bytes in the transaction based on the access size. The bus and transaction byte-swap variants can be combined by setting a value of 2. Consider a mapping with a 4-byte align-size and memory at address 0 that contains the bytes: 0x00 0x01 0x02 0x03. A 2-byte big-endian read access at address 0 will give the following values as results. No swap: 0x0001, bus swap: 0x0302, bus and transaction swap: 0x0203 and transaction swap: 0x0100

Pseudo attribute; read/write access; ; integer or list indexed; indexed type: Data.

Read from or write to the space. Data is read without side effects (with the inquiry bit set), while writes are allowed to trigger side effects (including actually writing the data).

Optional attribute; read/write access; type: Object or Nil.

The snoop_device is similar to a timing-model, but called after a memory operation is complete. The object has to implement the "snoop_memory" interface, but the returned stall time is ignored.

Optional attribute; read/write access; type: Object or Nil.

The timing_model is called when a memory operation reaches the memory-space, before it is performed. The model has to implement the "timing_model" interface.

Command List

Commands defined by interface log_object
log, log-group, log-level, log-size, log-type
Commands defined by interface breakpoint
break, tbreak
add-mapmap device in a memory-space
del-mapremove device map from a memory-space
getget value of physical address
infoprint information about the device
load-binaryload binary (executable) file into memory
load-fileload file into memory
maplist memory map
setset physical address to specified value
xexamine raw memory contents

Command Descriptions

<memory-space>.add-map device base length [function] [offset] [target] [priority] [align-size] ["swap"]
Map device into a memory-space at address base and with length length. Different mappings of the same device may be indentified by a device specific function number. For translator and bridge mappings, a target device should be given. The mapping may specify an offset into the device's memory space, using the offset argument. If several device mappings overlap, the priority is used to select what device will receive memory accesses. The priority is an integer between 0 and 255, where 0 is highest. For devices that do not support large accesses, the align-size governs how accesses are split before the device is accessed. A device mapping may swap the bytes of an access based on the swap argument, that should be one of none, bus, bus-trans and trans. For a description of these, see the documentation of the map attribute in the memory-space class.
See Also
<memory-space>.map, <memory-space>.del-map
<memory-space>.del-map device [function] [base]
Remove the mapping of device from a memory-space. If a function number is given by the function argument, then only mappings with a matching number are removed. If an address is given, only mappings with a matching address are removed. If both a function and an address are specified, then only mappings with a matching function number, at the specified address, are removed.
See Also
<memory-space>.map, <memory-space>.add-map
<memory-space>.get address [size] [-l] [-b]
get address [size] [-l] [-b]
Get value of physical memory location. The size argument specifies how many bytes should be read. This defaults to 4, but can be any number of bytes between 1 and 8 (inclusive).

The -l and -b flags are used to select little-endian and big-endian byte order, respectively. If neither is given, the byte order of the currently selected processor is used.

This command operates on the physical memory associated with the current processor.

See Also
x, set, signed
Print detailed information about the configuration of the device.
<memory-space>.load-binary filename [offset] [-v] [-pa]
<processor>.load-binary filename [offset] [-v] [-pa]
load-binary filename [offset] [-v] [-pa] [-l]
Load a binary (executable) file into the given physical or virtual memory space. The supported formats are ELF, Motorola S-Record, PE32 and PE32+. If an offset is supplied, it will be added to the load address taked from the file.

By default the virtual load address from the file is used, but the physical address can be used instead by specifying the -pa flag.

The -v flag turns on verbose mode, printing information about the loaded file.

When used as a global command, it will use the currently selected processor to find the memory space to load the binary into. If the -l flag is given, it will load it into the virtual memory space, otherwise it will use the physical memory space.

When using the namespace command on a processor object, it will load the binary into the virtual memory space of that processor.

When using the namespace command on a memory-space object, it will load the binary directly into that memory space.

The return value is the address of the execution entry point. This value is typically used in a call to set-pc.

load-binary uses Simics's Search Path and path markers (%simics%, %script%) to find the file to load. Refer to Simics User Guide (CLI chapter) for more information on how Simics's Search Path is used to locate files.

See Also
<memory-space>.load-file filename [offset]
load-file filename [offset]
Loads a file with name filename into the memory space (defaulting to the current frontend processor's physical memory space), starting at physical address offset. Default offset is 0.

load-file uses Simics's Search Path and path markers (%simics%, %script%) to find the file to load. Refer to Simics User Guide (CLI chapter) for more information on how Simics's Search Path is used to locate files.

See Also
Prints the memory map of the memory space object, one line per entry in the map attribute of the memory space. The base column is the starting address of the map. The object column contains the object mapped at that address. fn is the function number and offs is the offset for the object. length is the number of bytes mapped.
See Also
<memory-space>.add-map, <memory-space>.del-map
<memory-space>.set address value [size] [-l] [-b]
set address value [size] [-l] [-b]
Set the size bytes of physical memory at location address to value. The default size is 4 bytes, but can be anywhere between 1 and 8 (inclusive).

If value is larger than the specified size, behavior is undefined.

The -l and -b flags are used to select little-endian and big-endian byte order, respectively. If neither is given, the byte order of the currently selected processor is used.

The non-namespace version of this command operates on the physical memory associated with the current processor.

See Also
get, x, pselect
<memory-space>.x address [size]
<processor>.x address [size]
x [cpu-name] address [size]
Display the contents of a memory space starting at address. Either the memory space is explicitly specified as in <memory-space>.x or the CPU connected to the memory space can be specified; e.g., <processor>.x. By itself, x operates on the memory connected to the current frontend processor.

If the memory is accessed via a CPU, the type of address is specified by a prefix. For physical addresses use p:address; for virtual addresses, v:address on non-x86 targets. On x86, use segment-register:offset or l:address for x86 linear addresses.

If no prefix is given it will be interpreted as a virtual address. On x86 the default is ds:address (data segment addressing).

The size argument specifies the number of bytes to examine. When examining virtual memory, only addresses which can be found in the TLB or hardware page tables (if any) are shown. Unmapped addresses are shown as "--", undefined physical addresses as "**".

See Also
disassemble, get, set