Yes, I am aware of that. Like I already said, I have basic simif
interface functionality working - I can use the 'detect' command and get
back the proper response, as well as other commands.
What I am interested in is how to access this information:
Configuration memory of simif
0x00 00000001 . Turn simif on/off (bool, RW)
0x01 00000000 . WR: sets running state, RD: check if simulation is running
0x02 00000000 . WR: start simulation, RD: true if running
0x03 00000001 . WR: stop simulation, RD: true if stopped
0x04 00000000 . Quit simulator (any, WO)
0x05 0000006e n Reason of last stop (int, RO)
0x06 007a1200 . Xtal frequency in Hz (int, RW)
0x07 000a7db0 . Nuof ticks simulated so far (int, RO)
0x08 00000000 . Ticks spent in ISR (int, RO)
0x09 00000000 . Ticks spent in idle state (int, RO)
0x0a 00000055 U Real time since reset in msec (int, RO)
0x0b 00151ae2 . Nuof simulated virtual clocks (int, RO)
0x0c 000098e2 . PC register (int, RW)
0x0d 00000000 . Print char on stdout (int, WO)
0x0e 00000000 . Write char to simif output (int, WO)
0x0f 00000000 . Not used
I would like to read the "ticks simulated so far", but how?
BTW, I forgot to mention earlier, I am using the STM8 simulator, sstm8.
Regards,
Basil
On 22/05/2020 13:45, Raphael Neider wrote:
Hi,
have a look at
https://sourceforge.net/p/sdcc/code/HEAD/tree/trunk/sdcc/sim/ucsim/example/simif.c
They use
#define SIF_ADDRESS_SPACE_NAME "xram"
#define SIF_ADDRESS_SPACE __xdata
#define SIF_ADDRESS 0xffff
unsigned char SIF_ADDRESS_SPACE * volatile sif;
and read multi-byte values by repeatedly reading *sif:
void
get_commands(void)
{
int i;
*sif= SIFCM_COMMANDS;
nuof_commands= *sif;
for (i= 0; i < nuof_commands; i++)
commands[i]= *sif;
}
Hope that helps Raphael
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user