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++
12603 Discussions

memory map for SDRAM or ON_CHIP_RAM

Altera_Forum
Honored Contributor II
1,212 Views

Can anyone tell me a way to know the memory map of SDRAM or ON_CHIP_RAM 

THANKS..
0 Kudos
4 Replies
Altera_Forum
Honored Contributor II
338 Views

Do you mean the memory map of your entire system so that you can find SDRAM or onchip, etc... When you compile a system library project in the Nios II IDE there will be a file called 'system.h' created which will have all the# define values you need to map your hardware. Use those# defines in your code so that if the memory mapping changes it will be updated automatically for you. 

 

Now if you are asking about an internal memory map for each memory, that's up to you to decide (subdivide it any way you want to).
0 Kudos
Altera_Forum
Honored Contributor II
338 Views

Thanks BadOmen, 

 

Yeah i do mean the internal mapping of each memory(data address span,instruction address span,free memory left etc..)and you did mention than i can subdivide the memory as i wish could you tell me how? 

 

Another question? 

 

why is the reset address is always targeted towards the external flash does this has anything to do with the configuration file (sof) being loaded into the flash? Also could you tell me why when i loaded a file into the flash at address (0x0 offset '0') an error always appeared that there was no enough memory when execution which make me ask if i made a pointer stucture to that file in the flash and then allocating a buffer to load that file in, where the buffer is allocated has anything to do with the address where this file is? because i think that it is allocated at the flash (or may be where the reset address points to which is the location of my file) which made it think that there is no enough memory? 

 

thanks
0 Kudos
Altera_Forum
Honored Contributor II
338 Views

You subdivide your memory if you wish to do so in your software by design (Or the RTOS if present may do this). There are no boundaries to worry about in any of the main memories. With that said if you use a Nios Development board or use a flash dependent software template (like web_server) you do have to worry about how the flash is divided up since it has the following regions: 

 

User Software 

Factory Software 

User Hardware 

Factory Software 

Slack space (stores the MAC address, webpages, etc...) 

 

These regions vary depending on the board so I would look at the web server software example and the documentation for your specific board. 

 

<div class='quotetop'>QUOTE </div> 

--- Quote Start ---  

why is the reset address is always targeted towards the external flash does this has anything to do with the configuration file (sof) being loaded into the flash?[/b] 

--- Quote End ---  

 

 

I take it you are referring to the hardware reference designs shipped with Nios II. The reason why it targets flash at reset is so that if you program your software into flash (using the flash programmer) you will have a bootloader present as well (this is automated for you) that will copy the contents for whatever memory you targetted in the compilation of your software. So you don&#39;t have to use the flash base address as your reset address is what I&#39;m getting at but it was set to Flash in the hardware reference designs with flash programming in mind. 

 

To answer the rest of your questions I think this document will help: 

http://www.altera.com/literature/ug/ug_nio..._programmer.pdf (http://www.altera.com/literature/ug/ug_nios2_flash_programmer.pdf)
0 Kudos
Altera_Forum
Honored Contributor II
338 Views

thanks for your help..

0 Kudos
Reply