"Cannot connect part's output pin to gate's input pin"

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

"Cannot connect part's output pin to gate's input pin"

ninmurai
Hi there
I keep getting "Cannot connect part's output pin to gate's input pin" error on this particular line of code:

CHIP ALU {
    IN  
        x[16], y[16],  // 16-bit inputs        
        zx, // zero the x input?
        nx, // first zero, then negate the x input?
        zy, // zero the y input?
        ny, // first zero, then negate the y input?
        f,  // compute  out = x + y (if f == 1) or out = x & y (if == 0)
        no; // negate the out output?

    OUT
        out[16], // 16-bit output
        zr, // 1 if (out == 0), 0 otherwise
        ng; // 1 if (out < 0),  0 otherwise

Parts:
ZxyNxy(a=x, b=y, zx=zx, nx=nx, zy=zy, ny=ny, outx=x_zxnx, outy=y_zyny);
....}

ZxyNxy.hdl uses the following in/out values: IN a[16], b[16], zx, nx, zy, ny; OUT outx[16], outy[16];

I hope that code is enough to troubleshoot! I can also attach ZxyNxy.hdl if it is required.

I don't really understand what the message is telling me! I've tried renaming the input variables of ZxyNxy so there are no repetitions of input/output/internal pin names but no luck!

Best wishes,
Reply | Threaded
Open this post in threaded view
|

Re: "Cannot connect part's output pin to gate's input pin"

cadet1620
Administrator
ninmurai wrote
Hi there
I keep getting "Cannot connect part's output pin to gate's input pin" error on this particular line of code [in ALU.hdl]:

    ZxyNxy(a=x, b=y, zx=zx, nx=nx, zy=zy, ny=ny, outx=x_zxnx, outy=y_zyny);

ZxyNxy.hdl uses the following in/out values: IN a[16], b[16], zx, nx, zy, ny; OUT outx[16], outy[16];
The Hardware Simulator is giving the wrong error message here. The problem is that "_" is not a legal character in a pin/wire name. Use a name like xZxnx instead of x_zxnx.

Bug detail:
The "_" is causing the parser to to split the pin name "x_zxnx" at the "_" so it sees
    outx=x  _zxnx
and processes that connection. Since "x" is an input to ALU, it generates the "can't connect input to output" message.

If you change the conenction to "outx=xx_zxnx", the simulator generates a ", or ) expected" message.

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

Re: "Cannot connect part's output pin to gate's input pin"

ninmurai
Awesome, Thanks Mark - ALU now fully working :D