can't load chip

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

can't load chip

siwar
I edit my chips using notepad, but after I write anything in the chip file it doesn't load in the simulator.
Reply | Threaded
Open this post in threaded view
|

Re: can't load chip

WBahn
Administrator
The usual problem is that you aren't opening the file you think you are. Name your edited file something different, like my_Not.hdl, and load that file and see if you are able to see the changes. You won't be able to run the test script because it is looking for the original name, but this will let you see if you are looking in the wrong place.
Reply | Threaded
Open this post in threaded view
|

Re: can't load chip

siwar
it didn't work I still have the same issue
Reply | Threaded
Open this post in threaded view
|

Re: can't load chip

WBahn
Administrator
I need more detail that just "it didn't load".

How did you try to open your renamed file?

How did it fail? Did it not find the file? Did it open a blank file? Did it issue an error message at the bottom?
Reply | Threaded
Open this post in threaded view
|

Re: can't load chip

siwar
I tried to run the demo file and it worked fine, but when I write something in .hdl file and save it, something goes wrong and I get blank, with no error message.
Reply | Threaded
Open this post in threaded view
|

Re: can't load chip

rleininger
When you save the file in Notepad, are you explicitly including the ".hdl" extension to the file name?  Unless you do this, Notepad applies the extension ".txt" by default.  This snap from Windows File Explorer shows the same file with the ."hdl" and ".txt" extensions, respectively.  I still sometimes forget to add a necessary extension when I create new files in Notepad.

Reply | Threaded
Open this post in threaded view
|

Re: can't load chip

MartinB
I have the exact same problem!
I am running  the Hardware Simulator with OpenJava on Windows 10.
When I load for exmple the Not.hdl file from the \nand2tetris\projects\01 -folder it loads fine but if I open the Not.hdl with notepad and starts to write a just a single character after the line: "//Put your code here:"
and saves it with just the .hdl extension Then trying to load it in the Hardware Simulator it just says "Loading chip..." in the status line and the file Not.hdl never loads.
If I the open the Not.hdl with notepad again and removes whatever I have written after the line: "//Put your code here:" - restoring the file to its original contents and saves it again. Then the Hardware Simulator loads the file fine but without my code. Then it is a bit hard to finish any of the projects.
Please can anybody help!!!
wzh
Reply | Threaded
Open this post in threaded view
|

Re: can't load chip

wzh
do you solve it?
Reply | Threaded
Open this post in threaded view
|

Re: can't load chip

YEhrman
I'm having the same issue. (My modified HDL code isn't showing up in the simulator) Did anyone solve it?
Reply | Threaded
Open this post in threaded view
|

Re: can't load chip

mybrotherinChrist
One solution I have is ensuring that no chip has any constant values (i.e.: "true" or "false") as any of the inputs or outputs.
Reply | Threaded
Open this post in threaded view
|

Re: can't load chip

stranger
In reply to this post by YEhrman
did you get any luck? i'm encountering the same problem as well
Reply | Threaded
Open this post in threaded view
|

Re: can't load chip

cliverlong
This post was updated on .
I had the same symptom with Hardware simulator 2.5. The following may help. Check these and see if they help solve your problem

I am running Nand2tetris 2.5 on Windows 10.

1. Every statement, except comment and closing bracket, in HDL file must end with a semi-colon. Check the examples provided.

2. There is a difficult-to-see error message line at the bottom of the Hardware simulator window. In my situation this message line was hidden by the Windows taskbar. This line may contain an explanation of the problem - mine did. I can't get the Hardware simulator window to size well on the Windows desktop.

3. Ensure the name of your chip next to the keyword "CHIP" in the implementation section is the same as the name of your hdl file. So if I have an HDL file:

CRL1.hdl

the CHIP statement must be CRL1 (probably case sensitive).

4. Do not use a Part that is the name of the HDL - e.g. if you are modifying And.HDL do not use "And" within parts. If you try to load such a HDL file  the hardware simulator gives message "Loading CHIP"  in the difficult-to-read message line and never ends - I guess there is some kind of endless loop situation going on where And.HDL is trying to load itself.
It is only possible to have a PARTS that contains a gate that is the same as the HDL file name by using BUILTIN - for example see the definition of XOR in section 1.5.1.

5. If Chip gate2.HDL uses gate1 in PARTS, and gate1.HDL tries to use gate1 in parts (or any recursive call in a "gate hierarchy") then when trying to load the original gate2.HDL, the loading never completes - as in point 4 above.


I know saying there is a bug in software is a very "touchy" subject, but I have two suggestions for the software:

1. Make the (error) message line more clearly visible on a Windows screen (haven't checked on other platforms). Maybe move it from the bottom of the simulator window to somewhere where it can't be hidden. Maybe the sizing of the java windows isn't working quite right in Windows 10/ the java version my machine is running?

2. Add a check that an HDL file can't call itself e.g. And.HDl can't have And( ... ); in PARTS.
Reply | Threaded
Open this post in threaded view
|

Re: can't load chip

cliverlong
In section A2.6 HDL survival guide, section HDL syntax errors, there is a comment that messages may be off the bottom of screen. This is what IBM used to do, what was called a "Documentation APAR", to turn a bug into a feature by documenting the errant behaviour. Personally, I think the error message should be more clearly visible in the hardware simulator. My screen resolution in landscape is 1366 x 768, which I don't consider "small" . Apart from that - which is a real problem when someone is just starting with this Nand2Tetris - the idea behind this gate and chip simulator to trach how chips are designed and tested first in an HDL - is excellent.
Reply | Threaded
Open this post in threaded view
|

Re: can't load chip

WBahn
Administrator
The HDL Survival Guide (which has a few errors itself) isn't intended to turn bugs into features, but rather to help people use the tools as they exist -- i.e., get around the bugs or at least know they exist.

I keep hoping that the next generation of tools will get finished and released. I don't know what the status of that is, but my understanding is that it is a complete rewrite. We have to keep in mind that N2T is a pretty old project and the resources to update and maintain it are very minimal -- it's largely a labor of love at this point. The authors have a whole plate of other things to do and (per my understanding) the tools were originally written by some of their graduate students.

There is a laundry list of things that have been fed back to hopefully inform the next generation of tools. Which ones actually get addressed is going to depend on whomever is writing them and what they find most important and/or not too hard to implement.

One thing that I have noticed with laptop screens in general is that many applications have things at the bottom that are covered by the task bar with no way to move the window up so that you can see it. Or, have things that are off the bottom of the window so that you can't see them no matter what you do unless you move the window over onto an external monitor.

This has always annoyed me. You would think that the one screen that a laptop manufacturer and/or OS developer would be motivated to ensure worked properly would be the screen that comes with the machine.
Reply | Threaded
Open this post in threaded view
|

Re: can't load chip

cliverlong
Thank-you for taking the time to write and explain the background to the development of the Nand2Tetris software and project. Would that the moderators on StackOverflow be so helpful.

First, I think to make such a simulator so freely available as a teaching and learning aid is a tremendous act by the people who have contributed. Even in the first two chapters of the book, I have started to think about and understand that often stated, but rarely explained, phrase “All gates can be built from NAND (or NOR ) gates”. Also, for me the table that explains the basic operation of an ALU by use of “micro instructions” and selectors has transformed my understanding of the operation of this part of the CPU. Yes, all software has bugs, or at least features the user would wish changed.

I recognise the software development isn’t commercial and was mainly performed on goodwill. If time and resources can be found to address the “laundry list” you wrote about, I hope the positioning of the messages will be high on the list. A problem with developing for Windows, as I understand, is there is an almost unlimited range of target device types. However, a significant number of users of the Nand2Tetris software will be using laptops rather than desktops. The layout of the screen contents should accommodate these devices. I agree the taskbar covering up the bottom of Windows is a real pain. I agree the GUI should autoresize the windows to accommodate this “inflated” taskbar.

The only reason I emphasise this display issue is that the software is so useful that it would be a shame that when users first encounter the software and get stuck that they abandon using the software because they can’t see the error messages that might help them resolve their initial problem. If new users can understand better a problem in their HDL and fix it then they would be encouraged to continue to use and benefit from the software.