Hanging Simulator

classic Classic list List threaded Threaded
4 messages Options
Joe
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Hanging Simulator

Joe
So, whenever I try to run my Memory.tst, the hardware simulator gets stuck on the "Loading chip..." step.  I've tried restarting the simulator, but that didn't help.  I have, however, noticed that every time I hit the "Run" (>>) button, I get the following exception:

Exception in thread "Thread-111" java.lang.ArrayIndexOutOfBoundsException: 2
        at Hack.Gates.CompositeGateClass.isLegalToPartEdge(Unknown Source)
        at Hack.Gates.CompositeGateClass.createConnectionsGraph(Unknown Source)
        at Hack.Gates.CompositeGateClass.<init>(Unknown Source)
        at Hack.Gates.GateClass.readHDL(Unknown Source)
        at Hack.Gates.GateClass.getGateClass(Unknown Source)
        at Hack.HardwareSimulator.HardwareSimulator.loadGate(Unknown Source)
        at Hack.HardwareSimulator.HardwareSimulator.doCommand(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$FastForwardTask.run(Unknown Source)
        at java.lang.Thread.run(Thread.java:636)

I'd like to know what's going on.  The only thing I had to do that was not in the project description was make a DMux4Way16 (hopefully I don't have to give away why I did that, as other students can look at this post), so the problem might be that, although I cannot imagine why.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hanging Simulator

cadet1620
Administrator
Joe wrote
So, whenever I try to run my Memory.tst, the hardware simulator gets stuck on the "Loading chip..." step.  I've tried restarting the simulator, but that didn't help.  I have, however, noticed that every time I hit the "Run" (>>) button, I get the following exception:
    [call stack elided]

I'd like to know what's going on.  The only thing I had to do that was not in the project description was make a DMux4Way16 (hopefully I don't have to give away why I did that, as other students can look at this post), so the problem might be that, although I cannot imagine why.
Since the only "chip" that you are using that is not a built-in is the DMux4Way16 that you wrote, I'd comment out where it's used in your Memory.hdl.  Obviously, your Memory won't work this way, but it may load and run to the point of showing you a comparison failure.  This would tell you that there is something in your DMux4Way16 that's freaking out the simulator.

Did you write a DMux4Way16.tst file?

[If you become a registered user, you can mail me your DMux4Way16.hdl and Memory.hdl and I'll be happy to take a look at them and give you clues.]

--Mark
kv
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hanging Simulator

kv
My Memory.tst also hangs.

Just to be clear I run HardwareSimulator.sh Memory.tst

I tried many different implementations but it always hangs.

I tried many different ways to implement this, this one is the simplest. Although it allocates extra memory, it should be able to pass the tests.
    DMux(in=load, sel=address[14], a=a, b=b);
    RAM16K(in=in, load=a, address=address[0..13], out=out0);
    RAM16K(in=in, load=b, address=address[0..13], out=out1);
    Mux16(a=out0, b=out1, sel=address[14], out=out);

The problem is that it only starts hanging after line 35, therefore if I comment something out, it will fail at an earlier stage, therefore not hang. So it's difficult to tell what's causing it to hang.

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Hanging Simulator

cadet1620
Administrator
Memory.tst is interactive; it needs you to press keyboard keys.  You cannot test it from the command line.

You need to start the Hardware Simulator--run HardwareSimulator.sh from the command line without argument.  Then use File>Load Script to load Memory test.

--Mark

Loading...