entity PRIMO is
port(SEL,A,B: in bit;
Z: out bit);
end PRIMO;
architecture ARCH_PRIMO of PRIMO is
begin
P: process(SEL)
begin
if(SEL ='0')
then
Z<=A;
else
Z<=B;
end if;
end process;
end ARCH_PRIMO;
e relativo testbench
architecture BEHAV of TESTBENCH is
component UUT
port(SEL,A,B:in bit;
Z:out bit);
end component;
signal SEL_S,A_S,B_S,Z_S:bit;
begin
TEST_UNIT: UUT port map(SEL_S,A_S,B_S,Z_S);
process
begin
SEL_S <= '0'; wait for 10 ns;
SEL_S <= '1'; wait for 10 ns;
end process;
process
begin
A_S <= '0'; wait for 2 ns;
A_S <= '1'; wait for 2 ns;
end process;
process
begin
B_S <= '0'; wait for 4 ns;
B_S <= '1'; wait for 4 ns;
end process;
end BEHAV;
In pratica l'uscita Z rimane sempre a 0, non funzionano gli assegnamenti
Qualcuno sa aiutarmi?
P.s: ho diversi esercizi con problemi simili, ne risolviamo uno alla volta ?