Problem while writing the file

S

Shraddhs

Hello,
I have tried this code on Modelsim, but it is not writing the file
in readable form.
some symbols r there.........
Please help out





library ieee,STD;
USE IEEE.STD_LOGIC_ARITH.ALL;
use ieee.std_logic_1164.ALL;
use ieee.std_logic_unsigned.ALL;
USE STD.TEXTIO.ALL;
USE IEEE.STD_LOGIC_TEXTIO.ALL;
entity mat_add is

end mat_add;

architecture matadd1 of mat_add is
type subchar is('s','t');
type matrix is array(POSITIVE range 1 to 3,NATURAL range 1 to 3)
of integer;
type matrix_out is file of integer;
subtype NATURAL is INTEGER range 0 to INTEGER'HIGH;
subtype POSITIVE is INTEGER range 1 to INTEGER'HIGH;
SIGNAL k : integer ;
SIGNAL clock : BIT := '0';
file matout : matrix_out
open WRITE_MODE is "E:\shweta\extra\RCS card\examples\matout.txt";
begin
clock <= not(clock)after 10 ns;
process
VARIABLE i : INTEGER :=1;
VARIABLE j : INTEG

ER :=1;
-- FILE outFile : TEXT IS OUT "matout.txt";
VARIABLE outLine : LINE;
VARIABLE mat1 : matrix;
VARIABLE mat2 :matrix;
begin
for i in 1 to 3 loop
for j in 1 to 3 loop
mat1(i,j) := j+1 ;
mat2(i,j) := mat1(i,j);
end loop;
end loop;
for i in 1 to 3 loop
for j in 1 to 3 loop
-- WRITE(outLine, lineNumber, right, 3);
WAIT UNTIL clock = '1' AND clock'EVENT;
-- WRITE(outLine, HT);
k <= mat2(i,j);
WRITE(matout,k);
end loop;
end loop;
END PROCESS;
end matadd1;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top