Re: VHDL testbench: read BMP Files?

Discussion in 'VHDL' started by Allan Herriman, Aug 21, 2003.

  1. Jonathan Bromley wrote:
    > "itsme" <> wrote in message
    > news:bi1rho$4k5$00$-online.com...
    >
    >
    >>I want to direct read a Picture from a BMP File in a VHDL testbench and
    >>generate out of this some Stimulis for my video processing and store the
    >>video output again in a BMP File.
    >>Is there a library/Package?
    >>As I know there is a TEXTIO package but there must be ASCII data to read.
    >>How can a access raw File data?

    >
    >
    > In most simulators, and using VHDL-93, you can declare a FILE OF CHARACTER
    > which will allow you to read standard Unix or Windows byte-stream files.
    > READ(F, C); will read the next character into C; CHARACTER'POS(C) will
    > then return its byte value.
    >
    > Note that this is not guaranteed to be portable across simulators,
    > but it works OK in my experience.


    If using a simulator that supports Tcl/Tk, it might be possible to use
    the Tcl/Tk Img package that can read an image file (.bmp, .gif, .jpg,
    whatever) into a pixmap image type. This can then be fed pixel by pixel
    into the testbench.
    I think this may be easier than trying to decode (or generate) the
    various file formats in VHDL.

    http://aspn.activestate.com/ASPN/docs/ActiveTcl/ActiveTcl8.4.1.0-html/img/index.htm

    Regards,
    Allan.
     
    Allan Herriman, Aug 21, 2003
    #1
    1. Advertising

  2. Allan Herriman wrote:
    > Jonathan Bromley wrote:
    >
    >> "itsme" <> wrote in message
    >> news:bi1rho$4k5$00$-online.com...
    >>
    >>
    >>> I want to direct read a Picture from a BMP File in a VHDL testbench and
    >>> generate out of this some Stimulis for my video processing and store the
    >>> video output again in a BMP File.
    >>> Is there a library/Package?
    >>> As I know there is a TEXTIO package but there must be ASCII data to
    >>> read.
    >>> How can a access raw File data?

    >>
    >>
    >>
    >> In most simulators, and using VHDL-93, you can declare a FILE OF
    >> CHARACTER
    >> which will allow you to read standard Unix or Windows byte-stream files.
    >> READ(F, C); will read the next character into C; CHARACTER'POS(C) will
    >> then return its byte value.
    >>
    >> Note that this is not guaranteed to be portable across simulators,
    >> but it works OK in my experience.

    >
    >
    > If using a simulator that supports Tcl/Tk, it might be possible to use
    > the Tcl/Tk Img package that can read an image file (.bmp, .gif, .jpg,
    > whatever) into a pixmap image type. This can then be fed pixel by pixel
    > into the testbench.
    > I think this may be easier than trying to decode (or generate) the
    > various file formats in VHDL.
    >
    > http://aspn.activestate.com/ASPN/docs/ActiveTcl/ActiveTcl8.4.1.0-html/img/index.htm


    Better still, you can use Tk to display the "Before" and "After" images
    directly from your simulator.

    Allan.
     
    Allan Herriman, Aug 21, 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. Martin Thompson

    Re: VHDL testbench: read BMP Files?

    Martin Thompson, Aug 21, 2003, in forum: VHDL
    Replies:
    0
    Views:
    1,051
    Martin Thompson
    Aug 21, 2003
  2. Amontec Team, Laurent Gauch

    Re: VHDL testbench: read BMP Files?

    Amontec Team, Laurent Gauch, Aug 21, 2003, in forum: VHDL
    Replies:
    0
    Views:
    810
    Amontec Team, Laurent Gauch
    Aug 21, 2003
  3. Mike Treseler

    Re: VHDL testbench: read BMP Files?

    Mike Treseler, Aug 21, 2003, in forum: VHDL
    Replies:
    0
    Views:
    805
    Mike Treseler
    Aug 21, 2003
  4. Harry Simpson

    32 dpp BMP to 24dpp BMP??

    Harry Simpson, Oct 30, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    384
    Harry Simpson
    Oct 30, 2003
  5. doromdor
    Replies:
    0
    Views:
    754
    doromdor
    Dec 7, 2009
Loading...

Share This Page