Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Electronic Equipment > VHDL > Problem while w...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 6090 of 6417
Post > Topic >>

Problem while writing the file

by Shraddhs <shraddhs.vora@[EMAIL PROTECTED] > Jun 18, 2008 at 11:23 PM

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;
 




 2 Posts in Topic:
Problem while writing the file
Shraddhs <shraddhs.vor  2008-06-18 23:23:42 
Re: Problem while writing the file
Brian Drummond <brian_  2008-06-19 14:44:03 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 16:25:57 CST 2008.