"casting" bits to bits?

Discussion in 'VHDL' started by sergey, Nov 8, 2006.

  1. sergey

    sergey Guest

    Hi all again,

    Probably a stupid question, but...

    I have a signal in my testbench that's "sfixed(X downto -Y)" (sfixed
    being signed fixed from David Bishop's fixed-point library).

    When I synthesized the actual component, the synthesized model VHDL
    converted all of the sfixed to std_logic_vectors.

    How do I now map my sfixed in the testbench to std_logic_vector in the
    model? (its all just bits of the same length...)

    Thanks,

    Sergey
     
    sergey, Nov 8, 2006
    #1
    1. Advertisements

  2. sergey

    sergey Guest

    Yup, stupid question :) sorry guys.

    Should've looked at the fixed point manual:

    Most synthesis tools do not support any I/O format other than
    "std_logic_vector" and "std_logic". Thus, functions have been
    created to convert between std_logic_vector and ufixed or sfixed and
    vice versa:
    uf7_3 <= to_ufixed (slv7, uf7_3'high, uf7_3'low);
    and
    slv7 <= to_slv (uf7_3);

    -- Sergey


    sergey wrote:
    > Hi all again,
    >
    > Probably a stupid question, but...
    >
    > I have a signal in my testbench that's "sfixed(X downto -Y)" (sfixed
    > being signed fixed from David Bishop's fixed-point library).
    >
    > When I synthesized the actual component, the synthesized model VHDL
    > converted all of the sfixed to std_logic_vectors.
    >
    > How do I now map my sfixed in the testbench to std_logic_vector in the
    > model? (its all just bits of the same length...)
    >
    > Thanks,
    >
    > Sergey
     
    sergey, Nov 8, 2006
    #2
    1. Advertisements

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. kevin
    Replies:
    11
    Views:
    6,042
    Andrew McDonagh
    Jan 8, 2005
  2. GGG
    Replies:
    10
    Views:
    13,316
    Donar
    Jul 6, 2006
  3. sarmin kho
    Replies:
    2
    Views:
    1,029
    A. Lloyd Flanagan
    Jun 15, 2004
  4. Miki Tebeka
    Replies:
    1
    Views:
    599
    Marcin 'Qrczak' Kowalczyk
    Jun 14, 2004
  5. Tomás

    Value Bits Vs Object Bits

    Tomás, Jun 2, 2006, in forum: C Programming
    Replies:
    13
    Views:
    759
    Hallvard B Furuseth
    Jul 1, 2006
  6. steve yee
    Replies:
    15
    Views:
    572
    Eric Sosman
    Aug 6, 2006
  7. Wally Barnes
    Replies:
    3
    Views:
    733
    Wally Barnes
    Nov 20, 2008
  8. Sosuke

    Up casting and down casting

    Sosuke, Dec 20, 2009, in forum: C++
    Replies:
    2
    Views:
    738
    James Kanze
    Dec 20, 2009
Loading...