int retry = 0;
int i ;
Dprintf(D_simi, ("simi: openSimulator\n"));
-
+#ifdef SDCDB_DEBUG
+ if (D_simi & sdcdbDebug)
+ {
+ printf("simi: openSimulator: ");
+ for (i=0; i < nargs; i++ )
+ {
+ printf("arg%d: %s ",i,args[i]);
+ }
+ printf("\n");
+ }
+#endif
invalidateCache(XMEM_CACHE);
invalidateCache(IMEM_CACHE);
invalidateCache(SREG_CACHE);
return cachenr;
}
+void simSetPC( unsigned int addr )
+{
+ char buffer[40];
+ sprintf(buffer,"pc %d\n", addr);
+ sendSim(buffer);
+ waitForSim(100,NULL);
+ simResponse();
+}
+
int simSetValue (unsigned int addr,char mem, int size, unsigned long val)
{
char cachenr, i;
sendSim(buffer);
waitForSim(100,NULL);
simResponse();
+ return 0;
}
{
char buff[128];
- sprintf(buff,"l \"%s\"\n",s);
+ sprintf(buff,"file \"%s\"\n",s);
printf(buff);
sendSim(buff);
waitForSim(500,NULL);
//sleep(1);
//waitForSim();
+ sendSim("reset\n");
+ waitForSim(wait_ms, NULL);
sendSim("run 0x0\n");
} else if (gaddr == -1) { /* resume */
sendSim ("run\n");
sr++ ;
}
+ nointerrupt = 1;
+ /* get answer of stop command */
+ if ( userinterrupt )
+ waitForSim(wait_ms, NULL);
+
/* better solution: ask pc */
sendSim ("pc\n");
waitForSim(100, NULL);
sr = simResponse();
+ nointerrupt = 0;
gaddr = strtol(sr+3,0,0);
return gaddr;
simactive = 0;
return;
}
+ simactive = 0;
sendSim("quit\n");
fclose (simin);
fclose (simout);