23use ieee.std_logic_1164.
all;
24use ieee.numeric_std.
all;
95 report "assert(BWIDTH>=4): at least 4 BTNs available"
98 B4YES: if BWIDTH > 4 generate
101 B4NO: if BWIDTH = 4 generate
108 if rising_edge(CLK) then
116 end process proc_regs;
122 variable btn03 : slv4 := (others=>'0');
131 if SWI/=r.swi_1 or BTN/=r.btn_1 then
132 n.tcnt := slv(unsigned(r.tcnt) + 1);
135 btn03 := BTN(3 downto 0);
138 if unsigned(BTN) /= 0 then
153 n.tcnt := (others=>'0');
176 n.cnt := slv(unsigned(r.cnt) + 1);
177 if unsigned(r.cnt(8 downto 0)) = 0 then
178 n.rndm := crc8_update(r.rndm, SWI);
183 if r.allon = '1' then
184 n.led := (others=>'1');
185 n.dsp := (others=>'1');
186 n.dp := (others=>'1');
193 n.dsp(7 downto 0) := r.rndm;
194 n.dsp(15 downto 8) := not r.rndm;
197 n.led := r.cnt(14 downto 7);
202 n.dsp(7 downto 0) := SWI;
203 n.dsp(15 downto 8) := not SWI;
212 n.dp := BTN(3 downto 0);
222 end process proc_next;
std_logic_vector( 3 downto 0) slv4
std_logic_vector( 15 downto 0) slv16
std_logic_vector( 7 downto 0) slv8
std_logic_vector( 1 downto 0) slv2
regs_type := regs_init N_REGS
slv8 := "01010101" rndminit
slv( BWIDTH- 1 downto 0) :=( others => '0') btnzero
regs_type := regs_init R_REGS
regs_type :=( c_mode_rndm, '0',( others => '0'),( others => '0'), rndminit,( others => '0'), btnzero,( others => '0'),( others => '0'),( others => '0')) regs_init
in BTN slv( BWIDTH- 1 downto 0)