From: <jo...@us...> - 2007-10-26 13:11:22
|
Revision: 14 http://mspsim.svn.sourceforge.net/mspsim/?rev=14&view=rev Author: joxe Date: 2007-10-26 06:11:08 -0700 (Fri, 26 Oct 2007) Log Message: ----------- clear interrupt related info during reset Modified Paths: -------------- mspsim/se/sics/mspsim/core/MSP430Core.java Modified: mspsim/se/sics/mspsim/core/MSP430Core.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Core.java 2007-10-26 13:02:55 UTC (rev 13) +++ mspsim/se/sics/mspsim/core/MSP430Core.java 2007-10-26 13:11:08 UTC (rev 14) @@ -324,6 +324,12 @@ public void reset() { resetIOUnits(); reg[PC] = memory[0xfffe] + (memory[0xffff] << 8); + for (int i = 0, n = 16; i < n; i++) { + interruptSource[i] = null; + } + servicedInterruptUnit = null; + servicedInterrupt = -1; + interruptMax = -1; } // Indicate that we have an interrupt now! This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-02-12 12:03:07
|
Revision: 126 http://mspsim.svn.sourceforge.net/mspsim/?rev=126&view=rev Author: joxe Date: 2008-02-12 04:03:01 -0800 (Tue, 12 Feb 2008) Log Message: ----------- fixed a bug in getTime() Modified Paths: -------------- mspsim/se/sics/mspsim/core/MSP430Core.java Modified: mspsim/se/sics/mspsim/core/MSP430Core.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Core.java 2008-02-12 00:32:08 UTC (rev 125) +++ mspsim/se/sics/mspsim/core/MSP430Core.java 2008-02-12 12:03:01 UTC (rev 126) @@ -346,7 +346,7 @@ public long getTime() { long diff = cycles - lastTime; currentTime += (long) (diff * currentDCOFactor); - return 0; + return currentTime; } // get elapsed time in seconds @@ -561,8 +561,15 @@ long startCycles = cycles; // ------------------------------------------------------------------- - // I/O processing + // Event processing // ------------------------------------------------------------------- +// if (cycles >= nextEventCycles) { +// executeEvents(); +// } + + // ------------------------------------------------------------------- + // (old) I/O processing + // ------------------------------------------------------------------- if (cycles >= nextIOTickCycles) { handleIO(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-04-22 08:57:54
|
Revision: 250 http://mspsim.svn.sourceforge.net/mspsim/?rev=250&view=rev Author: joxe Date: 2008-04-22 01:57:47 -0700 (Tue, 22 Apr 2008) Log Message: ----------- Added watchdog in Core. Modified Paths: -------------- mspsim/se/sics/mspsim/core/MSP430Core.java Modified: mspsim/se/sics/mspsim/core/MSP430Core.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Core.java 2008-04-22 08:55:02 UTC (rev 249) +++ mspsim/se/sics/mspsim/core/MSP430Core.java 2008-04-22 08:57:47 UTC (rev 250) @@ -141,6 +141,10 @@ memIn[0x180 + i] = tb; } + Watchdog wdt = new Watchdog(this); + memOut[0x120] = wdt; + memIn[0x120] = wdt; + sfr = new SFR(this, memory); for (int i = 0, n = 0x10; i < n; i++) { memOut[i] = sfr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-04-23 20:42:19
|
Revision: 259 http://mspsim.svn.sourceforge.net/mspsim/?rev=259&view=rev Author: joxe Date: 2008-04-23 13:42:06 -0700 (Wed, 23 Apr 2008) Log Message: ----------- reimplemented reset to trigger the resetvector and added HW reset before executing reset vector. Modified Paths: -------------- mspsim/se/sics/mspsim/core/MSP430Core.java Modified: mspsim/se/sics/mspsim/core/MSP430Core.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Core.java 2008-04-23 19:06:13 UTC (rev 258) +++ mspsim/se/sics/mspsim/core/MSP430Core.java 2008-04-23 20:42:06 UTC (rev 259) @@ -514,10 +514,9 @@ } public void reset() { -// flagInterrupt(15, null, true); - reg[PC] = memory[0xfffe] + (memory[0xffff] << 8); - System.out.println("Reset the CPU: " + reg[PC]); - internalReset(); +// reg[PC] = memory[0xfffe] + (memory[0xffff] << 8); +// System.out.println("Reset the CPU: " + reg[PC]); + flagInterrupt(15, null, true); } // Indicate that we have an interrupt now! @@ -535,6 +534,8 @@ interruptMax = interrupt; if (interruptMax == 15) { System.out.println("Triggering reset IRQ!!!!!"); + // This can not be masked at all! + interruptsEnabled = true; } } } else { @@ -629,18 +630,22 @@ int spBefore = readRegister(SP); int sp = spBefore; int sr = readRegister(SR); - // Push PC and SR to stack - // store on stack - always move 2 steps (W) even if B. - writeRegister(SP, sp = spBefore - 2); - // Put lo & hi on stack! - memory[sp] = pc & 0xff; - memory[sp + 1] = (pc >> 8) & 0xff; - writeRegister(SP, sp = sp - 2); - // Put lo & hi on stack! - memory[sp] = sr & 0xff; - memory[sp + 1] = (sr >> 8) & 0xff; + // Only store stuff on irq except reset... - not sure if this is correct... + // TODO: Check what to do if reset is called! + if (interruptMax < 15) { + // Push PC and SR to stack + // store on stack - always move 2 steps (W) even if B. + writeRegister(SP, sp = spBefore - 2); + // Put lo & hi on stack! + memory[sp] = pc & 0xff; + memory[sp + 1] = (pc >> 8) & 0xff; + writeRegister(SP, sp = sp - 2); + // Put lo & hi on stack! + memory[sp] = sr & 0xff; + memory[sp + 1] = (sr >> 8) & 0xff; + } // Clear SR - except ... // Jump to the address specified in the interrupt vector writeRegister(PC, pc = @@ -656,7 +661,7 @@ interruptMax = -1; if (servicedInterrupt == 15) { - System.out.println("Servicing RESET! => " + Utils.hex16(pc)); + System.out.println("**** Servicing RESET! => " + Utils.hex16(pc)); internalReset(); } @@ -678,7 +683,7 @@ servicedInterruptUnit.getName()); } servicedInterruptUnit.interruptServiced(servicedInterrupt); - } + } return pc; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-06-11 21:59:26
|
Revision: 288 http://mspsim.svn.sourceforge.net/mspsim/?rev=288&view=rev Author: joxe Date: 2008-06-11 14:59:07 -0700 (Wed, 11 Jun 2008) Log Message: ----------- fixed index out of bounds bug for IO addresses (< 0x200). Modified Paths: -------------- mspsim/se/sics/mspsim/core/MSP430Core.java Modified: mspsim/se/sics/mspsim/core/MSP430Core.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Core.java 2008-06-02 10:44:49 UTC (rev 287) +++ mspsim/se/sics/mspsim/core/MSP430Core.java 2008-06-11 21:59:07 UTC (rev 288) @@ -597,7 +597,8 @@ // if (breakPoints[address] != null) { // breakPoints[address].call // } - if (address < 0x200 && memIn[address] != null) { + // Only word reads at 0x1fe which is highest address... + if (address < 0x1ff && memIn[address] != null) { val = memIn[address].read(address, word, cycles); } else { address &= 0xffff; @@ -614,7 +615,8 @@ breakPoints[dstAddress].cpuAction(CPUMonitor.MEMORY_WRITE, dstAddress, dst); } - if (dstAddress <= 0x200 && memOut[dstAddress] != null) { + // Only word writes at 0x1fe which is highest address... + if (dstAddress < 0x1ff && memOut[dstAddress] != null) { if (!word) dst &= 0xff; memOut[dstAddress].write(dstAddress, dst, word, cycles); } else { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <jo...@us...> - 2008-07-08 07:02:08
|
Revision: 290 http://mspsim.svn.sourceforge.net/mspsim/?rev=290&view=rev Author: joxe Date: 2008-07-08 00:01:45 -0700 (Tue, 08 Jul 2008) Log Message: ----------- fixed bug with word/byte handling of writeRegister after two ops instructions Modified Paths: -------------- mspsim/se/sics/mspsim/core/MSP430Core.java Modified: mspsim/se/sics/mspsim/core/MSP430Core.java =================================================================== --- mspsim/se/sics/mspsim/core/MSP430Core.java 2008-07-04 06:07:31 UTC (rev 289) +++ mspsim/se/sics/mspsim/core/MSP430Core.java 2008-07-08 07:01:45 UTC (rev 290) @@ -1177,6 +1177,7 @@ if (write) { if (dstRegMode) { + if (!word) dst &= 0xff; writeRegister(dstRegister, dst); } else { dstAddress &= 0xffff; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |