Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Valued Contributor III
746 Views

simultaneous access to ddrII memory by nios and vhdl entity

Hi all, 

I am using Arria II device.Basicly,what i need to do is to transfer large amounts of bulk data,which is stored in DDR2 memory using Ethernet to PC.The problem is that vhdl-based entity is performing the calculations and storing the data,so i think there is a problem with simultaneous access to the memory (Nios needs to read the data and vhdl needs to write (store) the data,so it might be possible collisions).If some kind of avalon bridge doesn't solve the problem,what would be the easiest (and efficient) way to implement this? 

Thank You
0 Kudos
9 Replies
Highlighted
Valued Contributor III
6 Views

Hi, 

 

The easiest way is probably to create an Avalon master for your VHDL entity, either enclosing it entirely or just providing an interface from the Avalon bus to your entity outside of SOPC builder. If you then connect both your master and the NIOS processor to the memory controller in SOPC builder the Avalon bus will take care of arbitration between the two. However, it's arbitration is very fair which might not be what you want - for example, you might want your VHDL entity to have priority access over the NIOS CPU. Have a look at the multi-port front end design on the Altera website for some arbitration ideas (part of the UDX4 reference design). 

 

Mark.
0 Kudos
Highlighted
Valued Contributor III
6 Views

If your VHDL module just provides a stream of data then you could use a DMA that pulls that data in and places it into the memory. That would just require you expose a simple streaming interface to your VHDL module which may be easier than building the master logic. Nios could then monitor the DMA to find out when it's done and safe to access the contents in the memory.

0 Kudos
Highlighted
Valued Contributor III
6 Views

I don't think it's possible,simply because the size of bulk data is several GBs,and i don't need to send all the data ,i just need to send specific data from the bulk over the ethernet channel.The SSRAM cannot store that amount of data ,because it is limited in size (2 MB)

0 Kudos
Highlighted
Valued Contributor III
6 Views

I have looked into UDX4 reference design.From what i see,the whole design is implemented inside the SOPC builder.Also,the vhdl entity needs to be instansciated inside the sopc builder.Let's say i did it.In nios II software , i know that i am able to access components with ease ,since the devices are memory mapped .How do i define the entity to be able to access the ddr II memory,for instance ( From definition point of view and also from vhdl code of view).Reference link/example would be welcome :) 

Thank you.
0 Kudos
Highlighted
Valued Contributor III
6 Views

Either you build the masters into your component or just use DMAs to move the streaming data to/from memory. What you are attempting is *very* commonly done with DMAs since it's easier to build a streaming front end then it is to create master logic. Building mastering logic is not overly difficult if you don't make it feature rich.

0 Kudos
Highlighted
Valued Contributor III
6 Views

I have a similar problem. You say that you build a Master into your component, but what do you use for this. If I don't want a DMA, do I use the Avalon-MM Master Translator to begin with? If not, what component? 

 

Thanks.
0 Kudos
Highlighted
Valued Contributor III
6 Views

I'm referring to you (as the designer) building mastering logic into your own IP. There is no generic master block out there because it doesn't make sense to have such a thing. If there was a generic master block then you would have to tell it what address you are accessing, provide/accept data from it, and control it..... But if you are going to go through that much trouble then you might as well have the master logic integrated into your own IP otherwise you are building a lot of redundant hardware for nothing. 

 

Study the Avalon-MM spec. Out of all the standard interface specifications out there it's one of the easiest to adhere to, so building a master interface isn't as hard as some seem to believe it to be.
0 Kudos
Highlighted
Valued Contributor III
6 Views

Right, I understand that I can map signals to the read_data, write_data, wait_request, etc, but I am concerned with how arbitration will work. I can't find any information in the Altera documentation concerning avalon arbitration. How do I handle this?

0 Kudos
Highlighted
Valued Contributor III
6 Views

Qsys generates a round-robin arbitration scheme. You can apply weights by increasing the arbitration share on a per master-slave pairing basis (Qsys uses slave side arbitration). This is just a system setting, your master doesn't need to do anything special for this. 

 

From the master perspective all you need to do is make sure you heed waitrequest. If you issue a read/write and waitrequest is asserted then your master just needs to stall until waitrequest deasserts which completes the access cycle. So it's not like a shared bus architecture where you need to worry about tri-stating your master when the arbiter kicks it out.
0 Kudos