Running Test Script wipes out Chip parts

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

Running Test Script wipes out Chip parts

scipio
Stuck on first problem - the NOT gate

The hdl loads fine. I devise and load the text script (from Notepad) without any problem and its correct (checked against answers on Internet).

I then load the test script - again no problem. However as soon as I run (either single or complete steps), the test script  wipes out the Parts details. And of course I get an error.

There is no problem with cmd either.

What am I doing wrong? Does not appear that I can save the Chip PARTS before running the test script.
Reply | Threaded
Open this post in threaded view
|

Re: Running Test Script wipes out Chip parts

ivant
What do you mean by "wipes out"? Wipes it from where?

I'm not sure if I'm getting this right, but I think you do the following:
1. Load the chip
2. Load the test script
3. Run the test script

If that's the case, then the problem is that the test script itself expects to find the chip definition in the file Not.hdl and it loads it from there. The default file contains just the skeleton, without any actual implementation. What you need to do is to edit this file and then load only the test script and run it. It should take care of the rest.
Reply | Threaded
Open this post in threaded view
|

Re: Running Test Script wipes out Chip parts

scipio
Thanks - for benefit of any other dummy, what I am doing is:

1.Start Hardware Simulator
2. Load Not.dhl
3. Load Not.txt (Notepad file) - looks good!
4. Load Script Not.tst (notice that API is now not correct eg 1 cahnged to 0)
5. Run Not.tst

Then as you say it goes to default which does not contain my PARTS implemenation.

So I think my problem is this default file, Not.dhl.

I can't open it so how do I use Notepad to edit it?


On 18/01/2020 07:36, ivant [via Nand2Tetris Questions and Answers Forum] wrote:
What do you mean by "wipes out"? Wipes it from where?

I'm not sure if I'm getting this right, but I think you do the following:
1. Load the chip
2. Load the test script
3. Run the test script

If that's the case, then the problem is that the test script itself expects to find the chip definition in the file Not.hdl and it loads it from there. The default file contains just the skeleton, without any actual implementation. What you need to do is to edit this file and then load only the test script and run it. It should take care of the rest.


To unsubscribe from Running Test Script wipes out Chip parts, click here.
NAML


Reply | Threaded
Open this post in threaded view
|

Re: Running Test Script wipes out Chip parts

scipio
In reply to this post by ivant
Success!

For others who have just wasted 5 hours of their life.

1. Take the Not.hdl into notepad

2. Add your implementation

3. Save with Ctrl S (do not save in any other way or this ends as a .txt file and yourinto the same problem I had earlier).

Cross your fingers, Start-up Hardware Simulator and load the Implented Chip -  bingo it works (Please excuse me. I am a Chemist BTW just trying to see how the products we sell end up as a computer)






On 18/01/2020 07:36, ivant [via Nand2Tetris Questions and Answers Forum] wrote:
What do you mean by "wipes out"? Wipes it from where?

I'm not sure if I'm getting this right, but I think you do the following:
1. Load the chip
2. Load the test script
3. Run the test script

If that's the case, then the problem is that the test script itself expects to find the chip definition in the file Not.hdl and it loads it from there. The default file contains just the skeleton, without any actual implementation. What you need to do is to edit this file and then load only the test script and run it. It should take care of the rest.


To unsubscribe from Running Test Script wipes out Chip parts, click here.
NAML


Reply | Threaded
Open this post in threaded view
|

Re: Running Test Script wipes out Chip parts

ivant
In reply to this post by scipio
Notepad is not a very good source code editor. You can use things like Notepad++, Visual Studio Code, Atom, Sublime Text or something else. (I think Sublime might not be free of charge, all the others are).

Notepad++ is probably the easiest to start with and also with the least features. I'd go either with it or with Visual Studio Code, but any of them or a number of others will be fine.
Reply | Threaded
Open this post in threaded view
|

Re: Running Test Script wipes out Chip parts

Lozminda
Just for the record; you don't have to pay, you can try out (in theory) forever (apparently). It asks you want to buy a licence every now and then. It's the best editor I've found so far, I might even buy a licence eventually. Might, if i go pro !!!
Reply | Threaded
Open this post in threaded view
|

Re: Running Test Script wipes out Chip parts

Lozminda
In reply to this post by scipio
Also your txt files have to be saved in the correct "character encoding" it's windows 1252 I think....
(I might be wrong about windows 1252)
for example

http://nand2tetris-questions-and-answers-forum.32033.n3.nabble.com/Illegal-Character-Error-tt4027811.html#a4027813
Reply | Threaded
Open this post in threaded view
|

Re: Running Test Script wipes out Chip parts

scipio
Thanks for the advice. Notepad should come with a health warning.

I got bored with the large amount of repetitive typing for And16 and Or16 and tried copying from Notepad Not16. This corrupted something and I even managed to wipe out the default values as well.

Notepad++ behaves very well and although I tried a bodge up using Notepad++ for And16 and Or16 these are still unacceptable. Fortunately I have scored more than 75% and am on to the next section (and a bit wiser).