I have the following setwatches:
Agsi.SetWatchOnMemory(addr, addr, check_data_write, AGSIWRITE); Agsi.SetWatchOnMemory(addr, addr, check_data_read, AGSIREAD);
void check_data_read() { // return some data to the micro // by calling AgsiWriteMemory() } void check_data_write() { // check what micro wrote // by calling AgsiReadMemory() }
Just use a flag that prevents from recursions:
void check_data_read() { static int called = 0; if (called) return; called = 1; // return some data to the micro // by calling AgsiWriteMemory() called = 0; }
actually, i did it already. but i was wondering if there is another way, like calling some other function for memory access. anyway, thx