HDL deletes our code

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

HDL deletes our code

TobeyMaghetti
Hello,

Whenever I try and run my XOR file I get a line 3 error where the HDL deletes the code we inputted into the file. I can see the code for the chip it appears on the screen but deletes as soon as I run it. Are there any ideas on these happenings.

Thank you for any responses
Reply | Threaded
Open this post in threaded view
|

Re: HDL deletes our code

WBahn
Administrator
It's likely just an issue that you have multiple files (in different folders) named Xor.hdl.

Reply | Threaded
Open this post in threaded view
|

Re: HDL deletes our code

TobeyMaghetti
Thank you so much for the response. I don't have multiple files of our XOR. My code will load into the HDL and I'll see it but once I run it, the code disappears.
Reply | Threaded
Open this post in threaded view
|

Re: HDL deletes our code

WBahn
Administrator
Post the contents of your Xor code (we can delete it later, if needed).

What folder are you putting this file in?

Reply | Threaded
Open this post in threaded view
|

Re: HDL deletes our code

TobeyMaghetti
This is the code we inputted.

CHIP Xor {
    IN a, b;
    OUT out;

    PARTS:
        Not(in=a,out=na);
        Not(in=b,out=nb);
        And(a=na,b=b,out=c);
        And(a=a,b=nb,out=d);
        Or(a=c,b=d,out=out);

}

We edited the built in XOR file and put it in the BuiltInChips folder. The HDL will revert to the original blank chip. Thank you for your help.

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

Re: HDL deletes our code

WBahn
Administrator
TobeyMaghetti wrote
We edited the built in XOR file and put it in the BuiltInChips folder. The HDL will revert to the original blank chip.
And therein lies your problem. Why did you put it in the BuiltInChips folder instead of leaving it in the projects\01 folder where it belongs?

Do you still have the original Xor.hdl file in your project\01 directory?

Don't mess with the BuiltInChips folder. That folder contains implementations that invoke the simulators built-in models, but ONLY when there is no corresponding file in the folder that the simulator is running on. When there IS a file in the folder being used, the simulator ONLY looks at the contents of THAT file.

Reply | Threaded
Open this post in threaded view
|

Re: HDL deletes our code

TobeyMaghetti
We left it in the projects\01 folder and it still doesn't work. So it doesn't seem that that's the issue. The issue causes it to have a line 3 error each time we run it.

Thank you for your help, Tobey
Reply | Threaded
Open this post in threaded view
|

Re: HDL deletes our code

WBahn
Administrator
How did you edit the file?

Are you trying to change it within the tools supplied by N2T? If so, that won't work. You need to use a text editor, such as Notepad (or Notepad++). Don't use a word processor such as Word.

What about the earlier chips, like Not, And, and Or? Did those work fine?