.hdl file modification

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

.hdl file modification

Jonathan Ennis
Hi,

I bought the kindle version of the "Elements of Computing" book, and think that it is great.

I am attempting to complete project 01, but am having trouble modifying the .hdl files, my system is as follows:

Mac OS X 10.5.8 (laptop)
running the HardwareSimulator.sh from a terminal window with the bash command

I edited the Not.hdl file with TextWrangler and added information in the PARTS: section.

after saving the edited version of the file, it is no longer executable. I tried to make it executable with the chmod command: "chmod +x Not.hdl"

but it didn't work, and I can't figure out how to make the file executable again. Any help would be greatly appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: .hdl file modification

cadet1620
Administrator
Jonathan Ennis wrote
I edited the Not.hdl file with TextWrangler and added information in the PARTS: section.

after saving the edited version of the file, it is no longer executable. I tried to make it executable with the chmod command: "chmod +x Not.hdl"

but it didn't work, and I can't figure out how to make the file executable again. Any help would be greatly appreciated.
You should not set the executable attribute on HDL files; they are source files for the Hardware Simulator.  After editing, load the corresponding .tst file in the simulator and it will load and test your .hdl file.

If the Hardware Simulator can't open your modified file, try closing and restarting the simulator after editing.  (Although I don't think it will happen on Macs, I have seen an interaction on Windows between the TECS tools and an ancient text editor I sometimes use that requires doing this.)

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

Re: .hdl file modification

ybakos
In reply to this post by Jonathan Ennis
Why are you trying to make the .hdl file executable?

If your goal is to see if your Not.hdl implementation is correct, you can either:

HardwareSimulator.sh /absolute/path/to/project01/Not.tst

(where "/absolute/path/to/..." is entirely dependent on your system)

Or, start up the HardwareSimulator and load & run Not.tst.
Reply | Threaded
Open this post in threaded view
|

Re: .hdl file modification

Jonathan
After downloading the project 00 and project 01 folders to my laptop (the mac), and opening the folders the icons for the files were 'gray squares' that mac uses to represent a unix executable file, at least I think that is the case, as when I use 'quick view' on any of them a larger view of the icon pops up that describes the file as a Unix executable file.  

But after changing the file with a text editor, the icon appears as a regular text file, and quick view describes it as such.  That made me think that I had to make the file executable.  I did try closing the HardwareSimulator.sh file and reopening it, but got the same result.  It won't load my modified file.

BTW, the reason I am on the Mac now, is because I couldn't get past go on my windows machine, which is an Asus laptop running Windows 7.  I found posts here about changing your classpath, and tried that, but I think that I entered the modifications incorrectly, and that is preventing my progress in Windows.

I entered this line:  '.;C:\Program Files (x86)\Java\jdk1.7.0_03\bin' (sans quotes), as a new environment variable called CLASSPATH, and tried different versions of it to no result, (eg, without '.;', reversing the '\' to '/', etc).  If my mistake in windows is apparent to anyone, please advise me on how to correctly set this path, and I will return to windows.  

My apologies for the long post
Reply | Threaded
Open this post in threaded view
|

Re: .hdl file modification

cadet1620
Administrator
Long posts are much preferred to short post that have to be guessed at to understand.

On Windows, you should not have to set the CLASSPATH variable yourself.  If it wasn't there, you likely don't have the Java runtime installed. (The "jdk" is the Java Developer's Kit; you won't need that unless you are developing Java apps.)

Delete the CLASSPATH you added and install the latest Java runtime from http://java.com/en/download/index.jsp

Use the Windows Explorer to find the HardwareSimulator.bat file and double-click on it.

You can create a shortcut to HardwareSimulator.bat on your desktop for convenience. Do not move or copy HardwareSimulator.bat itself.

Someone with a Mac will need to address those specific issues.

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

Re: .hdl file modification

Jonathan
Thanks for the help and advice.  I attempted to install the JRE from the link provided, but as I was installing the software, "it" said that the JRE was already installed, and asked if I wanted to reinstall.  Since I was having "issues" with the JRE, I went ahead and reinstalled.  I got the same error, as before.  So, I searched the term: 'classpath windows 7', and found a site that had a walkthrough on how to set the environment variables on your computer.  I followed those instructions exactly, and I am now up and running.  

I don't know why this is necessary, but it may have something to do with changes to the way the JRE/JDK installs in the latest updates, the Java folder is placed in C:\Program Files (x86)\Java\jre1.6.0_18\bin, and I believe that in previous versions of windows the default location is just c:\programs\java...  

That may not be, but nonetheless I am on solid ground, and the game is afoot.  This is going to be fun.

cheers,
Jonathan