VHDL Notes
VHDL Notes
--- option 2
-signal generation for testbench-- reset <= '1' after 10ns, '0' after 20ns;
--- option 3
--after, wait for and now are used for reset <= '0';
constructing testbench wait for 10ns;
if(now<50ns) then reset <= '1';
wait for 50ns-NOW; wait for 10ns;
y <= x; reset <= '0';
end if; wait;
----g------enerate clk--------------- -------- generate signal --------
signal clk: std_logic := '0'; signal x: std_logic := '1';
--- option 1 --- option1
clk <= not clk after 10ns; x <= '1', '0' after 20ns,'1' after 30ns,
--- option 2 '0' after 40ns, '1' after 80ns;
wait for 10ns; --- option2
clk <= not clk; x='1'; wait for 20ns;x='0'; wait for 10ns;
--- option 3 --- option 3: template
wait for 10ns; constant template:std_logic_vector(1 to 9)
clk <= '1'; := "110100001";
wait for 10ns; for i In template'range loop
clk <= '0'; x <= template(i);
-------- generate reset------------- wait for 10ns;
signal reset:=std_logic :='0'; end loop;
--- option 1
reset <= '0','1' after 10 ns, '0' after
20ns;