interrupt_subscriber map_demap
API Reference Manual  /  4 Model-to-Model Interfaces  / 

io_memory

Description

This interface is implemented by devices that can be mapped into address spaces (including port spaces). The operation() is called when the object is accessed through an address space.

The obj argument is a pointer to the mapped object and map_info contains information about how and where the device is mapped into memory. The mem_op argument to operation() contains information about the access.

The offset into the device mapping for the access is typically calculated in the following way:

offset = SIM_get_mem_op_physical_address(mem_op) - map_info.base + map_info.start

Note: The map() function is deprecated and should not be used. The function may be called when the object is mapped into an address space, but it is not guaranteed that this happens. The function can be left unimplemented (NULL).
The exception_type_t type, returned by the operation() function may be used to signal errors to Simics, but should in most cases be Sim_PE_No_Exception. If the device does not support inquiry accesses, it should return Sim_PE_Inquiry_Unhandled if mem_op->inquiry is 1.

typedef enum {
        Sim_Addr_Space_Conf,
        Sim_Addr_Space_IO,
        Sim_Addr_Space_Memory
} addr_space_t;

SIM_INTERFACE(io_memory) {
        int (*DEPRECATED_FUNC(map))(conf_object_t *NOTNULL obj,
                                    addr_space_t memory_or_io,
                                    map_info_t map_info);
        exception_type_t (*operation)(conf_object_t *NOTNULL obj,
                generic_transaction_t *NOTNULL mem_op,
                map_info_t map_info);
};

#define IO_MEMORY_INTERFACE "io_memory"

Execution Context
Cell Context for all methods.

interrupt_subscriber map_demap