Forum: FPGA, VHDL & Co. File-IO


von Martin (Gast)


Lesenswert?

Hallo Leute!

Ich möchte für Simulationszwecke unter VHDL ein File schreiben.

z.B.
architecture ....
file fh_file: bitfile open write_mode is "c:\testfile.dat";
begin
...

Der Compiler meldet folgendes:
Unknown identifier "bitfile"
FILE declaration must have a subtype indication that is a file type


Welche Library oder welches Package muss ich implementieren, damit das 
Öffnen des Files funktioniert oder habe ich einen anderen Fehler 
gemacht?

Danke Leute.
Tschüss
Martin

von Jörn K. (joern)


Lesenswert?

Bei mir hat das Schreiben so funktionieren:

process
  type characterFile_Typ is file of character;
  file f: characterFile_Typ open write_mode is "fifo.ts";
  variable c:character;
  variable i:integer;
begin
      wait until(XXX);
      i:=CONV_INTEGER(UNSIGNED(data_out(7 downto 0)));
      c:=character'val(i);
      write(f=>f,value=>c);
end;

Gruß
Jörn

von Martin (Gast)


Lesenswert?

Vielen Dank!

Ich habs geschafft.

Tschüss
Martin

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.