hypersim_pattern_matcher image_snoop
API Reference Manual  /  5 Model-to-Simulator Interfaces  / 

image

Description
This interface is used for handling big data images.

read and write access a chunk of data at a time. Only accesses within the bounds of the image are allowed.

clear_range fills an interval with null bytes, fill with any byte value.

size returns the image size.

get and set work like read and write but pass the data using a bytes_t instead, and can be used from Python.

flush_writable writes out all unwritten changes to a writable backing file if one exists; otherwise, does nothing.

Other methods are not currently for public use.

SIM_INTERFACE(image) {
#if !defined(PYWRAP)
        void (*read)(conf_object_t *img, void *NOTNULL to_buf, uint64 start,
                     size_t length);
        void (*write)(conf_object_t *img, const void *NOTNULL from_buf,
                      uint64 start, size_t length);
        int (*for_all_spages)(conf_object_t *img,
                              int (*NOTNULL f)(image_spage_t *NOTNULL p,
                                               uint64 ofs, void *arg),
                              void *arg);
#endif /* not PYWRAP */
        void (*set_persistent)(conf_object_t *obj);
        void (*save_to_file)(conf_object_t *NOTNULL obj,
                             const char *NOTNULL file,
                             uint64 start, uint64 length);
        void (*save_diff)(conf_object_t *NOTNULL obj,
                          const char *NOTNULL file);
        void (*clear_range)(conf_object_t *NOTNULL obj,
                            uint64 start, uint64 length);
        void (*fill)(conf_object_t *NOTNULL obj,
                     uint64 start, uint64 length, uint8 value);
        uint64 (*size)(conf_object_t *NOTNULL obj);
        void (*set)(conf_object_t *NOTNULL obj, uint64 ofs, bytes_t b);
        bytes_t (*get)(conf_object_t *NOTNULL obj, uint64 ofs, size_t size);
        void (*flush_writable)(conf_object_t *NOTNULL obj);
};

#define IMAGE_INTERFACE "image"

Execution Context
readCell Context
writeCell Context
for_all_spagesCell Context
set_persistentCell Context
save_to_fileCell Context
save_diffCell Context
clear_rangeCell Context
fillCell Context
sizeCell Context
setCell Context
getCell Context
flush_writableCell Context

hypersim_pattern_matcher image_snoop