SOPC builder/Nios2: booting from custom NV-RAM

When the Nios reset vector points into Altera-provided CFI flash SOPC builder automayically adds following lines to the system ptf file:

WIZARD_SCRIPT_ARGUMENTS { MAKE { MACRO { FLASH_FLASHTARGET_ALT_SIM_PREFIX = "$(FLASH_FLASHTARGET_TMP1:0=)"; FLASH_FLASHTARGET_TMP1 = "$(ALT_SIM_OPTIMIZE:1=RUN_ON_HDL_SIMULATOR_ONLY_)"; } MASTER cpu { MACRO { BOOT_COPIER = "boot_loader_cfi.srec"; CPU_CLASS = "altera_nios2"; CPU_RESET_ADDRESS = "0x0"; } } TARGET delete_placeholder_warning { flash { Command1 = "rm -f $(SIMDIR)/contents_file_warning.txt"; Is_Phony = "1"; Target_File = "do_delete_placeholder_warning"; } } TARGET flashfiles { flash { Command1 = "@echo Post-processing to create $(notdir $@)"; Command2 = "elf2flash --input=$(ELF) --flash=

--boot=$(shell $(QUARTUS_ROOTDIR)/sopc_builder/bin/find_sopc_component_dir $(CPU_CLASS) $(QUARTUS_PROJECT_DIR))/$(BOOT_COPIER)

--outfile=$(FLASH_FLASHTARGET_ALT_SIM_PREFIX)flash.flash

--sim_optimize=$(ALT_SIM_OPTIMIZE) --base=0x0 --end=0x1FFFFFF

--reset=$(CPU_RESET_ADDRESS) "; Dependency = "$(ELF)"; Target_File = "$(FLASH_FLASHTARGET_ALT_SIM_PREFIX)flash.flash"; } } TARGET sim { flash { Command1 = "if [ ! -d $(SIMDIR) ]; then mkdir $(SIMDIR) ; fi"; Command2 = "@echo Hardware simulation is not enabled for the target SOPC Builder system. Skipping creation of hardware simulation model contents and simulation symbol files. \\(Note: This does not affect the instruction set simulator.\\)"; Command3 = "touch $(SIMDIR)/dummy_file"; Dependency = "$(ELF)"; Target_File = "$(SIMDIR)/dummy_file"; } } } }

Later on when Nios2 IDE discovers that the text section has to be copied/relocated it adds the required commands to the makefile. That's nice because this way we never forget to run elf2flash utility at the end of the make process and at the same time could take full advantage from other aspects of automatic makefile generation in Nios2 IDE (pretty much the only useful feature of the whole thing. A big fan of Eclipse I am not).

Now the question is: how do I get the same functionality for custom non-volatile memory component? I looked at the file class.ptf in the \kits\nios2_51\components\altera_avalon_cfi_flash directory and didn't find anything resembling the required lines. Do we see a built-in SOPC builder wizardry at action once again treating custom components as 3rd class citizens?

Reply to
already5chosen
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.