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

ID 683364
Date 12/15/2018
Public
Document Table of Contents

1.13.7. Generating Header Files for Master Components

You can use the sopc-create-header-files command from the Nios® II command shell to create header files for any master 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 slave, relative to each master that accesses the slave. Different masters may have different address maps to access a particular slave 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 17.  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-masters

Does not combine a module's masters 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 master.

--module[=<moduleName>]

Specifies the module name when creating a single header file.

--master[=<masterName>]

Specifies the master 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 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. Addresses and available devices are a function of the master group.

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

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

Table 18.  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 does not have access to.