{
sendSim("ds 0x80 0xff\n");
}
- else
+ else if ( cachenum == CMEM_CACHE )
+ {
+#define CMEM_CACHE_MASK ((MAX_CACHE_SIZE >> 2) - 1)
+ laddr = addr & ~CMEM_CACHE_MASK;
+ sprintf(cache->buffer,"dump rom 0x%x 0x%x\n",laddr,laddr+CMEM_CACHE_MASK );
+ sendSim(cache->buffer);
+ }
+ else
{
laddr = addr & 0xffffffc0;
sprintf(cache->buffer,"dx 0x%x 0x%x\n",laddr,laddr+0xff );
invalidateCache(XMEM_CACHE);
invalidateCache(IMEM_CACHE);
invalidateCache(SREG_CACHE);
+ invalidateCache(CMEM_CACHE);
if (INVALID_SOCKET == (sock = WSASocket(PF_INET, SOCK_STREAM, IPPROTO_TCP, NULL, 0, 0))) {
fprintf(stderr, "cannot create socket: %d\n", WSAGetLastError());
exit(1);
}
}
+ return simPid;
}
void openSimulator (char **args, int nargs)
invalidateCache(XMEM_CACHE);
invalidateCache(IMEM_CACHE);
invalidateCache(SREG_CACHE);
+ invalidateCache(CMEM_CACHE);
if ((sock = socket(AF_INET,SOCK_STREAM,0)) < 0)
{
{
case 'A': /* External stack */
case 'F': /* External ram */
+ case 'P': /* Pdata space */
prefix = "xram";
cachenr = XMEM_CACHE;
break;
case 'C': /* Code */
case 'D': /* Code / static segment */
prefix = "rom";
+ cachenr = CMEM_CACHE;
break;
case 'B': /* Internal stack */
case 'E': /* Internal ram (lower 128) bytes */
simResponse();
}
+unsigned int simGetPC(void)
+{
+ char *sr;
+ sendSim("pc\n");
+ waitForSim(100,NULL);
+ simResponse();
+ sr = simResponse();
+ return strtol(sr+3,0,0);
+}
+
int simSetValue (unsigned int addr,char mem, int size, unsigned long val)
{
char cachenr, i;
s = buffer + strlen(buffer) -1;
for ( i = 0 ; i < size ; i++ )
{
- sprintf(s," 0x%x", val & 0xff);
+ sprintf(s," 0x%lx", val & 0xff);
s += strlen(s);
val >>= 8;
}
case of bit variables which case it becomes
[address] [assembler bit address] [v] */
/* first skip thru white space */
- while (isspace(*resp)) resp++ ;
+ resp = trim_left(resp);
if (strncmp(resp, "0x",2) == 0)
resp += 2;
for (i = 0 ; i < size ; i++ )
{
/* skip white space */
- while (isspace(*resp)) resp++ ;
+ resp = trim_left(resp);
b[i] = strtol(resp,&resp,16);
}
char buff[128];
sprintf(buff,"file \"%s\"\n",s);
- printf(buff);
+ printf("%s",buff);
sendSim(buff);
waitForSim(500,NULL);
}
invalidateCache(XMEM_CACHE);
invalidateCache(IMEM_CACHE);
invalidateCache(SREG_CACHE);
+ invalidateCache(CMEM_CACHE);
sendSim("res\n");
waitForSim(100,NULL);
}