How to reduce ROM/RAM requirements for a NIOSV Compact CPU Platform?
Hello ALTERA NIOSV Experts, I am trying to create a system in Quartus Platform Designer which has the following components: A 1G Tri mode ethernet IP (with 32 bit AVALON-ST TX/RX interfaces using minimum sized FIFOs) A RS 232 UART with no FIFO A couple of small FIFOs using AVALON-ST interfaces for data in and out of Platform via Conduits A NIOSV Compact CPU A JTAG UART ROM for NIOSV RAM for NIOSV My questions are about how to reduce the ROM (for the NIOSV compacts program) and RAM to the minimum amount. I am trying to shoehorn this all into a MAX10 FPGA ( Altera Max 10 part number 10M08SAU169I7G). When i build the BSP for this platform, with a "Hello World" program, it seems to need around 128 Bytes of ROM and several KBytes of RAM. Why is the program so large ? I expect it has to do with the BSP adding in drivers for all the Platform IP and it is getting bloated. What tactics are available for me to use in the Ashling RISC FREE IDE which i am using to create my BSP and/or Platform Designer to reduce the program size ? The FPGA i am trying to use only has around 48 K Bytes of RAM available in total ...so maybe this is not possible and i need a bigger FPGA of course ! Thanks for your help, Dr Barry10Views0likes0CommentsNios-V alt_epcq_controller_write() Problem
Hi, I have a flash on my custom board which is MT25QU01G. The flash is connected to Nios-V/g with Epcq Controller. I am trying to erase, write, read sectors from flash. Before write and erase I unlock all sectors and after write and erase I lock all sectors. The problem is that my alt_epcq_controller_write() returns success(0) however it doesn't write to flash memory. I read same data from same place and it is not changed. I also look that memory from memory browser and still nothing changed. I call erase method before each write method since it is nor flash but nothing happens. Could you please help me about the problem. Thanks, BalerionSolved131Views0likes13CommentsERROR building simple NIOSV Compact project
Hello and greetings All Quartus + NIOSV experts, or indeed anybody who can help me fix this error ! I am trying to build a System Verilog design, based on Platform Designer, which uses a NIOSV compact IP core. I am using Quartus Prime Version 25,1 Standard Edition on a Windows 10 Machine. When trying to compile my test design i get these 2 errors : Error (10170): Verilog HDL syntax error at niosv_cpp_fsm.sv(1418) near text: "'"; expecting ":", or "?", or binary operator. Check for and fix any syntax errors that appear immediately before or at the specified keyword. The Intel FPGA Knowledge Database contains many articles with specific details on how to resolve this error. Visit the Knowledge Database at https://www.altera.com/support/support-resources/knowledge-base/search.html and search for this specific error message number. Error (10112): Ignored design unit "niosv_cpp_fsm" at niosv_cpp_fsm.sv(18) due to previous errors Error 10112 is caused by previous error 10170. Does anybody have an idea why i get these errors ? I can't see the offending SV code because its encrypted (of course!). Is there a fix as well for this problem ? Thanks for any help, Dr Barry HSolved76Views0likes10CommentsNios V/c issue: no valid Nios V instance
Hi, I have synthesised a Nios V/c (3.0.0)-based SoC on a DE0-Nano board, which was successfully configured using the quartus_pgm command via a Nios V-shell terminal in Quartus Prime Standard 24.1. However, when the niosv-download command is executed after generating BSP and ELF files, the following message appears on the display: ... There are no devices with valid Nios V instance(s) ERROR: Failed to generate OpenOCD config file. ... However, if the same Quartus project is compiled with the Nios V/c (3.0.0) core replaced by a multicycle Nios V/m (26.0.0) core, this error does not appear, and the program runs successfully. Could you please provide any hints on how to fix this error for the Nios V/c IP ? Regards, Domingo.Solved44Views0likes2CommentsNIOSV/g with FPU: inconsistent calculation results
I'm using a NIOSV/g with FPU enabled in a MAX10 project. The project involves heavy use of float point calculations, hence the need for the FPU. I noticed some occasionally inconsistent results in this program and started debugging - assuming this was a bug in my code. However I was able to run my code in a simulator and on a different RISCV microcontroller and everything worked flawlessly. I also disabled the FPU in the NIOSV design and again the code ran fine. In order to recreate the problem, I created a basic project with just the NIOSV, some RAM and the JTAG-Uart. I also wrote a tiny C program to stress test the FPU. The results of this show that again, the FPU is producing incorrect results. I've attached a screenshot of the Platform Designer design. I'm running the design at 75Mhz and the design meets timing requirements. Here is the code I ran. Note that I have interrupts disabled to be sure this isn't a context switching issue. I also did not wrap the calculations into a function so I could more easily view the various calculation results in the debugger. This code works as expected when using a soft-FPU. When using the NIOSV FPU, results are inconsistent. I've attached a screenshot of one failed cycled. You can see that a1 and b1 are not equal. #include <stdint.h> #include <math.h> #include "sys/alt_stdio.h" static void fpuTest(void) { int fail_count = 0; int iteration = 0; while (1) { float a0 = (float)iteration * 0.001f; float a1 = 1.1f * sinf((float)iteration * 0.1f); float a2 = 2.2f / (1.0f + (float)iteration * 0.0001f); float a3 = sqrtf(3.3f + (float)iteration); float a4 = powf(4.4f + (float)iteration, 1.1f); float a5 = logf(5.5f + (float)iteration + 1.0f); float a6 = 6.6f * cosf((float)iteration * 0.05f); float a7 = 7.7f + tanf((float)iteration * 0.02f); float result_a = a0 + a1 + a2 + a3 + a4 + a5 + a6 + a7; float b0 = (float)iteration * 0.001f; float b1 = 1.1f * sinf((float)iteration * 0.1f); float b2 = 2.2f / (1.0f + (float)iteration * 0.0001f); float b3 = sqrtf(3.3f + (float)iteration); float b4 = powf(4.4f + (float)iteration, 1.1f); float b5 = logf(5.5f + (float)iteration + 1.0f); float b6 = 6.6f * cosf((float)iteration * 0.05f); float b7 = 7.7f + tanf((float)iteration * 0.02f); float result_b = b0 + b1 + b2 + b3 + b4 + b5 + b6 + b7; // Check if result is consistent (should be identical) if (fabsf(result_a - result_b) > 1e-6f) { alt_printf("FPU test failed at iteration %x\n", iteration); fail_count++; } iteration++; } } int main(void) { // Make sure interrupts are disabled __asm volatile ( "csrc mstatus, 8" ); fpuTest(); while (1); return 0; } Can someone help me investigate what could be wrong here? Could there be an issue in the FPU itself?3.1KViews0likes11CommentsProblem writing the NIOS II program to the EPCS controller.
I have a problem writing the NIOS II configuration and program to the EPCS controller. I've read the entire Internet on this topic and 70 posts on this forum. I've tried everything that's written here. My configuration. Chinese board OMDAZZ Cyclone 4E CPLD EP4CE6E22C8. I wrote a simple program that works in OnchipRAM. It blinks the LED and displays information on the LED indicator. This program was store to the OnchipRAM image and converted to a JIC file. It works. The EPCS controller is connected to the data bus, instruction bus, reset (including from JTAG) and PLL output 12 MHz. The EPCS base address is 0x8002000. NIOS II reset is assigned to the same address 0x8002000. Exception Vector is in OnchipRAM. The linker is configured to generate code in OnChip. allow_code_at_reset and the other 4 keys are disabled. log_port is disabled. In the linker settings I also see the correct reset address on the EPCS base. I am using Quartus II 13.1. I saw that there is a problem for Quartus II 13.0: Boot from Quad Serial Configuration(EPCQ) and Serial Configuration (EPCS) https://www.intel.com/content/dam/support/us/en/programmable/kdb/rd11122013-865/nios-ii-boot-from-epcq-and-epcs-in-quartus-ii-13-0.pdf Is this problem still present in Quartus II 13.1? Is there a patch for this? I read that EPCS boot only works with NIOS II/f processors. Is this true? https://community.intel.com/t5/Programmable-Devices/Nios-II-EPCS-booting-problem/m-p/113883#M32137%3Fwapkw=Epcs I tried the steps described here: https://community.intel.com/t5/Programmable-Devices/Nios-II-EPCS-booting-problem/m-p/113883#M32137%3Fwapkw=Epcs https://community.intel.com/t5/Programmable-Devices/Nios-Boot-up-from-EPCS/m-p/166705#M52307%3Fwapkw=Epcs https://community.intel.com/t5/Nios-V-II-Embedded-Design-Suite/Problem-booting-program-from-EPCS-flash-and-running-from-SRAM/m-p/142473#M38487%3Fwapkw=Epcs When generating nios_load1.sopcinfo I get two warnings: Warning: nios_load1.epcs_flash_controller_0: epcs_flash_controller_0.external must be exported, or connected to a matching conduit. Warning: nios_load1.epcs_flash_controller_0: Interrupt sender epcs_flash_controller_0.irq is not connected to an interrupt receiver I think it's not critical. I know several ways to get a HEX file. This is the only way to get a working file. I took this method from mem_init.mk. elf2hex NIOS_LED_SDRAM_APP.elf 0x08008000 0x0800cfff --width=32 --little-endian-mem --create-lanes=0 ../../output/EPCS_w.hex --verbose I inserted this file as an OnchipRAM image to check. It works. For write to EPCS, I converted the EPCS_w.hex file to the HEX byte format as described on the forum: Set Assignment -> Srtting -> More Setting -> set the Reading Or Writing HEX in byte adrresable mode key to OFF Load the EPCS_w.hex file to Kvartus Set Assignment -> Srtting -> More Setting -> set the Reading Or Writing HEX in byte adrresable mode key to On Save the EPCS_w.hex file. Then I loaded the file EPCS_w.hex into the converter to get the JIC file (also load SOF file). The converter created a JIC file with a report in SDRAM_LED.map Page_0 0x00000000 0x00023038 EPCS_sw.hex 0x00023039 0x00025DA0 Tried different offsets as recommended on the forum. Turned off and on SOF file compression. Doesn't help. Another way to get a HEX file sof2flash --input=../../output/NIOS_II_My.sof --output=hw.flash --epcs nios2-elf-objcopy --input-target srec --output-target ihex hw.flash ../../output/EPCS_hw.hex --verbose elf2flash --input=NIOS_LED_SDRAM_APP.elf --output=sw.flash --epcs -after hw.flash --verbose nios2-elf-objcopy --input-target srec --output-target ihex sw.flash ../../output/EPCS_sw.hex --verbose creates a HEX file that does not work even as an image in OnchipRAM. Can you tell me why? What did I do wrong here? I'm confused with the nios_load1_epcs_flash_controller_0_boot_rom.hex file. It is created when generating nios_load1.sopcinfo in the sopc\nios_load1\synthesis\submodules folder. But when using the mem_init_generate script in the mem_init/hdl_sim folder, this script also creates the same file. But if disable allow_code_at_reset in the linker and 4 keys below, this file consists of only one line - the end of the file. As far as I understand, the nios_load1_epcs_flash_controller_0_boot_rom.hex file is an image of the ROM disk of the EPCS controller. Could it be that when generating nios_load1.sopcinfo, the wrong file is created or should I create this file myself to replace the generated one? When programming Flash Programmer gives an error Info: No EPCS registers found: tried looking at addresses Info: 0x08002000, 0x08002100, 0x08002200, 0x08002300 and 0x08002400 Error: Error code: 8 for command: nios2-flash-programmer "E:/Q_Project_03_03/NIOS_LED_SDRAM/Software/NIOS_LED_SDRAM/flash/NIOS_II_My_epcs_flash_controller_0.flash" --base=0x8002000 --epcs --sidp=0x80010A0 --id=0x12345678 --timestamp=1741934460 --device=1 --instance=0 '--cable=USB-Blaster on localhost [USB-0]' --program --verbose However, if program the JIC file, the recording and checking are successful, the hardware works, but NIOS II does not start. I ask for help back up this situation me led to a dead end and not to see a solution. I"m have experience electronics and programming. I will understand even two words where I was wrong. Sorry for my bad EnglishSolved2.2KViews0likes11CommentsCyclone 10 GX Nios V: TSE with mSGDMA Not Responding to Ping
Hello , I am using a Cyclone 10 GX with Nios V and the Micrium MicroC/OS-II operating system. My setup includes the Triple-Speed Ethernet Intel FPGA IP paired with the Modular Scatter-Gather DMA Intel FPGA IP, connected to a DP83620 PHY IC. Problem Description: In my implementation, the auto-negotiation completes successfully, and the link is established as indicated by the PHY status registers. I have configured an IPv4 address, subnet mask, and gateway using NetIPv4_CfgAddrAdd. Additionally, the socket() creation, bind(), and listen() calls in my socket server task all succeed without errors. However, the system does not respond to ping requests from a connected PC using the assigned IP address. Key Information: The Ethernet MAC and PHY configuration seem correct: Auto-negotiation and link establishment indicate that hardware connections are likely fine. The MAC and IP address settings are successfully applied. The Modular Scatter-Gather DMA is initialized and configured, but there might be a gap in how the RX/TX buffers and descriptors interact with the network stack. Debugging Steps Taken: Verified MAC, PHY, and DMA initialization logs. Confirmed that the socket(), bind(), and listen() functions in the SocketServerTask return no errors. Observed proper PHY register behavior, including link status and speed/duplex negotiation. If anyone has experience with a similar setup or can offer suggestions on how to debug further or resolve this issue, I would greatly appreciate your input!2.6KViews0likes14CommentsHow is Nios V's MHARTID csr register assigned a determined value?
Hello, When multiple instances of the Nios V processor are integrated into a multiprocessor SoC, access to the MHARTID csr register when they execute concurrently is needed to identify the hardware thread. The Parameters tab of the configuration screen for Nios V in the Platform Designer tool does not allow assigning any value to the MHARTID register. For Nios II, there is a parameter for manually assigning the CPUID control register value, but for Nios V I do not see a similar parameter. Then, my question is: how is Nios V's MHARTID csr register assigned a determined value? Regards, Domingo.Solved1.7KViews0likes7CommentsIssue with SRAM and SDRAM in NiosV
Hey everyone. I am a student currently working on a project with niosv processor and de10 lite fpga. For this project i have Ashling Riscfree IDE to write the code. I currently have two designs and both of them cause errors related to SRAM in one and SDRAM Controller in another. In platform designer i had a design with IPs like niosv, jtag, sram, led_pio, uart_fifo. But then recently i added sdram controller and removed sram. Problems: 1) Both of the designs compile successfully in quartus but i get errors in Ashling IDE. In SRAM Version, I was getting errors that my .bss, .text and .rwdata segments weren't in the region of sram and also there was a memory overflow by around 30 KB. All these errors occurred while i was using printf function. I checked the linker script and all of those were linked with sram. So i guess thats correct. The thing is: Whenever i was doing minimal use of printf function without line breaker (\n) inside the printf function, i was getting those errors. And, also using many printf function (around 7-10) with the line breaker, also resulted the same errors. My Sram has 128 KB and should be enough for my program. 2) Having that problem i switched my design from sram to sdram controller. Here i have PLL100 for the clock generator and has phase shift of - 3ns to 3ns. Niosv, jtag, sdram conrroller, uart_fifo and led_pio are used in this design. The problem with this version is that i dont get error that i had with sram cause my space went up from 128KB to 64 MB, i guess. But another error has come up and that being, my simple hello world wont get printed properly. Whatever i print with or without line breaker (\n) with the printf function, only alternate characters get printed. For example, if i print "Hi Niosv", i get "iNov". Line space between the words is also counted as a character. Solution for either of these versions is acceptable, so i would really appreciate it, if you guys could give some tips or help to solve it. Thanks in advance guys.1.6KViews0likes5Comments