-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCSA-32bit-Test-Bench
More file actions
33 lines (29 loc) · 953 Bytes
/
CSA-32bit-Test-Bench
File metadata and controls
33 lines (29 loc) · 953 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.STD_LOGIC_ARITH.ALL;
entity Sim_CSA32b is
end Sim_CSA32b;
architecture Behavioral of Sim_CSA32b is
component CarrySelect32b is
Port ( A_cs : in STD_LOGIC_VECTOR (31 downto 0);
B_cs : in STD_LOGIC_VECTOR (31 downto 0);
Cin_cs: in STD_LOGIC;
S_cs : out STD_LOGIC_VECTOR (31 downto 0));
end component;
signal IA, IB, Osum : STD_LOGIC_VECTOR(31 downto 0);
signal Icin : STD_LOGIC;
begin
--instantiate the Unit Under Test (UUT)
uut: CarrySelect32b port map(IA, IB, Icin, Osum);
--simulazione esaustiva
ICin <= '0';
CSA: PROCESS BEGIN
for i in 1073741820 to 1073741830 loop
IA<= CONV_STD_LOGIC_VECTOR(i, 32);
for j in 2147483630 to 2147483640 loop
IB<= CONV_STD_LOGIC_VECTOR(j, 32);
wait for 20ns;
end loop;
end loop;
END PROCESS;
end Behavioral;