Jump to content

    

Recommended Posts

signal car: carry := ( x"000000",
                              x"000000",
                              x"000000",
                              x"000000",
                              x"000000",
                              x"000000",
                              x"000000",
                              x"000000",
                              x"000000",
                              x"000000",
                              x"000000",
                              x"000000");    

-- ....

write_to_file: process(clk)
                        variable outdata_line: line;
                        variable outdata: integer :=0;
                        file output_data_file: text open write_mode is "out_data.txt";
                            begin
                            if rising_edge(clk) then
--130:                            outdata := conv_integer(signed(car(N-1)(15 downto 8)));
                                write(outdata_line, outdata);
                                writeline(output_data_file,outdata_line);
                            end if;
                        end process

 

line 130: Second argument of write must have a constant value.

 

В чём проблема?

 

Share this post


Link to post
Share on other sites
outdata := conv_integer(signed(car(N-1)(15 downto 8)));

N подразумевает for

 

 

 

какие ieee.* библиотеки подключили?

 

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.NUMERIC_STD.ALL;
library std;
use std.textio.all;

entity FIR is
     Generic (N:natural:=12);
    Port ( X : in  STD_LOGIC_VECTOR (7 downto 0);
           clk : in  STD_LOGIC;
           start : in  STD_LOGIC;
           Y : out  STD_LOGIC_VECTOR (23 downto 0));
end FIR;

Share this post


Link to post
Share on other sites
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.NUMERIC_STD.ALL;

Использовать две эти библиотеки одновременно - плохая практика. Обычно рекомендуется использовать только numeric_std. В этом случае преобразование будет выглядеть так:

outdata := to_integer(signed(car(N-1)(15 downto 8)));

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this