Strange load bit behavior and random exceptions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Strange load bit behavior and random exceptions

Joeq
I was wondering three things:  1.)  Why does the Load bit for the 1-bit register need to be run through a Not gate before the component will actually work without having a comparison failure, 2.)  Why does the simulator lock up at random places when I'm testing that component (I can continue the test script by hitting the run button, but still, why does it lock up?), and 3.)  After testing this component and getting it to work, I closed the simulator with the "X" button for the window frame, and the command line barfed this back at me:
joe@Rose:~/Documents/UMW_Docs/CPSC-305$ sh HardwareSimulator.sh
Exception in thread "Thread-148" java.lang.NullPointerException
        at javax.swing.BufferStrategyPaintManager.prepare(BufferStrategyPaintManager.java:533)
        at javax.swing.BufferStrategyPaintManager.copyArea(BufferStrategyPaintManager.java:329)
        at javax.swing.RepaintManager.copyArea(RepaintManager.java:1160)
        at javax.swing.JViewport.blitDoubleBuffered(JViewport.java:1621)
        at javax.swing.JViewport.windowBlitPaint(JViewport.java:1590)
        at javax.swing.JViewport.setViewPosition(JViewport.java:1135)
        at javax.swing.JViewport.scrollRectToVisible(JViewport.java:432)
        at javax.swing.JComponent.scrollRectToVisible(JComponent.java:3065)
        at HackGUI.Utilities.tableCenterScroll(Unknown Source)
        at HackGUI.FileDisplayComponent.setSelectedRow(Unknown Source)
        at HackGUI.ControllerComponent.setCurrentScriptLine(Unknown Source)
        at Hack.Controller.HackController.miniStep(Unknown Source)
        at Hack.Controller.HackController.singleStep(Unknown Source)
        at Hack.Controller.HackController.access$000(Unknown Source)
        at Hack.Controller.HackController$SingleStepTask.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:636)
I could not replicate these event in a predictable manner, and I have noticed that sometimes, the simulator won't even lock up when testing this component.  If I may be so bold as to guess, I'd say it's either a random thing, there was something going on in the simulator that made it act weird, or my system wanted to do something, and it kicked the simulator, making it lock up until I hit "Run" again.
Reply | Threaded
Open this post in threaded view
|

Re: Strange load bit behavior and random exceptions

mmiller7
I'm having a similar problem...I got everything to pass the tests (which is what I need to get my grade in class) but it bothers me that I'm getting random NullPointerExceptions and other problems with the Computer.hdl I built.  One time the simulator crashed just trying to load the Computer chip without running it!

 Unexpected Error: null
java.lang.NullPointerException
...at javax.swing.plaf.basic.BasicListUI.updateLayoutState(BasicListUI.java:1351)
at javax.swing.plaf.basic.BasicListUI.maybeUpdateLayoutState(BasicListUI.java:1294)
at javax.swing.plaf.basic.BasicListUI.getCellBounds(BasicListUI.java:935)
at javax.swing.JList.getCellBounds(JList.java:1600)
at javax.swing.JList.ensureIndexIsVisible(JList.java:1116)
at sun.swing.FilePane.ensureIndexIsVisible(FilePane.java:1543)
at sun.swing.FilePane.doDirectoryChanged(FilePane.java:1466)
at sun.swing.FilePane.propertyChange(FilePane.java:1516)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:339)
at java.beans.PropertyChangeSupport.firePropertyChange(PropertyChangeSupport.java:276)
at java.awt.Component.firePropertyChange(Component.java:8132)
at javax.swing.JFileChooser.setCurrentDirectory(JFileChooser.java:568)
at SimulatorsGUI.HardwareSimulatorControllerComponent.setWorkingDir(Unknown Source)
at Hack.Controller.HackController.<init>(Unknown Source)
at Hack.HardwareSimulator.HardwareSimulatorController.<init>(Unknown Source)
at Hack.HardwareSimulator.HardwareSimulatorApplication.createController(Unknown Source)
at Hack.Controller.HackApplication.<init>(Unknown Source)
at Hack.HardwareSimulator.HardwareSimulatorApplication.<init>(Unknown Source)
at HardwareSimulatorMain.main(Unknown Source)

I've also had really strange results running programs from other assignments -- in particular Fill.asm the screen (not the HACK computer screen -- the Java window running the simulator) goes crazy.

Note, my same Fill.hack works perfectly in the CPUEmulator.



Any way to debug this or is it just a known bug?