Reading External .txt files in Quartus II 
Author Message
 Reading External .txt files in Quartus II

Hello all,

I'm having a problem reading some test data into my quartus ii design.

The .txt file has a simple format of integers in a column :eg.

234
-3421
21
etc .. .

I created a new block in quartus for vhdl :

LIBRARY ieee ;
USE ieee.std_logic_1164.all;
USE ieee.numeric_std.all;
LIBRARY std ;
USE std.textio.all;

ENTITY Read_Vectors IS
   generic(
    Input_File : string := "c:\test_read_vectors_integer.txt"
  );
   PORT(
        clk         : IN     std_logic;
        Ena         : IN     std_logic;
        Xout_Value  : OUT    signed (15 DOWNTO 0);
        );
END Read_Vectors ;
ARCHITECTURE Version_1 OF Read_Vectors IS
begin
Read_in_Integer : process(clk, Ena)                                        
  file X : TEXT open READ_MODE is input_file;
  variable L : line;-- line of file
  variable Xin_file_integer_value : Integer;
begin
if Ena = '0' then
  Xout_Value <=(others => '0');
  elsif rising_edge(clk) and not endfile(X) then
        readline (X, L);--read input file
        read (L, Xin_file_integer_value); --read value from file        
        Xout_Value <= to_signed(Xin_file_integer_value,16);
end if;
end process read_in_integer;
end Version_1;

My plan is to use Xout_Value as the input to my design. The problem is
that I can't get this code to output the values under the quartus
environment. Is there another way to achieve this ?



Sun, 17 Jul 2005 22:41:29 GMT  
 Reading External .txt files in Quartus II
Hello,

Generaly the simulator that comes with the vendor tools is not well suited
for such things. You'd better consider using something more advanced like
ModelSim.


Quote:
> Hello all,

> I'm having a problem reading some test data into my quartus ii design.

> The .txt file has a simple format of integers in a column :eg.

> 234
> -3421
> 21
> etc .. .

> I created a new block in quartus for vhdl :

> LIBRARY ieee ;
> USE ieee.std_logic_1164.all;
> USE ieee.numeric_std.all;
> LIBRARY std ;
> USE std.textio.all;

> ENTITY Read_Vectors IS
>    generic(
>     Input_File : string := "c:\test_read_vectors_integer.txt"
>   );
>    PORT(
>    clk         : IN     std_logic;
> Ena     : IN     std_logic;
> Xout_Value  : OUT    signed (15 DOWNTO 0);
>    );
> END Read_Vectors ;
> ARCHITECTURE Version_1 OF Read_Vectors IS
> begin
> Read_in_Integer : process(clk, Ena)
>   file X : TEXT open READ_MODE is input_file;
>   variable L : line;-- line of file
>   variable Xin_file_integer_value : Integer;
> begin
> if Ena = '0' then
>   Xout_Value <=(others => '0');
>   elsif rising_edge(clk) and not endfile(X) then
> readline (X, L);--read input file
> read (L, Xin_file_integer_value); --read value from file
> Xout_Value <= to_signed(Xin_file_integer_value,16);
> end if;
> end process read_in_integer;
> end Version_1;

> My plan is to use Xout_Value as the input to my design. The problem is
> that I can't get this code to output the values under the quartus
> environment. Is there another way to achieve this ?



Mon, 18 Jul 2005 00:07:07 GMT  
 Reading External .txt files in Quartus II
Thanks Arash,

I know this code works with ModelSim for functional verification but I
really wanted to use the Quartus II environment for timing analysis of
my existing design.
I could write a .vec file but this means typing in all the other
stimulus values which takes too long.

Dave


Quote:
> Hello,

> Generaly the simulator that comes with the vendor tools is not well suited
> for such things. You'd better consider using something more advanced like
> ModelSim.



> > Hello all,

> > I'm having a problem reading some test data into my quartus ii design.

> > The .txt file has a simple format of integers in a column :eg.

> > 234
> > -3421
> > 21
> > etc .. .

> > I created a new block in quartus for vhdl :

> > LIBRARY ieee ;
> > USE ieee.std_logic_1164.all;
> > USE ieee.numeric_std.all;
> > LIBRARY std ;
> > USE std.textio.all;

> > ENTITY Read_Vectors IS
> >    generic(
> >     Input_File : string := "c:\test_read_vectors_integer.txt"
> >   );
> >    PORT(
> >    clk         : IN     std_logic;
> > Ena     : IN     std_logic;
> > Xout_Value  : OUT    signed (15 DOWNTO 0);
> >    );
> > END Read_Vectors ;
> > ARCHITECTURE Version_1 OF Read_Vectors IS
> > begin
> > Read_in_Integer : process(clk, Ena)
> >   file X : TEXT open READ_MODE is input_file;
> >   variable L : line;-- line of file
> >   variable Xin_file_integer_value : Integer;
> > begin
> > if Ena = '0' then
> >   Xout_Value <=(others => '0');
> >   elsif rising_edge(clk) and not endfile(X) then
> > readline (X, L);--read input file
> > read (L, Xin_file_integer_value); --read value from file
> > Xout_Value <= to_signed(Xin_file_integer_value,16);
> > end if;
> > end process read_in_integer;
> > end Version_1;

> > My plan is to use Xout_Value as the input to my design. The problem is
> > that I can't get this code to output the values under the quartus
> > environment. Is there another way to achieve this ?



Mon, 18 Jul 2005 17:08:33 GMT  
 Reading External .txt files in Quartus II
Hello,

Well, you can export the post place&route verilog (usually runs much faster
than VHDL on modelsim) version of the design (i.e. the gate level model) to
ModelSim to have the timing analysis too. The other way is to use ModelSim
(or even C) and write a program to generate that .vec file for you...

Best Regards
Arash


Quote:
> Thanks Arash,

> I know this code works with ModelSim for functional verification but I
> really wanted to use the Quartus II environment for timing analysis of
> my existing design.
> I could write a .vec file but this means typing in all the other
> stimulus values which takes too long.

> Dave




Quote:
> > Hello,

> > Generaly the simulator that comes with the vendor tools is not well
suited
> > for such things. You'd better consider using something more advanced
like
> > ModelSim.



> > > Hello all,

> > > I'm having a problem reading some test data into my quartus ii design.

> > > The .txt file has a simple format of integers in a column :eg.

> > > 234
> > > -3421
> > > 21
> > > etc .. .

> > > I created a new block in quartus for vhdl :

> > > LIBRARY ieee ;
> > > USE ieee.std_logic_1164.all;
> > > USE ieee.numeric_std.all;
> > > LIBRARY std ;
> > > USE std.textio.all;

> > > ENTITY Read_Vectors IS
> > >    generic(
> > >     Input_File : string := "c:\test_read_vectors_integer.txt"
> > >   );
> > >    PORT(
> > >    clk         : IN     std_logic;
> > > Ena     : IN     std_logic;
> > > Xout_Value  : OUT    signed (15 DOWNTO 0);
> > >    );
> > > END Read_Vectors ;
> > > ARCHITECTURE Version_1 OF Read_Vectors IS
> > > begin
> > > Read_in_Integer : process(clk, Ena)
> > >   file X : TEXT open READ_MODE is input_file;
> > >   variable L : line;-- line of file
> > >   variable Xin_file_integer_value : Integer;
> > > begin
> > > if Ena = '0' then
> > >   Xout_Value <=(others => '0');
> > >   elsif rising_edge(clk) and not endfile(X) then
> > > readline (X, L);--read input file
> > > read (L, Xin_file_integer_value); --read value from file
> > > Xout_Value <= to_signed(Xin_file_integer_value,16);
> > > end if;
> > > end process read_in_integer;
> > > end Version_1;

> > > My plan is to use Xout_Value as the input to my design. The problem is
> > > that I can't get this code to output the values under the quartus
> > > environment. Is there another way to achieve this ?



Tue, 19 Jul 2005 00:41:08 GMT  
 Reading External .txt files in Quartus II

Quote:

> Thanks Arash,

> I know this code works with ModelSim for functional verification but I
> really wanted to use the Quartus II environment for timing analysis of
> my existing design.

I use the Quartus static timing analyzer.
It does not require any stimulus.

Quote:
> I could write a .vec file but this means typing in all the other
> stimulus values which takes too long.

Quartus does not support VHDL simulation.

Consider using synchronous design and static timing analysis
to verify timing.

Consider using a VHDL simulator first for
syntax and functional testing.

       -- Mike Treseler



Tue, 19 Jul 2005 01:02:49 GMT  
 Reading External .txt files in Quartus II
Thanks for your replies,

I'll use ModelSim from now on ..

Dave



Tue, 19 Jul 2005 17:00:52 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. read a particular line from txt file

2. reading excel, .txt files and displaying them?

3. How can I read a special line from a .txt file in BridgeVIEW

4. Urgent help needed reading txt file

5. Quartus II and parameters...

6. ModelSim and Quartus II

7. Quartus II...

8. "After" clause and Quartus II

9. While loops in Quartus II

10. Design Flow Help for a Newbie in Quartus II

11. Reading a txt-file as binary...

12. Reading from a .txt file

 

 
Powered by phpBB® Forum Software