Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
All support for Intel NUC 7 - 13 systems has transitioned to ASUS. Read latest update.
20561 Discussions

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?


0 Kudos
4 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



I am encountering a similar issue in trying to complete the "Build a custom hardware system" tutorial for a DE10-Nano board. The following are the version of relevant softwares I am using.


OS : Ubuntu 22.04

Quartus: Quartus Prime Version 21.1.0


In trying to generate the header file using the tcl script provided in the tutorial ( I get the following errors:


The code I entered is a direct copy paste from the tutorial.

0 Kudos

If I start nios2_command_shell in the terminal and then start quartus from there the code works without errors. I am guessing, that's how it is supposed to work


Leaving it here for anyone else stuck here.

0 Kudos