Hardware Simulator Not Working?

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

Hardware Simulator Not Working?

Garrett M
Hello. This might be an incredibly stupid question but I can not figure out this Hardware simulator. Where do I write the code for it? I cant type anything in it. As I was saying im pretty new to this and I have a decent understanding of logic gates and all this but im really annoyed. Also before I didnt have JRE or whatever and then i got it and everything pops up but the Jack Compiler which immediatly closes. Is this what I need to be writing the code? Also other than that awesome book so far.
Reply | Threaded
Open this post in threaded view
|

Re: Hardware Simulator Not Working?

cadet1620
Administrator
This post was updated on .
You need to use some sort of text editor like Notepad to write your HDL files.  Usually you will load a test script and the test script will load the HDL file.

A complete set of skeleton HDL files and test scripts is available from the TECS web site's Study Plan page's Project links.

The Jack compiler is a command line program.  That's why it's exiting immediately.

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

Re: Hardware Simulator Not Working?

Garrett M
Sorry probably another stupid question, but not that ive written my script in notepad, how do I get it into the simulator? Whenever I try to load the script it wont show up. Anyways a lot for responding fast.
Reply | Threaded
Open this post in threaded view
|

Re: Hardware Simulator Not Working?

cadet1620
Administrator
On the Study Plan page http://www1.idc.ac.il/tecs/plan.html there is a link to a tutorial on the Hardware Simulator http://www1.idc.ac.il/tecs/tutorials/hardware-simulator.pdf that is worth reading.

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

Re: Hardware Simulator Not Working?

Nick
I hope Garrett or someone on this forum figured out how to upload the .hdl file after editing in a text file.  I read through much of the tutorial and it doesn't address this specific issue.  I have the same issue as Garrett did.  I have a Windows computer and the simulator will load all the chips accept the ones that have been edited.  The script editor will not even load the .hdl file unless I have not edited the file.  Any ideas??
Thanks
Reply | Threaded
Open this post in threaded view
|

Re: Hardware Simulator Not Working?

cadet1620
Administrator
Nick wrote
I hope Garrett or someone on this forum figured out how to upload the .hdl file after editing in a text file.  I read through much of the tutorial and it doesn't address this specific issue.  I have the same issue as Garrett did.  I have a Windows computer and the simulator will load all the chips accept the ones that have been edited.  The script editor will not even load the .hdl file unless I have not edited the file.  Any ideas??
Thanks
What editor did you use?  If you're still having problems, email me one of the files that doesn't load, as an attachment, not cut-and-pasted, to <my-forum-name> at pobox dot com.

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

Re: Hardware Simulator Not Working?

Nick
Hey Mark, thanks for the quick reply.  I used notepad and notepad++.  Notepad++ does not have a .hdl format.  It does have a .vhdl format though, but that doesn't seem to make a difference.  Since all of the preloaded .hdl files work fine until it's brought into the text editor, I'm sure the text editor is to blame.  Do you have a suggestion of which editor to use? Thanks!!
Reply | Threaded
Open this post in threaded view
|

Re: Hardware Simulator Not Working?

cadet1620
Administrator
Nick wrote
Hey Mark, thanks for the quick reply.  I used notepad and notepad++.  Notepad++ does not have a .hdl format.  It does have a .vhdl format though, but that doesn't seem to make a difference.  Since all of the preloaded .hdl files work fine until it's brought into the text editor, I'm sure the text editor is to blame.  Do you have a suggestion of which editor to use? Thanks!!
Notepad and Notepad++ both work for me.  For Notepad++ make sure Encoding is set to Encode in ANSI.  Language setting shouldn't matter.  Don't do Save As and select a file type.

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

Re: Hardware Simulator Not Working?

Nick
I did save as, which was stupid.  But unfortunately that doesn't make a difference.  I just added one line to the implentation section and saved it (not as).  But when I went to the Hardware simulator it didn't open the file.  I used both notepad and notepad++.  Any suggestions?
Reply | Threaded
Open this post in threaded view
|

Re: Hardware Simulator Not Working?

cadet1620
Administrator
Email me one of the files that doesn't open to cadet1620 at pobox dot com.  Be sure to send the file as an attachment.  Don't use cut-and-past because the text will be reformatted in email.

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

Re: Hardware Simulator Not Working?

cadet1620
Administrator
Thanks for emailing the Not.hdl file.

Here's what's happening.  From your Not.hdl:
CHIP Not {
    IN a;
    OUT out;

    PARTS:
    Not(in = a out = nota)
This Not chip is trying to use itself in its definition, which is causing an infinite loop!

The only part that you can use in your Not is the Nand.
Then build your And using only Not and Nand, etc.

Also note that you need ';' at the end of all the part statements.

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

Re: Hardware Simulator Not Working?

Nick
Thanks so much for all of your help.  I read through the appendix again and the syntax makes more sense.   One confusion for me was which variable was the part's pin and which value was the input data.  For instance, in the And gate, there is a part where a = a.  The difference in variables seems to be that the left value is the value relating to the Nand gate and the right value is the original input.  I didn't think the vaiables would be equivalent for both distinct pins.  I am going to keep working on this, and perhaps I'll find my initial understanding was off.  Anyhow, thanks a lot!!
Reply | Threaded
Open this post in threaded view
|

Re: Hardware Simulator Not Working?

cadet1620
Administrator
The thing to remember here is that the '=' indicates a wiring connection, not a value assignment. The names are not variables as understood in programming, rather they are the names of wires and I/O pins.

The name on the left is always the name of a pin in the part being used, the name on the right is always the name of a wire or pin in the part being defined.

If you are building the DMux which has the following definition:
CHIP DMux {

    IN  in, sel;
    OUT a, b;
and you had a part line
    Not(in=sel, out=b);
in and out are pins in the Not, sel and b are pins (or wires) in the DMux.

If you haven't, read the Hardware Construction Survival Guide.

--Mark