Go Back   Velocity Reviews > Newsgroups > VHDL
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

VHDL - Help me with output TEXTIO please?

 
Thread Tools Search this Thread
Old 10-30-2006, 12:24 PM   #1
Exclamation Help me with output TEXTIO please?


Hi all,

Im new in the VHDL programming so i could use your help.
My problem is about exporting results from my test bench to a .txt file.

I made a testbench for a cordic core, this core gives me the cosine and sine results from a input angle. I generate this angle in a procedure in my testbench.
I would like to write these results to a .txt file but i dont know how to do this.

I have the following code:

----------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use std.textio.all;

ENTITY testbench IS END;

ARCHITECTURE full OF testbench IS

component sc_corproc is
port(
clk : in std_logic;
ena : in std_logic;
Ain : in signed(15 downto 0);

sin : out signed(15 downto 0);
cos : out signed(15 downto 0));
end component sc_corproc;

constant clk_period : time := 9.259 ns;
SIGNAL tb_ena : std_logic := '1';
SIGNAL tb_clk : std_logic;
SIGNAL x : integer;
SIGNAL tb_Ain, tb_sin, tb_cos : signed(15 downto 0);

BEGIN

DUT : sc_corproc
PORT MAP( clk => tb_clk,
ena => tb_ena,
Ain => tb_Ain,
sin => tb_sin,
cos => tb_cos
);

CLOCK : PROCESS
BEGIN
loop
wait for clk_period/2;
tb_clk <= '1';
wait for clk_period/2;
tb_clk <= '0';
end loop;

END PROCESS;

OUTPUT_RESULTS : process

File dataout : TEXT is out "output.txt";
variable temp : signed(15 downto 0);
VARIABLE line_out : LINE;

begin
wait until tb_clk'event and tb_clk='1';

if tb_clk'event and tb_clk='1'then
temp(15 downto 0) := tb_sin(15 downto 0);

write(line_out, temp);
writeline(dataout, line_out);

else
wait until tb_clk'event and tb_clk='1';
end if;
end process;

MAIN: PROCESS(tb_clk)
VARIABLE K : INTEGER := 0;
CONSTANT N : INTEGER := 120;

PROCEDURE ANGLE_GEN(SIGNAL CLOCK : IN STD_LOGIC)IS

BEGIN
if rising_edge(tb_clk) then

K := K + 5;
x <= 65536 * K/N;
tb_Ain <= CONV_SIGNED(x,16);

end if;
END PROCEDURE ANGLE_GEN;

BEGIN

ANGLE_GEN(tb_clk);

END PROCESS MAIN;

END full;

-----------------------------------------------------

When i try to compile it with MODELSIM i get the error that there are no feasible entries for the subprogram write.

I think this is because the testbench first needs to generate an angle for the core and than the results are given back. But with compiling, there's no angle input because it is made during simulation so there's no result yet to write it to my .txt file.

I hope there's someone who has the time to help me with this problem.
Kind Regards,

Robert B.

p.s. pls keep in notice that i'm new to the VHDL scene.


RobertBon
RobertBon is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
CISCO 1801 DNS problem marsav Hardware 2 07-05-2009 11:41 PM
Different types of video output - I'm confused robotiser@googlemail.com DVD Video 2 07-29-2007 04:25 PM
Post-Route Simulation does not give output for the first clock cycle Options velocityreviews Software 0 04-17-2007 05:47 PM
Sony Precision Cinema Progressive Output vs Component 480p Output Otto Pylot DVD Video 1 04-18-2004 10:49 PM
Panasonic S25 DVD player w/o S-video output - will its replacement have S-video? Mark DVD Video 1 02-11-2004 04:19 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46