Keep getting HDL errors ALU.hdl

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

Keep getting HDL errors ALU.hdl

OppaErich
Hi,

[oppa@oppa-F28 02]$ HardwareSimulator ALU.hdl
In script /home/oppa/Dokumente/MOOCs/Coursera/nand2tetris/projects/02/ALU.hdl, Line 30, Illegal terminator: '{'

...
CHIP ALU {
    IN  <- this is line 30
        x[16], y[16],  // 16-bit inputs        
        zx, // zero the x input?
...

Before this I had trouble with the zero and sign status bits, impossible to distribute outputs in HDL. So I just deleted these to test the ALU without the status bits but then this error came up.

When I load this file into a running simulator I get "Line 57, yx has no source pin.

   Not16 (in=xfy, out=notxfy);
   Mux16 (a=xfy, b=notxfy, sel=no, out=out);
} <- This is line 57 and there is no yx in my code.
Reply | Threaded
Open this post in threaded view
|

Re: Keep getting HDL errors ALU.hdl

cadet1620
Administrator
This post was updated on .
OppaErich wrote
[oppa@oppa-F28 02]$ HardwareSimulator ALU.hdl
In script /home/oppa/Dokumente/MOOCs/Coursera/nand2tetris/projects/02/ALU.hdl, Line 30, Illegal terminator: '{'
The tools only accept .tst files on their command line.

Before this I had trouble with the zero and sign status bits, impossible to distribute outputs in HDL. So I just deleted these to test the ALU without the status bits but then this error came up.
You can connect more than one wire to an output.
    Xxx16(..., out=out, out[0:7]=outLow, ...);
When I load this file into a running simulator I get "Line 57, yx has no source pin.

   Not16 (in=xfy, out=notxfy);
   Mux16 (a=xfy, b=notxfy, sel=no, out=out);
} <- This is line 57 and there is no yx in my code.
Somewhere in your code there is a "=xy". If you deleted code using /* */, make sure that you didn't nest comments.

Note that there is a ALU-nostat.tst that can be used to test the computation part of the ALU, ignoring the status outputs.

--Mark
Reply | Threaded
Open this post in threaded view
|

Re: Keep getting HDL errors ALU.hdl

OppaErich
cadet1620 wrote
The tools only accept .tst files on their command line.
Aha, didn't know.
You can donnect more than one wire to an output.
    Xxx16(..., out=out, out[0:7]=outLow, ...);
Ah, this may help with the status bits.
Somewhere in your code there is a "=xy". If you deleted code using /* */, make sure that you didn't nest comments.

Note that there is a ALU-nostat.tst that can be used to test the computation part of the ALU, ignoring the status outputs.
Yeah, of course. I just could not find it. I took a break and some food and found it then. It was at the 2nd line of my HDL. After corectin this, the ALU passed all nostat-tests. Let me try the status bits again.

Thanks,
Stephan
Reply | Threaded
Open this post in threaded view
|

Re: Keep getting HDL errors ALU.hdl

OppaErich
This post was updated on .
Hi,

I have no idea how to do this.

   Mux16 (a=xfy, b=notxfy, sel=no, out=out, out=zout, out[15]=zr);
   Or16Way (a=zout, out=zr);

This does not work. ~"Output may only be fed once" or so.

Edit: Sorry, that was me. zr is the double name. And I found a bug. The Or has to be Nor. ALU.tst does run now.

Edit: And "Comparison ended successfully"