next up previous contents
Next: Avoiding memory system simulation Up: Options to improve simulation Previous: Options to improve simulation

Moving data initialization offline

The RSIM applications library provides two special-purpose functions, SpecialInitInput and SpecialInitOutput, that can be used in some cases to bypass the initialization phase of an application. In applications that spend a large amount of time in initialization, the initialization phase can be run through RSIM or natively on the host machine once. After the initialization phase, a ``snapshot'' of the state of the memory can be taken, such that later simulation runs can load this snapshot into their memory space in lieu of actually simulating the initialization phase.

The SpecialInitOutput function allows the memory values of a program variable to be stored to a file specified in the arguments. For example,

SpecialInitOutput(char *array, int size, char *filename);

allows the contents of the program variable specified by bigarray of size (in bytes) specified by size to be stored in the file specified by filenamegif.

The SpecialInitInput function can then be used in the actual simulated run of the application to load the contents of this file into the data array and quickly initialize the data structures. SpecialInitInput can be invoked as follows,

SpecialInitInput(char *array, int size, char *filename);

The SpecialInitInput and SpecialInitOutput functions thus provide a simple way to facilitate offline (faster) initialization to be interfaced with a more detailed simulation methodology.

Note that the values held in these data arrays should not include pointers, as the pointers used in the native or simulated run which invoked SpecialInitOutput may not correspond to the pointers needed by the simulated runs which will call SpecialInitInput.



Vijay Sadananda Pai
Thu Aug 7 14:18:56 CDT 1997