This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

get the memory value on memory write trigger, how to avoid recursions

I have the following setwatches:

Agsi.SetWatchOnMemory(addr, addr, check_data_write, AGSIWRITE); Agsi.SetWatchOnMemory(addr, addr, check_data_read, AGSIREAD);

What I try to do is to trigger different functions when micro write / read to a memory address. This works fine except that there are unexpected triggers since I use AgsiReadMemory and AgsiWriteMemory in these functions (check_data_read and check_data_write).

void check_data_read()
{ // return some data to the micro // by calling AgsiWriteMemory()
}

void check_data_write()
{ // check what micro wrote // by calling AgsiReadMemory()
}

Is there a way to prevent these unexpected function triggers? I mean how can I know what micro wrote to that addres without using AgsiReadMemory? or how can i return a value to the micro on memoryread without calling AgsiWriteMemory?
How to avoid this read /write memory recursions???
Thanks

0