Quartus and source control

Hello all, I'm interested in implementing a source control system (Subversion) in the company I work. We do mostly Altera FPGA designs, so our main tool is Quartus. I would like to know if anyone has done that before, and how. The main problem with Quartus is that it has no "source file list", but rather it searches dynamically for files (mostly true for old design entry methods like AHDL and schematic). Does anyone know of a tool (maybe a TCL script) that takes a projects and generate a list of all source files included? I would be happy to hear about any experience of this kind.

Thanks, Avishay

Reply to
avishay
Loading thread data ...

Most of my designes are under CVS. They are are a mix of ASIC, Altera, and Xilinx designs. Some of the designs have even an implementation for all the above. However, I rarely use the GUI tools, except for floorplanners, memory/ip-builder and waveform viewers. To generate a new implementation I usually do:

cvs checkout designname cd designname/impl/somefpgadevicename make

In the Altera case make will run quartus_sh.

I usually explicitly list my source files:

foreach f designfile1.v designfile2.v designfile3.v { set_global_assignment -name VERILOG_FILE $f }

Petter

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
 Click to see the full signature
Reply to
Petter Gustad

What a timely post. I was just looking into this on Friday (but with CVS).

I've been used to Xilinx where I just archived my .npl an .ucf files to capture the project settings for the Synthesis/P&R..

I believe in Quartus you need to archive the .qpf and .qsf files (as well as your HDL code, of course).

Does anyone know of other Quartus specific files that need archived to be able to restore the Synthesis/P&R project?

John Providenza

Reply to
johnp

The list of all source files compiled can be found in the Report file under Analysis and Synthesis->Source Files Read. You can right click in this window and save the panel out to a text file. Take every file which says User Entered, every file which is not under the Quartus installation directory and add it to your source code control system. Then follow Petter's instructions. The process of discovery only works in the cases where there is 1-1 relationship between filename and entity name. This is true for BDF's (schematics) and TDF's(AHDL), but does not hold true for HDL's like VHDL and Verilog. You are required to add the list of HDL files in your project.

I recommend that you archive your design, and restore it in a separate directory. This should contain the list of files that Quartus needs to recreate your project. Never archive the db directory. To learn how to generate a Quartus Project from scratch each time if you only have the HDL files take a look at the Tcl file generated by the Project->Generate Tcl file for Project command.

Hope this helps, Subroto Datta Altera Corp.

Reply to
Subroto Datta

Ok, let's say I want to write a script that adds all new source files into the source control. The first step would be obtainig the list of sources from the report. Is there a better way other than reading the report file and process it to find the relevant section?

Apart from that, there is yet another problem. Some of the VHDL files in the project are generated automatically by SOPC builder. Strictly speaking, these are not source files, and I don't want to add them to the source control system (they're already there at their source locations). Is there any way to detect which are these files? As a starting point, it would be nice if I could instruct SOPC builder to put its files into some specific directory under the project, not in its root (even from command line).

Thanks, Avishay

Reply to
avishay

Is there a recommended source control system?

Thanks, Derek

Reply to
Derek Simmons

Quartus files can be stored in any source code control system. All source files needed to create and compile a project are text files. We have customers and internal users who have versioned Quartus projects with CVS, Clearcase, Perforce, RCS.... The only binary file is the .qws (workspace file) files that contains the locations of the window settings when the Quartus UI executable (quartus.exe) is closed..The .qws file is not needed for compilation.

Hope this helps,

- Subroto Datta Altera Corp.

Reply to
Subroto Datta

The 'source files' for things that flow through SOPC Builder are the .PTF file(s). If you develop your own unique Avalon components then those components will each have their own .PTF file.

Whether you develop your own components or are only integrating existing components via SOPC Builder, the system .PTF file is where all this information gets stored so at a minimum that .PTF file would need to be included in the sources with a build script needed to then transform the .PTF file into VHDL.

KJ

Reply to
KJ

One can use uuencode the .qws file to get it into a source code control system.

Btw, why is there no webpack linux offering like xilinx have?

Reply to
pbdelete

Can't you just store the binary in the source code control? Obviously you can't compare versions in the same way as for text files, but you couldn't do that with uuencoded files anyway. Certainly subversion should have no problem storing binary qws files - I don't know about any other systems.

Reply to
David Brown

For clarification purposes, I did not say that the .qws file should not be versioned, or cannot be stored in a source code control system. It was important to point out that you will need to take some steps to preserve its integrity if you store it in a version control system.

- Subroto Datta Altera Corp.

Reply to
Subroto Datta

I have had experience managing workgroups of engineers working with MS VisualStudio. The project was started with SourceSafe but we switched to CVS. We gained availability - people from off site could access the CVS source trees more easily. But what we lost was convenience and easy of use of being able to check in changes from within VisualStudio. And, I couldn't determine if it was unfamiliarity with a new tool, but when we switched to CVS, conflict resolution became an issue.

I have bid on projects that I have had in mind to have 4 to 8 engineers working on designs. What I have been on the look out for is workgroup software that integrates with the development environment so that engineers can stay focused on what they are working on and not distracted by resolving conflicts. I realize a lot of this has to do with who is working with what files. To summarize, I'm looking for something that I cost justify that it will increase employee efficiency.

Is Altera or any body that Altera has a partnership with working on a workgroup development tools that integrate into QuartusII and SOPC Builder?

Reply to
Derek Simmons

There are many windows text editors compatible out of the box with the best of the open source version control systems. However, visualstudio is not one of them.

formatting link

-- Mike Treseler

Reply to
Mike Treseler

You don't need to uuencode a binary file to store it in a version control system, at least not the ones I've used (cvs and subversion). Something like RCS may need to use text files, since (I believe) it modifies the files themselves, but it hardly counts as a modern source code control system. With cvs, there are a couple of gotchas regarding binaries, but subversion handles them smoothly and efficiently.

Reply to
David Brown

I see that this thread creates lots of interest, but it has gone a little off topic.

I will try to describe the problem I face in more details. The grup I work in is composed of several hardware (FPGA) engineers. Some of them use VHDL, and some use graphic methods. Currently, no source control of any kind is used, making tracking design sources and sharing them among the group very difficult. In order to solve some of these problems, I want to install and start use Subversion as a source control system. What I look for is a way to automatically include in the source control components that are normally added in the graphic editor or using the MegaWizard interface. Another, related problem is taking an existing Quartus project, and putting it under source control without losing files and without including files that are not necessary. The best way to accomplish both tasks, in my opinion, is writing a script that wolud go through the project hierarchy (after synthesis), pick up all the source files used and add them to the source control system (if theyr'e not already there). Subroto Datta suggested to use the "Source Files Read" section of the analysis report, which seem to be a good direction, but I need to know if there is a way to get this information*programatically*, rather than text processing the report. This report also seem to lack memory initialization files (maybe more kind of files I don't know of?).

Another type of problem is the SOPC builder. The SOPC builder takes the system specification from PTF files (as KJ mentioned) and copies HDL files from the relevant library into the project directory. These copied files are not strictly sources, but rather intermediate products, and as such they should not be under the soruce control (they should, in fact, but they should be controlled by the one that wrote the component, not the one using them). After SOPC builder has finished its run, there is no way (to my understanding) to distinguish between true source files and those who were copied. They will both show up the same in the said report. A possible solution might be to instruct SOPC builder to copy its files to a directory other than the project root (I think it would be much easier to manage also), but I don't know how to do that.

Thanks for everyone who has replied (and will) Avishay

Reply to
avishay

As I mentioned earlier in news: I usually do the following to build a new implementation:

cvs checkout designname cd designname/impl/somefpgadevicename make

This inlcudes designs based upon the SOPC builder. The PTF file it checked into CVS together with the C source files. Make will use the SOPC builder scripts to generate everything from the PTF file. The generated (or copied) HDL files are not checked in.

I don't keep the generated files under source control since they can be regenerated using the PTF file and SOPC builder.

Can't you keep the sources for the components in a different directory (also under your source control system) and refer to them from your SOPC run? You can then reuse the components for different projects as well. This is similar to how the components supplied with SOPC builder are handled (except that they are a part of the SOPC distribution and not under a source control system).

Petter

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
 Click to see the full signature
Reply to
Petter Gustad

Quartus provides a way to generate one compressed archived with all the required files. To archive, go to your project directory type: quartus_sh --archive

This command will generate a .qar file. To unarchive type

quartus_sh --restore As part of the --archive, a .qarlog which lists all archived files. You can parse this list to determine which files are most important, but note the list will also contain reports and other important output files (which many times are also put under revision control). To capture the sopc_builder files, add all files which end with the ptf extension to this file list. This may already be there in the qarlog file but do verify it for completeness.

As mentioned in my earlier post you can access the "Source Files Read" or any other report panel via Tcl. Use "quartus_sh --qhelp" to get details. Look for the "report" package. Here is the script that you will need (run it after you have compiled your project so that the report is available):

"myscript.tcl" load_package report set revision name [lindex $quartus(args) 0] project_open $revision_name load_report

# Set panel name and id set panel "*Source Files Read" set id [get_report_panel_id $panel]

# Get the number of rows set row_cnt [get_number_of_rows -id $id]for {set i 0} {$i < $row_cnt} {incr i} { puts [get_report_panel_data -row $i -col_name "*Absolute Path" -id $id] }

unload_report project_close

To execute this script type quartus_sh -t myscript.tcl You should be in your project directory when you execute this.

Hope this helps, Subroto Datta Altera Corp.

Reply to
Subroto Datta

Subroto -

For my archiving purposes, I'd like to know the smallest set of Quartus files I need to save to re-create the design.

My analogy here is - "if your house was on fire, what what you carry out with you".

I think I only need to keep my HDL code, the .qpf, and .qsf files. All the other files can be re-created using the Altera tools, correct?

Luckily, if "my house is on fire", all of these files will fit in my pocket.

John Providenza

Reply to
johnp

I keep my HDL files and a small tcl script to compile the design and generate the programming files (optionally upload the programming files to the DUT).

Petter

--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
 Click to see the full signature
Reply to
Petter Gustad

"Derek Simmons" writes: |> Is there a recommended source control system?

Subversion is one of the most popular ones today.

It has become the de-facto successor of CVS, because it is very easy to understand for people used to CVS and fixes most of CVS's problems. In particular, in contrast to CVS, Subversion understands about renaming and copying files and subdirectories, and using this, it provides a far more elegant and flexible alternative to the branching and tagging mess of CVS. Subversion also has much better support for remote access than CVS.

Definitely worth a try!

The manual is at

formatting link

A very good and mature tool for converting an existing CVS repository into Subversion is cvs2svn at

formatting link

Subversion, like CVS, is a set of command-line tools. If you want a Microsoft Windows GUI client for Subversion that integrates fully with Windows Explorer, try TortoiseSVN at

formatting link

A comparison of source control systems is at

formatting link

Markus

Reply to
Markus Kuhn

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.