OpenCores
URL https://opencores.org/ocsvn/System09/System09/trunk

Subversion Repositories System09

[/] [System09/] [trunk/] [rtl/] [Spartan6/] [keymap_rom512_b4.vhd] - Blame information for rev 210

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 204 davidgb
--===========================================================================--
2
--                                                                           --
3
--         Synthesizable PS/2 Keyboard Key map ROM for the Spartan 2         --
4
--                                                                           --
5
--===========================================================================--
6
--
7
--  File name      : keymap_rom512_b4.vhd
8
--
9
--  Entity name    : keymap_rom 
10
--
11
--  Purpose        : PS/2 key code look up table for PS/2 Keyboard
12
--                   Converts 7 bit key code to ASCII
13
--                   Address bit 8      = Shift
14
--                   Address bit 7      = CAPS Lock
15
--                   Address bits 6 - 0 = Key code
16
--                   Data bits 6 - 0    = ASCII code
17
--                   Designed for the Spartan 2
18
--
19
--  Dependencies   : ieee.std_logic_1164
20
--                   ieee.std_logic_arith
21
--                   ieee.std_logic_unsigned
22
--
23
--  Uses           : RAMB4_S8
24
--
25
--  Author         : John E. Kent
26
--
27
--  Email          : dilbert57@opencores.org      
28
--
29
--  Web            : http://opencores.org/project,system09
30
--
31
--  Copyright (C) 2004 - 2010 John Kent
32
--
33
--  This program is free software: you can redistribute it and/or modify
34
--  it under the terms of the GNU General Public License as published by
35
--  the Free Software Foundation, either version 3 of the License, or
36
--  (at your option) any later version.
37
--
38
--  This program is distributed in the hope that it will be useful,
39
--  but WITHOUT ANY WARRANTY; without even the implied warranty of
40
--  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
41
--  GNU General Public License for more details.
42
--
43
--  You should have received a copy of the GNU General Public License
44
--  along with this program.  If not, see <http://www.gnu.org/licenses/>.
45
--
46
--===========================================================================--
47
--                                                                           --
48
--                              Revision  History                            --
49
--                                                                           --
50
--===========================================================================--
51
--
52
-- Version Date        Author     Changes
53
-- 0.1     2004-10-18  John Kent  Initial Version
54
-- 0.2     2010-06-17  John Kent  Added header, Rename data signals
55
--
56
--
57
library IEEE;
58
use IEEE.STD_LOGIC_1164.ALL;
59
use IEEE.STD_LOGIC_ARITH.ALL;
60
library unisim;
61
        use unisim.vcomponents.all;
62
 
63
 
64
entity keymap_rom is
65
    Port (
66
       clk      : in  std_logic;
67
       rst      : in  std_logic;
68
       cs       : in  std_logic;
69
       rw       : in  std_logic;
70
       addr     : in  std_logic_vector (8 downto 0);
71
       data_in  : in  std_logic_vector (7 downto 0);
72
       data_out : out std_logic_vector (7 downto 0)
73
    );
74
end keymap_rom;
75
 
76
architecture rtl of keymap_rom is
77
   type data_array is array(0 to 0) of std_logic_vector(7 downto 0);
78
   signal xdata : data_array;
79
   signal en : std_logic_vector(0 downto 0);
80
   signal dp : std_logic_vector(0 downto 0);
81
   signal we : std_logic;
82
        signal xaddr : std_logic_vector(10 downto 0);
83
begin
84
 
85
  ROM : RAMB16_S9
86
    generic map (
87
    INIT_00 => x"00327761737a0000003171000000000000600900000000000000000000000000",
88
    INIT_01 => x"003837756a6d00000036796768626e0000357274667620000033346564786300",
89
    INIT_02 => x"00005c005d0d000000003d5b00270000002d703b6c2f2e000039306f696b2c00",
90
    INIT_03 => x"0000000000000000001b000000007f0000000000000000000008000000000000",
91
    INIT_04 => x"00325741535a00000031510000000000007e0900000000000000000000000000",
92
    INIT_05 => x"003837554a4d00000036594748424e0000355254465620000033344544584300",
93
    INIT_06 => x"00005c005d0d000000003d5b00270000002d503b4c2f2e000039304f494b2c00",
94
    INIT_07 => x"0000000000000000001b000000007f0000000000000000000008000000000000",
95
    INIT_08 => x"00405741535a00000021510000000000007e0900000000000000000000000000",
96
    INIT_09 => x"002a26554a4d0000005e594748424e0000255254465620000023244544584300",
97
    INIT_0A => x"00007c007d0d000000002b7b00220000005f503a4c3f3e000028294f494b3c00",
98
    INIT_0B => x"0000000000000000001b000000007f0000000000000000000008000000000000",
99
    INIT_0C => x"00407761737a0000002171000000000000600900000000000000000000000000",
100
    INIT_0D => x"002a26756a6d0000005e796768626e0000257274667620000023246564786300",
101
    INIT_0E => x"00007c007d0d000000002b7b00220000005f703a6c3f3e000028296f696b3c00",
102
    INIT_0F => x"0000000000000000001b000000007f0000000000000000000008000000000000"
103
    )
104
 
105
      port map (
106
         CLK     => clk,
107
         SSR     => rst,
108
         EN      => en(0),
109
         WE      => we,
110
         ADDR    => xaddr,
111
         DI      => data_in,
112
         DIP(0)  => dp(0),
113
         DO      => xdata(0),
114
         DOP(0)  => dp(0)
115
      );
116
   rom_glue: process (cs, rw, addr, xdata)
117
   begin
118
      en(0)  <= cs;
119
      data_out  <= xdata(0);
120
      we <= not rw;
121
                xaddr(8 downto 0) <= addr;
122
                xaddr(10 downto 9) <= (others => '0');
123
   end process;
124
 
125
end architecture rtl;
126
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.