Visible to Intel only — GUID: jgw1735051450202
Ixiasoft
1. About the Nios® V Embedded Processor
2. Nios® V Processor Hardware System Design with Quartus® Prime Software and Platform Designer
3. Nios® V Processor Software System Design
4. Nios® V Processor Configuration and Booting Solutions
5. Nios® V Processor - Using the MicroC/TCP-IP Stack
6. Nios® V Processor Debugging, Verifying, and Simulating
7. Nios® V Processor — Remote System Update
8. Nios® V Processor — Using Custom Instruction
9. Nios® V Embedded Processor Design Handbook Archives
10. Document Revision History for the Nios® V Embedded Processor Design Handbook
2.1. Creating Nios® V Processor System Design with Platform Designer
2.2. Integrating Platform Designer System into the Quartus® Prime Project
2.3. Designing a Nios® V Processor Memory System
2.4. Clocks and Resets Best Practices
2.5. Assigning a Default Agent
2.6. Assigning a UART Agent for Printing
2.7. JTAG Signals
4.1. Introduction
4.2. Linking Applications
4.3. Nios® V Processor Booting Methods
4.4. Introduction to Nios® V Processor Booting Methods
4.5. Nios® V Processor Booting from On-Chip Flash (UFM)
4.6. Nios® V Processor Booting from General Purpose QSPI Flash
4.7. Nios® V Processor Booting from Configuration QSPI Flash
4.8. Nios® V Processor Booting from On-Chip Memory (OCRAM)
4.9. Nios® V Processor Booting from Tightly Coupled Memory (TCM)
4.10. Summary of Nios® V Processor Vector Configuration and BSP Settings
4.11. Reducing Nios® V Processor Booting Time
4.6.2.1. Hardware Design Flow
4.6.2.2. Software Design Flow
Creating the Application BSP Project
Configuring the BSP Editor and Generating the BSP Project
Generating the User Application Project File
Building the User Application Project
Generating the HEX File
4.6.2.3. Programming Files Generation
4.6.2.4. QSPI Flash Programming
6.2.3.2.1. Enabling Signal Tap Logic Analyzer
6.2.3.2.2. Adding Signals for Monitoring and Debugging
6.2.3.2.3. Specifying Trigger Conditions
6.2.3.2.4. Assigning the Acquisition Clock, Sample Depth, and Memory Type, and Buffer Acquisition Mode
6.2.3.2.5. Compiling the Design and Programming the Target Device
6.6.1. Prerequisites
6.6.2. Setting Up and Generating Your Simulation Environment in Platform Designer
6.6.3. Creating Nios V Processor Software
6.6.4. Generating Memory Initialization File
6.6.5. Generating System Simulation Files
6.6.6. Running Simulation in the QuestaSim Simulator Using Command Line
Visible to Intel only — GUID: jgw1735051450202
Ixiasoft
4.6.2.2. Software Design Flow
This section provides the design flow to generate and build the Nios® V processor software project. To ensure a streamlined build flow, you are encouraged to create a similar directory tree in your design project. The following software design flow is based on this directory tree.
To create the software project directory tree, follow these steps:
- In your design project folder, create a folder called software.
- In the software folder, create two folders called hal_app and hal_bsp.
Figure 73. Software Project Directory Tree
Creating the Application BSP Project
To launch the BSP Editor, follow these steps:
- Enter the Nios® V Command Shell.
- Invoke the BSP Editor with niosv-bsp-editor command.
- In the BSP Editor, click File > New BSP to start your BSP project.
- Configure the following settings:
- SOPC Information File name: Provide the SOPCINFO file (.sopcinfo).
- CPU name: Select Nios® V processor.
- Operating system: Select the operating system of the Nios® V processor.
- Version: Leave as default.
- BSP target directory: Select the directory path of the BSP project. You can pre-set it at <Project directory>/software/hal_bsp by enabling Use default locations.
- BSP Settings File name: Type the name of the BSP Settings File.
- Additional Tcl scripts: Provide a BSP Tcl script by enabling Enable Additional Tcl script.
- Click OK.
Figure 74. Configure New BSP
Configuring the BSP Editor and Generating the BSP Project
- Go to Main > Settings > Advanced > hal.linker
- Leave all settings unchecked.
Figure 75. Advanced.hal.linker Settings
- Click on the Linker Script tab in the BSP Editor.
- Set all regions in the Linker Section Name list to the On-Chip Memory (OCRAM) or external RAM.
Figure 76. Linker Region Settings
- Click Generate to generate the BSP project.
Generating the User Application Project File
- Navigate to the software/hal_app folder and create your application source code,
- Launch the Nios® V Command Shell.
- Execute the command below to generate the application CMakeLists.txt.
niosv-app --app-dir=software/hal_app --bsp-dir=software/hal_bsp \ --srcs=software/hal_app/<user application>
Building the User Application Project
You can choose to build the user application project using Ashling* RiscFree* IDE for Intel® FPGAs or through the command line interface (CLI).
If you prefer using CLI, you can build the user application using the following command:
cmake -G "Unix Makefiles" -B software/hal_app/build -S software/hal_app make -C software/hal_app/build
The application (.elf) file is created in software/hal_app/build folder.
Generating the HEX File
You must generate a .hex file from your application .elf file, so you can create a .pof file suitable for programming the devices.
- Launch the Nios® V Command Shell.
- For Nios® V processor application boot from general purpose QSPI flash, use the following command line to convert the ELF to HEX for your application. This command creates the user application (onchip_flash.hex) file.
- Select the suitable Bootloader via GSFI in the elf2flash command.
elf2flash --boot <Intel Quartus Prime installation directory>/ niosv/components/bootloader/<Bootloader via GSFI> --input software/hal_app/build/<Nios V application>.elf \ --output flash.srec --reset <reset offset + base address of GSFI AVL MEM> \ --base <base address of GSFI AVL MEM> \ --end <end address of GSFI AVL MEM>
riscv32-unknown-elf-objcopy --input-target srec --output-target ihex \ flash.srec <Nios V application>.hex