rakeshk.r
Member level 2
- Joined
- Nov 12, 2013
- Messages
- 47
- Helped
- 1
- Reputation
- 2
- Reaction score
- 1
- Trophy points
- 8
- Activity points
- 421
HI, I am using HDL designer, I created a component "wr_text" by adding an existing .vhd file to my current design project. The code is pretty straight forward, I wanted to write out the unsigned input data to a text file. The code is shown below:
I am getting an compilation error as shown below:
However when I created a new interface "wr_bin" rather than adding an existing vhdl file, I put the same code as shown above in "wr_bin" and compiled it. Strange! (but fortunate) that it compiled succesfully.
One difference can be found by looking at the figures of these component attached with this query. The input port "datai" declaration in "wr_text" doesn't show up similar to "wr_bin" component. I don't know the reason behind this difference. But, still I am not sure why I have that compilation error for the component "wr_text". For now I have a working component but still I am curious to know the fix to this error. Your comments towards solving this error is appreciated.
Code:
ENTITY wr_text IS
GENERIC(
out_width : positive := 16
);
PORT(
clk : IN std_logic;
en_i : IN std_logic;
datai : IN unsigned (out_width-1 DOWNTO 0)
);
-- Declarations
END wr_text ;
--
ARCHITECTURE files OF wr_text IS
signal en_o : std_logic;
BEGIN
write_txt: process(clk)
variable outline :line;
file outputfile : text open append_mode is "sqrr_output.txt";
begin
if (rising_edge(clk)) then
if (en_i = '1') then
write(outline,datai); -- line 41
writeline(outputfile,outline);
en_o <= '1';
end if;
end if;
end process;-- line 49
I am getting an compilation error as shown below:
HTML:
Performing compile...
Library lns_project_lib
Writing temporary output file "/tmp/Files0".
-- Loading package STANDARD
-- Loading package TEXTIO
-- Loading package std_logic_1164
-- Loading package NUMERIC_STD
-- Compiling entity wr_text
-- Compiling architecture files of wr_text
** Error: /site/path1/path2/path3/user/folder1/lns/lns_project/lns_project_lib/hdl/wr_text_files.vhd(41): No feasible entries for subprogram "write".
** Error: /site/path1/path2/path3/user/folder1/lns/lns_project/lns_project_lib/hdl/wr_text_files.vhd(49): VHDL Compiler exiting
child process exited abnormally
Failed during ModelSim compile - Error executing "/sw/mentor/modelsim_10.0/modeltech/bin/vcom -work "lns_project_lib" -nologo -f /tmp/Files0"
Compiled 1 file(s) in 1 compiler invocation(s) with 2 failure(s)
However when I created a new interface "wr_bin" rather than adding an existing vhdl file, I put the same code as shown above in "wr_bin" and compiled it. Strange! (but fortunate) that it compiled succesfully.
HTML:
Performing compile...
Library lns_project_lib
Writing temporary output file "/tmp/Files0".
-- Loading package STANDARD
-- Loading package TEXTIO
-- Loading package std_logic_1164
-- Loading package NUMERIC_STD
-- Compiling entity wr_bin
-- Compiling architecture data of wr_bin
Compiled 1 file(s) in 1 compiler invocation(s) with 0 failure(s)
Compilation took 0 second(s)
Data preparation step completed, check transcript...
---------------------------------------------------------------------------------
Simulation directory is set to /site/path1/path2/path3/user/folder1/lns/lns_project/lns_project_lib/work
Saving Symbol for Design Unit lns_project_lib/wr_text
One difference can be found by looking at the figures of these component attached with this query. The input port "datai" declaration in "wr_text" doesn't show up similar to "wr_bin" component. I don't know the reason behind this difference. But, still I am not sure why I have that compilation error for the component "wr_text". For now I have a working component but still I am curious to know the fix to this error. Your comments towards solving this error is appreciated.