1 |
19 |
dilbert57 |
---------------------------------------------------------
|
2 |
|
|
--
|
3 |
|
|
-- PS2 Keycode look up table
|
4 |
|
|
-- converts 7 bit key code to ASCII
|
5 |
|
|
-- Address bit 7 = CAPS Lock
|
6 |
|
|
-- Address bit 8 = Shift
|
7 |
|
|
--
|
8 |
|
|
-- J.E.Kent
|
9 |
|
|
-- 18th Oct 2004
|
10 |
|
|
--
|
11 |
|
|
library IEEE;
|
12 |
|
|
use IEEE.STD_LOGIC_1164.ALL;
|
13 |
|
|
use IEEE.STD_LOGIC_ARITH.ALL;
|
14 |
|
|
library unisim;
|
15 |
|
|
use unisim.vcomponents.all;
|
16 |
|
|
|
17 |
|
|
entity keymap_rom is
|
18 |
|
|
Port (
|
19 |
|
|
clk : in std_logic;
|
20 |
|
|
rst : in std_logic;
|
21 |
|
|
cs : in std_logic;
|
22 |
|
|
rw : in std_logic;
|
23 |
|
|
addr : in std_logic_vector (8 downto 0);
|
24 |
|
|
rdata : out std_logic_vector (7 downto 0);
|
25 |
|
|
wdata : in std_logic_vector (7 downto 0)
|
26 |
|
|
);
|
27 |
|
|
end keymap_rom;
|
28 |
|
|
|
29 |
|
|
architecture rtl of keymap_rom is
|
30 |
|
|
|
31 |
|
|
|
32 |
|
|
signal we : std_logic;
|
33 |
|
|
|
34 |
|
|
begin
|
35 |
|
|
|
36 |
|
|
ROM : RAMB4_S8
|
37 |
|
|
generic map (
|
38 |
|
|
INIT_00 => x"00327761737a0000003171000000000000600900000000000000000000000000", -- 1F - 00
|
39 |
|
|
INIT_01 => x"003837756a6d00000036796768626e0000357274667620000033346564786300", -- 3F - 20
|
40 |
|
|
INIT_02 => x"00005c005d0d000000003d5b00270000002d703b6c2f2e000039306f696b2c00", -- 5F - 40
|
41 |
|
|
INIT_03 => x"0000000000000000001b000000007f0000000000000000000008000000000000", -- 7F - 60
|
42 |
|
|
INIT_04 => x"00325741535a00000031510000000000007e0900000000000000000000000000", -- 9F - 80
|
43 |
|
|
INIT_05 => x"003837554a4d00000036594748424e0000355254465620000033344544584300", -- BF - A0
|
44 |
|
|
INIT_06 => x"00005c005d0d000000003d5b00270000002d503b4c2f2e000039304f494b2c00", -- DF - C0
|
45 |
|
|
INIT_07 => x"0000000000000000001b000000007f0000000000000000000008000000000000", -- FF - E0
|
46 |
|
|
INIT_08 => x"00405741535a00000021510000000000007e0900000000000000000000000000", -- 1F - 00
|
47 |
|
|
INIT_09 => x"002a26554a4d0000005e594748424e0000255254465620000023244544584300", -- 3F - 20
|
48 |
|
|
INIT_0A => x"00007c007d0d000000002b7b00220000005f503a4c3f3e000028294f494b3c00", -- 5F - 40
|
49 |
|
|
INIT_0B => x"0000000000000000001b000000007f0000000000000000000008000000000000", -- 7F - 60
|
50 |
|
|
INIT_0C => x"00407761737a0000002171000000000000600900000000000000000000000000", -- 9F - 80
|
51 |
|
|
INIT_0D => x"002a26756a6d0000005e796768626e0000257274667620000023246564786300", -- BF - A0
|
52 |
|
|
INIT_0E => x"00007c007d0d000000002b7b00220000005f703a6c3f3e000028296f696b3c00", -- DF - C0
|
53 |
|
|
INIT_0F => x"0000000000000000001b000000007f0000000000000000000008000000000000" -- FF - E0
|
54 |
|
|
)
|
55 |
|
|
|
56 |
|
|
port map (
|
57 |
|
|
clk => clk,
|
58 |
|
|
en => cs,
|
59 |
|
|
we => we,
|
60 |
|
|
rst => rst,
|
61 |
|
|
addr => addr,
|
62 |
|
|
di => wdata,
|
63 |
|
|
do => rdata
|
64 |
|
|
);
|
65 |
|
|
|
66 |
|
|
|
67 |
|
|
my_keymap_rom_b4 : process ( rw )
|
68 |
|
|
begin
|
69 |
|
|
we <= not rw;
|
70 |
|
|
end process;
|
71 |
|
|
|
72 |
|
|
end architecture rtl;
|
73 |
|
|
|