From: <jo...@us...> - 2007-12-06 23:42:35
|
Revision: 65 http://mspsim.svn.sourceforge.net/mspsim/?rev=65&view=rev Author: joxe Date: 2007-12-06 15:42:32 -0800 (Thu, 06 Dec 2007) Log Message: ----------- added profiling while single-stepping Modified Paths: -------------- mspsim/se/sics/mspsim/core/MSP430.java Modified: mspsim/se/sics/mspsim/core/MSP430.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430.java 2007-12-06 23:35:08 UTC (rev 64) +++ mspsim/se/sics/mspsim/core/MSP430.java 2007-12-06 23:42:32 UTC (rev 65) @@ -164,16 +164,32 @@ int ctr = 0; - while (!emulateOP() && ctr++ < 10000) { + boolean emuOP = false; + while (!(emuOP = emulateOP()) && ctr++ < 10000) { /* Stuck in LPM - hopefully not more than 10000 times*/ } - if ((instCtr % 10000007) == 0 && !debug) { - printCPUSpeed(reg[PC]); - } + if (emuOP) { + if ((instCtr % 10000007) == 0 && !debug) { + printCPUSpeed(reg[PC]); + } - if (execCounter != null) { - execCounter[reg[PC]]++; + if (execCounter != null) { + execCounter[reg[PC]]++; + } + + if (profiler != null) { + if ((instruction & 0xff80) == CALL) { + /* The profiling should only be made on actual cpuCycles */ + String function = map.getFunction(reg[PC]); + if (function == null) { + function = "fkn at $" + Utils.hex16(reg[PC]); + } + profiler.profileCall(function, cpuCycles); + } else if (instruction == RETURN) { + profiler.profileReturn(cpuCycles); + } + } } return cycles; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |