-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDE0_pkg.vhd
55 lines (47 loc) · 1.39 KB
/
DE0_pkg.vhd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
-- Title:
-- File: DE0_pkg.vhd
-- Author:
-- Date:
-- Description: Terasic DE0 board
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.math_real.all;
-- package
package DE0_pkg is
-- DE0 clock
constant DE0_clk_freq_c : real := 50.0E6;
constant DE0_cycle_time_c : time := 1.0 sec / DE0_clk_freq_c;
-- emulated clock
-- use for circuit demos on DE0
constant em_clk_freq_c : real := 5.0;
constant em_cycle_time_c : time := 1.0 sec / em_clk_freq_c;
-- basic I/O
constant leds_c : natural := 10#10#;
constant digits_c : natural := 10#4#;
constant switches_c : natural := 10#10#;
constant buttons_c : natural := 10#3#;
-- 7 segment display
constant dp_c : std_logic := '0';
subtype hex_display_t is std_logic_vector(6 downto 0);
type hex_display_array_t is array (0 to 15) of hex_display_t;
constant hex_display_array_c : hex_display_array_t := (
-- inverted logic on de0_board
("1000000"), -- 0
("1111001"), -- 1
("0100100"), -- 2
("0110000"), -- 3
("0011001"), -- 4
("0010010"), -- 5
("0000010"), -- 6
("1111000"), -- 7
("0000000"), -- 8
("0010000"), -- 9
("0001000"), -- A
("1111100"), -- b
("1000110"), -- C
("0100001"), -- d
("0000110"), -- E
("0001110") -- F
);
end DE0_pkg;