[an error occurred while processing this directive]
|
library IEEE;
use IEEE.STD_LOGIC_1164.all;
use STD.TEXTIO.all;
use IEEE.STD_LOGIC_TEXTIO.all;
entity Convert is
end entity;
architecture Simple of Convert is
constant IDATA_FILE: string :="src\IData.txt";
constant ODATA_FILE: string :="src\OData.txt";
subtype NIBBLE is std_logic_vector( 3 downto 0);
procedure Hex2Dec (Ifile: in string; Ofile: in string) is
file fdhex : text open READ_MODE is Ifile;
file fdbin : text open WRITE_MODE is Ofile;
variable hLine: line;
variable bLine: line;
variable Value: NIBBLE;
variable i: integer;
begin
while not endfile(fdhex) loop
ReadLine(fdhex,hLine);
for i in 0 to hLine'length-1 loop
HRead(hLine,Value);
Write(bline,Value);
end loop;
WriteLine(fdbin,dline);
end loop;
end procedure Hex2Dec;
begin
CONV_PROC:process
begin
wait for 10 ns;
Hex2Dec(IDATA_FILE,ODATA_FILE);
wait for 10 ns;
end process CONV_PROC;
end Simple;
А для начала прочитайте пару книжек.
Кстати, "прогу" "лабают" "программеры",а схему на языке описания сверхскоростных БИС (VHDL) описывают инженеры-системотехники, тесты разрабатывают инженеры-верификаторы. Тут уж выбирать надо самому кем быть, и применять соответствующую терминалогию. :)
E-mail: info@telesys.ru