Intel® Quartus® Prime Software
Intel® Quartus® Prime Design Software, Design Entry, Synthesis, Simulation, Verification, Timing Analysis, System Design (Platform Designer, formerly Qsys)
16606 Discussions

Base address of SOPC components - exportable?

Altera_Forum
Honored Contributor II
998 Views

When a CPU master needs to access a slave device, the software# include's "system.h" which contains all the system addresses. 

 

Is there an equivalent for custom avalon masters written in VHDL? I would like my master device to be able to automatically locate the memory it should get it's data from, without requiring hardcoded constants which need to be changed each time I fiddle with the system memory map. 

 

(My question is the same as this old one here: alterauserforums. org/forum/showthread.php?p=20564 )
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
254 Views

You may be able to do that with a TCL script, but usually the way this is done is by having the CPU configure the component at run time. 

You can have both an Avalon master and an Avalon slave on your component, and have a few registers accessible from the slave that define the addresses to use on the master.
0 Kudos
Altera_Forum
Honored Contributor II
254 Views

>but usually the way this is done is by having the CPU configure the component at run time. 

 

Ah yes - that seems like a better solution. I'm a little short of logic elements on this design, so how many extra logic elements do you think it would add? (I already have a slave config interface...) 

 

I was assuming a constant address would use next to no logic elements, but a variable address would involve a storage register for the base address, and an extra 32-bit adder to add together base+offset for each memory access - with all the connecting logic that would be about 100 LE's, which seems like quite a lot...
0 Kudos
Altera_Forum
Honored Contributor II
254 Views

Yes it should take at least a 32-bit register and an adder. I didn't know you were that low on resources. 

The alternative would be a tcl script that reads the .ptf or .sopc file to extract the required base address and write it back in an HDL file. But I don't know if it has been done already, so you may not be able to find any example on how to do that.
0 Kudos
Reply