Programmable Devices
CPLDs, FPGAs, SoC FPGAs, Configuration, and Transceivers
20704 Discussions

Error in creating a header file using Tcl console

HKari1
Beginner
1,217 Views

I am relatively new to fpga and Quartus prime software. I was following intel's tutorial "Build a Custom Hardware System" https://software.intel.com/en-us/articles/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]

c:/intelfpga/18.1/quartus/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
RichardTanSY_Intel
1,075 Views

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:

https://www.intel.com/content/dam/www/programmable/us/en/pdfs/literature/ug/ug_sopc_builder.pdf#page=14

0 Kudos
RichardTanSY_Intel
1,075 Views

Hi, do you need further help regarding this case?

0 Kudos
AnupThapa
Beginner
875 Views

Hello,

 

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 (https://www.intel.com/content/www/us/en/developer/articles/technical/build-a-custom-hardware-system.html) I get the following errors:

AnupThapa_0-1654017167985.png

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

0 Kudos
AnupThapa
Beginner
867 Views

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
Reply