Embedded Design Handbook

ID 683689
Date 8/28/2023
Public
Document Table of Contents

3.6.5.5.8. Specify Base Addresses and Interrupt Request Priorities

To specify how the components added in the design to interact to form a system, you need assign base addresses for each slave component, and assign interrupt request (IRQ) priorities for the JTAG UART and the interval timer.

Platform Designer provides the Assign Base Addresses command which makes assigning component base addresses easy. For many systems, including this design example, Assign Base Addresses is adequate. However, you can adjust the base addresses to suit your needs. Below are some guidelines for assigning base addresses:

  • Nios® II processor cores can address a 31-bit address span. You must assign base address between 0x00000000 and 0x7FFFFFFF.
    Note: The Use most-significant address bit in processor to bypass data cache option is enable by default. If disabled, the Nios® II processor cores supports full 32-bit address.
  • Nios® II programs use symbolic constants to refer to addresses. You do not have to choose address values that are easy to remember.
  • 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 this can create less efficient hardware.
  • Platform Designer does not attempt to align separate memory components in a contiguous memory range. For example, if you want an on-chip RAM and an off-chip RAM to be addressable as one contiguous memory range, you must explicitly assign base addresses.

Platform Designer also provides an Assign Interrupt Numbers command which connects IRQ signals to produce valid hardware results. However, assigning IRQs effectively requires an understanding of how software responds to them. Because Platform Designer does not know the software behavior, Platform Designer cannot make educated guesses about the best IRQ assignment.

The Nios® II HAL interprets low IRQ values as higher priority. The timer component must have the highest IRQ priority to maintain the accuracy of the system clock tick.

To assign appropriate base addresses and IRQs, perform the following steps:

  1. On the System menu, click Assign Base Addresses to make Platform Designer assign functional base addresses to each component in the system. Values in the Base and End columns might change, reflecting the addresses that Platform Designer reassigned.
  2. In the IRQ column, connect the Nios® II processor to the JTAG UART and interval timer.
  3. Click the IRQ value for the jtag_uart component to select it.
  4. Type 16 and press Enter to assign a new IRQ value.
  5. Click the IRQ value for the sys_clk_timer component to select it.
  6. Type 1 and press Enter to assign a new IRQ value.