[Fpga-synth] RAM infer question

Magnus Danielson magnus at rubidium.dyndns.org
Sun Dec 30 01:47:53 CET 2007


From: Eric Brombaugh <ebrombaugh at earthlink.net>
Subject: Re: [Fpga-synth] RAM infer question
Date: Sat, 29 Dec 2007 17:28:12 -0700
Message-ID: <4FEC0024-C5C8-4BBD-B7C8-5D7DB361FE0F at earthlink.net>

> 
> On Dec 29, 2007, at 1:01 PM, Scott Gravenhorst wrote:
> 
> > I'm trying to infer Xilinx distributed RAM by using the coding  
> > examples in
> > the language templates.  For distributed RAM, they show a block with a
> > single point where clocked writing to the selected location occurs  
> > and an
> > asynchronous read.
> >
> > When I do this with my code, I don't get flipflops, I get INFO  
> > remarks that
> > the RAM will be implemented on LUTs because of the asynchronous reads.
> >
> > I assume this remark is not a bad thing (not a warning, just an  
> > info) and I
> > can ignore it because I'm doing it on purpose? (these are small RAMs  
> > and I
> > don't want to target block RAM)
> 
> In Xilinx it's actually more desirable to infer LUTs for distributed  
> RAM because you can store 16 bits in a LUT, but only 1 bit in a FF. So  
> I'd say you're doing it right.

Agree. For sizes like that LUT-RAM is what you want. You should try to get that
implicitly or explicitly.

> > FPGA synth content: My project is a 32 NCO additive MIDI monosynth.
> 
> Sounds cool. Question: you're using separate NCOs for all the  
> harmonics? The only reason to do that is if you want anharmonics - if  
> you want exact 1x, 2x, 3x, ... etc then you can use just 1 NCO and  
> shift/add networks for the higher harmonic phases.

You could also use a spare multiplier block to multiply the top 18 bits of the
phase from the fundamental by 1, 2, 3, 4 etc. to get the phase of the higher
harmonics. Of the resulting 36 bits, the top 18 bits will be the harmonics
cycle count relative start of fundamental and the bottom 18 bits will be the
phase of that harmonic.

This way you avoid having to maintain multiple NCOs for the harmonics of the
same wave.

I have used similar techniques on multiple occasions. The benefit is that it is
inherently in phase with the fundamental.

Then again, if you are doing that kind of stuff you can also stay with the
harmonic and go thought a wave-table and use IFFT to generate the wavetable
from the harmonics strengths and phase parameters.

Cheers,
Magnus


More information about the Fpga-synth mailing list