Intel® Quartus® Prime Pro Edition User Guide: Platform Designer

ID 683609
Date 6/20/2022
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

2.16.9. Generating Header Files for Host Components

You can use the sopc-create-header-files command from the Nios® II command shell to create header files for any host component in your Platform Designer system. The Nios® II tool chain uses this command to create the processor's system.h file. You can also use this command to generate system level information for a hard processing system (HPS) in Intel's SoC devices or other external processors. The header file includes address map information for each agent, relative to each host that accesses the agent. Different hosts may have different address maps to access a particular agent component. By default, the header files are in C format and have a .h suffix. You can select other formats with appropriate command-line options.
Table 22.  sopc-create-header-files Command-Line Options
Option Description

<sopc>

Path to Platform Designer .sopcinfo file, or the file directory. If you omit this option, the path defaults to the current directory. If you specify a directory path, you must make sure that there is a .sopcinfo file in the directory.

--separate-hosts

Does not combine a module's hosts that are in the same address space.

--output-dir[=<dirname>]

Allows you to specify multiple header files in dirname. The default output directory is '.'

--single[=<filename>]

Allows you to create a single header file, filename.

--single-prefix[=<prefix>]

Prefixes macros from a selected single host.

--module[=<moduleName>]

Specifies the module name when creating a single header file.

--host[=<hostName>]

Specifies the host name when creating a single header file.

--format[=<type>]

Specifies the header file format. Default file format is .h.

--silent

Does not display normal messages.

--help

Displays help for sopc-create-header-files.

By default, the sopc-create-header-files command creates multiple header files. There is one header file for the entire system, and one header file for each host group in each module. A host group is a set of hosts in a module in the same address space. In general, a module may have multiple host groups. Addresses and available devices are a function of the host group.

Alternatively, you can use the --single option to create one header file for one host group. If there is one CPU module in the Platform Designer system with one host group, the command generates a header file for that CPU's host group. If there are no CPU modules, but there is one module with one host group, the command generates the header file for that module's host group.

You can use the --module and --host options to override these defaults. If your module has multiple host groups, use the --host option to specify the name of a host in the desired host group.

Table 23.  Supported Header File Formats
Type Suffix Uses Example
h .h

C/C++ header files

#define FOO 12
m4 .m4

Macro files for m4

m4_define("FOO", 12)
sh .sh

Shell scripts

FOO=12
mk .mk

Makefiles

FOO := 12
pm .pm

Perl scripts

$macros{FOO} = 12;
Note: You can use the sopc-create-header-files command when you want to generate C macro files for DMAs that have access to memory that the Nios® II processor cannot access.