First working switches testbench

This commit is contained in:
2022-11-05 21:09:55 +01:00
parent 233cd9014b
commit 7ba04fe6c2
3 changed files with 92 additions and 5 deletions

View File

@@ -7,7 +7,7 @@ use work.lt16x32_global.all;
use work.wishbone.all;
use work.config.all;
entity wb_led is
entity wb_switches is
generic(
memaddr : generic_addr_type; --:= CFG_BADR_LED;
addrmask : generic_mask_type --:= CFG_MADR_LED;
@@ -19,11 +19,11 @@ entity wb_led is
wslvo : out wb_slv_out_type;
buttons : in std_logic_vector(4 downto 0);
switches : in std_logic_vector(15 downto 0);
switches : in std_logic_vector(15 downto 0)
);
end wb_led;
end wb_switches;
architecture Behavioral of wb_led is
architecture Behavioral of wb_switches is
signal data : std_logic_vector(20 downto 0);
signal ack : std_logic;
@@ -35,7 +35,7 @@ begin
if clk'event and clk='1' then
if rst = '1' then
ack <= '0';
data <= x"0F";
data <= (others=>'0');
else
if wslvi.stb = '1' and wslvi.cyc = '1' then
data(15 downto 0) <= switches;