mdio45_phy microwire
API Reference Manual  /  4 Model-to-Model Interfaces  / 

memory_space

Description
This interface is implemented by classes that provide linear address spaces.

Other objects may perform accesses in the address space using the access function or one of the simplified access functions, or may ask for mapped objects using space_lookup. Typical usage of this interface would be memory accesses from devices or processors.

The space_lookup function would be used to find end-points for a memory request. The mop needs to be crafted similarly as for a regular read or write operation and would typically be created with SIM_make_mem_op_read or SIM_make_mem_op_write. The return value for space_lookup is a list of all mappings that match the input mop.

The access function operates on a generic transaction that would typically be created with SIM_make_mem_op_read or SIM_make_mem_op_write. The access_simple function is similar to access but takes some additional arguments instead of a complete generic_transaction_t structure. An inquiry version of this function is available as access_simple_inq. Both these functions can perform endian conversion if the buffer pointed to by buf contains a value in host endian byte-order. To avoid endian conversion, Sim_Endian_Target should be specified as endian. These two functions are not available from Python.

The read and write methods are primarily intended for use in Python. They operate on data encapsulated in attribute values which should be of data type; in Python, this corresponds to tuples of integers (bytes). These two methods signal errors by raising a frontend exception. They can be used to read or write up to 1024 bytes in a single call. The return value from write should be ignored.

The fill method fills size bytes starting at start with value. It only works on memory, and returns the number of bytes actually written before encountering something that isn't RAM.

The timing_model_operate method is deprecated. It was used by objects of class memory-space to trigger an associated timing model, e.g. a cache model. See the Analyzer's User Guide for how to use the instrumentation API to connect cache models.

SIM_INTERFACE(memory_space) {
        map_list_t *(*space_lookup)(conf_object_t *NOTNULL obj,
                                    generic_transaction_t *NOTNULL mop,
                                    map_info_t mapinfo);
        exception_type_t (*access)(conf_object_t *NOTNULL obj,
                                   generic_transaction_t *NOTNULL mop);
#if !defined(PYWRAP)
        exception_type_t (*access_simple)(conf_object_t *obj,
                                          conf_object_t *initiator,
                                          physical_address_t addr,
                                          uint8 *buf,
                                          physical_address_t len,
                                          read_or_write_t type,
                                          endianness_t endian);
        exception_type_t (*access_simple_inq)(conf_object_t *obj,
                                              conf_object_t *initiator,
                                              physical_address_t addr,
                                              uint8 *buf,
                                              physical_address_t len,
                                              read_or_write_t type,
                                              endianness_t endian);
#endif /* !PYWRAP */
        attr_value_t (*read)(conf_object_t *NOTNULL obj,
                             conf_object_t *initiator,
                             physical_address_t addr,
                             int length,
                             int inquiry);
        exception_type_t (*write)(conf_object_t *NOTNULL obj,
                                  conf_object_t *initiator,
                                  physical_address_t addr,
                                  attr_value_t data,
                                  int inquiry);
        cycles_t (*timing_model_operate)(conf_object_t *NOTNULL space,
                                         generic_transaction_t *NOTNULL mop);
        uint64 (*fill)(conf_object_t *NOTNULL obj,
                       physical_address_t start, uint64 size, uint8 value,
                       bool inquiry);
};

#define MEMORY_SPACE_INTERFACE "memory_space"

Execution Context
Cell Context for all methods.

mdio45_phy microwire