Specifications
Table 4-5: mem_init.mk Targets
Target Operation
mem_init_install Generates memory initialization files in the application mem_init
directory. If the QUARTUS_PROJECT_DIR variable is defined, mem_
init.mk copies memory initialization files to your Quartus II
project directory named $(QUARTUS_PROJECT_DIR). If the SOPC_
NAME variable is defined, mem_init.mk copies memory initialization
files to your HDL simulation directory named $(QUARTUS_
PROJECT_DIR)/$(SOPC_NAME)_sim.
mem_init_generate Generates all memory initialization files in the application mem_
init directory.
This target also generates a Quartus II IP File (.qip). The .qip file
tells the Quartus II software where to find the initialization files.
mem_init_clean Removes the memory initialization files from the application
mem_init directory.
hex Generates all hex files.
dat Generates all dat files.
sym Generates all sym files.
flash Generates all flash files.
<memory name> Generates all memory initialization files for <memory name>
component.
Modifying Linker Memory Regions
If the linker memory regions that are created by default do not meet your needs, BSP Tcl commands let
you modify the memory regions as desired.
Suppose you have a memory region named onchip_ram. The Tcl script named reserve_1024_onchip_ram.tcl
separates the top 1024 bytes of onchip_ram to create a new region named onchip_special.
For more information about an explanation of each Tcl command used in this example, refer to the "Nios
II Software Build Tools Reference" chapter.
# Get region information for onchip_ram memory region.
# Returned as a list.
set region_info [get_memory_region onchip_ram]
# Extract fields from region information list.
set region_name [lindex $region_info 0]
set slave_desc [lindex $region_info 1]
set offset [lindex $region_info 2]
set span [lindex $region_info 3]
# Remove the existing memory region.
delete_memory_region $region_name
# Compute memory ranges for replacement regions.
set split_span 1024
set new_span [expr $span-$split_span]
set split_offset [expr $offset+$new_span]
# Create two memory regions out of the original region.
NII5V2
2015.05.14
Modifying Linker Memory Regions
4-11
Nios II Software Build Tools
Altera Corporation
Send Feedback