DSP simulations

Discussion in 'VHDL' started by Willem Oosthuizen, Jun 25, 2003.

  1. Hi,

    It have coded a block that pops out a value Q of type std_logic_vector(n
    downto 0). This value is a function of N, also of type std_logic_vector(m
    downto 0) The type of function the block calculates is something like Q =
    INT(k x SIN(w x N)+y)

    In my test vectors I would like be able to write something like

    assert (conv_real(Q) - ( k x SIN(w x conv_real(N))+y ) < 3.0)
    report "Failure. Bad result"
    severity failure;

    My Question: Is there functions like conv_real, and SIN ? How do i do it?

    Thanks
    Willem
     
    Willem Oosthuizen, Jun 25, 2003
    #1
    1. Advertising

  2. Willem Oosthuizen

    FE Guest

    for simulation purpose only and if it supported by your simulator, you can
    use the IEEE Std 1076.2-1996 library,

    library ieee;
    use ieee.math_real.all;

    function sin is in library ieee.math_real
    function conv_real (std_logic_vector to real) doesn't exist so you must
    write something like real(to_integer(signed(Q))) or
    real(to_integer(unsigned(Q)))

    to see a draft source of ieee.math_real, do a google search on mathpack.vhd

    regards
    FE


    "Willem Oosthuizen" <> wrote in message
    news:bdc5m8$90k$...
    > Hi,
    >
    > It have coded a block that pops out a value Q of type std_logic_vector(n
    > downto 0). This value is a function of N, also of type std_logic_vector(m
    > downto 0) The type of function the block calculates is something like Q =
    > INT(k x SIN(w x N)+y)
    >
    > In my test vectors I would like be able to write something like
    >
    > assert (conv_real(Q) - ( k x SIN(w x conv_real(N))+y ) < 3.0)
    > report "Failure. Bad result"
    > severity failure;
    >
    > My Question: Is there functions like conv_real, and SIN ? How do i do it?
    >
    > Thanks
    > Willem
    >
    >
    >
    >
     
    FE, Jun 25, 2003
    #2
    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. Pedro Claro

    Long simulations

    Pedro Claro, Aug 13, 2003, in forum: VHDL
    Replies:
    0
    Views:
    931
    Pedro Claro
    Aug 13, 2003
  2. Jay Davis

    "Real" Simulations?

    Jay Davis, Nov 21, 2003, in forum: VHDL
    Replies:
    8
    Views:
    717
    Tim Hubberstey
    Nov 25, 2003
  3. rajan

    Back Annotation simulations

    rajan, Aug 7, 2004, in forum: VHDL
    Replies:
    4
    Views:
    4,478
    Ansgar Bambynek
    Aug 10, 2004
  4. P. Flavin
    Replies:
    1
    Views:
    6,041
    P. Flavin
    Sep 12, 2003
  5. Replies:
    5
    Views:
    592
    Nick Craig-Wood
    Jan 24, 2008
Loading...

Share This Page