Showing results for 
Search instead for 
Did you mean: 

Error in creating a header file using Tcl console

I am relatively new to fpga and Quartus prime software. I was following intel's tutorial "Build a Custom Hardware System"

The final section of the tutorial is to generate header files and they given a code to paste into the Tcl console of the Quartus prime software. There is an error when I do so. This is how the Tcl console looks when I paste the given code.


# make a directory called ’qsys_headers’ to store the header files

file mkdir qsys_headers

# create a TCL variable SCHF_PATH to hold the path to the executable program

# sopc-create-header-files on your host PC using the environment variables

# provided by Quartus.

set SCHF_PATH [glob -join $quartus(quartus_rootpath) sopc_builder bin sopc-create-header-files]


# create a TCL variable BAT_PATH to hold the path to the Nios II Command Shell

# batch file on Windows platforms. The following code sequence will work on

# either Windows or Linux. For linux this variable will just be set to NULL.    

set BAT_PATH {}

if {$tcl_platform(platform) == "windows"} {

set BAT_PATH [glob -join $quartus(quartus_rootpath) .. nios2eds {Nios II Command Shell.bat}]


{c:/intelfpga/18.1/quartus/../nios2eds/Nios II Command Shell.bat}

# execute sopc-create-header-files to generate the header files

eval exec -ignorestderr ${BAT_PATH} ${SCHF_PATH} soc_system.sopcinfo --output-dir qsys_headers

Error:Authorized application c:\INTELF~2\18.1\quartus\bin64\jtagserver.exe is enabled in the firewall.

Error:]2;Altera Nios II EDS 18.1 [gcc4]child process exited abnormally

Error:  while executing

Error:"exec -ignorestderr {c:/intelfpga/18.1/quartus/../nios2eds/Nios II Command Shell.bat} c:/intelfpga/18.1/quartus/sopc_builder/bin/sopc-create-header-fil..."

Error:  ("eval" body line 1)

Error:  invoked from within

Error:"eval exec -ignorestderr ${BAT_PATH} ${SCHF_PATH} soc_system.sopcinfo --output-dir qsys_headers"

# read the header file for master_0 into a TCL variable

set master_0_header [read [open [glob -join qsys_headers master_0.h] r]]

Error:no files matched glob pattern "qsys_headers/master_0.h"

Error:  while executing

Error:"glob -join qsys_headers master_0.h"

Error:  invoked from within

Error:"open [glob -join qsys_headers master_0.h] r"

Error:  invoked from within

Error:"read [open [glob -join qsys_headers master_0.h] r]"

Error:  invoked from within

Error:"set master_0_header [read [open [glob -join qsys_headers master_0.h] r]]"

# output the C macro lines for the FPGA peripheral base addresses 

foreach line [split ${master_0_header} "\n"] { \

if {[string match "*_BASE*" ${line}]} {puts ${line}}}

Error:can't read "master_0_header": no such variable

Error:  while executing

Error:"split ${master_0_header} "\n""

Error:  invoked from within

Error:"foreach line [split ${master_0_header} "\n"] { \if {[string match "*_BASE*" ${line}]} {puts ${line}}}"



I cannot find a way to get through this. I am using Quartus prime 18.1 standard edition. What is the reason for this error? How can I fix it?


Tags (1)
0 Kudos
2 Replies

I do not know the correct script to create the header file through the tcl console in Intel Quartus Software. I believe the script trying to create the header file through the Nios II Command Shell.


You can try the alternate way of generating the header file through the Nios II Command Shell directly. Link:

0 Kudos

Hi, do you need further help regarding this case?

0 Kudos