Make switches module ready for real board

This commit is contained in:
2022-11-12 20:17:26 +01:00
parent 85112d9938
commit 62173ffb5e
3 changed files with 19 additions and 6 deletions

View File

@@ -21,7 +21,8 @@ timer_status_addr: .word 0x000F000C
dmem_start_addr: .word 0x00000400
dmem_end_addr: .word 0x000004FC
priority_mask: .word 0xFFFFFF03
timer_target_value: .word 127 // change for simulation / real board
// timer_target_value: .word 127 // for simulation
timer_target_value: .word 65536 // for real board
main:
// Initialize stack pointer to the end of the data memory

View File

@@ -38,8 +38,10 @@ begin
data <= (others=>'0');
else
if wslvi.stb = '1' and wslvi.cyc = '1' then
if wslvi.we='0' then
data(15 downto 0) <= switches;
data(20 downto 16) <= buttons;
end if;
if ack = '0' then
ack <= '1';

View File

@@ -57,15 +57,25 @@ BEGIN
switches <= "1001000101010111";
wait for CLK_PERIOD;
data <= (others => '0');
generate_sync_wb_single_read(slvi,slvo,clk,data);
wait for 2 ns;
data <= (others => '0');
generate_sync_wb_single_read(slvi,slvo,clk,data);
wait;
buttons <= "11011";
switches <= x"DEAD";
wait for 10 ns;
generate_sync_wb_single_read(slvi,slvo,clk,data, SIZE => "00"); -- Single byte
wait for 10 ns;
generate_sync_wb_single_read(slvi,slvo,clk,data, SIZE => "01"); -- Half word
wait for 100 ns;
assert false report "Simulation terminated!" severity failure;
end process stimuli;
END ARCHITECTURE;