Hardware Simulator Won't Load Chip

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

Hardware Simulator Won't Load Chip

Tim
This post was updated on .
The Hardware simulator won't load the chip below. The error is: Line 3, 'Missing CHIP' keyword.

CHIP Mux4Way16 {
    IN a[16], b[16], c[16], d[16], sel[2];
    OUT out[16];

    PARTS:
[Functional code deleted by admin.]
}
Reply | Threaded
Open this post in threaded view
|

Re: Hardware Simulator Won't Load Chip

cadet1620
Administrator
I see nothing wrong with this code; I could load it in the simulator after I made a Mux4Way. Check that the error is not actually coming from your Mux4Way.

Once you find your problem, please edit your post to remove the correct solution.

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

Re: Hardware Simulator Won't Load Chip

Tim
I am having the same issue.

This is my code for each chip part:
CHIP Mux4Way {
        IN a, b, c, d, sel[2];
        OUT out;
       
        PARTS:
        Mux(a=a, b=b, sel=sel[0], out=pass1);
        Mux(a=c, b=d, sel=sel[0], out=pass2);
        Mux(a=pass1, b=pass2, sel=sel[1], out=out);
}

CHIP Mux4Way16 {
    IN a[16], b[16], c[16], d[16], sel[2];
    OUT out[16];

    PARTS:
    Mux4Way(a=a[0], b=b[0], c=c[0], d=d[0], sel=sel[0..1], out=out[0]);
        Mux4Way(a=a[1], b=b[1], c=c[1], d=d[1], sel=sel, out=out[1]);
        Mux4Way(a=a[2], b=b[2], c=c[2], d=d[2], sel=sel, out=out[2]);
        Mux4Way(a=a[3], b=b[3], c=c[3], d=d[3], sel=sel, out=out[3]);
        Mux4Way(a=a[4], b=b[4], c=c[4], d=d[4], sel=sel, out=out[4]);
        Mux4Way(a=a[5], b=b[5], c=c[5], d=d[5], sel=sel, out=out[5]);
        Mux4Way(a=a[6], b=b[6], c=c[6], d=d[6], sel=sel, out=out[6]);
        Mux4Way(a=a[7], b=b[7], c=c[7], d=d[7], sel=sel, out=out[7]);
        Mux4Way(a=a[8], b=b[8], c=c[8], d=d[8], sel=sel, out=out[8]);
        Mux4Way(a=a[9], b=b[9], c=c[9], d=d[9], sel=sel, out=out[9]);
        Mux4Way(a=a[10], b=b[10], c=c[10], d=d[10], sel=sel, out=out[10]);
        Mux4Way(a=a[11], b=b[11], c=c[11], d=d[11], sel=sel, out=out[11]);
        Mux4Way(a=a[12], b=b[12], c=c[12], d=d[12], sel=sel, out=out[12]);
        Mux4Way(a=a[13], b=b[13], c=c[13], d=d[13], sel=sel, out=out[13]);
        Mux4Way(a=a[14], b=b[14], c=c[14], d=d[14], sel=sel, out=out[14]);
        Mux4Way(a=a[15], b=b[15], c=c[15], d=d[15], sel=sel, out=out[15]);

}

CHIP Mux {
    IN a, b, sel;
    OUT out;

    PARTS:
        //~sel AND A
        Nand(a=sel, b=sel, out=notSel);
        Nand(a=notSel, b=a, out=notSelNandA);
        Nand(a=notSelNandA, b=notSelNandA, out=notSelAndA);
       
        //sel AND B
        Nand(a=sel, b=b, out=selNandB);
        Nand(a=selNandB, b=selNandB, out=selAndB);
       
        //~sel and A OR sel AND B
        Nand(a=notSelAndA, b=notSelAndA, out=OR1);
        Nand(a=selAndB, b=selAndB, out=OR2);
        Nand(a=OR1, b=OR2, out=out);
}

I have tried this code on multiple computers and still have been getting the same error.

The Exact Error is: Mux4Way16.hdl, Line 3, Missing 'CHIP' keyword: load Myx4Wat16.hdl Is there a platform problem? Does the hardware simulator need a specific version to run? Because I have the CHIP keyword in all of the above code.
Reply | Threaded
Open this post in threaded view
|

Re: Hardware Simulator Won't Load Chip

cadet1620
Administrator
I don't know of any platform specific problems.

Your code loads and passes the test when cut and pasted from your post.

Please email me your .hdl files as attachments to
   
so I can see if there is some strange formatting in your specific files.

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

Re: Hardware Simulator Won't Load Chip

Tim
Ok thanks,
I sent them to you.
Reply | Threaded
Open this post in threaded view
|

Re: Hardware Simulator Won't Load Chip

cadet1620
Administrator
Tim's problem was Unicode text encoding. The Hardware Simulator can't handle it. You need to make sure that your editor is saving files in ANSI encoding.

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

Re: Hardware Simulator Won't Load Chip

rbilkie
I am using Text Editor with Mac as well, having the same problem (when I try to load a chip, it just says "loading chip..." and nothing happens).  I tried changing the encoding to Western ASCII, Latin Dos I, virtually all the different non-unicode options.  I then downloaded TextWrangler and re-saved the files under every conceivable type of encoding.  Same result.  I don't understand.

I'm not a computer wiz -- that's the reason I'm taking this course.  But I've been wrestling with this for five hours and my assignments are due by midnight tonight.  
Reply | Threaded
Open this post in threaded view
|

Re: Hardware Simulator Won't Load Chip

cadet1620
Administrator
rbilkie wrote
I am using Text Editor with Mac as well, having the same problem (when I try to load a chip, it just says "loading chip..." and nothing happens).  I tried changing the encoding to Western ASCII, Latin Dos I, virtually all the different non-unicode options.  I then downloaded TextWrangler and re-saved the files under every conceivable type of encoding.  Same result.  I don't understand.

I'm not a computer wiz -- that's the reason I'm taking this course.  But I've been wrestling with this for five hours and my assignments are due by midnight tonight.
The most common cause for the Hardware Simulator to hang when loading an HDL file is if the chip tries to use itself in its PARTS section
    CHIP Not {
    ...
    PARTS:
        Not(...);
    }
This can also happen indirectly if chip A uses chip B which uses chip A.

If you don't spot your problem, you can email your HDL to me and I'll let you know what I see.

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

Re: Hardware Simulator Won't Load Chip

ivant
In reply to this post by rbilkie
You can send me your chip file via email and I'll try to find the problem. My email is Ivan at toshkov dot org