Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12609 Discussions

Is it possible to run NIOSV through SDRAM ?

himanshuvaria
Beginner
2,422 Views

Hello, 

 

I am developing a project where NIOS II needs to replaced with NIOSV processor. When my design was having NIOS II as CPU, I was running the software code through External SDRAM on the Cyclone IV E Kit(EP4CE40F23C8). It's working fine with NIOS II. Able to run the software program.

 

Now, when I replaced the NIOS II processor with the NIOSV processor, I am not getting the expected results. I am trying to print a Simple "Hello World" code through the NIOSV processor with the same configuration of design. Almost all BSP settings are same for NIOSV processor as of the NIOS II. Still not getting the results.

 

When running the NIOSV from On-Chip-Ram, everything works as expected, but when I try to run the NIOSV through external SDRAM, the code does not gets executed as expected.

 

I want to inquire that if we can run the NIOSV processor through external SDRAM or not ?

 

Please note that I am not talking here about booting the NIOSV. I am simply running the software image through RiscFree IDE software on the external SDRAM of the board.

 

Regards,

Himanshu

0 Kudos
20 Replies
KellyJialin_Goh
Employee
2,403 Views

Hi Himanshu,

Greetings and welcome to Intel's Forum.


May I know does RiscFree IDE report any Run Configuration failure? By saying execute the code, you mean using RiscFree IDE to download ELF into SDRAM right?


I will get back to you with more information on whether RiscFree IDE supports running software code on external SDRAM.


Thank you.


Regards,

Kelly Jialin, GOH



0 Kudos
himanshuvaria
Beginner
2,376 Views

Hello,

 

Q :May I know does RiscFree IDE report any Run Configuration failure? By saying execute the code, you mean using RiscFree IDE to download ELF into SDRAM right?

A: Yes execute the code means using RiscFree IDE to download ELF into SDRAM, you got it right. And also the RiscFree IDE does not report any Run Configuration failure. There is no problem in downloading the ELF, it works fine up to this point. But my code does get executed as I expect a "Hello World" print as soon as the ELF is loaded, but no success.

 

Also I tried today to run the ELF in Debug mode, to verify where the NIOSV is getting stuck. On running through Debug Mode, it prompted me to Error : Operation failed : "Command Aborted". Below are the snapshots of error and warnings of Debugger console.

himanshuvaria_0-1692957043511.pnghimanshuvaria_2-1692957083250.pnghimanshuvaria_1-1692957058144.png

 

It seems that ELF is loaded successfully into SDRAM, but when trying to read the code from a particular address, it is getting stucked due to unknown reasons.

 

Any help regarding this could be appreciated. Thanks !!

 

Also the Debugger Console shows the warning : "Cannot access memory at address 0x2cc" - To which I want to make sure that is NIOSV processor capable to run through the external SDRAM ? If yes, It would be great if I can get a reference design to run NIOSV Code through external SDRAM.

 

Thanks in advance !!

 

Best Regards,

Himanshu

 

0 Kudos
himanshuvaria
Beginner
2,387 Views
0 Kudos
KellyJialin_Goh
Employee
2,329 Views

Hi Himanshu,

Unfortunately, we do not have a design example for External SDRAM running on NIOS V for your reference.


Also, may you check whether the Debug Module reset for NIOS V is connected to the external SDRAM? I will attach a picture of an example for this qsys connection.


Thank you and looking forward to your feedback.


Thank you.


Regards,

Kelly


0 Kudos
himanshuvaria
Beginner
2,315 Views

Hello,

 

I have verified that the Debug Module reset for NIOSV is connected to the external SDRAM. Please have a look at the below image for my QSYS configuration.

himanshuvaria_0-1693202167060.png

NIOSV configurations:-

himanshuvaria_1-1693202200782.png

 

With the above configuration, The NIOSV Code is able to get downloaded into SDRAM without RUN configuration failure in normal mode. But, still it gives me the same pop up error while running the ELF in Debug Mode. Error : Operation failed : "Command Aborted". 

 

Debugger Console warning : "Cannot access memory at address 0x984"

himanshuvaria_2-1693202354641.png

 

Can you please elaborate in detail for the root cause of such issue ? I am again asking just to confirm that can we run NIOSV through external SDRAM ? If yes, then we can debug further with the hardware design perspective. 

 

Thankyou for the co-operation. Looking forward for your response!!

 

Regards,

Himanshu.

 

0 Kudos
KellyJialin_Goh
Employee
2,307 Views

Hi,

Thank you for the information provided. Running NIOS V through external SDRAM should be possible.


Could you try to make the connection between "dbg_reset_out" to "ndm_reset_in" ? I will attach a screenshot on this qsys connection.


Also, could you try to use niosv-download command to try downloading elf to run the application and lowering the JTAG frequency to 6Mhz to check whether is it a RiscFree issue.


Thank you,


Regards,

Kelly


0 Kudos
KellyJialin_Goh
Employee
2,304 Views

Hi,

Attached below is a screenshot of the qsys connection between  "dbg_reset_out" to "ndm_reset_in"  for your reference. You may connect it as of below to the NIOS V ndm_reset_in , external sdram and jtag's reset.

 

Thank you and looking forward to your feedback after trying the debugging steps.

KellyJialin_Goh_0-1693206143733.png

 

Regards,

Kelly

 

0 Kudos
himanshuvaria
Beginner
2,266 Views

Hello,

 

I have tried to make connection between  "dbg_reset_out" to "ndm_reset_in" and also connected it to external sdram and jtag's reset.

With this configuration I again recompiled the design as well as build the software project. But still facing the same issue as I mentioned before. So this did not work out for me. I have attached the snap shot of QSYS system below for your reference.

himanshuvaria_0-1693287755754.png

 

Also I tried to download the ELF through "niosv-download command" but is doesn't make any differences as well. Lowering the JTAG Frequency to 6MHz also does not work out. So I am stuck at this point to debug further.

 

I tried to normally do write/read operations in the SDRAM. On-Chip-Ram was used as program memory for this. While doing so, it has been noted that I am able to do 16 bits of write/read transfers successfully. But not able to perform 32-bits of data transfers.  May be this can be a issue while reading the ELF stored in the external SDRAM. I will look into this further from my end. But please share your suggestions as well.

 

Can you please share the  PLL configurations for External SDRAM Part No : W9816G6IH ( WinBond ) which has been used on the Cyclone IV E FPGA. What is the minimum clock frequency that needs to be given to SDRAM and also at what phase shift ? 

 

Besides that you can also suggest any fitter assignments which are required for external SDRAM in the QSF file.

 

Looking forward to hear from you !!!

 

Regards,

Himanshu

 

0 Kudos
himanshuvaria
Beginner
2,264 Views

Hi,

Below is the snap shot of my SDRAM Controller IP configurations. Please have a look and verify if the configurations are correct for Cyclone IV E (EP4CE40F23C8).

 

himanshuvaria_0-1693289704968.png

 

Regards,

Himanshu

 

0 Kudos
KellyJialin_Goh
Employee
2,260 Views

Hi Himanshu,

Could you send me a screenshot of the OpenOCD error logs for me to investigate further.


Thank you.


Kelly


0 Kudos
himanshuvaria
Beginner
2,138 Views

Hello,

 

I would like to tell inform you that I am not using the OpenOCD Debugging option from the RiscFree IDE. Instead I am using "Ashling RISCV (auto-detect) hardware debugging option.

0 Kudos
himanshuvaria
Beginner
2,126 Views

Also I would like to mention some related information regarding the issues. The SDRAM consists 16 bit data bus while the data bus of NIOSV bus is 32 bits. Although the tool should be able to manage both the interfaces on its own, but to verify I created another simple design where I used On-Chip-Ram as program memory with 16 bits data width. Now my NIOSV code should work with 16 bit On-Chip-Ram but somehow I faced the same issue which I was facing while using external SDRAM as program memory. The NIOSV ELF gets loaded successfully without Run Failure but does not get executed. While running through Debug("Ashling RISCV (auto-detect) hardware debugging option), I faced the similar issues as I was facing for external SDRAM. The Debugger console shows the warning, "Cannot Access memory at address 0x2b4".

 

himanshuvaria_0-1693465421789.png

 

I am attaching the design here for your reference. Please have a look and give your feedback !!

 

Can NIOSV run with 16 bit On-Chip-Ram. If yes, then why it is resulting in such kind of errors. Only if I change the data width of On-Chip-Ram to 32 bits, everything works fine. But with 16 bit, it is having issues while accessing the code. I think similar issues were there with SDRAM as the data bus of SDRAM is 16 bits.

 

Please find a solution regarding this. Thanks !!

 

Regards,

Himanshu

 

 

0 Kudos
EBERLAZARE_I_Intel
2,070 Views

Hi,


Thanks for the design, we will check the design and get back to you.


0 Kudos
himanshuvaria
Beginner
2,058 Views

Sure. Would be waiting for your response

 

0 Kudos
himanshuvaria
Beginner
2,035 Views

Hello,

 

Did you follow up on the issue ? Please share your response !!

0 Kudos
EBERLAZARE_I_Intel
2,023 Views

Hi again,


For this issue, we currently working on a fix, we will update you from time to time, this will take some time. 


We will follow-up with the thread below you filed recently and proceed to close this thread.


https://community.intel.com/t5/forums/forumtopicpage/board-id/nios-II-embedded-design-suite/message-id/52189#M52189


0 Kudos
Moffo
Beginner
1,998 Views

Hi Himanshu,

     Greetings.

 

   I am first wondering how you succeeded to have the sdram controller in the platform designer. Please what version of Quartus are you using? I am using here Quartus Prime 22.1.2 standard edition (the latest version) there’s no more the “sdram controller” in the platform designer.

  So I wanted also to make one of my designs that is using nios II running in nios-v through external sdram but I got stuck on adding the sdram controller in qsys because it is missing.

 

Please any assistance.

Thanks

0 Kudos
himanshuvaria
Beginner
1,980 Views

Hi,

 

I know that SDRAM Controller IP is no more supported in the latest Quartus Versions. But I would like to inform you that I have the .TCL file that will generate source of SDRAM Controller IP and it's path is added in the user_components.ipx file. The .TCL will show the SDRAM Controller IP in the QSYS system. It is an older version of SDRAM Controller IP which I am using. 

 

The SDRAM Controller IP, which I am using is from older Quartus 18.x version. To use in the latest Quartus Versions, we need to add the .TCL file in the IP_IPX_PATH variable which have file user_components.ipx.

 

You can ask INTEL to provide the TCL of the SDRAM Controller IP,

 

Regards,

Himanshu

0 Kudos
Moffo
Beginner
1,971 Views

 

Hi Himanshu,

 

Thanks for the reply.

I will follow your instructions and bring you feedback about the use of the sdram with nios-v.

 

0 Kudos
JingyangTeh
Employee
1,855 Views

Hi


Since there is a duplicate case for this issue, we will follow up this issue in the case link below:

https://community.intel.com/t5/forums/forumtopicpage/board-id/nios-II-embedded-design-suite/message-id/52189#M52189


I shall set this thread to close pending. Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.


If you happened to close this thread you might receive a survey. If you think you would rank your support experience less than 10 out of 10, please allow me to correct it before closing or if the problem can’t be corrected, please let me know the cause so that I may improve your future service experience.



Regards

Jingyang


0 Kudos
Reply