Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Altera_Forum
Honored Contributor I
1,208 Views

Calling sopc_builder from the Quartus Tcl console

Hi, 

 

I'm having trouble figuring out a method for calling sopc_builder from within the Quartus Tcl console. There's several issues, so I'll try to summarize. 

 

objective: 

 

Build a project consisting of HDL source, timing constraints (.SDC), and an SOPC system (sopc_system.sopc) from a Tcl script that can be called from the Quartus Tcl console. The source files and script will be checked into a version control system. 

 

build environment: 

 

  • Windows XP or Windows 7 

  • Quartus 10.1 or Quartus 11 

  • Standard Cygwin shell also installed. 

 

sopc builder: 

 

Given an SOPC Builder system file, eg., sopc_system.sopc, the SOPC system files can be regenerated at a NIOS shell via the command 

 

sopc_builder --generate=1 --no_splash -s 

 

quartus tcl console issues: 

 

 

  1. If I start Quartus from the start menu, go to the Tcl console, and type 'exec mount', the output indicates that the standard Cygwin shell is being used. Given that Quartus installs with a version of Cygwin, you'd think the tool would use its own installed version by default! 

  2. To get Quartus to point to its own copy of Cygwin, start the NIOS shell, and then execute 'quartus', then in the Tcl console 'exec mount' shows that the Quartus version of Cygwin is being used. 

  3. In the Tcl console 'exec sopc_builder -h' can't find sopc_builder. 

  4. 'exec $env(QUARTUS_ROOTDIR)/sopc_builder/bin/sopc_builder -h' also can't find the tool, although this path is correct, since 'exec ls $env(QUARTUS_ROOTDIR)/sopc_builder/bin/', shows the file! So perhaps this is an executable flag issue? 

  5. To investigate further, I tried a standard Cygwin shell and executed '$QUARTUS_ROOTDIR/sopc_builder/bin/sopc_builder --generate=1 --no_splash -s' The sopc_builder_log.txt file shows me that the application can't find my component definitions. If I remove the --no_splash and -s options, the GUI starts up, and I get the equivalent messages about library components not being found. So sopc_builder called from the Cygwin shell is not getting the same path (project?) information as the NIOS shell. 

 

 

I searched the forum messages and didn't find anything that would help (though the search function yielded a lot more messages than I had time to read through). 

 

Any advice on how to get this working would be appreciated! (Even recommendations to move to using a command-line makefile would be ok, if that is known to work better). I'd even be happy calling Tcl 'exec' on a bash script, where the bash script setup the environment correctly. Its the 'correctly' part that is eluding me. 

 

I'll want to try this with Qsys next ... (if Qsys handles this better, I'm happy to skip straight to that too). 

 

Cheers, 

Dave
0 Kudos
4 Replies
Altera_Forum
Honored Contributor I
33 Views

i think you would be better off writing a bash or batch file and calling quartus_sh and sopc_builder independently. alternatively, you could write a make file. 

 

--dalon
Altera_Forum
Honored Contributor I
33 Views

Hi Dalon, 

 

 

--- Quote Start ---  

i think you would be better off writing a bash or batch file and calling quartus_sh and sopc_builder independently. alternatively, you could write a make file. 

 

--- Quote End ---  

I can live with makefiles. 

 

You wouldn't happen to know the appropriate command for adding to the IP search path would you? You can add to the search path manually per the instructions on p194 of the PDF of the Quartus Handbook for v11, but I don't see any mention of an IP search path variable in either of the scripting manuals (Tcl or QSF). I realize the manual change is permanent, but it would be nice for a makefile to be able to check that all IP is visible, and add to the search path if it is not. 

 

Cheers, 

Dave
Altera_Forum
Honored Contributor I
33 Views

I recommend skipping straight to qsys which should handle this better - there are executables like sb-generate.exe which you can call to generate a component. 

 

sb-generate (and friends) should set up a lot of the environment for you so you just need to have the exe on the path. I don't have an install to hand, but I think sopc_builder/model/bin is the directory you need.
Altera_Forum
Honored Contributor I
33 Views

Thanks for the pointers on Qsys. I'll read through the Qsys docs tomorrow. 

 

I'll post example designs once I get what I want working, and then we can all discuss Makefile design :) 

 

Cheers, 

Dave
Reply