"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
Cse 241
1. CSE 241
How to Use Script Command &
Zip Files in UNIX/Linux
Victoria Minorczyk
2. First enter the directory where the file you want to run is located.
Use the command “cd <name>” as shown above where <name> is the name of the directory.
Notice how the prompt changes to reflect the current directory.
Your prompt should now reflect the directory that your desired file is located.
3. To view the contents of a directory use the command “ls”.
As you can see, my Verilog file “hw8.v” is located in the “cse241” directory.
4. To start the script, use the command “script <name>.txt” as shown above, where
<name> is the name what you want to call your script file.
Make sure the file extension is “.txt” Also, if you do not give the script text file a name, it will
default to typescript. After entering this above script command, you will get confirmation that
the script has started. It will also inform you of the script file name, as shown below.
5. Now that the script has started, you will enter all the commands to run your Verilog
code just as you normally would.
You will start will the iverilog command as shown above. In this step you will link the “.v” file to
the “.vvp”. Then, as shown below, you will use the vvp command with the “.vvp” file you just
created. This step should create the “.vcd” file you will use with gtkwave.
6. You should get some output from your testbench module after running your vvp command.
This will all be captured by the script. Also note the confirmation message that your “.vcd” dump file was
created.
THIS IN NOT THE OUTPUT FOR YOUR ASSIGNED PROBLEM (5.36). THIS IS THE OUTPUT FOR THE SIMILAR
PROBLEM I WENT OVER IN RECIATION.
7. Once you get output from your testbench, you may end the script.
To end the script use the command “exit” as shown above. Once entering this command you will
get a confirmation message that the script has stop recording, as shown below.
8. Now if you use the “ls” command, you will see the script file you just created.
In my case, it is named “hw8.txt” as I specified when I started the script. As shown below, to
view what the script has captured, use the command “more <name>.txt” where <name> is the
name for your script text file.
9. As you can see,
this
was captured by
the script
command
and displayed
with
the more
command.
10. Now we are ready to zip up the files.
I would like to zip up all of my homework 8 files. So first, I must enter the directory where
all my homework 8 files are located. In this example I am already in that directory. If you
are not, you the “cd” command earlier in these slides. To zip use the command:
“zip <directory name> <new zip file name>.zip <list of files to be included in new zip>”
In the example below, I use the command “zip csce241 cse241.zip hw8.*”
Because all of my files are named “hw8” I used “hw8.*” to include hw8.v, hw8.vvp, hw8.vcd,
hw8.txt. As you can see, “*” is a wildcard. As shown below, when you enter this command,
you will get a confirmation message telling you all the files that were added to your zip file.
11. Please note, that I could have also used:
“zip cse241
cse241.zip hw8.v hw8.vvp hw8.vcd
Or, to include every single file in the directory use “*.*” like this:
“zip cse241 cse241.zip *.*”
hw8.txt”
You can now use the “ls” command to see the zip file you have just created, as shown below.
12. Once you have all the files zipped that you desire to turn in, you may use the
“submit_cse241” as shown below.
After you submit, you should receive a confirmation telling you your submission was successful,
as shown above.