2017-11-13 02:29:11 +01:00
|
|
|
library ieee;
|
|
|
|
|
|
|
|
use ieee.std_logic_1164.all;
|
|
|
|
use ieee.std_logic_unsigned.all;
|
|
|
|
use ieee.numeric_std.all;
|
|
|
|
|
|
|
|
entity main is
|
|
|
|
port (
|
|
|
|
clk: in std_logic;
|
|
|
|
|
|
|
|
dvi_d: out std_logic_vector(11 downto 0);
|
|
|
|
dvi_clk_p: out std_logic;
|
|
|
|
dvi_clk_n: out std_logic;
|
|
|
|
dvi_hsync: out std_logic;
|
|
|
|
dvi_vsync: out std_logic;
|
|
|
|
dvi_de: out std_logic;
|
|
|
|
dvi_reset: out std_logic;
|
2017-11-23 04:29:45 +01:00
|
|
|
i2c_scl: inout std_logic;
|
|
|
|
i2c_sda: inout std_logic;
|
2017-11-13 02:29:11 +01:00
|
|
|
|
2018-01-10 02:17:29 +01:00
|
|
|
ps2_scl: inout std_logic;
|
|
|
|
ps2_sda: inout std_logic;
|
|
|
|
|
2017-11-13 02:29:11 +01:00
|
|
|
switch_center: in std_logic;
|
2017-11-23 04:32:27 +01:00
|
|
|
rotary_up: in std_logic;
|
|
|
|
rotary_down: in std_logic;
|
|
|
|
rotary_push: in std_logic;
|
|
|
|
|
2018-04-24 21:58:42 +02:00
|
|
|
led: out std_logic_vector(7 downto 0)
|
2017-11-13 02:29:11 +01:00
|
|
|
);
|
|
|
|
end main;
|
|
|
|
|
2018-04-24 21:58:42 +02:00
|
|
|
architecture syn of main is
|
|
|
|
constant clk_vga_f: integer := 48_000_000;
|
2017-11-13 02:29:11 +01:00
|
|
|
signal clk_vga: std_logic;
|
2018-04-24 21:58:42 +02:00
|
|
|
|
|
|
|
signal reset: std_logic;
|
2017-11-13 02:29:11 +01:00
|
|
|
begin
|
2018-04-24 21:58:42 +02:00
|
|
|
|
|
|
|
reset <= switch_center;
|
|
|
|
|
2017-11-23 04:29:45 +01:00
|
|
|
-- convert the 100MHz to a 48MHz pixel clock
|
2017-11-13 02:29:11 +01:00
|
|
|
clock_source: entity work.clock_source port map (
|
|
|
|
CLKIN_IN => clk,
|
|
|
|
CLKFX_OUT => clk_vga
|
|
|
|
);
|
|
|
|
|
2018-04-25 23:47:50 +02:00
|
|
|
terminal: entity work.terminal port map (
|
2017-11-23 04:29:45 +01:00
|
|
|
clk => clk_vga,
|
2018-04-24 21:58:42 +02:00
|
|
|
reset => reset,
|
2017-11-23 04:29:45 +01:00
|
|
|
|
2018-04-24 23:44:13 +02:00
|
|
|
write_enable => '0',
|
|
|
|
write_data => x"00",
|
|
|
|
|
2017-11-13 02:29:11 +01:00
|
|
|
dvi_d => dvi_d,
|
2018-04-24 21:58:42 +02:00
|
|
|
dvi_clk_p => dvi_clk_p,
|
|
|
|
dvi_clk_n => dvi_clk_n,
|
|
|
|
dvi_hsync => dvi_hsync,
|
|
|
|
dvi_vsync => dvi_vsync,
|
|
|
|
dvi_de => dvi_de,
|
|
|
|
dvi_reset => dvi_reset,
|
|
|
|
i2c_scl => i2c_scl,
|
|
|
|
i2c_sda => i2c_sda
|
2017-11-23 04:32:27 +01:00
|
|
|
);
|
|
|
|
|
2018-01-10 02:17:29 +01:00
|
|
|
keyboard_i: entity work.keyboard generic map (
|
2018-04-24 21:58:42 +02:00
|
|
|
input_clk => clk_vga_f
|
2018-01-10 02:17:29 +01:00
|
|
|
) port map (
|
|
|
|
clk => clk_vga,
|
2018-04-24 21:58:42 +02:00
|
|
|
reset => reset,
|
2018-01-10 02:17:29 +01:00
|
|
|
bytes_received => led(5 downto 0),
|
|
|
|
ps2_scl => ps2_scl,
|
|
|
|
ps2_sda => ps2_sda
|
|
|
|
);
|
|
|
|
|
2018-04-24 21:58:42 +02:00
|
|
|
led(7) <= reset;
|
2018-01-10 02:17:29 +01:00
|
|
|
led(6) <= '0';
|
2018-04-24 21:58:42 +02:00
|
|
|
|
|
|
|
end syn;
|