This article describes known errors that occur in the Altera® ( Intel® ) SoC FPGA development environment and how to counter them.
Introduction.
The sopc-create-header-files included with Quartus® Prime can be used to generate header files containing definitions of base addresses for various IP components based on the Platform Designer design information (.sopcinfo files). The generated header files can then be used for software implementation.
However, in recent tool versions, an error may occur when running sopc-create-header-files under the Embedded Command Shell environment of the SoC FPGA Embedded Development Suite (SoC EDS). This article describes how to use sopc-create-header-files. This article introduces the contents of the error that occurs when executing sopc-create-header-files and its countermeasures.
Error Contents and Occurrence Conditions
If the execution of sopc-create-header-files fails, the following error message is displayed. Naturally, no header files are generated.
$ sopc-create-header-files ghrd_10as066n2.sopcinfo
swinfo2header: Failed to load *.swinfo file "/tmp/sopc-create-header-files.529.tmp. swinfo"
sopc-create-header-files: swinfo2header --swinfo /tmp/sopc-create-header-files.529.tmp.swinfo --sopc ghrd_10as066n2.sopcinfo failed
The condition occurs when the following versions of Quartus® Prime are used with SoC EDS in a Windows environment (tool versions after the Nios® II Shell environment was migrated to WSL (Windows Subsystem for Linux) are applicable). (This applies to tool versions after the Shell environment of Nios® II was migrated to WSL (Windows Subsystem for Linux).
- Quartus® Prime Pro Edition: version 19.2 or later
- Quartus® Prime Standard Edition: version 19.1 or later
Error Countermeasures
The contents of sopc-create-header-files are written in Shell script, so you can edit them with a text editor. Please add the following error-correcting description to the script.
Editing target:
- Standard Edition: C:\intelFPGA\<version>\quartus\sopc_builder\bin\sopc-create-header-files
- Pro Edition: C:\intelFPGA_pro\<version>\quartus\sopc_builder\bin\sopc-create-header-files
Edit contents:
The yellow text below is the part where the description was added for error countermeasures. The text of the added section is also shown below for copy and paste.
Lines 18 - 20:
elif [ "${_IS_WINDOWS}" = "1" ] && [ -n "$(which cygpath 2>/dev/null)" ]; then
_IS_CYGWIN=1
windows_exe=.exe
Lines 44 - 47:
[[ -x /bin/cygpath ]] && {
# Use cygpath to convert tmp to a windows path.
swinfo_tmp_fname=$(cygpath -w $swinfo_tmp_fname)
}
Supplemental: Basic usage of sopc-create-header-files (HELP)
sopc-create-header-files can be used by simply specifying a .sopcinfo file as a command line argument. You can also specify the output destination and the type of header files to be generated by specifying options.
The following is the result of normal execution. If only a .sopcinfo file is specified without options, various header files are generated with the following message displayed.
$ sopc-create-header-files ghrd_10as066n2.sopcinfo
swinfo2header: Creating macro file 'ghrd_10as066n2.h' for SOPC Builder system 'ghrd_10as066 n2'
swinfo2header: Creating macro file 'arria10_hps_0.h' for module 'arria10_hps_0'
swinfo2header: Creating macro file 'arria10_hps_0_bridges.h' for module 'arria10_hps_0_bridges'
swinfo2header: Creating macro file 'arria10_hps_0_arm_a9_0.h' for module 'arria10_hps_0_arm_a9_0'
swinfo2 header: Creating macro file 'arria10_hps_0_arm_a9_1.h' for module 'arria10_hps_0_arm_a9_1'
swinfo2header: Creating macro file 'f2sdram_m.h' for module 'f2sdram_m'
swinfo2header: Creating macro file 'f2sdram_m1.h' for module 'f2sdram_m1'
swinfo2header: Creating macro file 'fpga_m.h' for module 'fpga_m'
swinfo2header: Creating macro file 'hps_m.h' for module 'hps_m'
swinfo2header: Creating macro file 'pb_lwh2f.h' for module 'pb_lwh2 f'
The HELP output of sopc-create-header-files is also included.
$ sopc-create-header-files --help
Usage: sopc-create-header-files [<sopc>] [OPTION]...
This utility creates header files from your SOPC Builder system description.
By default, the header files are in cpp format and have a .h suffix.
Other formats may be selected with the appropriate command-line option.
Options:
<sopc> Path to SOPC Builder .sopcinfo file or its directory.
If omitted, <sopc> defaults to the current directory.
If a directory is specified for <sopc>, there must be one
.sopcinfo file in the directory.
If you don't have a .sopcinfo file for your SOPC Builder system,
re-generate your system in SOPC Builder (version 8.0 or later)
to create one.
--separate-masters Don't combine a module's masters that are in the same address space
--output-dir <dirname> Put multiple header files in dirname (default is '.')
--single <filename> Create single header file called filename
--single-prefix <prefix> Prefix macros from selected single master
--module <moduleName> Module name when creating single header file
--master <masterName> Master name when creating single header file
--format <type> Header file format (default is "h")
--silent Don't display normal messages
--help Display this help message
Supported header file formats:
type suffix uses example
==== ====== ========================== ======================
h .h C/C++ header file for cpp #define FOO 12
m4 .m4 macro file for m4 m4_define("FOO", 12)
sh .sh shell scripts FOO=12
mk .mk makefiles FOO := 12
pm .pm Perl scripts $macros{FOO} = 12;
By default, multiple header files are created. There is one header file for
the entire system and one header file for each master group in each module.
A master group is a set of masters in a module in the same address space.
In general, a module may have multiple master groups.
$
Alternatively, the --single option creates one header file for one master group.
If there is one CPU module in the SOPC Builder system with one master group,
the header file will be generated for that CPU's master group.
If there are no CPU modules but there is one module with one master group,
the header file will be generated for that module's master group.
The --module and --master options can be used to override these defaults
If the chosen module has multiple master groups, the
--master option specifies the name of a master in the desired master group.
Summary
We have confirmed that the error can be avoided by the method described in this article, but please consider this as a temporary workaround. In the future, we recommend that you use the method applied to the new tool version.