vhdl/basics/signal/signal_tb.vhd (706B)
1 entity signal_tb is 2 end entity; 3 4 architecture signal_arq of signal_tb is 5 6 -- signals are accessible to any process across the architecture 7 signal sig_a : integer := 0; 8 9 begin 10 process is 11 12 -- variables are only local to the process 13 variable var_x : integer := 0; 14 15 begin 16 17 -- variables update its value inmediatly while signals only update when 18 -- the process pauses, for example on a `wait` stament or when the 19 -- process starts again 20 21 var_x := var_x + 1; 22 sig_a <= sig_a + 1; 23 24 report "var_x: " & integer'image(var_x); 25 report "sig_a: " & integer'image(sig_a); 26 27 wait for 500 us; 28 29 end process; 30 end architecture;
