reading binary files in vhdl. Use of read in a function.

Discussion in 'VHDL' started by gfandango, Feb 3, 2009.

  1. gfandango

    gfandango

    Joined:
    Feb 3, 2009
    Messages:
    3
    Hello,

    I wrote the following code (reading.txt in attachment) to read the header of a ppm file. Modelsim throws me an error during the compilation:
    reading.vhd(54): (vcom-1282) Cannot reference file "ppm_file" inside pure function "readheader".

    I don't know how to solve it and I don't want to put the code of the function ReadHeader in the process. It seems to be linked to the passing of the file parameter and MODELSIM (see below). A problem of type ?

    Thanks in advance for your help.

    I have made some additional tests to see where the problem comes from. I was surprised to see that my file could be compiled with GHDL and works fine with it. So my problem is clearly related to MODELSIM (6.5 PE).
     

    Attached Files:

    Last edited: Feb 4, 2009
    gfandango, Feb 3, 2009
    #1
    1. Advertising

  2. gfandango

    gfandango

    Joined:
    Feb 3, 2009
    Messages:
    3
    I found the solution: declaring my function as impure.
     
    gfandango, Feb 10, 2009
    #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. Doug
    Replies:
    3
    Views:
    4,417
    Bruce Barker
    Nov 4, 2005
  2. Fernando Barsoba

    fread() function and reading binary files

    Fernando Barsoba, Oct 17, 2005, in forum: C Programming
    Replies:
    2
    Views:
    419
    Martin Ambuhl
    Oct 17, 2005
  3. utab
    Replies:
    3
    Views:
    909
    ionut.neicu@gmail.com
    Nov 28, 2006
  4. afd
    Replies:
    1
    Views:
    8,566
    Colin Paul Gloster
    Mar 23, 2007
  5. Jim
    Replies:
    6
    Views:
    768
    gabriel@agence8.com
    Dec 24, 2013
Loading...

Share This Page