direct_memory_lookup_v2 direct_memory_update
API Reference Manual  /  5 Model-to-Simulator Interfaces  / 

direct_memory_tags

Description

The direct_memory_tags interface is implemented by objects that model RAM memory with support for auxiliary RAM bits.

The get_tags_data method returns a direct_memory_tags_t value which contains a direct pointer to the memory used to store the tags bits. The handle argument should be a handle for a region of memory previously obtained from the get_handle method of the direct_memory interface.

NOTE: The memory region specified indirectly by the handle argument will be enlarged, if necessary, to have a natural 128-byte alignment. This is done to ensure that the tags mapping is unambiguous.

The returned data pointer points to tag bits for the region specified by handle. The least significant bit of the first byte corresponds to the first 16 bytes of the (aligned) region.

The len field is set to the number of bytes holding tags data that may be accessed and it equals the size of the (aligned) region divided by 128.

The augmented memory bits may be read or modified using the returned pointer, provided that the user has corresponding read or write permissions to the region specified by handle.

The returned pointer will remain valid until the corresponding permissions to the direct memory region are lost, which usually happens through a call to the update_permission method of the direct_memory_update interface. The returned pointer must also be considered invalid when additional permissions for the region are requested using the request method of the direct_memory interface. This is necessary since e.g. a write request could trigger copy-on-write behavior and reallocation of the underlying storage.

typedef struct {
#ifndef PYWRAP
        uint8 *data;
#endif
        unsigned len;
} direct_memory_tags_t;

SIM_INTERFACE(direct_memory_tags) {
        direct_memory_tags_t (*get_tags_data)(conf_object_t *NOTNULL obj,
                                              direct_memory_handle_t handle);
};
#define DIRECT_MEMORY_TAGS_INTERFACE "direct_memory_tags"        

Execution Context
Cell Context for all methods.

direct_memory_lookup_v2 direct_memory_update