- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi All,
I am a newbie to Altera FPGA. I am using Altera FPGA for a class project. I am using a custom processor ( not NIOS) and I am as of now using Onchip memory for instruction and data. I now need to use SRAM instead of onchip memory. I am using DE4 development board with Stratix 4 FPGA. As of now I am instantiating "altsyncram" for both instruction and data and initialising them using .mif file. I have no idea how to migrate this to SRAM. I have generated SRAM controller using Megawizard and I am struck as how to initalise SRAM.?? If you could give any links of project code where SRAM controller is used it would be helpful. Thanks,Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If the SRAM is an external component then you can't initialize it with a .mif file and you will need a system to fill it up. A very common way is to use a small on-chip memory that the CPU can boot on. This memory holds a bootloader, that will read the application code from an external source (a flash memory for example) and copy it into the SRAM. Then it sets the CPU to jump to the application.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you ... If I could get some example design as how to interface SRAM to a custom project it would be helpful.
I am not able to understant how to access avalon bus and from there to SRAM controller.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you aren't using SOPC builder or QSys to connect your CPU to memories or components, it may be easier to avoid using the controller generated by the megawizard and make it yourself. Accessing an SRAM is pretty easy, just set the address and read signal, or address, data and write signal, and wait for the correct timing.
Alternatively if you want to use Avalon bus (which should make your system easier to expand and adapt) then you should learn about the avalon specifications, by reading this document: http://www.altera.com/literature/manual/mnl_avalon_spec.pdf.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks again !! Its the exact solution what I was lookking. I feel its better for me to implement a SRAM controller on my own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Daixiwen, could you provide some more details on how to initialize SRAM/SDRAM? Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't understand your question. If it it the main memory (used for the .text, .data. and .bss sections) it will automatically get initialized when you upload the elf file. If it is separate memory section you can use memset to initialize its contents to a fixed value (most usually 0).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I mean if you want to load a particular file into SRAM/SDRAM and later process it by reading from the memory, how would you initialize the SRAM/SDRAM to that file content?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If you have an on-board CPU such as a Nios ", then you can write your own communication protocol to transfer the data from Ethernet or a serial link to the RAM.
If you have a JTAG connection then you could also use system console to do the transfer.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The latter one sounds good to me. Any link (or examples) on the details of that? Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You will find information about system console here (https://www.altera.com/content/dam/altera-www/global/en_us/pdfs/literature/ug/ug_system_console.pdf). You will have to write a script in TCL to write to the memory. I've never done it but it should be possible to open and read a binary file in TCL.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page