ENTITY mult2_vhd_tst IS
END mult2_vhd_tst;
ARCHITECTURE mult2_arch OF mult2_vhd_tst IS
-- constants
constant ClockPeriod : TIME := 20 ns;
-- signals
SIGNAL aclr : STD_LOGIC;
SIGNAL clk_en : STD_LOGIC;
SIGNAL clock : STD_LOGIC;
SIGNAL dataa : STD_LOGIC_VECTOR(31 DOWNTO 0);
SIGNAL datab : STD_LOGIC_VECTOR(31 DOWNTO 0);
SIGNAL result : STD_LOGIC_VECTOR(31 DOWNTO 0);
COMPONENT mult2
PORT (
aclr : IN STD_LOGIC;
clk_en : IN STD_LOGIC;
clock : IN STD_LOGIC;
dataa : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
datab : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
result : OUT STD_LOGIC_VECTOR(31 DOWNTO 0)
);
END COMPONENT;
BEGIN
i1 : mult2
PORT MAP (
-- list connections between master ports and signals
aclr => aclr,
clk_en => clk_en,
clock => clock,
dataa => dataa,
datab => datab,
result => result
);
init : PROCESS
-- variable declarations
BEGIN
-- code that executes only once
aclr<='1';
clk_en<='0';
wait for 30ns;
aclr<='0';
clk_en<='1';
dataa<="01000000000000000000000000000000"; --2
datab<="01000010000000000000000000000000";--32
wait for 20ns;
--s<="001";
dataa<="00111111100000000000000000000000";-- 1
datab<="11000010100000000000000000000000"; -- -64
wait for 20ns;
--s<="001";
dataa<="00000000000000000000000000000000"; --0
datab<="00000000000000000000000000000000";--0
WAIT;
END PROCESS init;
always : PROCESS
-- optional sensitivity list
-- ( )
-- variable declarations
BEGIN
-- code executes for every event on sensitivity list
clock<='0';
wait for (ClockPeriod/2);
clock<='1';
wait for (ClockPeriod/2);
END PROCESS always;
END mult2_arch;
ENTITY mult2_vhd_tst IS
END mult2_vhd_tst;
ARCHITECTURE mult2_arch OF mult2_vhd_tst IS
-- constants
constant ClockPeriod : TIME := 20 ns;
-- signals
SIGNAL aclr : STD_LOGIC;
SIGNAL clk_en : STD_LOGIC;
SIGNAL clock : STD_LOGIC;
SIGNAL dataa : STD_LOGIC_VECTOR(31 DOWNTO 0);
SIGNAL datab : STD_LOGIC_VECTOR(31 DOWNTO 0);
SIGNAL result : STD_LOGIC_VECTOR(31 DOWNTO 0);
COMPONENT mult2
PORT (
aclr : IN STD_LOGIC;
clk_en : IN STD_LOGIC;
clock : IN STD_LOGIC;
dataa : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
datab : IN STD_LOGIC_VECTOR(31 DOWNTO 0);
result : OUT STD_LOGIC_VECTOR(31 DOWNTO 0)
);
END COMPONENT;
BEGIN
i1 : mult2
PORT MAP (
-- list connections between master ports and signals
aclr => aclr,
clk_en => clk_en,
clock => clock,
dataa => dataa,
datab => datab,
result => result
);
init : PROCESS
-- variable declarations
BEGIN
-- code that executes only once
aclr<='1';
clk_en<='0';
wait for 30ns;
aclr<='0';
clk_en<='1';
dataa<="01000000000000000000000000000000"; --2
datab<="01000010000000000000000000000000";--32
wait for 20ns;
--s<="001";
dataa<="00111111100000000000000000000000";-- 1
datab<="11000010100000000000000000000000"; -- -64
wait for 20ns;
--s<="001";
dataa<="00000000000000000000000000000000"; --0
datab<="00000000000000000000000000000000";--0
WAIT;
END PROCESS init;
always : PROCESS
-- optional sensitivity list
-- ( )
-- variable declarations
BEGIN
-- code executes for every event on sensitivity list
clock<='0';
wait for (ClockPeriod/2);
clock<='1';
wait for (ClockPeriod/2);
END PROCESS always;
END mult2_arch;