kasthu
Newbie level 3
- Joined
- Sep 13, 2013
- Messages
- 4
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 37
me newly working in textio function. integer files to write and read no problem,where as to write the output of binary vectors problem. any one know syntax for that help me please.below is code.
1)library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use std.textio.all;
entity m is
Port ( clk ,rst: in STD_LOGIC);
end m;
architecture Behavioral of m is
begin
process(clk,rst)
file outfile:text is out"d:\kasthu\outfile1.txt";
variable outline:line;
variable q:bit_vector(4 downto 0);
begin
if(rst='1')then
q:="00000";
elsif(clk'event and clk='1')then
q:=q+1;
write(outline,q);
writeline(outfile,outline);
end if;
end process;
end Behavioral;
error:
+ can not have such operands in this context.
-------------------------------------------------------------------------------------------------------------------------------------------------
2)library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use std.textio.all;
entity lf is
Port ( clk,rst : in STD_LOGIC;
q :inout STD_LOGIC_vector(4 downto 0));
end lf;
architecture Behavioral of lf is
begin
process(clk,rst)
file outfile:text is out"d:\kas\outfile1.txt";
variable outline:line;
begin
for i in 0 to 31 loop
if(rst='1')then
q<="00001";
elsif(clk'event and clk='1')then
q(0)<=q(4) ;
q(1)<=q(0);
q(2)<=q(1);
q(3)<=q(2);
q(4)<=q(3);
write(outline,q);
writeline(outfile,outline);
end if;
end loop;
end process;
end Behavioral;
error:
write can not have such operands in this context.
1)library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use std.textio.all;
entity m is
Port ( clk ,rst: in STD_LOGIC);
end m;
architecture Behavioral of m is
begin
process(clk,rst)
file outfile:text is out"d:\kasthu\outfile1.txt";
variable outline:line;
variable q:bit_vector(4 downto 0);
begin
if(rst='1')then
q:="00000";
elsif(clk'event and clk='1')then
q:=q+1;
write(outline,q);
writeline(outfile,outline);
end if;
end process;
end Behavioral;
error:
+ can not have such operands in this context.
-------------------------------------------------------------------------------------------------------------------------------------------------
2)library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
use std.textio.all;
entity lf is
Port ( clk,rst : in STD_LOGIC;
q :inout STD_LOGIC_vector(4 downto 0));
end lf;
architecture Behavioral of lf is
begin
process(clk,rst)
file outfile:text is out"d:\kas\outfile1.txt";
variable outline:line;
begin
for i in 0 to 31 loop
if(rst='1')then
q<="00001";
elsif(clk'event and clk='1')then
q(0)<=q(4) ;
q(1)<=q(0);
q(2)<=q(1);
q(3)<=q(2);
q(4)<=q(3);
write(outline,q);
writeline(outfile,outline);
end if;
end loop;
end process;
end Behavioral;
error:
write can not have such operands in this context.