Version Control

From Altera Wiki
Jump to: navigation, search


Short introduction into subversion

Subversion is a free version control system, the successor of CVS. Version control helps you backup your code, track changes, and share code among multiple developers. You can find more at the subversion home page.

A great tool for accessing a subversion repository from Windows OS is TortoiseSVN.

Storing Quartus II projects under version control

There is no need to backup all files in a Quartus project to be able reproduce it. You have to store source files (so that you can modify the project) and final binary files (so that you can reproduce the system exactly).

NOTE: This is not the final list yet, but it works for most simple projects (the software part is still missing). You should still test a reconstruction of the project from this files.

Quartus II source files:

  • project files:
    • project_name.qpf Quartus II project file
    • project_name.qsf Quartus constraint file (lists the hardware constraints defined for a project, from the used chip and pinout to timing constraints)
    • project_name.qws Quartus Window Settings ? (the configuration of the Quartus gui for the project, may be omitted)
  • top level source files:
    • project_name.bdf Block diagram / Schematic file (top level schematic file, there may be many nested files)
    • project_name.vhd VHDL file (top level VHDL file)
    • project_name.v Verilog file (top level Verilog file)
  • component source files:
    • component_name.bsf Block Symbol file (component symbol file)
    • component_name.vhd VHDL file (top level VHDL file)
    • component_name.v Verilog file (top level Verilog file)
  • SOPC builder project source files (SOPC builder creates many VHDL or Verilog files, that you do not need to store)
    • sopc_project_name.ptf the list and configuration of components selected in the SOPC gui
    • sopc_project_name.bsf Block Symbol file (SOPC component symbol file, especially if you modified it)
  • Board Description (if you created your own board, the list is incomplete!)
    • board_name/class.ptf
  • software source files:
    • tbd

Quartus II binary files

  • hardware binary files
    • project_name.sof SRAM Object File
  • software binary files
    • tbd

Reconstructing a project from a subversion repository

Since the subversion repository contains only the necessary files, a procedure should be followed for reconstructing the full project from the repository.

  1. Import the selected project from the subversion repository to the local drive.
  2. Open the project in Quartus II.
  3. Open the SOPC builder project and build it.
  4. Build the Quartus II project and program the hardware into the FPGA.
  5. Import the software part of the project into a NIOS IDE workplace.


  1. Archiving SOPC Builder Projects

18. STRONGLY RECOMMENDED, You should use subversion to help tracking your works, including both hardware and software.
Try "svn help", if you don't have it, install it with "yum install subversion". (for fedora core)

a. create the svn store, and check your original as rev1.
[code]cd ~
mkdir mysvn
svnadmin create mysvn/webs
tar xzvf webs218.tar.gz
svn import ws031202 file:///home/alex/mysvn/webs/ws031202 -m="initial
rm -rf ws031202
svn co file:///home/alex/mysvn/webs/ws031202[/code]

b. make your change to Makefile, misc.c ....
build and test....

use `svn add` to add new files to keep track of.

use `svn commit -m="this is an update for....." ` to save your change.

c. after you finished, or when you want to save your change to store, as rev2
[code]cd ws031202
svn commit -m="update for nios2 uclinux"
svn diff -r1 >webs.diff[/code]
Then you can send webs.diff to others

d. when other get your diff file, he can apply the patch and get the same update from yours.
[code]tar xzvf webs218.tar.gz
cd ws031202
patch -p0 <webs.diff[/code]

The subversion is very helpful. You can find more usages from the subversion guide on their web.

Personal tools