Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Reading from external text file

Status
Not open for further replies.

BilalM

Newbie
Joined
Apr 14, 2022
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
24
First of all, thank you so much for your help.
I need to read data (0's and 1's) from an external file, even a (Matlab) or text file for my testbench.
I tried to do so using the textio package, but I get this error "(vcom-1600) No feasible entries for subprogram "READ""
I am not expert in VHDL, please help me with this issue
here is the part from the testbench where I use the textio package:

LIBRARY IEEE;
USE IEEE.STD_LOGIC_1164.ALL;

USE IEEE.STD_LOGIC_TEXTIO.ALL;
USE IEEE.NUMERIC_STD.ALL;

LIBRARY WORK;
USE WORK.mem_types.ALL;

LIBRARY STD;
USE STD.TEXTIO.ALL;

--read from file--------------
File fin: TEXT OPEN READ_MODE IS "codeword.txt";

variable current_read_line: line; --current_read_line
variable current_read_field: B(34 downto 0); --current_read_field
begin
while (not endfile(fin)) loop
readline(fin,current_read_line);
read(current_read_line,current_read_field);
in1 <= current_read_field;
end loop;
------------------------------

B is declared as
TYPE B1 IS ARRAY (7 downto 0) of STD_LOGIC;
TYPE B IS ARRAY (NATURAL RANGE <>) of B1;

Thank you so much for your time
 

There's no textio.read() or std_logic_textio.read() procedure defined for type b or two-dimensional std_logic array. You can read known types or need to define your own read procedure.
 

Thank you for your answer, is there any suggestion how can I write my own read procedure
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top