Everyone expert here please help me... I'm new to this.. but these problem I really dunno how to solve... Thx everyone!
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity Sobel_vhdl is
Port(
Xnm1Ynm1 : in std_logic_vector ( 7 downto 0 );
XnYnm1 : in std_logic_vector ( 7 downto 0 );
Xnp1Ynm1 : in std_logic_vector ( 7 downto 0 );
Xnm1Yn : in std_logic_vector ( 7 downto 0 );
XnYn : in std_logic_vector ( 7 downto 0 );
Xnp1Yn : in std_logic_vector ( 7 downto 0 );
Xnm1Ynp1 : in std_logic_vector ( 7 downto 0 );
XnYnp1 : in std_logic_vector ( 7 downto 0 );
Xnp1Ynp1 : in std_logic_vector ( 7 downto 0 );
ydata_out : out std_logic_vector ( 7 downto 0 ));
end Sobel_vhdl;
architecture Behavioral of Sobel_vhdl is
signal op_int_vaL1 : std_logic_vector ( 10 downto 0 );
signal op_int_vaL2 : std_logic_vector ( 10 downto 0 );
signal op_vaL1 : std_logic_vector ( 10 downto 0 );
signal op_vaL2 : std_logic_vector ( 10 downto 0 );
signal abs_op_cal_val : std_logic_vector ( 10 downto 0 );
constant Xnm1Ynm1VaL1 : integer := -1;
constant XnYnm1VaL1 : integer := 0;
constant Xnp1Ynm1VaL1 : integer := 1;
constant Xnm1YnVaL1 : integer := -2;
constant XnYnVaL1 : integer := 0;
constant Xnp1YnVaL1 : integer := 2;
constant Xnm1Ynp1VaL1 : integer := -1;
constant XnYnp1VaL1 : integer := 0;
constant Xnp1Ynp1VaL1 : integer := 1;
constant Xnm1Ynm1VaL2 : integer := -1;
constant XnYnm1VaL2 : integer := -2;
constant Xnp1Ynm1VaL2 : integer := -1;
constant Xnm1YnVaL2 : integer := 0;
constant XnYnVaL2 : integer := 0;
constant Xnp1YnVaL2 : integer := 0;
constant Xnm1Ynp1VaL2 : integer := 1;
constant XnYnp1VaL2 : integer := 2;
constant Xnp1Ynp1VaL2 : integer := 1;
begin
op_int_vaL1 <= Xnm1Ynm1VaL1*CONV_INTEGER(Xnm1Ynm1) + XnYnm1VaL1*CONV_INTEGER(XnYnm1) + Xnp1Ynm1VaL1*CONV_INTEGER(Xnp1Ynm1)
+ Xnm1YnVaL1*CONV_INTEGER(Xnm1Yn) + XnYnVaL1*CONV_INTEGER(XnYn) + Xnp1YnVaL1*CONV_INTEGER(Xnp1Yn)
+ Xnm1Ynp1VaL1*CONV_INTEGER(Xnm1Ynp1) + XnYnp1VaL1*CONV_INTEGER(XnYnp1) + Xnp1Ynp1VaL1*CONV_INTEGER(Xnp1Ynp1);
op_int_vaL2 <= Xnm1Ynm1VaL2*CONV_INTEGER(Xnm1Ynm1) + XnYnm1VaL2*CONV_INTEGER(XnYnm1) + Xnp1Ynm1VaL2*CONV_INTEGER(Xnp1Ynm1)
+ Xnm1YnVaL2*CONV_INTEGER(Xnm1Yn) + XnYnVaL2*CONV_INTEGER(XnYn) + Xnp1YnVaL2*CONV_INTEGER(Xnp1Yn)
+ Xnm1Ynp1VaL2*CONV_INTEGER(Xnm1Ynp1) + XnYnp1VaL2*CONV_INTEGER(XnYnp1) + Xnp1Ynp1VaL2*CONV_INTEGER(Xnp1Ynp1);
op_vaL1 <= CONV_STD_LOGIC_VECTOR(op_int_vaL1, op_vaL1'length);
op_vaL2 <= CONV_STD_LOGIC_VECTOR(op_int_vaL2, op_vaL2'length);
process(op_vaL1) begin
if op_vaL1(op_vaL1'left)='1' then -- 負の値
abs_op_cal_vaL1 <= not(op_vaL1 -1);
else -- 正の数
abs_op_cal_vaL1 <= op_vaL1;
end if;
end process;
process(op_vaL2) begin
if op_vaL2(op_vaL2'left)='1' then -- 負の値
abs_op_cal_vaL2 <= not(op_vaL2 -1);
else -- 正の数
abs_op_cal_vaL2 <= op_vaL2;
end if;
end process;
abs_op_cal_val <= abs_op_cal_vaL1 + abs_op_cal_vaL2;
ydata_out <= x"00" when h_valid_flag='0' or v_valid_flag='0' else
x"FF" when (abs_op_cal_val(12) or abs_op_cal_val(11) or abs_op_cal_val(10) or abs_op_cal_val(9) or abs_op_cal_val(8))='1'
else abs_op_cal_val(7 downto 0); -- 飽和演算
end Behavioral;
* HDL Compilation *
=========================================================================
Compiling vhdl file "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" in Library work.
Entity <sobel_vhdl> compiled.
ERROR:HDLParsers:800 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 75. Type of op_int_vaL1 is incompatible with type of +.
ERROR:HDLParsers:800 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 79. Type of op_int_vaL2 is incompatible with type of +.
ERROR:HDLParsers:808 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 81. CONV_STD_LOGIC_VECTOR can not have such operands in this context.
ERROR:HDLParsers:808 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 82. CONV_STD_LOGIC_VECTOR can not have such operands in this context.
ERROR:HDLParsers:3312 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 86. Undefined symbol 'abs_op_cal_vaL1'.
ERROR:HDLParsers:1209 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 88. abs_op_cal_vaL1: Undefined symbol (last report in this block)
ERROR:HDLParsers:3312 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 93. Undefined symbol 'abs_op_cal_vaL2'.
ERROR:HDLParsers:1209 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 95. abs_op_cal_vaL2: Undefined symbol (last report in this block)
ERROR:HDLParsers:3312 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 98. Undefined symbol 'abs_op_cal_vaL1'.
ERROR:HDLParsers:1209 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 98. abs_op_cal_vaL1: Undefined symbol (last report in this block)
ERROR:HDLParsers:3312 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 98. Undefined symbol 'abs_op_cal_vaL2'.
ERROR:HDLParsers:1209 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 98. abs_op_cal_vaL2: Undefined symbol (last report in this block)
ERROR:HDLParsers:3312 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 100. Undefined symbol 'h_valid_flag'.
ERROR:HDLParsers:1209 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 100. h_valid_flag: Undefined symbol (last report in this block)
ERROR:HDLParsers:3312 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 100. Undefined symbol 'v_valid_flag'.
ERROR:HDLParsers:1209 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 100. v_valid_flag: Undefined symbol (last report in this block)
ERROR:HDLParsers:3367 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 101. 12 is not included in the index range, 10 downto 0, of array abs_op_cal_val.
ERROR:HDLParsers:3367 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 101. 11 is not included in the index range, 10 downto 0, of array abs_op_cal_val.
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
use IEEE.STD_LOGIC_UNSIGNED.ALL;
---- Uncomment the following library declaration if instantiating
---- any Xilinx primitives in this code.
--library UNISIM;
--use UNISIM.VComponents.all;
entity Sobel_vhdl is
Port(
Xnm1Ynm1 : in std_logic_vector ( 7 downto 0 );
XnYnm1 : in std_logic_vector ( 7 downto 0 );
Xnp1Ynm1 : in std_logic_vector ( 7 downto 0 );
Xnm1Yn : in std_logic_vector ( 7 downto 0 );
XnYn : in std_logic_vector ( 7 downto 0 );
Xnp1Yn : in std_logic_vector ( 7 downto 0 );
Xnm1Ynp1 : in std_logic_vector ( 7 downto 0 );
XnYnp1 : in std_logic_vector ( 7 downto 0 );
Xnp1Ynp1 : in std_logic_vector ( 7 downto 0 );
ydata_out : out std_logic_vector ( 7 downto 0 ));
end Sobel_vhdl;
architecture Behavioral of Sobel_vhdl is
signal op_int_vaL1 : std_logic_vector ( 10 downto 0 );
signal op_int_vaL2 : std_logic_vector ( 10 downto 0 );
signal op_vaL1 : std_logic_vector ( 10 downto 0 );
signal op_vaL2 : std_logic_vector ( 10 downto 0 );
signal abs_op_cal_val : std_logic_vector ( 10 downto 0 );
constant Xnm1Ynm1VaL1 : integer := -1;
constant XnYnm1VaL1 : integer := 0;
constant Xnp1Ynm1VaL1 : integer := 1;
constant Xnm1YnVaL1 : integer := -2;
constant XnYnVaL1 : integer := 0;
constant Xnp1YnVaL1 : integer := 2;
constant Xnm1Ynp1VaL1 : integer := -1;
constant XnYnp1VaL1 : integer := 0;
constant Xnp1Ynp1VaL1 : integer := 1;
constant Xnm1Ynm1VaL2 : integer := -1;
constant XnYnm1VaL2 : integer := -2;
constant Xnp1Ynm1VaL2 : integer := -1;
constant Xnm1YnVaL2 : integer := 0;
constant XnYnVaL2 : integer := 0;
constant Xnp1YnVaL2 : integer := 0;
constant Xnm1Ynp1VaL2 : integer := 1;
constant XnYnp1VaL2 : integer := 2;
constant Xnp1Ynp1VaL2 : integer := 1;
begin
op_int_vaL1 <= Xnm1Ynm1VaL1*CONV_INTEGER(Xnm1Ynm1) + XnYnm1VaL1*CONV_INTEGER(XnYnm1) + Xnp1Ynm1VaL1*CONV_INTEGER(Xnp1Ynm1)
+ Xnm1YnVaL1*CONV_INTEGER(Xnm1Yn) + XnYnVaL1*CONV_INTEGER(XnYn) + Xnp1YnVaL1*CONV_INTEGER(Xnp1Yn)
+ Xnm1Ynp1VaL1*CONV_INTEGER(Xnm1Ynp1) + XnYnp1VaL1*CONV_INTEGER(XnYnp1) + Xnp1Ynp1VaL1*CONV_INTEGER(Xnp1Ynp1);
op_int_vaL2 <= Xnm1Ynm1VaL2*CONV_INTEGER(Xnm1Ynm1) + XnYnm1VaL2*CONV_INTEGER(XnYnm1) + Xnp1Ynm1VaL2*CONV_INTEGER(Xnp1Ynm1)
+ Xnm1YnVaL2*CONV_INTEGER(Xnm1Yn) + XnYnVaL2*CONV_INTEGER(XnYn) + Xnp1YnVaL2*CONV_INTEGER(Xnp1Yn)
+ Xnm1Ynp1VaL2*CONV_INTEGER(Xnm1Ynp1) + XnYnp1VaL2*CONV_INTEGER(XnYnp1) + Xnp1Ynp1VaL2*CONV_INTEGER(Xnp1Ynp1);
op_vaL1 <= CONV_STD_LOGIC_VECTOR(op_int_vaL1, op_vaL1'length);
op_vaL2 <= CONV_STD_LOGIC_VECTOR(op_int_vaL2, op_vaL2'length);
process(op_vaL1) begin
if op_vaL1(op_vaL1'left)='1' then -- 負の値
abs_op_cal_vaL1 <= not(op_vaL1 -1);
else -- 正の数
abs_op_cal_vaL1 <= op_vaL1;
end if;
end process;
process(op_vaL2) begin
if op_vaL2(op_vaL2'left)='1' then -- 負の値
abs_op_cal_vaL2 <= not(op_vaL2 -1);
else -- 正の数
abs_op_cal_vaL2 <= op_vaL2;
end if;
end process;
abs_op_cal_val <= abs_op_cal_vaL1 + abs_op_cal_vaL2;
ydata_out <= x"00" when h_valid_flag='0' or v_valid_flag='0' else
x"FF" when (abs_op_cal_val(12) or abs_op_cal_val(11) or abs_op_cal_val(10) or abs_op_cal_val(9) or abs_op_cal_val(8))='1'
else abs_op_cal_val(7 downto 0); -- 飽和演算
end Behavioral;
* HDL Compilation *
=========================================================================
Compiling vhdl file "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" in Library work.
Entity <sobel_vhdl> compiled.
ERROR:HDLParsers:800 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 75. Type of op_int_vaL1 is incompatible with type of +.
ERROR:HDLParsers:800 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 79. Type of op_int_vaL2 is incompatible with type of +.
ERROR:HDLParsers:808 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 81. CONV_STD_LOGIC_VECTOR can not have such operands in this context.
ERROR:HDLParsers:808 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 82. CONV_STD_LOGIC_VECTOR can not have such operands in this context.
ERROR:HDLParsers:3312 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 86. Undefined symbol 'abs_op_cal_vaL1'.
ERROR:HDLParsers:1209 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 88. abs_op_cal_vaL1: Undefined symbol (last report in this block)
ERROR:HDLParsers:3312 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 93. Undefined symbol 'abs_op_cal_vaL2'.
ERROR:HDLParsers:1209 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 95. abs_op_cal_vaL2: Undefined symbol (last report in this block)
ERROR:HDLParsers:3312 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 98. Undefined symbol 'abs_op_cal_vaL1'.
ERROR:HDLParsers:1209 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 98. abs_op_cal_vaL1: Undefined symbol (last report in this block)
ERROR:HDLParsers:3312 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 98. Undefined symbol 'abs_op_cal_vaL2'.
ERROR:HDLParsers:1209 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 98. abs_op_cal_vaL2: Undefined symbol (last report in this block)
ERROR:HDLParsers:3312 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 100. Undefined symbol 'h_valid_flag'.
ERROR:HDLParsers:1209 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 100. h_valid_flag: Undefined symbol (last report in this block)
ERROR:HDLParsers:3312 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 100. Undefined symbol 'v_valid_flag'.
ERROR:HDLParsers:1209 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 100. v_valid_flag: Undefined symbol (last report in this block)
ERROR:HDLParsers:3367 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 101. 12 is not included in the index range, 10 downto 0, of array abs_op_cal_val.
ERROR:HDLParsers:3367 - "C:/Documents and Settings/Lawrence/Sobel_vhdl/Sobel_vhdl.vhd" Line 101. 11 is not included in the index range, 10 downto 0, of array abs_op_cal_val.