1 |
19 |
wfjm |
-- $Id: bpgenrbuslib.vhd 476 2013-01-26 22:23:53Z mueller $
|
2 |
12 |
wfjm |
--
|
3 |
19 |
wfjm |
-- Copyright 2013- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
4 |
12 |
wfjm |
--
|
5 |
|
|
-- This program is free software; you may redistribute and/or modify it under
|
6 |
|
|
-- the terms of the GNU General Public License as published by the Free
|
7 |
|
|
-- Software Foundation, either version 2, or at your option any later version.
|
8 |
|
|
--
|
9 |
|
|
-- This program is distributed in the hope that it will be useful, but
|
10 |
|
|
-- WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
|
11 |
|
|
-- or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
12 |
|
|
-- for complete details.
|
13 |
|
|
--
|
14 |
|
|
------------------------------------------------------------------------------
|
15 |
19 |
wfjm |
-- Package Name: bpgenrbuslib
|
16 |
|
|
-- Description: Generic Board/Part components using rbus
|
17 |
12 |
wfjm |
--
|
18 |
|
|
-- Dependencies: -
|
19 |
18 |
wfjm |
-- Tool versions: 12.1, 13.3; ghdl 0.26-0.29
|
20 |
12 |
wfjm |
-- Revision History:
|
21 |
|
|
-- Date Rev Version Comment
|
22 |
19 |
wfjm |
-- 2013-01-26 476 1.0 Initial version (extracted from bpgenlib)
|
23 |
12 |
wfjm |
------------------------------------------------------------------------------
|
24 |
|
|
|
25 |
|
|
library ieee;
|
26 |
|
|
use ieee.std_logic_1164.all;
|
27 |
13 |
wfjm |
use ieee.numeric_std.all;
|
28 |
12 |
wfjm |
|
29 |
|
|
use work.slvtypes.all;
|
30 |
|
|
use work.rblib.all;
|
31 |
|
|
|
32 |
19 |
wfjm |
package bpgenrbuslib is
|
33 |
12 |
wfjm |
|
34 |
|
|
component bp_swibtnled_rbus is -- swi,btn,led handling /w rbus icept
|
35 |
|
|
generic (
|
36 |
|
|
SWIDTH : positive := 4; -- SWI port width
|
37 |
|
|
BWIDTH : positive := 4; -- BTN port width
|
38 |
|
|
LWIDTH : positive := 4; -- LED port width
|
39 |
|
|
DEBOUNCE : boolean := true; -- instantiate debouncer for SWI,BTN
|
40 |
13 |
wfjm |
RB_ADDR : slv8 := slv(to_unsigned(2#10000000#,8)));
|
41 |
12 |
wfjm |
port (
|
42 |
|
|
CLK : in slbit; -- clock
|
43 |
|
|
RESET : in slbit := '0'; -- reset
|
44 |
|
|
CE_MSEC : in slbit; -- 1 ms clock enable
|
45 |
|
|
RB_MREQ : in rb_mreq_type; -- rbus: request
|
46 |
|
|
RB_SRES : out rb_sres_type; -- rbus: response
|
47 |
|
|
SWI : out slv(SWIDTH-1 downto 0); -- switch settings, debounced
|
48 |
|
|
BTN : out slv(BWIDTH-1 downto 0); -- button settings, debounced
|
49 |
|
|
LED : in slv(LWIDTH-1 downto 0); -- led data
|
50 |
|
|
I_SWI : in slv(SWIDTH-1 downto 0); -- pad-i: switches
|
51 |
|
|
I_BTN : in slv(BWIDTH-1 downto 0); -- pad-i: buttons
|
52 |
|
|
O_LED : out slv(LWIDTH-1 downto 0) -- pad-o: leds
|
53 |
|
|
);
|
54 |
|
|
end component;
|
55 |
|
|
|
56 |
|
|
component sn_humanio_rbus is -- human i/o handling /w rbus intercept
|
57 |
|
|
generic (
|
58 |
|
|
BWIDTH : positive := 4; -- BTN port width
|
59 |
|
|
DEBOUNCE : boolean := true; -- instantiate debouncer for SWI,BTN
|
60 |
13 |
wfjm |
RB_ADDR : slv8 := slv(to_unsigned(2#10000000#,8)));
|
61 |
12 |
wfjm |
port (
|
62 |
|
|
CLK : in slbit; -- clock
|
63 |
|
|
RESET : in slbit := '0'; -- reset
|
64 |
|
|
CE_MSEC : in slbit; -- 1 ms clock enable
|
65 |
|
|
RB_MREQ : in rb_mreq_type; -- rbus: request
|
66 |
|
|
RB_SRES : out rb_sres_type; -- rbus: response
|
67 |
|
|
SWI : out slv8; -- switch settings, debounced
|
68 |
|
|
BTN : out slv(BWIDTH-1 downto 0); -- button settings, debounced
|
69 |
|
|
LED : in slv8; -- led data
|
70 |
|
|
DSP_DAT : in slv16; -- display data
|
71 |
|
|
DSP_DP : in slv4; -- display decimal points
|
72 |
|
|
I_SWI : in slv8; -- pad-i: switches
|
73 |
|
|
I_BTN : in slv(BWIDTH-1 downto 0); -- pad-i: buttons
|
74 |
|
|
O_LED : out slv8; -- pad-o: leds
|
75 |
|
|
O_ANO_N : out slv4; -- pad-o: 7 seg disp: anodes (act.low)
|
76 |
|
|
O_SEG_N : out slv8 -- pad-o: 7 seg disp: segments (act.low)
|
77 |
|
|
);
|
78 |
|
|
end component;
|
79 |
|
|
|
80 |
18 |
wfjm |
component sn_humanio_demu_rbus is -- human i/o swi,btn,led only /w rbus
|
81 |
|
|
generic (
|
82 |
|
|
DEBOUNCE : boolean := true; -- instantiate debouncer for SWI,BTN
|
83 |
|
|
RB_ADDR : slv8 := slv(to_unsigned(2#10000000#,8)));
|
84 |
|
|
port (
|
85 |
|
|
CLK : in slbit; -- clock
|
86 |
|
|
RESET : in slbit := '0'; -- reset
|
87 |
|
|
CE_MSEC : in slbit; -- 1 ms clock enable
|
88 |
|
|
RB_MREQ : in rb_mreq_type; -- rbus: request
|
89 |
|
|
RB_SRES : out rb_sres_type; -- rbus: response
|
90 |
|
|
SWI : out slv8; -- switch settings, debounced
|
91 |
|
|
BTN : out slv4; -- button settings, debounced
|
92 |
|
|
LED : in slv8; -- led data
|
93 |
|
|
DSP_DAT : in slv16; -- display data
|
94 |
|
|
DSP_DP : in slv4; -- display decimal points
|
95 |
|
|
I_SWI : in slv8; -- pad-i: switches
|
96 |
|
|
I_BTN : in slv6; -- pad-i: buttons
|
97 |
|
|
O_LED : out slv8 -- pad-o: leds
|
98 |
|
|
);
|
99 |
|
|
end component;
|
100 |
|
|
|
101 |
19 |
wfjm |
end package bpgenrbuslib;
|