Altera_Forum
Honored Contributor
16 years agoAvalon to Onchip RAM Bridge
I currently am running a Nios II system based on SOPC Builder with separate RAM & ROM banks comprised of onchip memory. I have a requirement to update the the software while the system is running. In order to use the procedures used by other processors in the system, I need to implement a dual ROM bank version of my Nios system. One ROM bank will contain the currently running software. The second bank will be writeable abd will be loaded with a new copy of the software by a background software process. When the second bank has finished loading, the Nios will jump to the reset location and start using the second bank. All software is built to run in bank one. So, while jumping to reset, the bank addresses need to be swapped.
My simplistic approach is to use SOPC Builder to create a custom Avalon-MM bridge between the Avalon fabric and the onchip memories. Then I can switch the upper address bit to swap the two bank. However, I cannot get a simple MM Slave to MM Master bridge to work. When I look at the waveforms in simulation, the 32 bit wide memory is being byte addressed four times with incrementing byte addresses for each instruction fetch. There may be other problems but I won't know that until I get this problem fixed. Is there a simple Slave-Master bridge example that works correctly that I can use as a starting point?