Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

DMA to on-chip RAM

Altera_Forum
Honored Contributor II
1,151 Views

I've got a custom platform DMAing from CF into SDRAM. All OK. 

 

To compare performance against on-chip SRAM, I've added an on-chip memory block in SOPC builder (24KB total, 32 bits wide), and am now attempting to DMA into it rather than the SDRAM. 

 

I can read/write to the on-chip RAM using IORD/WR_32DIRECT so I know the RAM block is OK. 

However, DMA doesn't write anything to the RAM. 

I tried supplying the base address as defined in SYSTEM.H to the DMA controller. 

Then I tried supplying the return value from alt_remap_uncached(). 

Neither work. 

 

Any idea what I could be doing wrong? 

Regards, 

Mark
0 Kudos
8 Replies
Altera_Forum
Honored Contributor II
364 Views

OK, I'm going to chalk this one up to a bug in SOPC builder... 

 

After adding the internal SRAM, I started to generate the design. Then, realising I hadn't hooked up the DMA controller read/write masters and the CPU instruction master was also hooked up to the on-chip ram, I stopped the generate. 

 

I made the changes and hit 'generate' again. Re-built in Quartus and I couldn't get this design to DMA to the on-chip RAM. I know I re-generated the design b/c it wouldn't have built a design I stopped half-way thru the generate - right?!? 

 

Anyway, when that didn't work, I was looking thu the generated VHDL for some signals I wanted to snoop in Signal-Tap and noticed that the CPU instruction master was still hooked to the on-chip RAM! Huh!?! Went into SOPC builder again, and re-generated the design. This time - it looked like it should! 

 

And now it works. 

 

I can't see that it was merely a case of 'forgetting' to do something? The design definitely built the 1st time 'round, b/c it was the first and only design to have on-chip RAM, which was definitely working. 

 

I can only put it down to SOPC builder not re-building *everything* after I hit 'stop' and then made changes to the bus interconnect and re-generated! 

 

That&#39;s my story - and I&#39;m sticking to it! http://forum.niosforum.com/work2/style_emoticons/<#EMO_DIR#>/wink.gif  

 

Regards, 

Mark
0 Kudos
Altera_Forum
Honored Contributor II
364 Views

 

--- Quote Start ---  

originally posted by tcdev+oct 7 2005, 03:18 am--><div class='quotetop'>quote (tcdev @ oct 7 2005, 03:18 am)</div> 

--- quote start ---  

i know i re-generated the design b/c it wouldn&#39;t have built a design i stopped half-way thru the generate - right?!?[/b] 

--- quote end ---  

 

not necessarily... it could have used some files that were newly generated and some from the last build. if there are no outright incompatibilities, it might build. 

 

<!--quotebegin-tcdev@Oct 7 2005, 03:18 AM 

i can only put it down to sopc builder not re-building *everything* after i hit &#39;stop&#39; and then made changes to the bus interconnect and re-generated! 

--- Quote End ---  

 

Sounds about right. The Stop button just stops the process; it doesn&#39;t do much in the way of cleaning up partial builds. It&#39;s a lot like &#39;make&#39; in that regard.
0 Kudos
Altera_Forum
Honored Contributor II
364 Views

Not necessarily... it could have used some files that were newly generated and some from the last build. If there are no outright incompatibilities, it might build. 

 

 

Well is there a 100% method to force SOPC builder to rebuild everything? 

I have been (am) having similar results. 

 

George
0 Kudos
Altera_Forum
Honored Contributor II
364 Views

another DMA question here 

 

in order to call the dma routines, you need to include the "nios.h" include file according to the altera DMA documentation 

 

but when both i and my colleague do that, we get an "file not found" error on nios.h, on both our PC&#39;s 

 

anyone have an idea were to find nios.h and were it should be put for the nios IDE to find it?
0 Kudos
Altera_Forum
Honored Contributor II
364 Views

 

--- Quote Start ---  

originally posted by gmm50@Oct 25 2005, 08:33 AM 

well is there a 100% method to force sopc builder to rebuild everything? 

--- Quote End ---  

 

In SOPC Builder, start it generating and let it finish. Don&#39;t build a Quartus project with half-generated SOPC files. 

 

That said, it would be nice if, when starting a build, SOPC Builder deleted any preexisting <system_name>.v/vhdl file, since (supposedly) this is the last file generated, and hopefully that would prevent the Quartus project from building. For the time being, though, it doesn&#39;t.
0 Kudos
Altera_Forum
Honored Contributor II
364 Views

 

--- Quote Start ---  

originally posted by thomsonbro@Oct 26 2005, 09:19 AM 

in order to call the dma routines, you need to include the "nios.h" include file according to the altera dma documentation 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=10598) 

--- quote end ---  

 

--- Quote End ---  

 

Since I&#39;ve never heard of a "nios.h" file, I have to wonder what documentation you&#39;re looking at. Title, page number, where on the page...? 

 

I would think that all you&#39;d need is "altera_avalon_dma.h".
0 Kudos
Altera_Forum
Honored Contributor II
364 Views

im talking about the official altera datasheet for the nios 2 dma controller, on the page where the dma controll methods are introduced it say these methods are declared in nios.h... 

 

but for now it doesnt really matter, we have just been re-asigned to another part of the project (again *sigh*) so DMA isnt a priority anymore for us...
0 Kudos
Altera_Forum
Honored Contributor II
364 Views

As another engineer told me once: 

 

"Like a ping-pong ball in a dryer, bouncing from one artificially-created emergency to the next."
0 Kudos
Reply