Re: Simulator crashes when loading chip

Posted by cadet1620 on
URL: http://nand2tetris-questions-and-answers-forum.52.s1.nabble.com/Simulator-crashes-when-loading-chip-tp3289029p3289323.html

dave wrote
As I am working on this same 32-bit register problem, I tried another solution, namely to build it out of 32 single bits, namely:
...
    Bit(in=in[16], out=out[16], load=load);  // <== this is the line that causes the problem
...
Does that mean that I can never use indices larger than 15 in my hdl??? Someone, please help me find a way around this 8^) Thank you!!!
From the PinInfo class source code:

    /**
     * Constructs a new empty PinInfo.
     */
    public PinInfo() {
        initialized = new boolean[16];
    }

It looks like the simulator does not support buses wider than 16 bits.

I think you will need to split your 32-bit buses:
    CHIP Register32 {

        IN  inH[16], inL[16], load;
        OUT outH[16], outL[16];

        PARTS:
        Register(in=inH, out=outH, load=load);
        Register(in=inL, out=outL, load=load);
    }

Ugly, but workable.

--Mark