altera Nios V Embedded Processor

Mga detalye

  • Ngalan sa Produkto: Nios V Processor
  • Software Compatibility: Quartus Prime Software and Platform Designer
  • Uri sa Proseso: Altera FPGA
  • Sistema sa Panumduman: Mabalhinon ug Dili Mabalhinon nga Memorya
  • Interface sa Komunikasyon: Ahente sa UART

Nios V Processor Hardware System Design

To design the Nios V Processor hardware system, follow these steps:

  1. Create Nios V Processor system design using Platform Designer.
  2. I-integrate ang sistema sa proyekto sa Quartus Prime.
  3. Design memory system including volatile and non-volatile memory.
  4. Ipatuman ang mga orasan ug i-reset ang labing maayong mga gawi.
  5. Itudlo ang default ug UART nga mga ahente alang sa episyente nga operasyon.

Nios V Processor Software System Design

To design the software system for Nios V Processor:

  1. Sunda ang dagan sa pagpalambo sa software para sa Nios V Processor.
  2. Create Board Support Package Project and Application Project.

Nios V Processor Configuration and Booting Solutions

Alang sa pag-configure ug pag-boot sa Nios V Processor:

  1. Understand the introduction to configuration and booting solutions.
  2. I-link ang mga aplikasyon alang sa seamless nga operasyon.

About the Nios® V Embedded Processor
1.1. Altera® FPGA ug Naka-embed nga mga Proseso sa Paglabayview
Ang mga Altera FPGA nga mga aparato mahimong mag-implementar sa lohika nga naglihok ingon usa ka kompleto nga microprocessor samtang naghatag daghang mga kapilian.
Usa ka hinungdanon nga kalainan tali sa mga discrete microprocessors ug Altera FPGA mao nga ang tela sa Altera FPGA wala’y lohika kung kini molihok. Ang Nios® V processor kay usa ka soft intellectual property (IP) processor base sa RISC-V specification. Sa dili ka pa magpadagan sa software sa Nios V processor based system, kinahanglan nimong i-configure ang Altera FPGA device nga adunay disenyo sa hardware nga adunay Nios V processor. Mahimo nimong ibutang ang processor sa Nios V bisan asa sa Altera FPGA, depende sa mga kinahanglanon sa disenyo.


Aron mahimo ang imong Altera® FPGA IP-based embedded system nga molihok isip discrete microprocessor-based system, ang imong sistema kinahanglang maglakip sa mosunod: · AJTAG interface to support Altera FPGA configuration, hardware and software
pag-debug · Usa ka mekanismo sa pagsumpo sa Altera FPGA nga power-up
Kung ang imong sistema adunay kini nga mga kapabilidad, mahimo nimong sugdan ang pagpino sa imong disenyo gikan sa usa ka pretested nga disenyo sa hardware nga gikarga sa Altera FPGA. Ang paggamit sa usa ka Altera FPGA nagtugot usab kanimo sa pag-usab sa imong disenyo sa madali aron matubag ang mga problema o aron makadugang bag-ong gamit. Mahimo nimong sulayan kining bag-ong mga disenyo sa hardware pinaagi sa pag-reconfigure sa Altera FPGA gamit ang JTAG interface.
Ang JTAG interface nagsuporta sa hardware ug software development. Mahimo nimong buhaton ang mosunod nga mga buluhaton gamit ang JTAG interface: · I-configure ang Altera FPGA · I-download ug i-debug ang software · Pakigkomunikar sa Altera FPGA pinaagi sa interface nga sama sa UART (JTAG UART
terminal) · Debug hardware (uban ang Signal Tap nga naka-embed nga logic analyzer) · Program flash memory
Human nimo ma-configure ang Altera FPGA nga adunay disenyo nga base sa processor sa Nios V, ang dagan sa software development susama sa dagan alang sa discrete microcontroller designs.


Related Information · AN 985: Nios V Processor Tutorial
Usa ka dali nga giya sa pagsugod bahin sa paghimo og yano nga sistema sa processor sa Nios V ug pagpadagan sa aplikasyon sa Hello World.
© Altera Corporation. Ang Altera, ang logo sa Altera, ang logo sa `a', ug uban pang mga marka sa Altera mga tatak sa Altera Corporation. Ang Altera adunay katungod sa paghimo og mga pagbag-o sa bisan unsang mga produkto ug serbisyo sa bisan unsang oras nga wala’y pahibalo. Ang Altera walay responsibilidad o tulubagon nga naggikan sa aplikasyon o paggamit sa bisan unsang impormasyon, produkto, o serbisyo nga gihulagway dinhi gawas sa dayag nga giuyonan sa pagsulat sa Altera. Gitambagan ang mga kustomer sa Altera nga magkuha sa labing bag-ong bersyon sa mga detalye sa aparato sa dili pa magsalig sa bisan unsang gipatik nga kasayuran ug sa dili pa magbutang mga order alang sa mga produkto o serbisyo. *Ang ubang mga ngalan ug mga tatak mahimong maangkon nga gipanag-iya sa uban.

1. Mahitungod sa Nios® V Embedded Processor 726952 | 2025.07.16
· Nios V Processor Reference Manual Naghatag og impormasyon mahitungod sa Nios V processor performance benchmarks, processor architecture, ang programming model, ug ang core nga pagpatuman.
· Gi-embed nga Peripheral IP User Guide · Nios V Processor Software Developer Handbook


Describes the Nios V processor software development environment, the tools that are available, and the process to build software to run on Nios V processor. · Ashling* RiscFree* Integrated Development Environment (IDE) for Altera FPGAs User Guide Describes the RiscFree* integrated development environment (IDE) for Altera FPGAs Arm*-based HPS and Nios V core processor. · Nios V Processor Altera FPGA IP Release Notes
1.2. Suporta sa Quartus® Prime Software
Ang Nios V processor build flow lahi para sa Quartus® Prime Pro Edition software ug Quartus Prime Standard Edition software. Tan-awa ang AN 980: Nios V Processor Quartus Prime Software Support para sa dugang nga impormasyon bahin sa mga kalainan.
May Kalabutan nga Impormasyon AN 980: Nios V Processor Quartus Prime Software Support
1.3. Nios V Processor Licensing
Ang matag variant sa processor sa Nios V adunay yawe sa lisensya. Kung makuha nimo ang yawe sa lisensya, mahimo nimong gamiton ang parehas nga yawe sa lisensya alang sa tanan nga mga proyekto sa processor sa Nios V hangtod sa petsa sa pag-expire. Mahimo nimong makuha ang mga lisensya sa Nios V Processor Altera FPGA IP sa zero nga gasto.
Ang Nios V processor license key list anaa sa Altera FPGA Self-Service Licensing Center. I-klik ang Sign up for Evaluation o Free License tab, ug pilia ang katugbang nga mga opsyon aron mahimo ang hangyo.
Hulagway 1. Altera FPGA Self-Service Licensing Center

Uban sa mga yawe sa lisensya, mahimo nimo:
Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 7

1. Mahitungod sa Nios® V Embedded Processor 726952 | 2025.07.16
· Implement a Nios V processor within your system. · Simulate the behavior of a Nios V processor system. · Verify the functionality of the design, such as size and speed. · Generate device programming files. · Programa ang usa ka aparato ug pamatud-i ang disenyo sa hardware.
You do not need a license to develop software in the Ashling* RiscFree* IDE for Altera FPGAs.
Related Information · Altera FPGA Self-Service Licensing Center
Para sa dugang nga impormasyon bahin sa pagkuha sa Nios V Processor Altera FPGA IP license keys. · Altera FPGA Software Installation and Licensing Para sa dugang nga impormasyon mahitungod sa paglilisensya sa Altera FPGA software ug pag-set up og fixed nga lisensya ug network license server.
1.4. Naka-embed nga Disenyo sa Sistema
Ang mosunod nga numero naghulagway sa usa ka gipayano nga Nios V processor base sa dagan sa disenyo sa sistema, lakip ang hardware ug software development.

Handbook sa Disenyo sa Disenyo sa Nios® V V 8

Ipadala ang Feedback

1. Mahitungod sa Nios® V Embedded Processor 726952 | 2025.07.16

Hulagway 2.

Nios V Processor System Design Flow
Konsepto sa Sistema

Analisaha ang mga Kinahanglanon sa Sistema

Nios® V
Mga Core sa Proseso ug Mga Sumbanan nga Mga Bahagi

Define and Generate System in
Tigdesinyo sa Platform

Hardware Flow: Integrate and Compile Intel Quartus Prime Project

Pag-agos sa Software: Pag-ugmad ug Pagtukod ug Nios V Proposal Software

Daloy sa Hardware: Pag-download sa Disenyo sa FPGA
ngadto sa Target Board

Software Flow: Test and Debug Nios V Processor Software

Ang Software Wala Makatagbo sa Spec?
Oo
Hardware Wala Nakatagbo sa Spec? Oo
Kompleto ang Sistema

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 9

726952 | 2025.07.16 Magpadala ug Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer

Hulagway 3.

Ang mosunod nga diagram naghulagway sa usa ka tipikal nga disenyo sa hardware sa processor sa Nios V. Nios V Processor System Hardware Design Flow

Pagsugod

Nios V Cores ug Standard Components

Gamita ang Platform Designer sa Pagdesinyo sa Nios V Based System
Paghimo og Platform Designer Design

I-integrate ang Platform Designer System sa Intel Quartus Prime Project
I-assign ang Pin Locations, Timing Requirements, ug uban pang Design Constraints
Compile Hardware for Target Device in Intel Quartus Prime

Andam na sa Pag-download
2.1. Paghimo sa Nios V Processor System Design uban sa Platform Designer
Ang Quartus Prime software naglakip sa Platform Designer system integration tool nga nagpasimple sa tahas sa pagdeterminar ug paghiusa sa Nios V processor IP core ug uban pang mga IP ngadto sa Altera FPGA system design. Ang Platform Designer awtomatik nga nagmugna og interconnect logic gikan sa gipiho nga taas nga lebel nga koneksyon. Ang interconnect automation nagwagtang sa makahurot sa panahon nga buluhaton sa pagtino sa lebel sa sistema sa HDL nga mga koneksyon.
© Altera Corporation. Ang Altera, ang logo sa Altera, ang logo sa `a', ug uban pang mga marka sa Altera mga tatak sa Altera Corporation. Ang Altera adunay katungod sa paghimo og mga pagbag-o sa bisan unsang mga produkto ug serbisyo sa bisan unsang oras nga wala’y pahibalo. Ang Altera walay responsibilidad o tulubagon nga naggikan sa aplikasyon o paggamit sa bisan unsang impormasyon, produkto, o serbisyo nga gihulagway dinhi gawas sa dayag nga giuyonan sa pagsulat sa Altera. Gitambagan ang mga kustomer sa Altera nga magkuha sa labing bag-ong bersyon sa mga detalye sa aparato sa dili pa magsalig sa bisan unsang gipatik nga kasayuran ug sa dili pa magbutang mga order alang sa mga produkto o serbisyo. *Ang ubang mga ngalan ug mga tatak mahimong maangkon nga gipanag-iya sa uban.

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

Human sa pag-analisar sa mga kinahanglanon sa hardware sa sistema, imong gigamit ang Quartus Prime aron itakda ang Nios V processor core, memorya, ug uban pang mga component nga gikinahanglan sa imong sistema. Ang Platform Designer awtomatik nga nagmugna sa interconnect logic aron mahiusa ang mga sangkap sa sistema sa hardware.

2.1.1. Pag-instantiate sa Nios V Processor Altera FPGA IP

You can instantiate any of the processor IP cores in Platform Designer IP Catalog Processors and Peripherals Embedded Processors.

Ang IP core sa matag processor nagsuporta sa lain-laing mga opsyon sa pag-configure base sa talagsaon nga arkitektura niini. Mahimo nimong ipasabut kini nga mga pag-configure aron mas haum sa imong mga panginahanglanon sa disenyo.

Talaan 1.

Mga Opsyon sa Pag-configure sa Mga Kinauyokan nga Variant

Mga Opsyon sa Pag-configure

Nios V/c Processor

Nios V/m Processor

Debug Paggamit Reset Request

Traps, Exceptions, ug Interrupts

Arkitektura sa CPU

ECC

Mga Cache, Peripheral nga Rehiyon ug TCM

Custom nga mga Instruksyon

Lockstep

Nios V/g Processor

2.1.1.1. Pag-instantiate sa Nios V/c Compact Microcontroller Altera FPGA IP Figure 4. Nios V/c Compact Microcontroller Altera FPGA IP

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 11

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

2.1.1.1.1. Tab nga Arkitektura sa CPU

Talaan 2.

Tab nga Arkitektura sa CPU

Feature

Deskripsyon

Enable Avalon® Interface Enable Avalon Interface para sa instruction manager ug data manager. Kung disabled, ang sistema naggamit sa AXI4-Lite interface.

mhartid CSR value

· Invalid IP option. · Do not use mhartid CSR value in Nios V/c processor.

2.1.1.1.2. Gamita ang Reset Request Tab

Talaan 3.

Gamita ang Reset Request Tab Parameter

Gamita ang Reset Request Tab

Deskripsyon

Idugang ang Reset Request Interface

· Enable this option to expose local reset ports where a local master can use it to trigger the Nios V processor to reset without affecting other components in a Nios V processor system.
· Ang reset interface naglangkob sa usa ka input resetreq signal ug usa ka output ack signal.
· You can request a reset to the Nios V processor core by asserting the resetreq signal.
· The resetreq signal must remain asserted until the processor asserts ack signal. Failure for the signal to remain asserted can cause the processor to be in a non-deterministic state.
· Ang Nios V processor motubag nga ang reset malampuson pinaagi sa pagpahayag sa ack signal.
· Human malamposong ma-reset ang processor, ang assertion sa ack signal mahimong mahitabo sa makadaghang higayon matag karon ug unya hangtod sa de-assertion sa resetreq signal.

2.1.1.1.3. Mga Traps, Exceptions, ug Interrupts Tab

Talaan 4.

Traps, Exceptions, ug Interrupts Tab Parameters

Traps, Exceptions, ug Interrupts

Deskripsyon

I-reset ang Ahente

· Ang memorya nga nag-host sa reset vector (ang Nios V processor reset address) diin ang reset code nagpuyo.
· Makapili ka ug bisan unsang memory module nga konektado sa Nios V processor instruction master ug gisuportahan sa Nios V processor boot flow isip reset agent.

I-reset ang Offset

· Gipiho ang offset sa reset vector kalabot sa pinili nga reset agent sa base address. · Ang Tigdesinyo sa Platform awtomatiko nga naghatag usa ka default nga kantidad alang sa pag-reset sa offset.

Mubo nga sulat:

Naghatag ang Platform Designer og Absolute nga kapilian, nga nagtugot kanimo sa pagtino sa usa ka hingpit nga adres sa Reset Offset. Gamita kini nga opsyon kung ang memorya nga nagtipig sa reset vector nahimutang sa gawas sa processor system ug mga subsystem.

Handbook sa Disenyo sa Disenyo sa Nios® V V 12

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

2.1.1.1.4. ECC Tab

Talaan 5.

ECC Tab

ECC

I-enable ang Error Detection ug Status Reporting

Deskripsyon
· I-enable kining opsyon sa paggamit sa ECC feature para sa Nios V processor internal RAM blocks. · Ang mga bahin sa ECC nakamatikod hangtod sa 2-bit nga mga sayup ug nag-reaksyon base sa mosunod nga pamatasan:
- Kung kini usa ka correctable error 1-bit, ang processor nagpadayon sa pag-operate human sa pagtul-id sa sayop sa processor pipeline. Bisan pa, ang pagtul-id wala makita sa gigikanan nga mga panumduman.
— Kung ang sayup dili matul-id, ang processor magpadayon sa paglihok nga wala kini gitul-id sa pipeline sa processor ug gigikanan nga mga panumduman, nga mahimong hinungdan nga ang processor mosulod sa usa ka dili matino nga kahimtang.

2.1.1.2. Pag-instantiate sa Nios V/m Microcontroller Altera FPGA IP Figure 5. Nios V/m Microcontroller Altera FPGA IP

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 13

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

2.1.1.2.1. Debug Tab

Talaan 6.

Debug Tab Parameter

Debug Tab

Deskripsyon

I-enable ang Debug
I-enable ang Reset gikan sa Debug Module

· I-enable kini nga opsyon aron idugang ang JTAG target nga koneksyon module sa Nios V processor. · Ang JTAG target connection module allows connecting to the Nios V processor through the
JTAG interface pins of the FPGA. · The connection provides the following basic capabilities:
— Pagsugod ug paghunong sa Nios V processor — Pagsusi ug pag-edit sa mga rehistro ug memorya. — I-download ang Nios V nga aplikasyon .elf file sa memorya sa processor sa runtime pinaagi sa
niosv-download. — I-debug ang aplikasyon nga nagdagan sa Nios V processor · Ikonektar ang dm_agent port sa instruksyon sa processor ug data bus. Siguroha nga ang base nga adres tali sa duha ka mga bus managsama.
· I-enable kini nga opsyon aron ma-expose ang dbg_reset_out ug ndm_reset_in ports. · JTAG debugger o niosv-download -r nga sugo mag-trigger sa dbg_reset_out, nga
allows the Nios V processor to reset system peripherals connecting to this port. · You must connect the dbg_reset_out interface to ndm_reset_in instead of reset
interface aron ma-trigger ang pag-reset sa processor core ug timer module. Kinahanglang dili ka magkonektar sa dbg_reset_out interface aron ma-reset ang interface aron mapugngan ang dili matino nga kinaiya.

2.1.1.2.2. Gamita ang Reset Request Tab

Talaan 7.

Gamita ang Reset Request Tab Parameter

Gamita ang Reset Request Tab

Deskripsyon

Idugang ang Reset Request Interface

· Enable this option to expose local reset ports where a local master can use it to trigger the Nios V processor to reset without affecting other components in a Nios V processor system.
· Ang reset interface naglangkob sa usa ka input resetreq signal ug usa ka output ack signal.
· You can request a reset to the Nios V processor core by asserting the resetreq signal.
· The resetreq signal must remain asserted until the processor asserts ack signal. Failure for the signal to remain asserted can cause the processor to be in a non-deterministic state.
· Assertion of the resetreq signal in debug mode has no effect on the processor’s state.
· Ang Nios V processor motubag nga ang reset malampuson pinaagi sa pagpahayag sa ack signal.
· Human malamposong ma-reset ang processor, ang assertion sa ack signal mahimong mahitabo sa makadaghang higayon matag karon ug unya hangtod sa de-assertion sa resetreq signal.

2.1.1.2.3. Mga Traps, Exceptions, ug Interrupts Tab

Talaan 8.

Mga Traps, Exceptions, ug Interrupts Tab

Mga Traps, Exceptions, ug Interrupts Tab

Deskripsyon

I-reset ang Ahente

· Ang memorya nga nag-host sa reset vector (ang Nios V processor reset address) diin ang reset code nagpuyo.
· Makapili ka ug bisan unsang memory module nga konektado sa Nios V processor instruction master ug gisuportahan sa Nios V processor boot flow isip reset agent.

Reset Offset Interrupt Mode

· Gipiho ang offset sa reset vector kalabot sa pinili nga reset agent sa base address. · Ang Tigdesinyo sa Platform awtomatiko nga naghatag usa ka default nga kantidad alang sa pag-reset sa offset.
Piho ang tipo sa interrupt controller nga Direct o Vectored. Mubo nga sulat: Ang Nios V/m non-pipelined processor dili mosuporta sa Vectored interrupts.
Busa, likayi ang paggamit sa Vectored interrupt mode kung ang processor anaa sa Nonpipelined mode.

Handbook sa Disenyo sa Disenyo sa Nios® V V 14

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

Mubo nga sulat:

Naghatag ang Platform Designer og Absolute nga kapilian, nga nagtugot kanimo sa pagtino sa usa ka hingpit nga adres sa Reset Offset. Gamita kini nga opsyon kung ang memorya nga nagtipig sa reset vector nahimutang sa gawas sa processor system ug mga subsystem.

2.1.1.2.4. Arkitektura sa CPU

Talaan 9.

Mga Parameter sa Tab sa Arkitektura sa CPU

Arkitektura sa CPU

Deskripsyon

I-enable ang Pipelining sa CPU

· I-enable kini nga opsyon aron ma-instantiate ang pipeline nga Nios V/m processor. - Ang IPC mas taas sa gasto sa mas taas nga logic area ug ubos nga Fmax frequency.
· I-disable kini nga opsyon aron ma-instantiate ang non-pipelined nga Nios V/m processor. — Adunay susama nga core performance sama sa Nios V/c processor. - Nagsuporta sa debugging ug interrupt nga kapabilidad - Ubos nga logic area ug mas taas nga Fmax frequency sa gasto sa ubos nga IPC.

I-enable ang Avalon Interface

Makapahimo sa Avalon Interface para sa instruction manager ug data manager. Kung disabled, ang sistema naggamit sa AXI4-Lite interface.

mhartid CSR value

· Ang rehistro sa Hart ID (mhartid) nga bili kay 0 sa default. · Paghatag ug bili tali sa 0 ug 4094. · Nahiuyon sa Altera FPGA Avalon Mutex Core HAL API.

May Kalabutan nga Impormasyon nga Gi-embed nga Peripheral IP User Guide – Intel FPGA Avalon® Mutex Core

2.1.1.2.5. ECC Tab
Talaan 10. ECC Tab
ECC Enable Error Detection ug Status Reporting

Deskripsyon
· I-enable kining opsyon sa paggamit sa ECC feature para sa Nios V processor internal RAM blocks. · Ang mga bahin sa ECC nakamatikod hangtod sa 2-bit nga mga sayup ug nag-reaksyon base sa mosunod nga pamatasan:
- Kung kini usa ka correctable error 1-bit, ang processor nagpadayon sa pag-operate human sa pagtul-id sa sayop sa processor pipeline. Bisan pa, ang pagtul-id wala makita sa gigikanan nga mga panumduman.
— Kung ang sayup dili matul-id, ang processor magpadayon sa paglihok nga wala kini gitul-id sa pipeline sa processor ug gigikanan nga mga panumduman, nga mahimong hinungdan nga ang processor mosulod sa usa ka dili matino nga kahimtang.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 15

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16
2.1.1.3. Pag-instantiate sa Nios V/g General Purpose Processor Altera FPGA IP
Figure 6. Nios V/g General Purpose Processor Altera FPGA IP – Bahin 1

Hulagway 7.

Nios V/g Kinatibuk-ang Katuyoan Processor Altera FPGA IP – Bahin 2 (I-off Enable Core Level Interrupt Controller)

Handbook sa Disenyo sa Disenyo sa Nios® V V 16

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

Hulagway 8.

Nios V/g Kinatibuk-ang Katuyoan Processor Altera FPGA IP – Bahin 2 (I-on Enable Core Level Interrupt Controller)

Figure 9. Nios V/g General Purpose Processor Altera FPGA IP – Bahin 3

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 17

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16
Figure 10. Nios V/g General Purpose Processor Altera FPGA IP – Bahin 4

2.1.1.3.1. Arkitektura sa CPU

Talaan 11. Mga Parameter sa Arkitektura sa CPU

Tab sa Arkitektura sa CPU I-enable ang Floating Point Unit

Deskripsyon I-enable kini nga opsyon aron idugang ang floating-point unit ("F" extension) sa processor core.

Enable Branch Prediction

I-enable ang static nga panagna sa sanga (Backward Taken ug Forward Not Taken) para sa mga instruksyon sa branch.

mhartid CSR value

· Ang rehistro sa Hart ID (mhartid) nga bili kay 0 sa default. · Paghatag ug bili tali sa 0 ug 4094. · Nahiuyon sa Altera FPGA Avalon Mutex Core HAL API.

I-disable ang mga instruksyon sa FSQRT & FDIV para sa FPU

· Kuhaa ang floating-point square root (FSQRT) ug floating-point division (FDIV) nga mga operasyon sa FPU.
· Ibutang ang software emulation sa duha ka instruksyon atol sa runtime.

May Kalabutan nga Impormasyon nga Gi-embed nga Peripheral IP User Guide – Intel FPGA Avalon® Mutex Core

Handbook sa Disenyo sa Disenyo sa Nios® V V 18

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

2.1.1.3.2. Debug Tab

Table 12. Debug Tab Parameters

Debug Tab

Deskripsyon

I-enable ang Debug
I-enable ang Reset gikan sa Debug Module

· I-enable kini nga opsyon aron idugang ang JTAG target nga koneksyon module sa Nios V processor. · Ang JTAG target connection module allows connecting to the Nios V processor through the
JTAG interface pins of the FPGA. · The connection provides the following basic capabilities:
— Pagsugod ug paghunong sa Nios V processor — Pagsusi ug pag-edit sa mga rehistro ug memorya. — I-download ang Nios V nga aplikasyon .elf file sa memorya sa processor sa runtime pinaagi sa
niosv-download. — I-debug ang aplikasyon nga nagdagan sa Nios V processor · Ikonektar ang dm_agent port sa instruksyon sa processor ug data bus. Siguroha nga ang base nga adres tali sa duha ka mga bus managsama.
· I-enable kini nga opsyon aron ma-expose ang dbg_reset_out ug ndm_reset_in ports. · JTAG debugger o niosv-download -r nga sugo mag-trigger sa dbg_reset_out, nga
allows the Nios V processor to reset system peripherals connecting to this port. · You must connect the dbg_reset_out interface to ndm_reset_in instead of reset
interface aron ma-trigger ang pag-reset sa processor core ug timer module. Kinahanglang dili ka magkonektar sa dbg_reset_out interface aron ma-reset ang interface aron mapugngan ang dili matino nga kinaiya.

2.1.1.3.3. Lockstep Tab Table 13. Lockstep Tab
Parameters Enable Lockstep Default Timeout Period Enable Extended Reset Interface

Deskripsyon · I-enable ang dual core Lockstep system. · Default nga bili sa programmable timeout sa reset exit (tali sa 0 ug 255). · I-enable ang opsyonal nga Extended Reset Interface para sa Extended Reset Control. · Kung na-disable, ang fRSmartComp nagpatuman sa Basic Reset Control.

2.1.1.3.4. Gamita ang Reset Request Tab

Table 14. Use Reset Request Tab Parameter

Gamita ang Reset Request Tab

Deskripsyon

Idugang ang Reset Request Interface

· Enable this option to expose local reset ports where a local master can use it to trigger the Nios V processor to reset without affecting other components in a Nios V processor system.
· Ang reset interface naglangkob sa usa ka input resetreq signal ug usa ka output ack signal.
· You can request a reset to the Nios V processor core by asserting the resetreq signal.
· The resetreq signal must remain asserted until the processor asserts ack signal. Failure for the signal to remain asserted can cause the processor to be in a non-deterministic state.
· Assertion of the resetreq signal in debug mode has no effect on the processor’s state.
· Ang Nios V processor motubag nga ang reset malampuson pinaagi sa pagpahayag sa ack signal.
· Human malamposong ma-reset ang processor, ang assertion sa ack signal mahimong mahitabo sa makadaghang higayon matag karon ug unya hangtod sa de-assertion sa resetreq signal.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 19

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

2.1.1.3.5. Mga Traps, Exceptions, ug Interrupts Tab

Talaan 15.

Mga Traps, Exceptions, ug Interrupts Tab kung ang Enable Core Level Interrupt Controller Gipalong

Mga Traps, Exceptions, ug Interrupts Tab
I-reset ang Ahente

Deskripsyon
· Ang memorya nga nag-host sa reset vector (ang Nios V processor reset address) diin ang reset code nagpuyo.
· Makapili ka ug bisan unsang memory module nga konektado sa Nios V processor instruction master ug gisuportahan sa Nios V processor boot flow isip reset agent.

I-reset ang Offset

· Gipiho ang offset sa reset vector kalabot sa pinili nga reset agent sa base address. · Ang Tigdesinyo sa Platform awtomatiko nga naghatag usa ka default nga kantidad alang sa pag-reset sa offset.

I-enable ang Core Level Interrupt Controller (CLIC)

· I-enable ang CLIC sa pagsuporta sa pre-emptive interrupts ug configurable interrupt trigger condition.
· Kung mahimo, mahimo nimong i-configure ang gidaghanon sa mga interrupts sa platform, itakda ang mga kondisyon sa pag-trigger, ug itudlo ang pipila nga mga interrupts ingon pre-emptive.

Interrupt Mode Shadow Register Files

Ipiho ang mga matang sa interrupt isip Direkta, o Vectored Enable shadow register aron makunhuran ang pagbalhin sa konteksto sa panahon sa interrupt.

Talaan 16.

Mga Traps, Exceptions ug Interrupts kung ang Enable Core Level Interrupt Controller gi-on

Traps, Exceptions, ug Interrupts

Mga paghulagway

I-reset ang Ahente
I-reset ang Offset
I-enable ang Core Level Interrupt Controller (CLIC)

· Ang memorya nga nag-host sa reset vector (ang Nios V processor reset address) diin ang reset code nagpuyo.
· Makapili ka ug bisan unsang memory module nga konektado sa Nios V processor instruction master ug gisuportahan sa Nios V processor boot flow isip reset agent.
· Gipiho ang offset sa reset vector kalabot sa pinili nga reset agent sa base address. · Ang Tigdesinyo sa Platform awtomatiko nga naghatag usa ka default nga kantidad alang sa pag-reset sa offset.
· I-enable ang CLIC sa pagsuporta sa pre-emptive interrupts ug configurable interrupt trigger condition. · Kung mahimo, mahimo nimong i-configure ang gidaghanon sa mga pag-undang sa plataporma, itakda ang mga kondisyon sa pag-trigger,
ug itudlo ang pipila sa mga interrupts isip pre-emptive.

Interrupt Mode

· Ipiho ang mga matang sa interrupt isip Direct, Vectored, o CLIC.

Shadow Register Files

· I-enable ang rehistro sa anino aron makunhuran ang pagbalhin sa konteksto sa paghunong.
· Nagtanyag ug duha ka paagi:
- Gidaghanon sa CLIC interrupt nga lebel
— Gidaghanon sa CLIC interrupt nga lebel – 1: Kini nga opsyon mapuslanon kung gusto nimo ang gidaghanon sa rehistro file copies to fit in an exact number of M20K or M9K blocks.
· Enable the Nios V processor to use shadow register files nga makapakunhod sa konteksto sa pagbalhin sa ibabaw sa ibabaw sa interrupt.
Alang sa dugang nga kasayuran bahin sa rehistro sa anino files, tan-awa ang Nios V Processor Reference Manual.

Number of Platform interrupt sources

· Gipiho ang gidaghanon sa platform interrupt tali sa 16 ngadto sa 2048.
Matikdi: Ang CLIC nagsuporta hangtod sa 2064 interrupt inputs, ug ang unang 16 interrupt inputs konektado usab sa basic interrupt controller.

CLIC Vector Table Alignment

· Awtomatikong gitino base sa gidaghanon sa mga tinubdan sa interrupt nga plataporma. · Kon mogamit ka ug alignment nga ubos sa girekomendar nga bili, ang CLIC mopataas sa lohika
pagkakomplikado pinaagi sa pagdugang ug dugang nga adder aron mahimo ang mga kalkulasyon sa vectoring. · Kon mogamit ka og alignment nga ubos sa girekomendar nga bili, moresulta kini sa pagpataas
pagkakomplikado sa lohika sa CLIC.
nagpadayon…

Handbook sa Disenyo sa Disenyo sa Nios® V V 20

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

Traps, Exceptions, ug Interrupts
Gidaghanon sa Interrupt Levels
Gidaghanon sa Interrupt Priyoridad matag lebel
Configurable interrupt polarity Suporta sa ngilit nag-trigger sa mga interrupt

Mga paghulagway
· Gipiho ang gidaghanon sa mga lebel sa interrupt nga adunay dugang nga lebel 0 alang sa code sa aplikasyon. Ang mga interrupt sa mas taas nga lebel mahimong makabalda (pre-empt) sa usa ka running handler para sa ubos nga level interrupt.
· Uban sa non-zero interrupt nga lebel isip bugtong kapilian sa mga interrupts, ang application code kanunay anaa sa pinakaubos nga lebel 0. Pahinumdom: Run-time nga configuration sa level sa interrupt ug priority kay gihimo sa usa ka 8-bit register. Kung ang gidaghanon sa mga lebel sa interrupt mao ang 256, dili posible nga i-configure ang prayoridad sa interrupt sa run-time. Kung dili, ang labing kadaghan nga ma-configure nga mga prayoridad mao ang 256 / (gidaghanon sa mga lebel sa interrupt – 1).
· Gipiho ang gidaghanon sa mga prayoridad sa interrupt, nga gigamit sa CLIC aron mahibal-an ang han-ay kung diin gitawag ang mga non-pre-empting interrupt handler. Mubo nga sulat: Ang paghugpong sa binary values ​​sa pinili nga interrupt level ug pinili nga interrupt priority kinahanglang ubos sa 8 bits.
· Allows you to configure interrupt polarity during runtime. · Default polarity is positive polarity.
· Gitugotan ka sa pag-configure sa kahimtang sa interrupt trigger atol sa runtime, ie high-level triggered o positive-edge triggered (kon ang interrupt polarity positibo sa Configurable interrupt polarity).
· Default trigger nga kahimtang mao ang lebel triggered interrupt.

Mubo nga sulat:

Naghatag ang Platform Designer og Absolute nga kapilian, nga nagtugot kanimo sa pagtino sa usa ka hingpit nga adres sa Reset Offset. Gamita kini nga opsyon kung ang memorya nga nagtipig sa reset vector nahimutang sa gawas sa processor system ug mga subsystem.

May Kalabutan nga Impormasyon Nios® V Processor Reference Manual

2.1.1.3.6. Tab sa Pag-configure sa Memorya

Talaan 17. Memory Configuration Tab Parameters

Kategorya

Tab sa Pag-configure sa Memorya

Deskripsyon

Mga cache

Gidak-on sa Data Cache

· Gipiho ang gidak-on sa cache sa datos. · Ang balido nga mga gidak-on gikan sa 0 kilobytes (KB) hangtod sa 16 KB. · I-off ang data cache kung 0 KB ang gidak-on.

Instruction Cache Size

· Gipiho ang gidak-on sa cache sa panudlo. · Ang mga balido nga gidak-on gikan sa 0 KB hangtod 16 KB. · I-off ang cache sa instruksiyon kung 0 KB ang gidak-on.

Peripheral nga Rehiyon A ug B

Gidak-on

· Gipiho ang gidak-on sa peripheral nga rehiyon.
· Ang mga balido nga gidak-on gikan sa 64 KB hangtod sa 2 gigabytes (GB), o Wala. Ang Pagpili sa Wala makapugong sa peripheral nga rehiyon.

Base Address

· Gipiho ang base nga adres sa peripheral nga rehiyon pagkahuman nimo mapili ang gidak-on.
· Ang tanan nga mga adres sa peripheral nga rehiyon naghimo og dili ma-cache nga mga access sa datos.
· Ang address sa base sa peripheral nga rehiyon kinahanglan nga ipahiangay sa gidak-on sa peripheral nga rehiyon.

Hugot nga Gihiusa nga mga Memorya

Gidak-on

· Gipiho ang gidak-on sa hugot nga gihiusa nga memorya. — Ang mga balido nga gidak-on gikan sa 0 MB hangtod 512 MB.

Base Address Initialization File

· Gipiho ang base nga adres sa hugot nga gihiusa nga memorya. · Gipiho ang pagsugod file alang sa hugot nga gihiusa nga panumduman.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 21

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

Mubo nga sulat:

Sa usa ka sistema sa processor sa Nios V nga naka-enable ang cache, kinahanglan nimong ibutang ang mga peripheral sa sistema sulod sa usa ka peripheral nga rehiyon. Mahimo nimong gamiton ang mga peripheral nga rehiyon aron mahibal-an ang usa ka non-cacheable nga transaksyon alang sa mga peripheral sama sa UART, PIO, DMA, ug uban pa.

2.1.1.3.7. ECC Tab

Talaan 18. ECC Tab
ECC Enable Error Detection ug Status Reporting
I-enable ang Single Bit Correction

Deskripsyon
· I-enable kining opsyon sa paggamit sa ECC feature para sa Nios V processor internal RAM blocks. · Ang mga bahin sa ECC nakamatikod hangtod sa 2-bit nga mga sayup ug nag-reaksyon base sa mosunod nga pamatasan:
— Kung kini usa ka matul-id nga usa ka gamay nga sayup ug ang Enable Single Bit Correction gipalong, ang processor nagpadayon sa pag-operate pagkahuman sa pagtul-id sa sayup sa pipeline sa processor. Bisan pa, ang pagtul-id wala makita sa gigikanan nga mga panumduman.
— Kung kini usa ka matul-id nga usa ka gamay nga sayup ug ang Enable Single Bit Correction gi-on, ang processor nagpadayon sa pag-operate pagkahuman gitul-id ang sayup sa pipeline sa processor ug ang gigikanan nga mga panumduman.
— If it is an uncorrectable error, the processor halts its operation.
I-enable ang single bit correction sa mga embedded memory blocks sa core.

2.1.1.3.8. Tab sa Custom nga Instruksyon

Mubo nga sulat:

Kini nga tab anaa lamang sa Nios V/g processor core.

Custom nga Instruksyon Nios V Custom Instruksyon Hardware Interface Table
Nios V Custom Instruction Software Macro Table

Deskripsyon
· Nios V processor uses this table to define its custom instruction manager interfaces.
· Gihubit nga naandan nga mga interface sa manedyer sa panudlo talagsaon nga gi-encode sa usa ka Opcode (CUSTOM0-3) ug 3 ka piraso sa function7 [6:4].
· Mahimo nimong ipasabut hangtod sa kinatibuk-an nga 32 ka indibidwal nga mga interface sa tagdumala sa panudlo sa panudlo.
· Ang Nios V processor naggamit niini nga lamesa kay gigamit sa pag-define sa custom nga instruksiyon nga software encodings para sa gipiho nga custom instruction manager interfaces.
· Alang sa matag gipiho nga custom nga instruksiyon nga software encoding, ang Opcode (CUSTOM0-3) ug 3 ka bits sa function7[6:4] nga pag-encode kinahanglang mo-correlate sa usa ka gipiho nga custom instruction manager interface encoding sa Custom Instruction Hardware Interface Table.
· Mahimo nimong gamiton ang funct7[6:4], funct7[3:0], ug funct3[2:0] aron ipasabot ang dugang nga pag-encode para sa gihatag nga custom nga instruksiyon, o gipiho isip Xs nga ipasa isip dugang nga argumento sa instruksiyon.
· Nios V processor provides defined custom instruction software encodings as generated C-macros in system.h, and follow the R-type RISC-V instruction format.
· Ang mnemonics mahimong gamiton sa paghubit sa naandang mga ngalan para sa: — Ang namugna nga C-Macros sa system.h.
— Ang namugna nga GDB debug mnemonics sa custom_instruction_debug.xml.

May Kalabutan nga Impormasyon
AN 977: Nios V Processor Custom Instruction Para sa dugang nga impormasyon mahitungod sa custom nga mga instruksyon nga nagtugot kanimo sa pag-customize sa Nios® V processor aron matubag ang mga panginahanglan sa usa ka partikular nga aplikasyon.

Handbook sa Disenyo sa Disenyo sa Nios® V V 22

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer 726952 | 2025.07.16
2.1.2. Pagtino sa Disenyo sa Component sa Sistema
Use the Platform Designer to define the hardware characteristics of the Nios V processor system and add in the desired components. The following diagram demonstrates a basic Nios V processor system design with the following components: · Nios V processor core · On-Chip Memory · JTAG UART · Interval Timer (opsyonal)(1)
Kung ang usa ka bag-ong On-Chip Memory idugang sa usa ka Platform Designer system, buhata ang Sync System Infos aron mapakita ang gidugang nga mga sangkap sa memorya sa pag-reset. Sa laing paagi, mahimo nimong palihokon ang Auto Sync sa Platform Designer nga awtomatiko nga magpakita sa labing bag-ong mga pagbag-o sa sangkap
Hulagway 11. ExampAng koneksyon sa Nios V processor sa ubang mga peripheral sa Platform Designer

(1) You have the option to use the Nios V Internal Timer features to replace the external Interval Timer in Platform Designer.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 23

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16
Kinahanglan nimo usab nga ipasabut ang mga pin sa operasyon aron ma-export ingon nga agianan sa imong Sistema sa Platform Designer. Kay example, usa ka tukma nga FPGA system operation pin list gihubit ingon sa ubos apan dili limitado sa:
· Relo
· Pag-usab
· Mga signal sa I/O
2.1.3. Pagtino sa Base nga mga Adres ug Interrupt Request Priyoridad
Aron mahibal-an kung giunsa ang mga sangkap nga gidugang sa disenyo nakig-interact aron maporma ang usa ka sistema, kinahanglan nimo nga mag-assign sa base nga mga adres alang sa matag sangkap sa ahente ug mag-assign sa mga prayoridad sa interrupt request (IRQ) para sa JTAG UART and the interval timer. The Platform Designer provides a command – Assign Base Addresses – which automatically assigns proper base addresses to all components in a system. However, you can adjust the base addresses based on your needs.
Ang mosunod mao ang pipila ka mga giya sa pag-assign sa base nga mga adres:
· Nios V processor core adunay 32-bit address span. Aron ma-access ang mga sangkap sa ahente, ang ilang base nga adres kinahanglan gikan sa 0x00000000 ug 0xFFFFFFFF.
· Ang mga programa sa Nios V naggamit ug simbolikong mga makanunayon sa pagtumong sa mga adres. Dili nimo kinahanglan nga mopili sa mga bili sa address nga sayon ​​​​nga mahinumduman.
· Address values that differentiate components with only a one-bit address difference produce more efficient hardware. You do not have to compact all base addresses into the smallest possible address range because compacting can create less efficient hardware.
· Ang Platform Designer wala mosulay sa pag-align sa bulag nga mga sangkap sa memorya sa usa ka magkadugtong nga memory range. Kay exampUg, kung gusto nimo daghang mga sangkap sa On-Chip Memory nga matubag ingon usa ka magkadugtong nga sakup sa memorya, kinahanglan nimo nga klaro nga mag-assign sa mga base nga adres.
Naghatag usab ang Tigdesinyo sa Platform og usa ka mando sa automation - Pag-assign sa mga Interrupt Numbers nga nagkonektar sa mga signal sa IRQ aron makahimo og balido nga mga resulta sa hardware. Bisan pa, ang pag-assign sa mga IRQ nga epektibo nanginahanglan usa ka pagsabut sa kinatibuk-ang pamatasan sa pagtubag sa sistema. Ang Platform Designer dili makahimo sa edukado nga mga panagna bahin sa labing kaayo nga buluhaton sa IRQ.
Ang labing ubos nga kantidad sa IRQ adunay labing taas nga prayoridad. Sa usa ka sulundon nga sistema, girekomenda ni Altera nga ang sangkap sa timer adunay labing taas nga prayoridad nga IRQ, ie, ang labing ubos nga kantidad, aron mapadayon ang katukma sa tick sa orasan sa sistema.
Sa pipila ka mga kaso, mahimo nimong hatagan ang usa ka mas taas nga prayoridad sa mga real time peripheral (sama sa mga video controller), nga nangayo og mas taas nga rate sa interrupt kaysa mga component sa timer.
May Kalabutan nga Impormasyon
Giya sa Gumagamit sa Quartus Prime Pro Edition: Dugang nga impormasyon bahin sa paghimo og System nga adunay Platform Designer.

Handbook sa Disenyo sa Disenyo sa Nios® V V 24

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer 726952 | 2025.07.16
2.2. Paghiusa sa Sistema sa Tigdesinyo sa Platform sa Quartus Prime Project
After generating the Nios V system design in Platform Designer, perform the following tasks to integrate the Nios V system module into the Quartus Prime FPGA design project. · Instantiate the Nios V system module in the Quartus Prime project · Connect signals from Nios V system module to other signals in the FPGA logic · Assign physical pins location · Constrain the FPGA design
2.2.1. Pag-instantiate sa Nios V Processor System Module sa Quartus Prime Project
Ang Tigdesinyo sa Platform nagmugna usa ka entidad sa disenyo sa module sa sistema nga mahimo nimong i-instantiate sa Quartus Prime. Giunsa nimo pag-instantiate ang module sa sistema nagdepende sa pamaagi sa pagsulod sa disenyo alang sa kinatibuk-ang proyekto sa Quartus Prime. Kay exampug, kon ikaw naggamit sa Verilog HDL alang sa disenyo nga pagsulod, i-instantiate ang Verilog based system module. Kung gusto nimo nga gamiton ang block diagram nga pamaagi alang sa pagdesinyo sa pagsulod, paghimo dayon og simbolo sa system module .bdf file.
2.2.2. Connecting Signals and Assigning Physical Pin Locations
Aron makonektar ang imong Altera FPGA nga disenyo sa imong board-level nga disenyo, buhata ang mosunod nga mga buluhaton: · Ilha ang top-level file para sa imong desinyo ug signal nga makonektar sa external Altera
FPGA device pins. · Sabta kung unsang mga pin ang makonektar pinaagi sa imong board-level nga giya sa disenyo sa user o
schematics. · Assign signals in the top-level design to ports on your Altera FPGA device with pin
galamiton sa assignment.
Ang imong Platform Designer nga sistema mahimong labing taas nga lebel nga disenyo. Bisan pa, ang Altera FPGA mahimo usab nga maglakip sa dugang nga lohika base sa imong mga panginahanglan ug sa ingon nagpaila sa usa ka naandan nga top-level file. Ang taas nga lebel file nagkonektar sa Nios V processor system module signal ngadto sa ubang Altera FPGA design logic.
Nalambigit nga Impormasyon Giya sa Gumagamit sa Quartus Prime Pro Edition: Mga Limitasyon sa Disenyo
2.2.3. Pagpugong sa Altera FPGA Design
Ang usa ka husto nga disenyo sa Altera FPGA nga sistema naglakip sa mga pagpugong sa disenyo aron masiguro nga ang disenyo makatagbo sa timing closure ug uban pang mga kinahanglanon sa pagpugong sa lohika. Kinahanglan nimong pugngan ang imong disenyo sa Altera FPGA aron matuman kini nga mga kinahanglanon sa dayag nga paagi gamit ang mga himan nga gihatag sa software sa Quartus Prime o mga third-party nga EDA providers. Ang software nga Quartus Prime naggamit sa gihatag nga mga pagpugong sa panahon sa yugto sa pagtipon aron makuha ang labing kaayo nga mga resulta sa pagbutang.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 25

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16
Related Information · Quartus Prime Pro Edition User Guide: Design Constraints · Third-party EDA Partners · Quartus Prime Pro Edition User Guide: Timing Analyzer
2.3. Pagdisenyo ug Nios V Processor Memory System
Kini nga seksyon naghulagway sa labing maayo nga mga gawi sa pagpili sa mga himan sa memorya sa usa ka Platform Designer nga naka-embed nga sistema nga adunay Nios V nga processor ug pagkab-ot sa labing maayo nga performance. Ang mga aparato sa memorya adunay hinungdanon nga papel sa pagpaayo sa kinatibuk-ang pasundayag sa usa ka naka-embed nga sistema. Ang naka-embed nga memorya sa sistema nagtipig sa mga panudlo ug datos sa programa.
2.3.1. Mabalhinon nga Memorya
A primary distinction in a memory type is volatility. Volatile memory only holds its contents while you supply power to the memory device. As soon as you remove the power, the memory loses its contents.
Examples of volatile memory are RAM, cache, and registers. These are fast memory types that increases running performance. Altera recommends you load and execute Nios V processor instructions in RAM and pair Nios V IP core with On-Chip Memory IP or External Memory Interface IP for optimum performance.
Aron mapauswag ang pasundayag, mahimo nimong wagtangon ang dugang nga mga sangkap sa pagpahiangay sa Platform Designer pinaagi sa pagpares sa tipo sa interface o gilapdon sa interface sa data manager sa Nios V nga adunay boot RAM. Kay example, mahimo nimong i-configure ang On-Chip Memory II nga adunay 32-bits AXI-4 interface, nga mohaum sa Nios V data manager interface.
May Kalabutan nga Impormasyon · External Memory Interfaces IP Support Center · On-Chip Memory (RAM o ROM) Altera FPGA IP · On-Chip Memory II (RAM o ROM) Altera FPGA IP · Nios V Processor Application Execute-In-Place gikan sa OCRAM sa pahina 54
2.3.1.1. On-Chip Memory Configuration RAM o ROM
Mahimo nimong i-configure ang Altera FPGA On-Chip Memory IPs isip RAM o ROM. · Naghatag ang RAM og katakus sa pagbasa ug pagsulat ug adunay usa ka dali dali nga kinaiya. Kung ikaw
pag-boot sa Nios V nga processor gikan sa On-Chip RAM, kinahanglan nimong sigurohon nga ang boot content mapreserbar ug dili madaot kung adunay pag-reset sa panahon sa pagdagan. · Kung ang Nios V nga processor nag-boot gikan sa ROM, ang bisan unsang software bug sa Nios V processor dili mahimong sayop nga ma-overwrite ang mga sulod sa On-Chip Memory. Busa, pagkunhod sa risgo sa boot software korapsyon.
May Kalabutan nga Impormasyon · On-Chip Memory (RAM o ROM) Altera FPGA IP · On-Chip Memory II (RAM o ROM) Altera FPGA IP · Nios V Processor Application Execute-In-Place gikan sa OCRAM sa pahina 54

Handbook sa Disenyo sa Disenyo sa Nios® V V 26

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer 726952 | 2025.07.16
2.3.1.2. Mga cache
Ang on-chip nga mga handumanan kasagarang gigamit sa pagpatuman sa cache functionality tungod sa ilang ubos nga latency. Ang Nios V processor naggamit sa on-chip memory alang sa pagtudlo niini ug mga data cache. Ang limitado nga kapasidad sa on-chip nga panumduman kasagaran dili usa ka isyu alang sa mga cache tungod kay kini kasagaran gamay.
Caches are commonly used under the following conditions:
· Ang regular nga memorya nahimutang sa off-chip ug adunay mas taas nga oras sa pag-access kaysa sa on-chip memory.
· Ang performance-critical nga mga seksyon sa software code mahimong mohaum sa instruksiyon cache, pagpalambo sa sistema sa performance.
· Ang pasundayag-kritikal, labing kanunay nga gigamit nga seksyon sa data mahimong mohaum sa data cache, pagpalambo sa sistema sa performance.
Ang pagpagana sa mga cache sa Nios V nga processor nagmugna og memory hierarchy, nga nagpamenos sa oras sa pag-access sa memorya.
2.3.1.2.1. Peripheral region
Ang bisan unsang naka-embed nga peripheral IP, sama sa UART, I2C, ug SPI kinahanglang dili i-cache. Girekomendar kaayo ang cache alang sa mga eksternal nga panumduman nga apektado sa taas nga oras sa pag-access, samtang ang internal nga on-chip nga mga panumduman mahimong dili iapil tungod sa ilang mubo nga oras sa pag-access. Kinahanglang dili nimo i-cache ang bisan unsang naka-embed nga peripheral IP, sama sa UART, I2C, ug SPI, gawas sa mga handumanan. Importante kini tungod kay ang mga panghitabo gikan sa gawas nga mga himan, sama sa ahente nga mga himan nga nag-update sa humok nga mga IP, wala makuha sa cache sa processor, sa baylo dili madawat sa processor. Ingon usa ka sangputanan, kini nga mga panghitabo mahimong dili mamatikdan hangtod nga ma-flush nimo ang cache, nga mahimong mosangput sa wala damha nga pamatasan sa imong sistema. Sa katingbanan, ang memory-mapped nga rehiyon sa embedded peripheral IPs dili ma-cache ug kinahanglang magpuyo sulod sa peripheral regions sa processor.
Para magbutang ug peripheral nga rehiyon, sunda kini nga mga lakang:
1. Ablihi ang Address Map sa sistema sa Platform Designer.
2. Pagdala ngadto sa adres nga mapa sa Instruction Manager ug Data Manager sa processor.
3. Ilha ang mga peripheral ug mga panumduman sa imong sistema.
Hulagway 12. Example sa Address Mapa

Pahinumdom: Ang asul nga mga pana nagpunting sa mga panumduman. 4. Igrupo ang mga peripheral:
a. Ang panumduman ingon nga ma-cache b. Ang mga peripheral ingon dili ma-cache

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 27

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

Table 19. Cacheable and Uncacheable Region

Subordinate

Mapa sa Address

Status

Peripheral nga Rehiyon

Gidak-on

Base Address

user_application_mem.s1

0x0 ~ 0x3ffff

Ma-cacheable

N/A

N/A

cpu.dm_agent bootcopier_rom.s1

0x40000 ~ 0x4ffff 0x50000 ~ 0x517ff

Uncacheable Cacheable

65536 bytes N/A

0x40000 N/A

bootcopier_ram.s1 cpu.timer_sw_agent mailbox.avmm

0x52000 ~ 0x537ff 0x54000 ~ 0x5403f 0x54040 ~ 0x5407f

Cacheable Uncacheable Uncacheable

144 bytes (mini nga gidak-on mao ang 65536 bytes)

0x54000

sysid_qsys_0.control_slave

0x54080 ~ 0x54087

Uncacheable

uart.avalon_jtag_ulipon

0x54088 ~ 0x5408f

Uncacheable

5. I-align ang peripheral nga mga rehiyon sa ilang piho nga gidak-on:
· Alang sa example, kung ang gidak-on mao ang 65536 bytes, kini katumbas sa 0x10000 bytes. Busa, ang gitugotan nga base nga adres kinahanglan nga usa ka multiple sa 0x10000.
· Ang CPU.dm_agent naggamit ug base nga adres nga 0x40000, nga usa ka multiple sa 0x10000. Ingon usa ka sangputanan, ang Peripheral Region A, nga adunay gidak-on nga 65536 bytes ug base nga adres nga 0x40000, nakab-ot ang mga kinahanglanon.
· Ang base nga adres sa koleksyon sa dili ma-cache nga mga rehiyon sa 0x54000 dili usa ka multiple sa 0x10000. Kinahanglan nimo nga i-reassign sila sa 0x60000 o uban pang multiple sa 0x10000. Busa, ang Peripheral Region B, nga adunay gidak-on nga 65536 bytes ug base nga adres nga 0x60000, nakatagbaw sa criteria.

Talaan 20. Ma-cache ug Dili Ma-cache nga Rehiyon nga adunay Reassignment

Subordinate

Mapa sa Address

Status

Peripheral nga Rehiyon

Gidak-on

Base Address

user_application_mem.s1

0x0 ~ 0x3ffff

Ma-cacheable

N/A

N/A

cpu.dm_agent

0x40000 ~ 0x4ffff

Dili ma-cache nga 65536 bytes

0x40000

bootcopier_rom.s1

0x50000 ~ 0x517ff

Ma-cacheable

N/A

N/A

bootcopier_ram.s1 cpu.timer_sw_agent mailbox.avmm sysid_qsys_0.control_slave

0x52000 ~ 0x537ff 0x60000 ~ 0x6003f 0x60040 ~ 0x6007f 0x60080 ~ 0x60087

Dili ma-cacheable nga dili ma-cacheable nga dili ma-cacheable

144 bytes (mini nga gidak-on mao ang 65536 bytes)

0x60000

uart.avalon_jtag_ulipon

0x60088 ~ 0x6008f

Uncacheable

2.3.1.3. Hugot nga Gihiusa nga Memorya
Ang hugot nga gihiusa nga mga panumduman (TCM) gipatuman gamit ang on-chip memory tungod kay ang ilang ubos nga latency naghimo kanila nga haum kaayo sa buluhaton. Ang mga TCM kay mga handumanan nga gimapa sa tipikal nga address space apan adunay gipahinungod nga interface sa microprocessor ug adunay taas nga performance, low-latency nga mga kabtangan sa cache memory. Naghatag usab ang TCM og subordinate nga interface alang sa external host. Ang processor ug eksternal nga host adunay parehas nga lebel sa pagtugot sa pagdumala sa TCM.

Handbook sa Disenyo sa Disenyo sa Nios® V V 28

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

Mubo nga sulat:

Kung ang subordinate nga pantalan sa TCM konektado sa usa ka eksternal nga host, mahimo kini ipakita nga adunay lahi nga adres sa base kaysa sa base nga adres nga gi-assign sa core sa processor. Girekomenda ni Altera nga ipahiangay ang duha ka adres sa parehas nga kantidad.

2.3.1.4. External Memory Interface (EMIF)
Ang EMIF (External Memory Interface) naglihok parehas sa SRAM (Static Random Access Memory), apan kini dinamiko ug nanginahanglan kanunay nga pag-refresh aron mapadayon ang sulud niini. Ang dinamikong memory cell sa EMIF mas gamay kay sa static memory cells sa SRAM, nga moresulta sa mas taas nga kapasidad ug ubos nga gasto sa memory device.
Gawas pa sa kinahanglanon sa pag-refresh, ang EMIF adunay piho nga mga kinahanglanon sa interface nga kanunay nanginahanglan espesyal nga hardware sa controller. Dili sama sa SRAM, nga adunay usa ka piho nga set sa mga linya sa adres, ang EMIF nag-organisar sa iyang memory space sa mga bangko, mga linya, ug mga kolum. Ang pagbalhin tali sa mga bangko ug mga linya nagpaila sa pipila ka overhead, mao nga kinahanglan nimo nga maampingon nga mag-order sa mga access sa memorya aron magamit ang EMIF nga epektibo. Ang EMIF usab nag-multiplex sa mga row ug column nga mga adres sa parehas nga mga linya sa adres, nga nagpamenos sa gidaghanon sa mga pin nga gikinahanglan alang sa gihatag nga gidak-on sa EMIF.
Ang mas tulin nga mga bersyon sa EMIF, sama sa DDR, DDR2, DDR3, DDR4, ug DDR5, nagpahamtang ug estrikto nga mga kinahanglanon sa integridad sa signal nga kinahanglang tagdon sa mga tigdesinyo sa PCB.
EMIF devices rank among the most cost-effective and high-capacity RAM types available, making them a popular option. A key component of an EMIF interface is the EMIF IP, which manages tasks related to address multiplexing, refreshing, and switching between rows and banks. This design allows the rest of the system to access EMIF without needing to understand its internal architecture.

Nalambigit nga Impormasyon Mga Interface sa External Memory IP Support Center

2.3.1.4.1. Address Span Extender IP
Ang Address Span Extender Altera FPGA IP nagtugot sa memory-mapped host interfaces nga maka-access sa mas dako o mas gamay nga address map kay sa gilapdon sa ilang address signal nga gitugot. Ang Address Span Extender IP nagbahin sa addressable space ngadto sa daghang bulag nga mga bintana aron ang host maka-access sa angay nga bahin sa memorya pinaagi sa bintana.
The Address Span Extender does not limit host and agent widths to a 32-bit and 64bit configuration. You can use the Address Span Extender with 1-64 bit address windows.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 29

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

Figure 13. Address Span Extender Altera FPGA IP
Adres sa Pulong sa Ahente

Address Span Extender

A

Talaan sa Mapa
Pagkontrol sa Port A

Control Register 0 Control Register Z-1

Gipalapad nga Host Address H

May Kalabutan nga Impormasyon
Giya sa Gumagamit sa Quartus® Prime Pro Edition: Tigdesinyo sa Platform I-refer ang hilisgutan nga Address Span Extender Intel® FPGA IP para sa dugang nga impormasyon.

2.3.1.4.2. Paggamit sa Address Span Extender IP nga adunay Nios V Processor
Ang 32-bit nga Nios V nga processor makatubag hangtod sa 4 GB sa usa ka gitas-on sa address. Kung ang EMIF adunay labaw pa sa 4GB nga memorya, molapas kini sa labing taas nga gisuportahan nga gitas-on sa adres, nga naghimo sa sistema sa Platform Designer nga sayup. Ang usa ka Address Span Extender IP gikinahanglan aron masulbad kini nga isyu pinaagi sa pagbahin sa usa ka EMIF address space ngadto sa daghang mas gagmay nga mga bintana.
Girekomenda ni Altera nga imong tagdon ang mosunod nga mga parameter.

Talaan 21. Address Span Extender Parameter

Parameter

Girekomenda nga Mga setting

Lapad sa Datapath
Gipadako nga Master Byte Address Width

Pilia ang 32-bits, nga adunay kalabotan sa 32-bit nga processor. Depende sa gidak-on sa memorya sa EMIF.

Slave Word Address Width Burstcount Width

Pagpili og 2 GB o ubos pa. Ang nahabilin nga gitas-on sa adres sa Nios V nga processor gitagana alang sa ubang mga na-embed nga soft IP.
Pagsugod sa 1 ug hinayhinay nga dugangan kini nga kantidad aron mapauswag ang pasundayag.

Gidaghanon sa mga sub-window

Pagpili og 1 sub-window kung imong gikonektar ang EMIF sa Nios V processor isip instruksiyon ug data memory, o pareho. Ang pagbalhin tali sa daghang mga sub-windows samtang ang Nios V nga processor nagpatuman gikan sa EMIF peligroso.

I-enable ang Slave Control Port

I-disable ang slave control port kung imong gikonektar ang EMIF sa Nios V processor isip instruksiyon ug/o data memory. Parehas nga mga kabalaka sama sa Gidaghanon sa mga sub-windows.

Maximum nga Naghulat nga Pagbasa

Pagsugod sa 1 ug hinayhinay nga dugangan kini nga kantidad aron mapauswag ang pasundayag.

Handbook sa Disenyo sa Disenyo sa Nios® V V 30

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer 726952 | 2025.07.16
Figure 14. Pagdugtong sa Instruksyon ug Data Manager sa Address sa Span Extender

Figure 15. Pagmapa sa Address

Matikdi nga ang Address Span Extender maka-access sa tibuok 8GB memory space sa EMIF. Bisan pa, pinaagi sa Address Span Extender, ang Nios V processor maka-access lamang sa unang 1GB nga memory space sa EMIF.

Figure 16. Gipasimple nga Block Diagram

Sistema sa Tigdesinyo sa Platform

Nabilin nga 3 GB

Nios V processor address

span kay para embedded

NNioios sVV PProrocecsesosor r
M

soft IPs in the same system.
1 GB nga bintana

Span sa Address

S

Extender

M

Only the first 1 GB

sa EMIF memory konektado sa Nios V

EMIF

processor.

8 GB
S

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 31

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16
2.3.1.4.3. Pagtino sa Address Span Extender Linker Memory Device 1. Ipasabot ang Address Span Extender (EMIF) isip reset vector. Sa laing paagi, mahimo nimong i-assign ang Nios V processor reset vector sa ubang mga handumanan, sama sa OCRAM o flash device.
Figure 17. Daghang Opsyon isip Reset Vector
However, the Board Support Package (BSP) Editor cannot automatically register the Address Span Extender (EMIF) as a valid memory. Depending on the choice you made, you see two different situations as shown in the following figures. Figure 18. BSP Error when Defining Address Span Extender (EMIF) as Reset Vector

Handbook sa Disenyo sa Disenyo sa Nios® V V 32

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer 726952 | 2025.07.16
Figure 19. Nawala ang EMIF sa dihang Gihubit ang Ubang mga Memorya isip Reset Vector

2. Kinahanglang manwal nimong idugang ang Address Span Extender (EMIF) gamit ang Add Memory Device, Add Linker Memory Region, ug Add Linker Section Mappings sa BSP Linker Script tab.
3. Sunda kini nga mga lakang:
a. Determine the address span of the Address Span Extender using the Memory Map (The example in the following figure uses Address Span Extender range from 0x0 to 0x3fff_ffff).
Figure 20. Memory Map

b. I-klik ang Add Memory Device, ug sulati base sa impormasyon sa Memory Map sa imong desinyo: i. Ngalan sa Device: emif_ddr4. Pahinumdom: Siguruha nga imong kopyahon ang parehas nga ngalan gikan sa Memory Map. ii. Base Address: 0x0 iii. Gidak-on: 0x40000000
c. I-klik ang Add aron makadugang og bag-ong linker memory region:

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 33

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

Talaan 22. Pagdugang Linker Memory Region

Mga lakang

I-reset ang Vector

emif_ddr4

Ubang mga handumanan

1

Pagdugang og bag-ong Linker Memory Region nga gitawag og reset. Pagdugang og bag-ong Linker Memory Region para sa

· Ngalan sa Rehiyon: i-reset

emif_ddr4.

· Region Size: 0x20

· Ngalan sa Rehiyon: emif_ddr4

· Device sa Memorya: emif_ddr4

· Region Size: 0x40000000

· Offset sa Memorya: 0x0

· Device sa Memorya: emif_ddr4

· Offset sa Memorya: 0x0

2

Pagdugang og bag-ong Linker Memory Region para sa

nahabilin nga emif_ddr4.

· Ngalan sa Rehiyon: emif_ddr4

· Gidak-on sa Rehiyon: 0x3fffffe0

· Device sa Memorya: emif_ddr4

· Offset sa Memorya: 0x20

Figure 21. Linker Region when Defining Address Span Extender (EMIF) as Reset Vector

Figure 22. Rehiyon sa Linker sa dihang Gihubit ang Ubang mga Memorya isip Reset Vector
d. Sa higayon nga ang emif_ddr4 idugang sa BSP, mahimo nimo kining pilion alang sa bisan unsang Linker Section.
Figure 23. Malamposong Gidugang ang Address Span Extender (EMIF).

e. Ibaliwala ang pasidaan bahin sa Memory device emif_ddr4 dili makita sa SOPC design.
f. Padayon sa Paghimo og BSP.
May Kalabutan nga Impormasyon Pasiuna sa Nios V Processor Booting Methods sa pahina 51

Handbook sa Disenyo sa Disenyo sa Nios® V V 34

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer 726952 | 2025.07.16
2.3.2. Non-Volatile Memory
Ang non-volatile nga panumduman nagpabilin sa mga sulod niini sa dihang ang kuryente gipalong, nga naghimo niini nga usa ka maayong pagpili alang sa pagtipig sa impormasyon nga kinahanglan makuha sa sistema human sa usa ka siklo sa gahum sa sistema. Ang non-volatile memory kasagarang nagtipig sa processor boot-code, padayon nga mga setting sa aplikasyon, ug Altera FPGA configuration data. Bisan tuod ang non-volatile memory adunay advantage sa pagpabilin sa mga datos niini sa dihang imong tangtangon ang gahum, kini mas hinay kon itandi sa dali moalisngaw nga panumduman, ug sa kasagaran adunay mas komplikado nga pagsulat ug pagpapas nga mga pamaagi. Ang dili mabag-o nga panumduman kasagaran usab nga gigarantiyahan nga mapapas sa usa ka gihatag nga gidaghanon sa mga higayon, pagkahuman mahimo’g mapakyas.
Examples of non-volatile memory include all types of flash, EPROM, and EEPROM. Altera recommends you to store Altera FPGA bitstreams and Nios V program images in a non-volatile memory, and use serial flash as the boot device for Nios V processors.
May Kalabutan nga Impormasyon
· Generic Serial Flash Interface Altera FPGA IP User Guide
· Mailbox Client Altera FPGA IP User Guide · MAX® 10 User Flash Memory User Guide: On-Chip Flash Altera FPGA IP Core
2.4. Mga Orasan ug Pag-reset sa Labing Maayo nga Mga Kasanayan
Ang pagsabut kung giunsa ang orasan sa processor sa Nios V ug ang pag-reset sa domain nakig-uban sa matag peripheral nga gikonektar niini hinungdanon. Ang usa ka yano nga sistema sa processor sa Nios V nagsugod sa usa ka domain sa orasan, ug mahimo kini nga komplikado sa usa ka multi-clock nga sistema sa domain kung ang usa ka paspas nga orasan nga domain nabangga sa usa ka hinay nga domain sa orasan. Kinahanglan nimong timan-an ug sabton kung giunsa pagkasunod-sunod ang lainlaing mga dominyo gikan sa pag-reset ug siguroha nga wala’y bisan unsang maliputon nga mga problema.
For best practice, Altera recommends placing the Nios V processor and boot memory in the same clock domain. Do not release the Nios V processor from reset in a fast clock domain when it boots from a memory that resides in a very slow clock domain, which may cause an instruction fetch error. You may require some manual sequencing beyond what Platform Designer provides by default, and plan out reset release topology accordingly based on your use case. If you want to reset your system after it comes up and runs for a while, apply the same considerations to system reset sequencing and post reset initialization requirement.
2.4.1. System JTAG Relo
Specifying the clock constraints in every Nios V processor system is an important system design consideration and is required for correctness and deterministic behavior. The Quartus Prime Timing Analyzer performs static timing analysis to validate the timing performance of all logic in your design using industry-standard constraint, analysis, and reporting methodology.
Example 1. Basic 100 MHz Clock nga adunay 50/50 Duty Cycle ug 16 MHz JTAG Relo
#************************************************************** # Create 100MHz Clock #************************************************************** create_clock -name {clk} -period 10 [get_ports {clk}] #************************ Create 16MHz JTAG Clock #************************

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 35

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16
create_clock -name {altera_reserved_tck} -period 62.500 [get_ports {altera_reserved_tck}] set_clock_groups -asynchronous -group [get_clock {altera_reserved_tck}] Nalambigit nga Impormasyon Quartus Prime Timing Analyzer Cookbook
2.4.2. I-reset ang Interface sa Paghangyo
Ang processor sa Nios V naglakip sa opsyonal nga pasilidad sa paghangyo sa pag-reset. Ang pasilidad sa hangyo sa pag-reset naglangkob sa reset_req ug reset_req_ack signal.
Aron mahimo ang hangyo sa pag-reset sa Platform Designer: 1. Ilunsad ang Nios V Processor IP Parameter Editor. 2. Sa Use Reset Request setting, i-on ang Add Reset Request Interface
kapilian.
Figure 24. I-enable ang Nios V Processor Reset Request
Ang reset_req signal molihok sama sa usa ka interrupt. Kung imong gipahayag ang reset_req, naghangyo ka nga i-reset sa kinauyokan. Ang kinauyokan naghulat alang sa bisan unsang talagsaon nga transaksyon sa bus aron makompleto ang operasyon niini. Kay exampUg, kung adunay usa ka pending nga transaksyon sa pag-access sa memorya, ang kinauyokan naghulat alang sa usa ka kompleto nga tubag. Sa susama, ang kinauyokan modawat sa bisan unsang pending nga tubag sa instruksiyon apan wala mag-isyu ug instruksiyon nga hangyo human madawat ang reset_req signal.
The reset operation consists of the following flow: 1. Complete all pending operations 2. Flush the internal pipeline 3. Set the Program Counter to the reset vector 4. Reset the core The whole reset operation takes a few clock cycles. The reset_req must remain asserted until reset_req_ack is asserted indicating core reset operation has successfully completed. Failure to do so results in core’s state being non-deterministic.

Handbook sa Disenyo sa Disenyo sa Nios® V V 36

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer 726952 | 2025.07.16
2.4.2.1. Kinaandan nga mga Kaso sa Paggamit
· Mahimo nimong iduso ang reset_req signal gikan sa power-on aron mapugngan ang Nios V processor core gikan sa pagsugod sa pagpatuman sa programa gikan sa reset vector niini hangtod nga ang ubang mga FPGA host sa sistema mag-initialize sa Nios V processor boot memory. Sa kini nga kaso, ang tibuuk nga subsystem makasinati usa ka limpyo nga pag-reset sa hardware. Ang Nios V nga processor gihuptan hangtod sa hangtod sa usa ka kahimtang sa hangyo sa pag-reset hangtod nga ang ubang mga host sa FPGA mag-initial sa memorya sa boot sa processor.
· Sa usa ka sistema diin kinahanglan nimo nga i-reset ang Nios V processor core nga dili makabalda sa nahabilin nga sistema, mahimo nimong ipahayag ang reset_req signal aron limpyo nga mapahunong ang kasamtangan nga operasyon sa core ug i-restart ang processor gikan sa reset vector sa higayon nga gipagawas sa sistema ang reset_req_ack signal.
· Ang usa ka eksternal nga host mahimong mogamit sa interface sa pag-reset sa hangyo aron mapagaan ang mga pagpatuman sa mosunod nga mga buluhaton:
— Halt the current Nios V processor program.
— Pag-load ug bag-ong programa sa Nios V processor boot memory.
— Allow the processor to begin executing the new program.
Girekomenda ka ni Altera nga ipatuman ang usa ka mekanismo sa oras sa pag-monitor sa kahimtang sa reset_req_ack signal. Kung ang Nios V processor core mahulog sa usa ka walay kinutuban nga kahimtang sa paghulat sa kahimtang ug mga stall alang sa usa ka wala mahibal-an nga hinungdan, ang reset_req_ack dili makapahayag nga walay katapusan. Ang mekanismo sa timeout makapahimo kanimo sa:
· Itakda ang panahon sa pag-ayo sa oras sa pag-ayo ug paghimo sa pagbawi sa sistema gamit ang pag-reset sa lebel sa sistema.
· Paghimo usa ka pag-reset sa lebel sa hardware.
2.4.3. I-reset ang Release IP
Ang Altera SDM-based nga mga device naggamit ug parallel, sector-based architecture nga nag-apod-apod sa core fabric logic sa daghang sektor. Girekomenda ka ni Altera nga gamiton ang Reset Release Altera FPGA IP isip usa sa mga inisyal nga input sa reset circuit. Ang Intel® SDMbased nga mga himan naglakip sa Stratix® 10, ug AgilexTM nga mga himan. Ang mga aparato nga nakabase sa control block dili maapektuhan niini nga kinahanglanon.
May Kalabutan nga Impormasyon
AN 891: Using the Reset Release Altera FPGA IP
2.5. Assigning a Default Agent
Gitugotan ka sa Tigdesinyo sa Platform nga ipiho ang usa ka default nga ahente nga naglihok ingon usa ka default nga ahente sa pagtubag sa sayup. Ang default nga ahente nga imong gitudlo naghatag usa ka serbisyo sa pagtubag sa sayup alang sa mga host nga misulay sa dili na-decode nga pag-access sa mapa sa adres.
Ang mosunud nga mga senaryo nag-aghat sa usa ka dili na-decode nga panghitabo:
· Paglapas sa estado sa seguridad sa transaksyon sa bus
· Pag-access sa transaksyon sa wala matino nga rehiyon sa memorya
· Eksepsiyon nga panghitabo ug uban pa.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 37

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

Ang usa ka default nga ahente kinahanglan nga itudlo aron pagdumala sa ingon nga mga panghitabo, diin ang wala mahibal-an nga transaksyon ibalhin sa default nga ahente ug pagkahuman motubag sa Nios V processor nga adunay tubag nga sayup.
May Kalabutan nga Impormasyon
· Giya sa Gumagamit sa Quartus Prime Pro Edition: Tigdesinyo sa Platform. Pagtudlo ug Default nga Ahente
· Giya sa Gumagamit sa Quartus Prime Pro Edition: Tigdesinyo sa Platform. Error Response Slave Altera FPGA IP
· Github – Supplemental Reset nga mga sangkap alang sa Qsys

2.6. Pagtudlo ug UART Ahente alang sa Pag-imprenta
Ang pag-imprinta mapuslanon sa pag-debug sa software application, ingon man sa pagmonitor sa status sa imong system. Girekomenda ni Altera ang pag-imprenta sa sukaranan nga kasayuran sama sa usa ka mensahe sa pagsugod, mensahe sa sayup, ug pag-uswag sa pagpatuman sa aplikasyon sa software.
Likayi ang paggamit sa printf() library function ubos sa mosunod nga mga sirkumstansya: · Ang printf() library maoy hinungdan sa aplikasyon nga mahunong kung walay host nga nagbasa sa output.
Kini magamit sa JTAG UART lang. · Ang printf() nga librarya naggamit ug dako nga kantidad sa memorya sa programa.

2.6.1. Paglikay sa mga Stalls ni JTAG UART

Talaan 23. Mga kalainan tali sa Tradisyonal nga UART ug JTAG UART

UART Type Tradisyonal nga UART

Deskripsyon
Nagpadala sa serial data bisan pa kung ang usa ka eksternal nga host naminaw. Kung walay host nga nagbasa sa serial data, nawala ang data.

JTAG UART

Gisulat ang gipasa nga datos sa usa ka output buffer ug nagsalig sa usa ka eksternal nga host aron mabasa gikan sa buffer aron mahaw-as kini.

Ang JTAG Ang drayber sa UART naghulat kung puno na ang output buffer. Ang JTAG Ang drayber sa UART naghulat alang sa usa ka eksternal nga host nga mobasa gikan sa output buffer sa dili pa magsulat og dugang nga pagpadala sa datos. Kini nga proseso nagpugong sa pagkawala sa pagpadala sa datos.
However, when system debugging is not required, such as during production, embedded systems are deployed without a host PC connected to JTAG UART. Kung gipili sa sistema ang JTAG Ang UART isip ahente sa UART, mahimo’g hinungdan sa pagpahunong sa sistema tungod kay walay eksternal nga host ang konektado.
Aron malikayan ang paghunong ni JTAG UART, gamita ang mosunod nga mga opsyon:

Handbook sa Disenyo sa Disenyo sa Nios® V V 38

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16

Talaan 24. Paglikay sa Stalling ni JTAG UART

Mga kapilian
Walay UART interface ug driver nga anaa
Gamit ug laing UART interface ug driver
Pagtipig JTAG UART interface (walay drayber)

Atol sa Hardware Development (sa Platform Designer)

Atol sa Software Development (sa Board Support Package Editor)

Kuhaa si JTAG UART gikan sa sistema

I-configure ang hal.stdin, hal.stdout ug hal.stderr isip Wala.

Replace JTAG UART with other soft Configure hal.stdin, hal.stdout and hal.stderr

UART IP

uban sa ubang humok nga UART IP.

Pagtipig JTAG UART sa sistema

· I-configure ang hal.stdin, hal.stdout ug hal.stderr isip Wala sa Board Support Package Editor.
· I-disable ang JTAG UART driver in BSP Driver tab.

2.7. JTAG Mga signal
Ang Nios V processor debug module naggamit sa JTAG interface alang sa software ELF download ug software debugging. Kung imong gi-debug ang imong disenyo sa JTAG interface, ang JTAG Ang mga signal nga TCK, TMS, TDI, ug TDO gipatuman isip kabahin sa disenyo. Pagtino sa JTAG Ang mga pagpugong sa signal sa matag sistema sa processor sa Nios V usa ka importante nga konsiderasyon sa disenyo sa sistema ug gikinahanglan alang sa pagkahusto ug deterministikong kinaiya.
Girekomenda ni Altera nga ang frequency sa orasan sa sistema sa bisan unsang disenyo labing menos upat ka pilo sa JTAG frequency sa orasan aron masiguro nga ang on-chip instrumentation (OCI) core naglihok sa husto.
May Kalabutan nga Impormasyon · Quartus® Prime Timing Analyzer Cookbook: JTAG Mga signal
Alang sa dugang nga kasayuran bahin sa JTAG timing constraints guidelines. · KDB: Why does niosv-download fail with a non-pipelined Nios® V/m processor at
JTAG frequency 24MHz or 16Mhz?
2.8. Pag-optimize sa Platform Designer System Performance
Naghatag ang Platform Designer og mga himan alang sa pag-optimize sa performance sa system interconnect alang sa mga disenyo sa Altera FPGA.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 39

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer
726952 | 2025.07.16
Figure 25. Optimization Examples

Ang exampAng gipakita sa hulagway nagpakita sa mosunod nga mga lakang:
1. Nagdugang sa Pipeline Bridge aron mapagaan ang mga kritikal nga agianan pinaagi sa pagbutang niini: a. Tali sa Instruction Manager ug sa mga ahente niini b. Tali sa Data Manager ug sa mga ahente niini
2. Ibutang ang Tinuod nga Dual port On-Chip RAM, nga ang matag pantalan gipahinungod sa Instruction Manager ug sa Data Manager matag usa

Handbook sa Disenyo sa Disenyo sa Nios® V V 40

Ipadala ang Feedback

2. Nios V Processor Hardware System Design uban sa Quartus Prime Software ug Platform Designer 726952 | 2025.07.16
Tan-awa ang mosunod nga mga link sa ubos, nga nagpresentar sa mga teknik sa paggamit sa magamit nga mga himan ug ang mga trade-off sa matag pagpatuman.
May Kalabutan nga Impormasyon · Giya sa Gumagamit sa Quartus® Prime Pro Edition: Tigdesinyo sa Platform
Tan-awa ang hilisgutan nga Pag-optimize sa Platform Designer System Performance para sa dugang nga impormasyon. · Giya sa Gumagamit sa Quartus® Prime Standard Edition: Tigdesinyo sa Plataporma Tan-awa ang hilisgutan nga Pag-optimize sa Pagdesinyo sa Sistema sa Platform sa Pagdisenyo alang sa dugang nga impormasyon.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 41

726952 | 2025.07.16 Magpadala ug Feedback

3. Nios V Processor Software System Design
Kini nga kapitulo naghulagway sa Nios V processor software development flow ug sa software tools nga imong magamit sa pagpalambo sa imong embedded design system. Ang sulod nagsilbi nga usa ka katapusanview sa wala pa mag-develop ug Nios V processor software system.
Figure 26. Daloy sa Disenyo sa Software
Pagsugod

Paghimo sa BSP sa Platform Designer Gamit ang BSP Editor

Paghimo sa BSP Gamit ang Nios V Command Shell
Paghimo sa Application CMake Build File Gamit ang Nios V Command Shell

Mubo nga sulat:

Import ang BSP ug Application CMake Build File
Build the Nios V Processor Application using the
RiscFree IDE para sa Intel FPGA

Paghimo sa Nios V Processor nga aplikasyon gamit ang bisan unsa
command-line source code editor, CMake, ug Make
mga sugo
Katapusan

Girekomenda ni Altera nga mogamit ka og Altera FPGA development kit o usa ka custom nga prototype board para sa software development ug debugging. Daghang mga peripheral ug lebel sa sistema ang magamit lamang kung ang imong software nagdagan sa usa ka aktwal nga board.

© Altera Corporation. Ang Altera, ang logo sa Altera, ang logo sa `a', ug uban pang mga marka sa Altera mga tatak sa Altera Corporation. Ang Altera adunay katungod sa paghimo og mga pagbag-o sa bisan unsang mga produkto ug serbisyo sa bisan unsang oras nga wala’y pahibalo. Ang Altera walay responsibilidad o tulubagon nga naggikan sa aplikasyon o paggamit sa bisan unsang impormasyon, produkto, o serbisyo nga gihulagway dinhi gawas sa dayag nga giuyonan sa pagsulat sa Altera. Gitambagan ang mga kustomer sa Altera nga magkuha sa labing bag-ong bersyon sa mga detalye sa aparato sa dili pa magsalig sa bisan unsang gipatik nga kasayuran ug sa dili pa magbutang mga order alang sa mga produkto o serbisyo. *Ang ubang mga ngalan ug mga tatak mahimong maangkon nga gipanag-iya sa uban.

3. Nios V Processor Software System Design 726952 | 2025.07.16
3.1. Nios V Processor Software Development Flow
3.1.1. Board Support Package Project
Ang proyekto sa Nios V Board Support Package (BSP) usa ka espesyal nga librarya nga adunay code sa suporta nga piho sa sistema. Ang BSP naghatag ug software runtime environment nga gipasibo para sa usa ka processor sa Nios V processor hardware system.
The Quartus Prime software provides Nios V Board Support Package Editor and niosv-bsp utility tools to modify settings that control the behavior of the BSP.
A BSP contains the following elements: · Hardware abstraction layer · Device drivers · Optional software packages · Optional real-time operating system
3.1.2. Proyekto sa Aplikasyon
Ang proyekto sa aplikasyon sa Nios VC/C++ adunay mosunod nga mga bahin: · Naglangkob sa usa ka koleksyon sa source code ug usa ka CMakeLists.txt.
— Ang CMakeLists.txt nag-compile sa source code ug nagsumpay niini sa usa ka BSP ug usa o labaw pa nga opsyonal nga mga librarya, aron makahimo og usa ka .elf file
· One of the source files naglangkob sa function main(). · Naglakip sa code nga nagtawag sa mga gimbuhaton sa mga librarya ug mga BSP.
Naghatag ang Altera og niosv-app utility tool sa Quartus Prime software utility tools aron makamugna ang Application CMakeLists.txt, ug RiscFree IDE para sa Altera FPGAs aron usbon ang source code sa usa ka palibot nga nakabase sa Eclipse.
3.2. Altera FPGA nga Naka-embed nga Mga Himan sa Pag-uswag
The Nios V processor supports the following tools for software development: · Graphical User Interface (GUI) – Graphical development tools that are available in
both Windows* and Linux* Operating Systems (OS). — Nios V Board Support Package Editor (Nios V BSP Editor) — Ashling RiscFree IDE for Altera FPGAs · Command-Line Tools (CLI) – Development tools that are initiated from the Nios V Command Shell. Each tool provides its own documentation in the form of help accessible from the command line. Open the Nios V Command Shell and type the following command: <name of tool> –help to view ang Help menu. — Nios V Utilities Tools — File Format Conversion Tools — Ubang Utilities Tools

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 43

3. Nios V Processor Software System Design 726952 | 2025.07.16

Talaan 25. GUI Tools ug Command-line Tools Buluhaton Summary

Buluhaton

GUI Tool

Tool sa linya sa command

Paghimo ug BSP

Nios V BSP Editor

· Sa software sa Quartus Prime Pro Edition: niosv-bsp -c -s=<.qsys file> -t=<bsp type> [OPTIONS] settings.bsp
· Sa software sa Quartus Prime Standard Edition: niosv-bsp -c -s=<.sopcinfo file> -t=<bsp type>[OPTIONS] settings.bsp

Generating a BSP using existing .bsp file
Pag-update sa BSP

Nios V BSP Editor Nios V BSP Editor

niosv-bsp -g [OPTIONS] settings.bsp niosv-bsp -u [OPTIONS] settings.bsp

Pagsusi sa usa ka BSP

Nios V BSP Editor

niosv-bsp -q -E= [OPSYON] setting.bsp

Creating an application

niosv-app -a= -b= -s= files direktoryo> [OPSYON]

Paghimo usa ka librarya sa tiggamit

niosv-app -l= -s= files direktoryo> -p= [OPSYON]

Pag-usab sa usa ka aplikasyon Pag-usab sa usa ka librarya sa tiggamit Pagtukod og aplikasyon

RiscFree IDE for Altera FPGAs
RiscFree IDE for Altera FPGAs
RiscFree IDE for Altera FPGAs

Bisan unsang command-line source editor
Bisan unsang command-line source editor
· paghimo · paghimo

Pagtukod og librarya sa tiggamit

RiscFree IDE for Altera FPGAs

· paghimo · paghimo

Pag-download sa usa ka aplikasyon nga ELF
Pagkabig sa .elf file

RiscFree IDE for Altera FPGAs

niosv-download
· elf2flash · elf2hex

May Kalabutan nga Impormasyon
Ashling RiscFree Integrated Development Environment (IDE) for Altera FPGAs User Guide

3.2.1. Nios V Processor Board Support Package Editor
Mahimo nimong gamiton ang Nios V processor nga BSP Editor aron mahimo ang mosunod nga mga buluhaton: · Paghimo o pag-usab sa usa ka proyekto sa Nios V processor BSP · Pag-edit sa mga setting, linker nga rehiyon, ug mga pagmapa sa seksyon · Pagpili og software packages ug device drivers.
Ang mga kapabilidad sa BSP Editor naglakip sa mga kapabilidad sa niosv-bsp utilities. Ang bisan unsang proyekto nga gihimo sa BSP Editor mahimo usab nga himuon gamit ang command-line utilities.

Handbook sa Disenyo sa Disenyo sa Nios® V V 44

Ipadala ang Feedback

3. Nios V Processor Software System Design 726952 | 2025.07.16

Mubo nga sulat:

Para sa software nga Quartus Prime Standard Edition, tan-awa ang AN 980: Nios V Processor Quartus Prime Software Support para sa mga lakang sa paggamit sa BSP Editor GUI.

Aron ilunsad ang BSP Editor, sunda kini nga mga lakang: 1. Open Platform Designer, ug navigate sa File menu.
a. Aron maablihan ang kasamtangan nga setting sa BSP file, i-klik ang Open… b. Para makahimo ug bag-ong BSP, i-klik ang Bag-ong BSP... 2. Pilia ang BSP Editor tab ug ihatag ang tukma nga mga detalye.

Hulagway 27. Ilusad ang BSP Editor

May Kalabutan nga Impormasyon AN 980: Nios V Processor Quartus Prime Software Support
3.2.2. RiscFree IDE for Altera FPGAs
Ang RiscFree IDE para sa Altera FPGAs usa ka Eclipse-based IDE para sa Nios V processor. Girekomenda ni Altera nga imong pauswagon ang Nios V processor software niini nga IDE alang sa mosunod nga mga rason: · Ang mga feature gipalambo ug gipamatud-an nga nahiuyon sa Nios V
processor pagtukod dagan. · Gisangkapan sa tanan nga gikinahanglan nga mga toolchain ug pagsuporta sa mga himan nga makapahimo kanimo
sa dali nga pagsugod sa Nios V processor development.
Nalambigit nga Impormasyon Ashling RiscFree Integrated Development Environment (IDE) para sa Altera FPGAs User Guide
3.2.3. Nios V Utilities Tools
Mahimo kang maghimo, mag-usab, ug magtukod og mga programa sa Nios V nga adunay mga command nga gi-type sa command line o gi-embed sa usa ka script. Ang Nios V command-line nga mga himan nga gihulagway niini nga seksyon anaa sa /niosv/bin nga direktoryo.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 45

3. Nios V Processor Software System Design 726952 | 2025.07.16

Talaan 26. Nios V Utilities Tools

Command-Line Tools

Summary

niosv-app niosv-bsp niosv-download niosv-shell niosv-stack-report

To generate and configure an application project.
Sa paghimo o pag-update sa mga setting sa BSP file and create the BSP files. Aron ma-download ang ELF file ngadto sa Nios® V processor.
Aron maablihan ang Nios V Command Shell. Aron ipahibalo kanimo ang nahabilin nga espasyo sa memorya nga magamit sa imong aplikasyon .elf alang sa paggamit sa stack o tambak.

3.2.4. File Mga Himan sa Pagkakabig sa Format

File format pagkakabig usahay gikinahanglan sa diha nga ang pagpasa sa data gikan sa usa ka utility ngadto sa lain. Ang file format pagkakabig himan anaa sa
software installation directory>/niosv/bin directory.

Talaan 27. File Mga Himan sa Pagkakabig sa Format

Command-Line Tools elf2flash elf2hex

Summary Sa paghubad sa .elf file sa .srec nga pormat para sa flash memory programming. Sa paghubad sa .elf file sa .hex nga pormat para sa pag-initialize sa memorya.

3.2.5. Uban pang Utility Tools

Mahimo nimong gikinahanglan ang mosunod nga mga himan sa command-line sa paghimo og sistema nga nakabase sa processor sa Nios V. Kini nga mga himan sa command-line gihatag sa Intel sa /quartus/bin o nakuha gikan sa
open-source nga mga himan.

Talaan 28. Ubang Command-Line Tools

Command-Line Tools

Type

Summary

juart-terminal

Intel nga gihatag

Sa pagmonitor sa stdout ug stderr, ug sa paghatag og input sa Nios® V processor
subsystem pinaagi sa stdin. Kini nga himan magamit lamang sa JTAG UART IP kung kini konektado sa Nios® V processor.

openocd

Gihatag sa Intel Aron ipatuman ang OpenOCD.

openocd-cfg-gen

Intel-provided · Aron makamugna sa OpenOCD configuration file. · Aron ipakita ang JTAG indeks sa kadena nga aparato.

Handbook sa Disenyo sa Disenyo sa Nios® V V 46

Ipadala ang Feedback

726952 | 2025.07.16 Magpadala ug Feedback
4. Nios V Processor Configuration ug Booting Solutions
You can configure the Nios V processor to boot and execute software from different memory locations. The boot memory is the Quad Serial Peripheral Interface (QSPI) flash, On-Chip Memory (OCRAM), or Tightly Coupled Memory (TCM).
Related Information · Power-Up Trigger Conditions on page 193 · Power-Up Triggers
Para sa dugang nga impormasyon bahin sa power-up triggers.
4.1. Pasiuna
Ang Nios V processor nagsuporta sa duha ka matang sa boot nga proseso: · Execute-in-Place (XIP) gamit ang alt_load() function · Program nga gikopya sa RAM gamit ang boot copier. Ang Nios V embedded program development gibase sa hardware abstraction layer (HAL). Ang HAL naghatag og gamay nga boot loader nga programa (nailhan usab nga boot copier) nga nagkopya sa mga may kalabutan nga linker nga mga seksyon gikan sa boot memory ngadto sa ilang run time nga lokasyon sa boot time. Mahimo nimong ipiho ang mga lokasyon sa oras sa pagdagan sa programa ug data memory pinaagi sa pagmaniobra sa mga setting sa Editor sa Board Support Package (BSP). Kini nga seksyon naghulagway: · Nios V processor boot copier nga nag-boot sa imong Nios V processor system sumala sa
the boot memory selection · Nios V processor booting options and general flow · Nios V programming solutions for the selected boot memory
4.2. Pag-link sa mga Aplikasyon
Sa diha nga ikaw makahimo sa Nios V processor nga proyekto, ang BSP Editor makamugna og duha ka linker nga may kalabutan files: · linker.x: Ang linker nga sugo file nga gihimo sa namugna nga aplikasyonfile mga gamit
to create the .elf binary file. · linker.h: Naglangkob sa kasayuran bahin sa layout sa memorya sa linker. Ang tanang linker setting modifications nga imong gihimo sa BSP project makaapekto sa sulod niining duha ka linker files. Ang matag aplikasyon sa Nios V processor naglangkob sa mosunod nga mga seksyon sa linker:
© Altera Corporation. Ang Altera, ang logo sa Altera, ang logo sa `a', ug uban pang mga marka sa Altera mga tatak sa Altera Corporation. Ang Altera adunay katungod sa paghimo og mga pagbag-o sa bisan unsang mga produkto ug serbisyo sa bisan unsang oras nga wala’y pahibalo. Ang Altera walay responsibilidad o tulubagon nga naggikan sa aplikasyon o paggamit sa bisan unsang impormasyon, produkto, o serbisyo nga gihulagway dinhi gawas sa dayag nga giuyonan sa pagsulat sa Altera. Gitambagan ang mga kustomer sa Altera nga magkuha sa labing bag-ong bersyon sa mga detalye sa aparato sa dili pa magsalig sa bisan unsang gipatik nga kasayuran ug sa dili pa magbutang mga order alang sa mga produkto o serbisyo. *Ang ubang mga ngalan ug mga tatak mahimong maangkon nga gipanag-iya sa uban.

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16

Talaan 29. Mga Seksyon sa Linker

.text

Mga Seksyon sa Linker

.rodata

.rwdata

.bss

.tapok

.stack

Deskripsyon Executable code. Bisan unsang read-only data nga gigamit sa pagpatuman sa programa. Gitipigan ang mga datos sa pagbasa-sulat nga gigamit sa pagpatuman sa programa. Naglangkob uninitialized static data. Naglangkob sa dinamikong gigahin nga memorya. Gitipigan ang mga parameter sa function-call ug uban pang temporaryo nga datos.

Mahimo nimong idugang ang dugang nga mga seksyon sa linker sa .elf file sa paghupot sa custom code ug data. Kini nga mga seksyon sa linker gibutang sa ginganlan nga mga rehiyon sa memorya, nga gihubit nga katumbas sa pisikal nga memorya nga mga himan ug mga adres. Sa kasagaran, ang BSP Editor awtomatik nga nagmugna niining mga seksyon sa linker. Bisan pa, mahimo nimong kontrolon ang mga seksyon sa linker alang sa usa ka partikular nga aplikasyon.

4.2.1. Pagdugtong nga Kinaiya
Kini nga seksyon naghulagway sa BSP Editor default linking behavior ug unsaon pagkontrolar sa linking behavior.

4.2.1.1. Default nga BSP Linking
Atol sa pag-configure sa BSP, ang mga himan awtomatikong mobuhat sa mosunod nga mga lakang:
1. I-assign ang mga ngalan sa rehiyon sa memorya: I-assign ang usa ka ngalan sa matag device sa memorya sa sistema ug idugang ang matag ngalan sa linker file isip usa ka rehiyon sa memorya.
2. Pangitaa ang pinakadako nga memorya: Ilha ang pinakadako nga read-and-write memory region sa linker file.
3. I-assign ang mga seksyon sa linker: Ibutang ang default linker nga mga seksyon (.text, .rodata, .rwdata, .bss, .heap, ug .stack) sa memory region nga giila sa miaging lakang.
4. Pagsulat files: Isulat ang linker.x ug linker.h files.
Kasagaran, ang laraw sa alokasyon sa seksyon sa linker molihok sa panahon sa proseso sa pagpauswag sa software tungod kay ang aplikasyon gigarantiyahan nga molihok kung ang memorya igo nga kadako.
Ang mga lagda alang sa default linking nga kinaiya anaa sa Altera-generated Tcl scripts bsp-set-defaults.tcl ug bsp-linker-utils.tcl nga makita sa /niosv/scripts/bsp-defaults nga direktoryo. Ang niosv-bsp nga sugo nagtawag niini nga mga script. Ayaw usba kini nga mga script direkta.

Handbook sa Disenyo sa Disenyo sa Nios® V V 48

Ipadala ang Feedback

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16

4.2.1.2. Ma-configure nga BSP Linking
Mahimo nimong madumala ang default nga pamatasan sa pag-link sa tab nga Linker Script sa BSP Editor. Manipulate sa linker script gamit ang mosunod nga mga pamaagi: · Pagdugang og memory region: Mapa ang ngalan sa memory region ngadto sa physical memory device. · Pagdugang og pagmapa sa seksyon: Mapa ang ngalan sa seksyon ngadto sa rehiyon sa memorya. Ang BSP
Gitugotan ka sa editor view ang memory map sa wala pa ug pagkahuman sa paghimo og mga pagbag-o.

4.3. Mga Pamaagi sa Pag-booting sa Nios V Processor

Adunay pipila ka mga pamaagi aron ma-boot ang Nios V nga processor sa Altera FPGA nga mga aparato. Ang mga pamaagi sa pag-boot sa Nios V processor magkalainlain sumala sa pagpili sa flash memory ug mga pamilya sa aparato.

Talaan 30. Gisuportahan nga Flash Memory uban sa Respective Boot Options

Gisuportahan nga Boot Memory

Device

On-Chip Flash (for Internal configuration)

Max 10 device lang (nga adunay On-Chip Flash IP)

Kinatibuk-ang Katuyoan QSPI Flash (para sa data sa user lamang)

All supported FPGA devices (with Generic Serial Flash Interface FPGA IP)

Configuration QSPI Flash (para sa Active Serial configuration)

Pagkontrol sa block-based
devices (with Generic
Serial Flash Interface Intel FPGA IP)(2)

Mga Pamaagi sa Pag-booting sa Nios V Processor

Lokasyon sa Runtime sa Aplikasyon

Boot Copier

Ang aplikasyon sa processor sa Nios V gipatuman sa lugar gikan sa On-Chip Flash

On-Chip Flash (XIP) + OCRAM/ External RAM (for writable data sections)

alt_load() function

Nios V processor application nga gikopya gikan sa On-Chip Flash ngadto sa RAM gamit ang boot copier

OCRAM/External nga RAM

Paggamit pag-usab sa Bootloader pinaagi sa GSFI

Nios V processor application executein-place from general purpose QSPI flash

Kinatibuk-ang katuyoan nga QSPI flash (XIP) + OCRAM/ External RAM (alang sa mga seksyon sa data nga masulat)

alt_load() function

Ang aplikasyon sa processor sa Nios V gikopya gikan sa kinatibuk-ang katuyoan nga QSPI flash ngadto sa RAM gamit ang boot copier

OCRAM/External nga RAM

Bootloader pinaagi sa GSFI

Ang aplikasyon sa processor sa Nios V gipatuman sa lugar gikan sa pag-configure sa QSPI flash

Configuration QSPI flash (XIP) + OCRAM/ External RAM (para sa mga seksyon sa data nga masulat)

alt_load() function

Ang aplikasyon sa processor sa Nios V gikopya gikan sa configuration sa QSPI flash ngadto sa RAM gamit ang boot copier

Ang OCRAM/ External RAM Bootloader pinaagi sa GSFI nagpadayon…

(2) Tan-awa ang AN 980: Nios V Processor Quartus Prime Software Support para sa listahan sa device.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 49

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16

Gisuportahan nga Boot Memory
On-chip Memory (OCRAM) Tightly Coupled Memory (TCM)

Device
SDM-based nga mga himan (uban sa Mailbox Client Intel FPGA IP). (2)
Tanan nga gisuportahan nga mga aparato sa Altera FPGA (2)
Tanan nga gisuportahan nga mga aparato sa Altera FPGA (2)

Mga Pamaagi sa Pag-booting sa Nios V Processor
Ang aplikasyon sa processor sa Nios V gikopya gikan sa configuration sa QSPI flash ngadto sa RAM gamit ang boot copier
Ang aplikasyon sa processor sa Nios V gipatuman sa lugar gikan sa OCRAM
Ang aplikasyon sa processor sa Nios V gipatuman sa lugar gikan sa TCM

Lokasyon sa Runtime sa Aplikasyon

Boot Copier

OCRAM/ External RAM Bootloader pinaagi sa SDM

OCRAM

alt_load() function

Instruction TCM (XIP) None + Data TCM (for writable data sections)

Figure 28. Nios V Processor Boot Flow

I-reset

Processor jumps to reset vector (boot code start)

Ang code sa aplikasyon mahimong makopya sa laing lokasyon sa memorya (depende sa mga opsyon sa boot)
Ang boot code magsugod sa processor

Depende sa mga kapilian sa boot, ang boot code mahimong kopyahon ang mga inisyal nga kantidad para sa data/code ngadto sa laing memory space (alt_load)
Ang boot code nag-initialize sa application code ug data memory space
Ang boot code nagsugod sa tanan nga mga peripheral sa sistema nga adunay mga drayber sa HAL (alt_main)
Pagsulod sa main
May Kalabutan nga Impormasyon · Generic Serial Flash Interface Altera FPGA IP User Guide
Handbook sa Disenyo sa Disenyo sa Nios® V V 50

Ipadala ang Feedback

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16
· Mailbox Client Altera FPGA IP User Guide · AN 980: Nios V Processor Quartus Prime Software Support
4.4. Introduction to Nios V Processor Booting Methods
Ang mga sistema sa processor sa Nios V nanginahanglan sa mga imahe sa software nga ma-configure sa memorya sa sistema sa dili pa magsugod ang processor sa pagpatuman sa programa sa aplikasyon. Tan-awa ang Linker Sections para sa default linker sections.
The BSP Editor generates a linker script that performs the following functions: · Ensures that the processor software is linked in accordance with the linker settings
sa editor sa BSP ug nagtino kung asa ang software nagpuyo sa memorya. · Ibutang ang code region sa processor sa memory component sumala sa
gi-assign nga mga sangkap sa memorya.
Ang mosunod nga seksyon mubo nga naghulagway sa anaa nga Nios V processor booting mga pamaagi.
4.4.1. Nios V Processor Application Ipatuman-In-Place gikan sa Boot Flash
Gidisenyo sa Altera ang mga flash controller aron ang boot flash address space ma-access dayon sa Nios V processor sa pag-reset sa sistema, nga dili kinahanglan nga magsugod sa memory controller o memory device. Makapahimo kini sa Nios V nga processor sa pag-execute sa application code nga gitipigan sa mga boot device direkta nga dili mogamit ug boot copier aron kopyahon ang code ngadto sa laing matang sa memorya. Ang flash controllers mao ang: · On-Chip Flash uban sa On-Chip Flash IP (lamang sa MAX® 10 device) · Kinatibuk-ang katuyoan QSPI flash uban sa Generic Serial Flash Interface IP · Configuration QSPI flash uban sa Generic Serial Flash Interface IP (gawas sa MAX 10
mga aparato)
Sa diha nga ang Nios V processor nga aplikasyon mag-execute-in-place gikan sa boot flash, ang BSP Editor mobuhat sa mosunod nga mga gimbuhaton: · Itakda ang .text linker nga mga seksyon ngadto sa boot flash memory region. · Gitakda ang .bss,.rodata, .rwdata, .stack ug .heap linker nga mga seksyon sa RAM
rehiyon sa memorya. Kinahanglan nimong palihokon ang alt_load() function sa BSP Settings para kopyahon ang data sections (.rodata, .rwdata,, .exceptions) sa RAM sa pag-reset sa sistema. Ang seksyon sa code (.text) nagpabilin sa rehiyon sa boot flash memory.
May Kalabutan nga Impormasyon · Generic Serial Flash Interface Altera FPGA IP User Guide · Altera MAX 10 User Flash Memory User Guide
4.4.1.1. alt_load()
Mahimo nimong palihokon ang alt_load() function sa HAL code gamit ang BSP Editor.
When used in the execute-in-place boot flow, the alt_load() function performs the following tasks:

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 51

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16

· Operates as a mini boot copier that copies the memory sections to RAM based on the BSP settings.
· Gikopya ang mga seksyon sa datos (.rodata, .rwdata, .eksepsiyon) ngadto sa RAM apan dili ang mga seksyon sa code (.teksto). Kini nga partitioning makatabang sa pagpamenos sa paggamit sa RAM apan mahimong limitahan ang performance sa code execution tungod kay ang mga access sa flash memory mas hinay kay sa access sa on-chip RAM.

Ang mosunod nga talaan naglista sa mga setting ug mga gimbuhaton sa BSP Editor:

Talaan 31. BSP Editor Settings
Setting sa BSP Editor hal.linker.enable_alt_load hal.linker.enable_alt_load_copy_rodata hal.linker.enable_alt_load_copy_rwdata hal.linker.enable_alt_load_copy_exceptions

Function Enables alt_load() function. alt_load() copies .rodata section to RAM. alt_load() copies .rwdata section to RAM. alt_load() copies .exceptions section to RAM.

4.4.2. Nios V Processor Application Gikopya gikan sa Boot Flash ngadto sa RAM Gamit ang Boot Copier
Ang Nios V processor ug HAL naglakip sa usa ka boot copier nga naghatag og igong gamit alang sa kadaghanan sa Nios V processor nga mga aplikasyon ug sayon ​​nga ipatuman uban sa Nios V software development flow.
When the application uses a boot copier, it sets all linker sections ( .text, .heap , .rwdata, .rodata , .bss, .stack) to an internal or external RAM. Using the boot copier to copy a Nios V processor application from the boot flash to the internal or external RAM for execution helps to improve the execution performance.
Alang niini nga opsyon sa boot, ang Nios V processor magsugod sa pagpatuman sa boot copier software sa pag-reset sa sistema. Ang software nagkopya sa aplikasyon gikan sa boot flash ngadto sa internal o external RAM. Kung kompleto na ang proseso, ibalhin sa Nios V processor ang kontrol sa programa ngadto sa aplikasyon.

Mubo nga sulat:

If the boot copier is in flash, then the alt_load() function does not need to be called because they both serve the same purpose.

4.4.2.1. Nios V Processor Bootloader pinaagi sa Generic Serial Flash Interface
Ang Bootloader pinaagi sa GSFI mao ang Nios V processor boot copier nga nagsuporta sa QSPI flash memory sa control block-based nga mga device. Ang Bootloader pinaagi sa GSFI naglakip sa mosunod nga mga bahin:
· Gipangita ang software application sa non-volatile memory.
· Unpacks and copies the software application image to RAM.
· Awtomatikong gibalhin ang pagpatuman sa processor ngadto sa code sa aplikasyon sa RAM human makompleto ang kopya.

Handbook sa Disenyo sa Disenyo sa Nios® V V 52

Ipadala ang Feedback

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16

Ang imahe sa boot nahimutang pagkahuman sa boot copier. Kinahanglan nimo nga sigurohon nga ang Nios V processor nag-reset sa mga offset nga punto sa pagsugod sa boot copier. Ang Figure: Memory Map para sa QSPI Flash nga adunay Bootloader pinaagi sa GSFI memory map para sa QSPI Flash nga adunay Bootloader pinaagi sa GSFI nagpakita sa flash memory map para sa QSPI flash kung naggamit og boot copier. Kini nga mapa sa memorya nagtuo nga ang memorya sa flash nagtipig sa imahe sa FPGA ug ang software sa aplikasyon.

Talaan 32. Bootloader pinaagi sa GSFI alang sa Nios V Processor Core

Nios V Processor Core
Nios V/m processor

Bootloader pinaagi sa GSFI File Lokasyon
/niosv/components/bootloader/ niosv_m_bootloader.srec

Nios V/g processor

/niosv/components/bootloader/ niosv_g_bootloader.srec

Figure 29. Memory Map para sa QSPI Flash nga adunay Bootloader pinaagi sa GSFI

Data sa Kustomer (*.hex)

Kodigo sa Aplikasyon

Mubo nga sulat:

Reset Vector Offset

Boot Copier

0x01E00000

Hulagway sa FPGA (*.sof)

0x00000000

1. Sa pagsugod sa memory map mao ang FPGA image nga gisundan sa imong data, nga naglangkob sa boot copier ug application code.
2. You must set the Nios V processor reset offset in Platform Designer and point it to the start of the boot copier.
3. The size of the FPGA image is unknown.You can only know the exact size after the Quartus Prime project compilation. You must determine an upper bound for the size of the Altera FPGA image. For example, kung ang gidak-on sa FPGA nga imahe gibanabana nga ubos pa sa 0x01E00000, itakda ang Reset Offset sa 0x01E00000 sa Platform Designer, nga mao usab ang pagsugod sa boot copier.
4. Ang usa ka maayo nga praktis sa pagdesinyo naglangkob sa pag-set sa reset vector offset sa flash sector boundary aron masiguro nga walay partial erase sa FPGA image mahitabo kung ang software application ma-update.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 53

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16

4.4.2.2. Nios V Processor Bootloader pinaagi sa Secure Device Manager
Ang Bootloader pinaagi sa Secure Device Manager (SDM) usa ka HAL application code nga naggamit sa Mailbox Client Altera FPGA IP HAL driver para sa processor booting. Girekomenda ni Altera kini nga aplikasyon sa bootloader kung gigamit ang pag-configure nga QSPI flash sa mga aparato nga nakabase sa SDM aron ma-boot ang processor sa Nios V.
Sa pag-reset sa sistema, ang Nios V processor unang nag-boot sa Bootloader pinaagi sa SDM gikan sa gamay nga on-chip memory ug nagpatuman sa Bootloader pinaagi sa SDM aron makigkomunikar sa configuration QSPI flash gamit ang Mailbox Client IP.
Ang Bootloader pinaagi sa SDM naghimo sa mosunod nga mga buluhaton: · Gipangita ang Nios V software sa configuration QSPI flash. · Pagkopya sa Nios V software ngadto sa on-chip RAM o external RAM. · Gibalhin ang pagpatuman sa processor ngadto sa Nios V software sulod sa on-chip RAM o
external RAM.
Kung nahuman na ang proseso, ang Bootloader pinaagi sa SDM nagbalhin sa kontrol sa programa sa aplikasyon sa gumagamit. Girekomenda ni Altera ang organisasyon sa memorya ingon nga gilatid sa Memory Organization para sa Bootloader pinaagi sa SDM.
Figure 30. Bootloader pinaagi sa SDM Process Flow

Pag-configure

Flash

2

Nios V Software

SDM

SDM-Based FPGA Device

Mailbox Client IP

FPGA Logic Nios V

4 Sa gawas nga RAM
Nios V Software

On-Chip 4

EMIF

RAM

On-Chip Memory

IP

Nios V

1

Software

Bootloader pinaagi sa SDM

3

3

1. Ang Nios V processor nagpadagan sa Bootloader pinaagi sa SDM gikan sa on-chip memory.
2. Ang bootloader pinaagi sa SDM nakigsulti sa configuration flash ug nangita sa Nios V software.
3. Ang Bootloader pinaagi sa SDM nagkopya sa Nios V software gikan sa Configuration Flash ngadto sa on-chip RAM / external RAM.
4. Bootloader via SDM switches the Nios V processor execution to the Nios V software in the on-chip RAM / external RAM.

4.4.3. Nios V Processor Application Ipatuman-In-Place gikan sa OCRAM
In this method, the Nios V processor reset address is set to the base address of the on-chip memory (OCRAM). The application binary (.hex) file gikarga ngadto sa OCRAM sa dihang ang FPGA na-configure, human ang disenyo sa hardware gihugpong sa Quartus Prime software. Sa higayon nga ang Nios V processor ma-reset, ang aplikasyon magsugod sa pagpatuman ug sanga ngadto sa entry point.

Handbook sa Disenyo sa Disenyo sa Nios® V V 54

Ipadala ang Feedback

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16

Mubo nga sulat:

· Ang Execute-In-Place gikan sa OCRAM wala magkinahanglan og boot copier tungod kay ang Nios V processor nga aplikasyon anaa na sa pag-reset sa sistema.
· Girekomenda ni Altera ang pagpagana sa alt_load() para niining paagi sa pag-booting aron ang embedded software molihok nga parehas kung i-reset nga wala’y pag-configure pag-usab sa imahe sa aparato sa FPGA.
· Kinahanglan nimong i-enable ang alt_load() function sa BSP Settings para kopyahon ang .rwdata section sa pag-reset sa system. Niini nga pamaagi, ang mga inisyal nga bili alang sa mga inisyal nga mga variable gitipigan nga gilain gikan sa katugbang nga mga variable aron malikayan ang overwriting sa pagpatuman sa programa.

4.4.4. Nios V Processor Application Execute-In-Place from TCM
Ang execute-in-place nga pamaagi nagtakda sa Nios V processor reset address ngadto sa base address sa tightly coupled memory (TCM). Ang binary nga aplikasyon (.hex) file gikarga sa TCM sa dihang imong gi-configure ang FPGA human nimo i-compile ang hardware nga disenyo sa Quartus Prime software. Sa higayon nga ang Nios V processor ma-reset, ang aplikasyon magsugod sa pagpatuman ug mga sanga ngadto sa entry point.

Mubo nga sulat:

Execute-In-Place from TCM does not require boot copier because Nios V processor application is already in place at system reset.

4.5. Nios V Processor Booting gikan sa On-Chip Flash (UFM)

Ang Nios V processor booting ug executing software gikan sa on-chip flash (UFM) anaa sa MAX 10 FPGA device. Ang Nios V processor nagsuporta sa mosunod nga duha ka boot nga mga opsyon gamit ang On-Chip Flash ubos sa Internal Configuration mode:
· Nios V processor application executes in-place from On-Chip Flash.
· Ang aplikasyon sa processor sa Nios V gikopya gikan sa On-Chip Flash ngadto sa RAM gamit ang boot copier.

Table 33. Supported Flash Memories with respective Boot Options

Gisuportahan nga Boot Memory

Nios V Booting Methods

Lokasyon sa Runtime sa Aplikasyon

Boot Copier

MAX 10 devices only (with OnChip Flash IP)

Ang aplikasyon sa processor sa Nios V gipatuman sa lugar gikan sa On-Chip Flash
Nios V processor application nga gikopya gikan sa On-Chip Flash ngadto sa RAM gamit ang boot copier

On-Chip Flash (XIP) + OCRAM/ External RAM (for writable data sections)

alt_load() function

OCRAM/External nga RAM

Paggamit pag-usab sa Bootloader pinaagi sa GSFI

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 55

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16

Hulagway 31.

Design, Configuration, ug Booting Flow
Disenyo · Paghimo sa imong proyekto nga nakabase sa Nios V Processor gamit ang Platform Designer. · Siguruha nga adunay eksternal nga RAM o on-chip RAM sa disenyo sa sistema.

FPGA Configuration ug Compilation
· I-set ang parehas nga internal configuration mode sa On-chip Flash IP sa Platform Designer ug Quartus Prime software. · Ibutang ang Nios V processor reset agent sa On-chip Flash. · Pilia ang imong gusto nga paagi sa pagsugod sa UFM. · Paghimo sa imong disenyo sa Platform Designer. · I-compile ang imong proyekto sa Quartus Prime software.

User Application BSP Project · Paghimo Nios V processor HAL BSP base sa .sopcinfo file gihimo sa Platform Designer. · I-edit ang Nios V processor BSP settings ug Linker Script sa BSP Editor. · Paghimo og proyekto sa BSP.
Proyekto sa Aplikasyon sa Gumagamit APP · Pagpalambo sa code sa aplikasyon sa processor sa Nios V. · Pag-compile sa Nios V nga aplikasyon sa processor ug paghimo sa Nios V processor nga aplikasyon (.hex) file. · Recompile your project in Quartus Prime software if you check Initialize memory content option in Intel FPGA On-Chip Flash IP.

Pagprograma Files Conversion, Download ug Run · Paghimo sa On-Chip Flash .pof file gamit ang Convert Programming Files feature sa Quartus Prime software.
· Programa ang .pof file sa imong MAX 10 device. · Siklo sa kuryente ang imong hardware.
4.5.1. MAX 10 FPGA On-Chip Flash Deskripsyon
Ang MAX 10 FPGA nga mga himan adunay on-chip flash nga gibahin sa duha ka bahin: · Configuration Flash Memory (CFM) — nagtipig sa datos sa configuration sa hardware alang sa
MAX 10 ka FPGA. · User Flash Memory (UFM) — nagtipig sa datos sa tiggamit o mga aplikasyon sa software.
Ang arkitektura sa UFM sa MAX 10 nga aparato usa ka kombinasyon sa humok ug gahi nga mga IP. Ma-access ra nimo ang UFM gamit ang On-Chip Flash IP Core sa Quartus Prime software.
Ang On-chip Flash IP core nagsuporta sa mosunod nga mga bahin: · Pagbasa o pagsulat sa mga access sa UFM ug CFM (kon mahimo sa Platform Designer) nga mga sektor
gamit ang datos sa Avalon MM ug kontrola ang interface sa ulipon. · Gisuportahan ang pagtangtang sa panid, pagtangtang sa sektor ug pagsulat sa sektor. · Simulation model para sa UFM read/write accesses gamit ang nagkalain-laing EDA simulation tools.

Handbook sa Disenyo sa Disenyo sa Nios® V V 56

Ipadala ang Feedback

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16

Talaan 34. On-chip Flash Rehiyon sa MAX 10 FPGA Devices

Mga Rehiyon sa Flash

Functionality

Configuration Flash Memory (mga sektor nga CFM0-2)

Pag-configure sa FPGA file pagtipig

User Flash Memory (mga sektor UFM0-1)

Nios V processor aplikasyon ug user data

MAX 10 FPGA devices support several configuration modes and some of these modes allow CFM1 and CFM2 to be used as an additional UFM region. The following table shows the storage location of the FPGA configuration images based on the MAX 10 FPGA’s configuration modes.

Talaan 35. Lokasyon sa Pagtipig sa FPGA Configuration Images

Configuration Mode Dual compressed nga mga hulagway

CFM2 Compressed Image 2

CFM1

CFM0 Compressed Image 1

Usa ka wala ma-compress nga imahe

Virtual nga UFM

Dili ma-compress nga imahe

Usa ka wala ma-compress nga imahe nga adunay Memory Initialization

Uncompressed image (with pre-initialized on-chip memory content)

Usa ka compressed nga imahe nga adunay Memory Initialization Na-compress nga imahe (nga adunay pre-initialized on-chip memory content)

Usa ka compressed nga imahe

Virtual nga UFM

Compressed Image

Kinahanglan nimong gamiton ang On-chip Flash IP core aron maka-access sa flash memory sa MAX 10 FPGAs. Mahimo nimong i-instantiate ug ikonektar ang On-chip Flash IP sa software nga Quartus Prime. Ang Nios V soft core processor naggamit sa Platform Designer interconnects aron makigkomunikar sa On-chip Flash IP.
Figure 32. Koneksyon tali sa On-chip Flash IP ug Nios V Processor

Mubo nga sulat:

Siguruha nga ang On-chip Flash csr port konektado sa Nios V processor data_manager aron ang processor makakontrol sa pagsulat ug pagtangtang sa mga operasyon.
The On-chip Flash IP core can provide access to five flash sectors – UFM0, UFM1, CFM0, CFM1, and CFM2.
Importante nga impormasyon mahitungod sa UFM ug CFM nga mga sektor.: · Ang CFM nga mga sektor gituyo alang sa configuration (bitstream) data (*.pof) storage.
· Ang datos sa gumagamit mahimong tipigan sa mga sektor sa UFM ug mahimong itago, kung ang husto nga mga setting gipili sa tool sa Platform Designer.
· Ang pipila ka mga himan walay UFM1 nga sektor. Mahimo nimong i-refer ang lamesa: UFM ug CFM Sector Size alang sa magamit nga mga sektor sa matag indibidwal nga MAX 10 FPGA device.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 57

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16

· Mahimo nimong i-configure ang CFM2 isip usa ka virtual nga UFM pinaagi sa pagpili sa Single Uncompressed Image configuration mode.
· You can configure CFM2 and CFM1 as a virtual UFM by selecting Single Uncompressed Image configuration mode.
· Ang gidak-on sa matag sektor managlahi sa pinili nga MAX 10 FPGA nga mga himan.

Talaan 36.

UFM and CFM Sector Size
Kini nga lamesa naglista sa mga sukod sa UFM ug CFM arrays.

Device

Mga panid matag Sektor

UFM1 UFM0 CFM2 CFM1 CFM0

Page Size (Kbit)

Maximum nga Gumagamit
Gidak-on sa Flash Memory (Kbit) (3)

Kinatibuk-ang Gidak-on sa Memorya sa Configuration (Kbit)

10M02 3

3

0

0

34 16

96

544

10M04 0

8

41 29 70 16

1248

2240

10M08 8

8

41 29 70 16

1376

2240

10M16 4

4

38 28 66 32

2368

4224

10M25 4

4

52 40 92 32

3200

5888

10M40 4

4

48 36 84 64

5888

10752

10M50 4

4

48 36 84 64

5888

10752

Gidak-on sa OCRAM (Kbit)
108 189 378 549 675 1260 1638

May Kalabutan nga Impormasyon · MAX 10 FPGA Configuration User Guide · Altera MAX 10 User Flash Memory User Guide

4.5.2. Nios V Processor Application Ipatuman-In-Place gikan sa UFM

Ang Execute-In-Place gikan sa UFM nga solusyon angay alang sa Nios V nga mga aplikasyon sa processor nga nagkinahanglan og limitado nga on-chip memory nga paggamit. Ang alt_load() function naglihok isip mini boot copier nga nagkopya sa data sections (.rodata, .rwdata, o .exceptions) gikan sa boot memory ngadto sa RAM base sa BSP settings. Ang seksyon sa code (.text),
nga usa ka read only nga seksyon, nagpabilin sa MAX 10 On-chip Flash memory nga rehiyon. Kini nga setup nagpamenos sa paggamit sa RAM apan mahimong limitahan ang performance sa code execution kay ang access sa flash memory mas hinay kay sa on-chip RAM.

Ang aplikasyon sa Nios V processor giprograma sa sektor sa UFM. Ang reset vector sa Nios V processor nagpunting sa UFM base address aron ipatuman ang code gikan sa UFM pagkahuman sa pag-reset sa sistema.

Kung ikaw naggamit sa source-level debugger aron sa pag-debug sa imong aplikasyon, kinahanglan nga mogamit ka ug hardware breakpoint. Kini tungod kay ang UFM wala mosuporta sa random memory access, nga gikinahanglan alang sa soft breakpoint debugging.

Mubo nga sulat:

You cannot erase or write UFM while performing execute-in-place in the MAX 10. Sswitch to boot copier approach if you need to erase or write the UFM.

(3) Ang labing taas nga posible nga kantidad, nga nagdepende sa mode sa pag-configure nga imong gipili.

Handbook sa Disenyo sa Disenyo sa Nios® V V 58

Ipadala ang Feedback

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16

Figure 33. Nios V Processor Application XIP from UFM

Max 10 nga Device

.POF
Nios V Hardware .SOF
Nios V Software .HEX

Quartus Programmer

On-Chip Flash

CFM

Nios V Hardware

UFM

Nios V Software

Internal nga Configuration

On-Chip Flash IP

FPGA Logic
Nios V Processor

On-Chip RAM

Sa gawas

RAM

EMIF

IP

4.5.2.1. Daloy sa Disenyo sa Hardware
Ang mosunod nga seksyon naghulagway sa usa ka lakang-sa-lakang nga pamaagi sa pagtukod og bootable nga sistema alang sa Nios V processor nga aplikasyon gikan sa On-Chip Flash. Ang exampAng ubos kay gihimo gamit ang MAX 10 device.
Mga Setting sa IP Component
1. Paghimo sa imong proyekto sa Nios V processor gamit ang Quartus Prime ug Platform Designer. 2. Siguroha nga ang external RAM o On-Chip Memory (OCRAM) idugang sa imong Platform
Sistema sa tigdesinyo.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 59

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16
Hulagway 34. Example IP Connections sa Platform Designer para sa Booting Nios V gikan sa OnChip Flash (UFM)

3. Sa On-Chip Flash IP parameter editor, itakda ang Configuration Mode sa usa sa mosunod, sumala sa imong gusto sa disenyo: · Single Uncompressed Image · Single Compressed Image · Single Uncompressed Image with Memory Initialization · Single Compressed Image with Memory Initialization
Para sa dugang nga impormasyon bahin sa Dual Compressed Images, tan-awa ang MAX 10 FPGA Configuration User Guide – Remote System Upgrade.

Mubo nga sulat:

Kinahanglan nimong i-assign ang Hidden Access sa matag rehiyon sa CFM sa On-Chip Flash IP.

Figure 35. Pagpili sa Configuration Mode sa On-Chip Flash Parameter Editor

On-Chip Flash IP Settings – UFM Initialization Mahimo nimong pilion ang usa sa mosunod nga mga pamaagi sumala sa imong gusto:

Handbook sa Disenyo sa Disenyo sa Nios® V V 60

Ipadala ang Feedback

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16

Mubo nga sulat:

The steps in the subsequent subchapters (Software Design Flow and Programming) depend on the selection you make here.

· Method 1: Initialize the UFM data in the SOF during compilation
Ang Quartus Prime naglakip sa UFM initialization data sa SOF atol sa compilation. Gikinahanglan ang SOF recompilation kung adunay mga pagbag-o sa datos sa UFM.
1. Susiha ang Initialize flash content ug Enable non-default initialization file.

Figure 36. Initialize Flash Contents and Enable Non-default Initialization File

2. Ipiho ang agianan sa namugna nga .hex file (gikan sa elf2hex nga sugo) sa User gibuhat hex o mif file.
Figure 37. Pagdugang sa .hex File Dalan

· Pamaagi 2: I-combine ang UFM data sa usa ka compiled SOF atol sa POF generation
UFM data is combined with the compiled SOF when converting programming files. You do not need to recompile the SOF, even if the UFM data changes. During development, you do not have to recompile SOF files for changes in the application. Alterarecommends this method for application developers.
1. I-uncheck ang Initialize flash content..
Figure 38. Initialize Flash Content with Non-default Initialization File

I-reset ang Mga Setting sa Ahente para sa Nios V Processor Ipatuman-In-Place nga Pamaagi
1. Sa Nios V processor parameter editor, ibutang ang Reset Agent sa On-Chip Flash.
Figure 39. Nios V Processor Parameter Editor Settings with Reset Agent Set to On-Chip Flash

2. I-klik Generate HDL sa diha nga ang Generation dialog box makita. 3. Ipiho ang output file generation options ug i-klik Generate.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 61

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16
Quartus Prime Software Settings 1. In the Quartus Prime software, click Assignments Device Device and Pin
Options Configuration. Set the Configuration mode according to the setting in On-Chip Flash IP. Figure 40. Configuration Mode Selection in Quartus Prime Software

2. I-klik ang OK aron mogawas sa bintana sa Device ug Pin Options,
3. I-klik ang OK aron mogawas sa bintana sa Device.
4. Click Processing Start Compilation to compile your project and generate the .sof file.

Mubo nga sulat:

If the configuration mode setting in Quartus Prime software and Platform Designer parameter editor is different, the Quartus Prime project fails with the following error message.

Hulagway 41.

Error Message para sa Different Configuration Mode Setting Error (14740): Configuration mode sa atom “q_sys:q_sys_inst| altera_onchip_flash:onchip_flash_1|altera_onchip_flash_block: altera_onchip_flash_block|ufm_block” dili mohaum sa project setting. I-update ug i-regenerate ang Qsys system aron mohaum sa setting sa proyekto.

Related Information MAX 10 FPGA Configuration User Guide

4.5.2.2. Daloy sa Disenyo sa Software
Kini nga seksyon naghatag sa dagan sa disenyo aron makamugna ug matukod ang Nios V processor software project. Aron masiguro ang usa ka streamline nga dagan sa pagtukod, giawhag ka nga maghimo usa ka parehas nga punoan sa direktoryo sa imong proyekto sa disenyo. Ang mosunud nga dagan sa disenyo sa software gibase sa kini nga punoan sa direktoryo.
Sa paghimo sa software project directory tree, sunda kini nga mga lakang: 1. Sa imong design project folder, paghimo og folder nga gitawag og software. 2. Sa software folder, paghimo og duha ka folder nga gitawag og hal_app ug hal_bsp.
Figure 42. Software Project Directory Tree

Handbook sa Disenyo sa Disenyo sa Nios® V V 62

Ipadala ang Feedback

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16
Creating the Application BSP Project
Para ilunsad ang BSP Editor, sunda kini nga mga lakang: 1. Isulod ang Nios V Command Shell. 2. Tawga ang BSP Editor gamit ang niosv-bsp-editor command. 3. Sa BSP Editor, i-klik File Bag-ong BSP aron masugdan ang imong proyekto sa BSP. 4. I-configure ang mosunod nga mga setting:
· Impormasyon sa SOPC File ngalan: Ihatag ang SOPCINFO file (.sopcinfo). · Ngalan sa CPU: Pilia ang Nios V processor. · Operating system: Pilia ang operating system sa Nios V processor. · Bersyon: Biyai isip default. · BSP target nga direktoryo: Pilia ang direktoryo nga agianan sa proyekto sa BSP. Mahimo nimo
pre-set kini sa /software/hal_bsp pinaagi sa pagpagana sa Paggamit sa default nga mga lokasyon. · Mga Setting sa BSP File ngalan: Isulat ang ngalan sa BSP Settings File. · Additional Tcl scripts: Provide a BSP Tcl script by enabling Enable Additional Tcl script. 5. Click OK.
Figure 43. Configure New BSP

Configuring the BSP Editor and Generating the BSP Project
You can define the processor’s exception vector either in On-Chip Memory (OCRAM) or On-Chip Flash based on your design preference. Setting the exception vector memory to OCRAM/External RAM is recommended to make the interrupt processing faster. 1. Go to Main Settings Advanced hal.linker. 2. If you select On-Chip Flash as exception vector,
a. Enable the following settings:

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 63

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16
· allow_code_at_reset · enable_alt_load · enable_alt_load_copy_rodata · enable_alt_load_copy_rwdata Figure 44. Advanced.hal.linker Settings

b. Click on the Linker Script tab in the BSP Editor. c. Set the .exceptions and .text regions in the Linker Section Name to
On-Chip Flash. d. Set the rest of the regions in the Linker Section Name list to the On-Chip
Memory (OCRAM) or external RAM.
Figure 45. Linker Region Settings (Exception Vector Memory: On-Chip Flash)

3. If you select OCRAM/External RAM as exception vector, a. Enable the following settings: · allow_code_at_reset · enable_alt_load · enable_alt_load_copy_rodata · enable_alt_load_copy_rwdata · enable_alt_load_copy_exception
Figure 46. Linker Region Settings (Exception Vector Memory: OCRAM/External RAM)

b. Click on the Linker Script tab in the BSP Editor.
c. Set the.text regions in the Linker Section Name to On-Chip Flash.
d. Set the rest of the regions in the Linker Section Name list to the On-Chip Memory (OCRAM) or external RAM.

Handbook sa Disenyo sa Disenyo sa Nios® V V 64

Ipadala ang Feedback

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16
Figure 47. Linker Region Settings (Exception Vector Memory: OCRAM)
4. Click Generate to generate the BSP project. Generating the User Application Project File 1. Navigate to the software/hal_app folder and create your application source
code. 2. Launch the Nios V Command Shell. 3. 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 Altera 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. 1. Launch the Nios V Command Shell. 2. For Nios V processor application boot from On-Chip 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. elf2hex software/hal_app/build/<user_application>.elf -o onchip_flash.hex
-b <base address of On-Chip Flash UFM region> -w 8 -e <end address of On-Chip Flash UFM region> 3. Recompile the hardware design if you check Initialize memory content option in On-Chip Flash IP (Method 1). This is to include the software data (.HEX) in the SOF file.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 65

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16
4.5.2.3. Programming 1. In Quartus Prime, click File Pag-convert sa Programming Files. 2. Under Output programming file, choose Programmer Object File (.pof) as Programming file type. 3. Set Mode to Internal Configuration.
Figure 48. Convert Programming File Mga setting
4. Click Options/Boot info…, the MAX 10 Device Options window appears. 5. Based on the Initialize flash content settings in the On-chip Flash IP, perform
one of the following steps: · If Initialize flash content is checked (Method 1), the UFM initialization data
was included in the SOF duringQuartus Prime compilation. — Select Page_0 for UFM source: option. Click OK and proceed to the
next. Figure 49. Setting Page_0 for UFM Source if Initialize Flash Content is Checked

Handbook sa Disenyo sa Disenyo sa Nios® V V 66

Ipadala ang Feedback

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16
· If Initialize flash content is not checked (Method 2), choose Load memory file for the UFM source option. Browse to the generated On-chip Flash HEX file (onchip_flash.hex) in the File path: and click OK. This step adds UFM data separately to the SOF file during the programming file pagkakabig.
Figure 50. Setting Load Memory File for UFM Source if Initialize Flash Content is Not Checked

6. In the Convert Programming File dialog box, at the Input files to convert section, click Add File… and point to the generated Quartus Prime .sof file.
Figure 51. Input Files to Convert in Convert Programming Files for Single Image Mode

7. Click Generate to create the .pof file. 8. Program the .pof file into your MAX 10 device. 9. Power cycle your hardware.

4.5.3. Nios V Processor Application Copied from UFM to RAM using Boot Copier

Altera recommends this solution for MAX 10 FPGA Nios V processor system designs where multiple iterations of application software development and high system performance are required. The boot copier is located within the UFM at an offset that is the same address as the reset vector. The Nios V application is located next to the boot copier.

For this boot option, the Nios V processor starts executing the boot copier upon system reset to copy the application from the UFM sector to the OCRAM or external RAM. Once copying is complete, the Nios V processor transfers the program control over to the application.

Mubo nga sulat:

The applied boot copier is the same as the Bootloader via GSFI.

Ipadala ang Feedback

Handbook sa Disenyo sa Disenyo sa Nios® V V 67

4. Nios V Processor Configuration ug Booting Solutions 726952 | 2025.07.16

Figure 52. Nios V Application Copied from UFM to RAM using Boot Copier

Max 10 nga Device

.POF
Nios V Hardware .SOF
Nios V Software .HEX
Bootloader .SREC

Quartus Programmer

External nga RAM
Nios V Software

On-Chip Flash

CFM

Nios V Hardwa

Mga Dokumento / Mga Kapanguhaan

altera Nios V Embedded Processor [pdf] Giya sa Gumagamit
Nios V, Nios V-m, Nios V-g, Nios V-c, Nios V Embedded Processor, Nios V, Embedded Processor, Processor

Mga pakisayran

Pagbilin ug komento

Ang imong email address dili mamantala. Ang gikinahanglan nga mga natad gimarkahan *