-- implement slave model software accessible register(s) read mux
SLAVE_REG_READ_PROC : process( slv_reg_read_sel, slv_reg0 ) is
begin
case slv_reg_read_sel is
when "1" => slv_ip2bus_data <= slv_reg0(1 downto 0) & "00" & count;
when others => slv_ip2bus_data <= (others => '0');
end case;
end process SLAVE_REG_READ_PROC;
------------------------------------------
-- Example code to drive IP to Bus signals
------------------------------------------
IP2Bus_Data <= slv_ip2bus_data when slv_read_ack = '1' else
(others => '0');
IP2Bus_WrAck <= slv_write_ack;
IP2Bus_RdAck <= slv_read_ack;
IP2Bus_Error <= '0';
-- Create Counter
-- Use slv_reg0 value to enable counter (LSB = '1' to run, LSB = '0' to stop)
counter : process(Bus2IP_Clk) begin
if Bus2IP_Clk'event and Bus2IP_Clk='1' then
if Bus2IP_Resetn = '0' then
count <= (others => '0');
else
if slv_reg0(1 downto 0) = "01" then
count <= count + 1;
elsif slv_reg0(1 downto 0) = "10" then
count <= count + 2;
end if;
end if;
end if;
end process counter;
-- Attach slowest bits to LEDs
LEDs(3 downto 0) <= count(27 downto 24);
日 | 月 | 火 | 水 | 木 | 金 | 土 |
---|---|---|---|---|---|---|
- | - | - | - | - | 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 |