Forum Discussion
Altera_Forum
Honored Contributor
14 years agoDE2-115 and SRAM using SOPC (Qsys)
Hello Everyone,
I need help pleeeeeeeeeeeeeese. I am trying to initlize the SRAM on the DE2 board using a C program, and I thought I will do this using SOPC. I've been told that the name of the SRAM interface on Qsys or SOPC is "Avalon-MM Tristate Bridge" but I have an error when I add it to my simple SOPC system; it says: "Error: tri_state_bridge_0.tristate_master must be connected to An Avalon-MM Tri state slave" The question is: 1) Where do I connect this "tri_state_bridge.tristate_master"? or 2) Does anyone know how to access the SRAM using SOPC or Qsys? Please help11 Replies
- Altera_Forum
Honored Contributor
You need both the component you mentioned: tristate bridge and tristate slave.
Tristate Bridge slave port has to be connected to an Avalon bus master (usually this is the same which is connected to Nios data and/or instruction port). The other bridge port connects to the tristate slave device. In your case you should have a specific component for your sram. Browse the Qsys/sopc components for the one matching your sram. If you don't have it you can use the component wizard to design one. Actually, this is usually a simple *.tcl file defining your sram timing and pin connections. - Altera_Forum
Honored Contributor
Thank you Cris72, but let me understand you correctly...
You mean that I have to have one Tri_state_bridge component with two ports: tri_state_bridge.tristate_master and tri_state_bridge.tristate.slave. The master should be connected to Avalon cpu busses data & instruction, and the slave should be connected to the SRAM model. That makes perfect sense, but...... What I did is I added tri_state_bridge in SOPC and automatically it connected the tri_state_bridge.tristate_slave to the Avalon bus master (Nios II cpu.data.master and cpu.instruction.master ). However, the other tri_state_bridge.master is left without connection, and this gave me an error. Also, how can I build my own SRAM model? - Altera_Forum
Honored Contributor
--- Quote Start --- What I did is I added tri_state_bridge in SOPC and automatically it connected the tri_state_bridge.tristate_slave to the Avalon bus master (Nios II cpu.data.master and cpu.instruction.master ). --- Quote End --- That's fine --- Quote Start --- However, the other tri_state_bridge.master is left without connection, and this gave me an error. Also, how can I build my own SRAM model? --- Quote End --- You must connect this to a sram component model. Browse sopc standard components; you should have at least a sram model (probably a Cypress CY7C1380). Add it to sopc system, connect to tristate bridge and generate. The generated system will expose sram interface port and you'll have to route them to proper fpga pins. In case the provided sram mode doesn't meet your needs, use the template I attached. Rename the way you want, but remember to keep the *_hw.tcl suffix, which is mandatory, otherwise sopc builder won't find it. Change the parameters inside the file in order to match your sram device, then copy to altera\<version>\ip\user_components. The next time you start sopc builder you'll find the sram component in the list and you only need to add it to your system. - Altera_Forum
Honored Contributor
Thank you very much for your help. Yes I added an SRAM model that I found in SOPC (IDT71V416 SRAM) and error is gone. SOPC atuomatically conencted the Avalon-MM tristate Master to the SRAM slave :)
BUT the SRAM model is not what we have on the DE2 board, I need my own model. I just didn't see the attachement?!!!!!!!!!!!!!!!!! Thank you - Altera_Forum
Honored Contributor
--- Quote Start --- In case the provided sram mode doesn't meet your needs, use the template I attached. Rename the way you want, but remember to keep the *_hw.tcl suffix, which is mandatory, otherwise sopc builder won't find it. Change the parameters inside the file in order to match your sram device, then copy to altera\<version>\ip\user_components. --- Quote End --- Cris72, Where can I find the SRAM template that you mention? I'm trying to add a Cypress CY62146EV30 to my system and would like to create a component to match it. Alternatively, is there a repository for user created components where I can look for one for my memory? Thanks - Altera_Forum
Honored Contributor
- Altera_Forum
Honored Contributor
Thank you very much Cris72. Your model worked, but I will modify it to fit my DE2 SRAM.
Many Thanks :) - Altera_Forum
Honored Contributor
Cris72, Thank you.
-phil - Altera_Forum
Honored Contributor
Hi everyone,
The SOPC system that I build with the help of modified Cris72's SRAM model works perfectly :) I was able to run Hello_world_small program. I modified the model to suit my SRAM in the DE2-115 board :) Does anyone know if there are a build-in functions in the NiosII Eclipse library to access the SRAM? I am trying to load an image on the DE2-board SRAM. Pleeeeeeeeeeeeeese Help, Thank you - Altera_Forum
Honored Contributor
Hi, man . can you a little easy make