| CSE 566 |
Reconfigurable System On Chip Design
|
John W. Lockwood Fall 2004 |
Machine Problem 0:
Version Control for Large-Scale
SoC Project Designs
Due: Tuesday, September 28, 2004, 2:30pm
10 Points
Instructions
- Visit the Urbauer 116 Laboratory to perform the
exercises described below.
- Show your results to a laboratory assistant.
- Save your results back to the CVS repository
Throughout this course, we will use a tool called the Concurrent Versions System (CVS). The following material provides you with a very brief introduction to using CVS with your projects. CVS has many more features than those that we will be using in this class. Our examples do not, for example, specify how to revert to past versions of your files. A full manual on CVS is available on-line at:
The CVS Manual
and is recommended reading.
To complete the following exercises, you will need to use a Cygwin shell from a Windows machines in the Urbauer 116 lab. As a student in CSE566, you have been assigned a username that you will need to access your files.
We will be accessing the files and simulating the design two ways: locally and remotely.
Part 1: Local Access
- Open the Cygwin Bash Shell, and run the following command:
export CVS_RSH=/bin/ssh && export CVSROOT=username@soc.arl.wustl.edu:/usr/local/cvsroot
- You will be using the account provided to you for CSE566 at the start
of the semester.
- Make a directory called projects (or choose a different directory name of your choice) with the command:
mkdir projects
Assuming that you use the directory called projects, use the following command to change to it:
cd projects
- Run the following:
cvs checkout -P username/MP1
to check out Machine Problem 1. Substitute your username for username. This will create a directory with your username, and underneath that a directory called MP1. The P flag is to prune empty directories. By default there is no way to delete directories from a CVS repository, so the P option will cause these folders to not be copied when you check out the project.
Part 2: Remote Access
- Open the Cygwin Bash Shell, and run the following command:
export DISPLAY=localhost:0.0
This sets up your X environment. Next run the following command:
startx &
This will start the X server (Cygwin-XFree86). It may take a little to come up.
- Using one of the terminals (either in the X window or the regular Cygwin Bash Shell), run the following command:
ssh -X username@soc.arl.wustl.edu
where username is the username you were given. You will be asked for your password, and then you will log in. Note that when you are logged into SOC, your CVS environment is already set up.
- Make a directory called projects (or choose a different directory name of your choice) with the command:
mkdir projects
Assuming that you use the directory called projects, use the following command to change to it:
cd projects
- Run the following:
cvs checkout -P username/MP1
to check out Machine Problem 1. Substitute your username for username. As previously, this will create a directory with your username, and underneath that a directory called MP1 containing another copy of your source code on the remote machine SOC.
Part 3: Using CVS
You'll now get an introduction to most of the main functionality of CVS. Below are some general instructions for renaming, adding and removing files, and committing changes. Follow the instructions below to change the name of the What_To_Do file to What_To_Do.txt Do all of this while SSHed into SOC, immediately following Part 2.
Renaming files
- Files are renamed by deleting the old file from the repository and adding it with its new name to the repository, following the instructions for removing, adding, and then committing files as described below.
- Hint: The easiest method to rename files is to copy the old file to a new file with the new file name, then run the remove and add, and then commit both changes. Start, then, by doing the following:
cp What_To_Do What_To_Do.txt
Adding new files to your project
- The command
cvs add -m comment filename
will add files to the repository. Replace comment with a descriptive comment, in quotes, of what you're adding, and replace filename with the file or files that you wish to add (or you can specify a directory with no trailing slash to add that directory and its files).
- To add the What_To_Do.txt file, do this:
cvs add -m "Changed name to give it an extension" What_To_Do.txt
- Once you've added a file, you must perform a commit on the added file or files to make this addition final.
Removing files from your project
- First delete the file or files or directories from your working copy. Yes, really delete them. To remove the file What_To_Do, run:
rm -f What_To_Do
- Then, use
cvs remove filename
where filename is the name of the file, files, or directories (no trailing slash) to remove from the repository. If you're feeling risky, you can pass the -f flag to cvs remove to remove the file from both CVS and your filesystem in one go. You'll still have to commit the change though. In the context of this tutorial, the command would be:
cvs remove What_To_Do
- Once you've removed a file, you must perform a commit on the removed file or files to make the removal final.
Changes to existing files (not adding, deleting, or renaming files)
- Design files can be edited either using a text editor (vi, emacs, textpad, etc.) or using the interfaces provided in the GUI-based tools. If you make changes to the source code, follow the instructions in the README file in the MP1 directory (or below) to recompile the project.
- When you change a file, you must commit the change (just as you commit an add or remove).
Committing changes
- Our tools generate large numbers of output files and temporary files. Since these files are not really part of the design, we prefer to delete them before we check in changes to a design. To do this, run
make clean
from the MP1 directory to delete temporary files before performing a commit.
- To store your files back in cvs, you need to commit your changes. Running a commit command on a directory (with no trailing slash!) will recursively commit all changes to files and subdirectories in the specified directory to your CVS repository. This is the best way to commit groups of files at once, unless you specifically do not want to commit some files for some reason. Keep in mind that the current directory, signified by a single period ( . ) is a valid directory.
- To commit changes back to the server, the following command should be run from the MP1 directory and will update all changed files in MP1 (note the trailing period):
cvs commit -m comment .
Replace comment with a descriptive comment (human readable text) of what you've changed, in quotes!
Updating the local copy
Now, go back to your local copy (using Cygwin, not but not SSHed into SOC), change to the MP1 directory, and run the following:
cvs update -P
Look at the files in the directory. Note how What_To_Do is now gone, and What_To_Do.txt now appears in the directory.