vt52-fpga
1.0.0 Initial
vt52-fpga is a serial terminal implemented on a FPGA
keymap_rom.v
Go to the documentation of this file.
1
/**
2
* Keymap ROM (2KB, maps keycodes to ASCII chars)
3
* This could be a RAM to allow keymap modifications, but not for now
4
* There's 8 planes for each keycode (controlled by the highest three bits)
5
* MSB is for long keycode vs short keycode, the the next two bits:
6
* 00: no shift or caps lock
7
* 01: just shift
8
* 10: just caps lock
9
* 11: caps lock & shift
10
*/
11
module
keymap_rom
12
(input clk,
13
input [10:0] addr,
14
output [7:0] dout_
15
);
16
17
reg [7:0] dout_;
18
reg [7:0] mem [2047:0];
19
20
integer i;
21
22
initial begin
23
// the hex file is sparse, prefill with zeros
24
// XXX yosys doesn't like this, it overrides the readmemh
25
// so for now just assume that all other positions have zeros...
26
// for (i = 0; i < 2047; i = i + 1) mem[i] = "b";
27
$readmemh(
"keymap.mem"
, mem) ;
28
end
29
30
always
@(posedge clk) begin
31
dout_ = mem[addr];
32
end
33
endmodule
keymap_rom
module keymap_rom(input clk, input[10:0] addr, output[8] dout_)
Keymap ROM (2KB, maps keycodes to ASCII chars) This could be a RAM to allow keymap modifications,...
Definition:
keymap_rom.v:12
always
always(posedge clk)
Definition:
uart_rx.v:86
keymap_rom.v
Generated on Fri Jan 27 2023 16:39:57 for vt52-fpga by
1.9.1