initialize ROM using a generic value

Discussion in 'VHDL' started by frznchckn, Jul 20, 2010.

  1. frznchckn

    frznchckn

    Joined:
    Jul 20, 2010
    Messages:
    1
    I need to model a ROM of twiddle factors for an FFT implementation. The FFT is supposed to be parameterized for input data sample size (ie number of samples to have the FFT performed on). This means that the twiddle ROM will be of a varying size.

    The perl code below generates the real and imaginary twiddle factors. Basically, how can I initialize ROM locations using the type of expressions below? Is this even possible or do I need to specify the ROM using an external file (I have seen this process in a few locations including Xilinx's XST manual).

    Thanks!

    $PI = 3.14159_26535_89793_23846_26433_83279_50288_41971_69399_37510;
    $PI2 = $PI * 2.;
    $K1 = $PI2 / $FFT_SIZE;

    for ($i = 0; $i <= ($FFT_SIZE-1); $i++) {

    $twiddle_rl[$i] = cos($K1 * $i);
    $twiddle_im[$i] = sin($K1 * $i);
    }
     
    frznchckn, Jul 20, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Murat Tasan
    Replies:
    1
    Views:
    8,131
    Chaitanya
    Feb 3, 2009
  2. Inno_pf
    Replies:
    0
    Views:
    4,221
    Inno_pf
    May 25, 2006
  3. Zorjak

    generic ROM memory help

    Zorjak, Oct 19, 2006, in forum: VHDL
    Replies:
    3
    Views:
    726
    zoran
    Oct 19, 2006
  4. hangeonos
    Replies:
    0
    Views:
    801
    hangeonos
    May 24, 2009
  5. jam2310
    Replies:
    1
    Views:
    476
    jeppe
    May 2, 2010
Loading...

Share This Page