编译reg_aggr.vhd总是出现这个错误
Error:Termination notification:errors in ...\reg_aggr.vhd prevent
from further processing
------------------------------------------reg_aggr.vhd-------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
component mux16_1
port
(
sel_in:in std_logic_vector(15 downto 0);
p:out integer range 0 to 15
);
end component;
signal outFromAaddr:std_logic_vector(15 downto 0);
signal outFromBaddr:std_logic_vector(15 downto 0);
signal outy:std_logic_vector(15 downto 0);--4至16译码输出的地址
signal input:integer range 0 to 15;--16选1多路选择
signal outputA,outputB:integer range 0 to 15;
signal B0,B1,B2,B3,B4,B5,B6,B7,B8,B9,B10,B11,B12,B13,B14,B15:std_logic_vector(15 downto 0);
begin
pa:process(Baddr,Benable,clk,sel,Bin)
begin
--if(clk'event and clk='1') then
sel_Baddr:dec4_16 PORT MAP (Baddr,Benable,outy);
sel_Bin:mux16_1 PORT MAP (outy,input);
case input is
when 0 =>reg0: reg PORT MAP (clk,sel,Bin,B0);
when 1 =>reg1: reg PORT MAP (clk,sel,Bin,B1);
when 2 =>reg2: reg PORT MAP (clk,sel,Bin,B2);
when 3 =>reg3: reg PORT MAP (clk,sel,Bin,B3);
when 4 =>reg4: reg PORT MAP (clk,sel,Bin,B4);
when 5 =>reg5: reg PORT MAP (clk,sel,Bin,B5);
when 6 =>reg6: reg PORT MAP (clk,sel,Bin,B6);
when 7 =>reg7: reg PORT MAP (clk,sel,Bin,B7);
when 8 =>reg8: reg PORT MAP (clk,sel,Bin,B8);
when 9 =>reg9: reg PORT MAP (clk,sel,Bin,B9);
when 10 =>reg10: reg PORT MAP (clk,sel,Bin,B10);
when 11 =>reg11: reg PORT MAP (clk,sel,Bin,B11);
when 12 =>reg12: reg PORT MAP (clk,sel,Bin,B12);
when 13 =>reg13: reg PORT MAP (clk,sel,Bin,B13);
when 14 =>reg14: reg PORT MAP (clk,sel,Bin,B14);
when 15 =>reg15: reg PORT MAP (clk,sel,Bin,B15);
end case;
end process;
pb:process(Aaddr,Aenable,Baddr,Benable,clk,Aout,Bout)
begin
decA:dec4_16 PORT MAP (Aaddr,Aenable,outFromAaddr);
decB:dec4_16 PORT MAP (Baddr,Benable,outFromBaddr);
muxA:mux16_1 PORT MAP (outFromAaddr,outputA);
muxB:mux16_1 PORT MAP (outFromAaddr,outputB);
if (clk'event and clk=1) then
case outputA is
when 0 =>Aout<=B0;
when 1 =>Aout<=B1;
when 2 =>Aout<=B2;
when 3 =>Aout<=B3;
when 4 =>Aout<=B4;
when 5 =>Aout<=B5;
when 6 =>Aout<=B6;
when 7 =>Aout<=B7;
when 8 =>Aout<=B8;
when 9 =>Aout<=B9;
when 10 =>Aout<=B10;
when 11 =>Aout<=B11;
when 12 =>Aout<=B12;
when 13 =>Aout<=B13;
when 14 =>Aout<=B14;
when 15 =>Aout<=B15;
end case;
case outputB is
when 0 =>Bout<=B0;
when 1 =>Bout<=B1;
when 2 =>Bout<=B2;
when 3 =>Bout<=B3;
when 4 =>Bout<=B4;
when 5 =>Bout<=B5;
when 6 =>Bout<=B6;
when 7 =>Bout<=B7;
when 8 =>Bout<=B8;
when 9 =>Bout<=B9;
when 10 =>Bout<=B10;
when 11 =>Bout<=B11;
when 12 =>Bout<=B12;
when 13 =>Bout<=B13;
when 14 =>Bout<=B14;
when 15 =>Bout<=B15;
end case;
end if;
end process;
end behavior;
-------------------------------------------------------------------------------------------------------
-------------------------------------------------reg.vhd------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity reg is
port(
clk,sel:in std_logic;
din:in std_logic_vector(15 downto 0);
dout:out std_logic_vector(15 downto 0)
);
end reg;
architecture behavior of reg is
begin
process(clk,sel,din)
begin
if clk'event and clk='1' then
if sel='1' then
dout<=din;
end if;
end if;
end process;
end behavior;
------------------------------------------------------------------------------------------------------
-----------------------------------------dec4_16.vhd-------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity dec4_16 is
port(
addr:in std_logic_vector(3 downto 0);
en:in std_logic;
y:out std_logic_vector(15 downto 0)
);
end dec4_16;
architecture behavior of dec4_16 is
begin
process(addr,en)
begin
y<="1111111111111111";
if (en='1') then
case addr is
when "0000" =>y(0)<='0';
when "0001" =>y(1)<='0';
when "0010" =>y(2)<='0';
when "0011" =>y(3)<='0';
when "0100" =>y(4)<='0';
when "0101" =>y(5)<='0';
when "0110" =>y(6)<='0';
when "0111" =>y(7)<='0';
when "1000" =>y(8)<='0';
when "1001" =>y(9)<='0';
when "1010" =>y(10)<='0';
when "1011" =>y(11)<='0';
when "1100" =>y(12)<='0';
when "1101" =>y(13)<='0';
when "1110" =>y(14)<='0';
when "1111" =>y(15)<='0';
when others=>null;
end case;
end if;
end process;
end behavior;
----------------------------------------------------------------------------------
-------------------------------------------------mux16_1.vhd---------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
use ieee.std_logic_arith.all;
use ieee.std_logic_unsigned.all;
entity mux16_1 is
port
(
sel_in:in std_logic_vector(15 downto 0);
p:out integer range 0 to 15
);
end mux16_1;
architecture behavior of mux16_1 is
begin
p<=0 when sel_in="1111111111111110" else
1 when sel_in="1111111111111101" else
2 when sel_in="1111111111111011" else
3 when sel_in="1111111111110111" else
4 when sel_in="1111111111101111" else
5 when sel_in="1111111111011111" else
6 when sel_in="1111111110111111" else
7 when sel_in="1111111101111111" else
8 when sel_in="1111111011111111" else
9 when sel_in="1111110111111111" else
10 when sel_in="1111101111111111" else
11 when sel_in="1111011111111111" else
12 when sel_in="1110111111111111" else
13 when sel_in="1101111111111111" else
14 when sel_in="1011111111111111" else
15 when sel_in="0111111111111111";
end behavior;
----------------------------------------------------------------------------------