w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
bpgenrbuslib.vhd
Go to the documentation of this file.
1-- $Id: bpgenrbuslib.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2013-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Package Name: bpgenrbuslib
7-- Description: Generic Board/Part components using rbus
8--
9-- Dependencies: -
10-- Tool versions: ise 12.1-14.7; viv 2014.4-2019.1; ghdl 0.26-0.35
11-- Revision History:
12-- Date Rev Version Comment
13-- 2017-06-11 912 1.3.2 add sn_humanio_emu_rbus
14-- 2017-06-05 907 1.3.1 rgbdrv_analog_rbus: add ACTLOW generic
15-- 2016-02-20 734 1.3 add rgbdrv_analog_rbus
16-- 2015-01-25 637 1.2 add generics to sn_humanio_rbus
17-- 2014-08-15 583 1.1 rb_mreq addr now 16 bit
18-- 2013-01-26 476 1.0 Initial version (extracted from bpgenlib)
19------------------------------------------------------------------------------
20
21library ieee;
22use ieee.std_logic_1164.all;
23use ieee.numeric_std.all;
24
25use work.slvtypes.all;
26use work.rblib.all;
27
28package bpgenrbuslib is
29
30component bp_swibtnled_rbus is -- swi,btn,led handling /w rbus icept
31 generic (
32 SWIDTH : positive := 4; -- SWI port width
33 BWIDTH : positive := 4; -- BTN port width
34 LWIDTH : positive := 4; -- LED port width
35 DEBOUNCE : boolean := true; -- instantiate debouncer for SWI,BTN
36 RB_ADDR : slv16 := x"fef0");
37 port (
38 CLK : in slbit; -- clock
39 RESET : in slbit := '0'; -- reset
40 CE_MSEC : in slbit; -- 1 ms clock enable
41 RB_MREQ : in rb_mreq_type; -- rbus: request
42 RB_SRES : out rb_sres_type; -- rbus: response
43 SWI : out slv(SWIDTH-1 downto 0); -- switch settings, debounced
44 BTN : out slv(BWIDTH-1 downto 0); -- button settings, debounced
45 LED : in slv(LWIDTH-1 downto 0); -- led data
46 I_SWI : in slv(SWIDTH-1 downto 0); -- pad-i: switches
47 I_BTN : in slv(BWIDTH-1 downto 0); -- pad-i: buttons
48 O_LED : out slv(LWIDTH-1 downto 0) -- pad-o: leds
49 );
50end component;
51
52component sn_humanio_rbus is -- human i/o handling /w rbus intercept
53 generic (
54 SWIDTH : positive := 8; -- SWI port width
55 BWIDTH : positive := 4; -- BTN port width
56 LWIDTH : positive := 8; -- LED port width
57 DCWIDTH : positive := 2; -- digit counter width (2 or 3)
58 DEBOUNCE : boolean := true; -- instantiate debouncer for SWI,BTN
59 RB_ADDR : slv16 := x"fef0");
60 port (
61 CLK : in slbit; -- clock
62 RESET : in slbit := '0'; -- reset
63 CE_MSEC : in slbit; -- 1 ms clock enable
64 RB_MREQ : in rb_mreq_type; -- rbus: request
65 RB_SRES : out rb_sres_type; -- rbus: response
66 SWI : out slv(SWIDTH-1 downto 0); -- switch settings, debounced
67 BTN : out slv(BWIDTH-1 downto 0); -- button settings, debounced
68 LED : in slv(LWIDTH-1 downto 0); -- led data
69 DSP_DAT : in slv(4*(2**DCWIDTH)-1 downto 0); -- display data
70 DSP_DP : in slv((2**DCWIDTH)-1 downto 0); -- display decimal points
71 I_SWI : in slv(SWIDTH-1 downto 0); -- pad-i: switches
72 I_BTN : in slv(BWIDTH-1 downto 0); -- pad-i: buttons
73 O_LED : out slv(LWIDTH-1 downto 0); -- pad-o: leds
74 O_ANO_N : out slv((2**DCWIDTH)-1 downto 0); -- pad-o: disp: anodes (act.low)
75 O_SEG_N : out slv8 -- pad-o: disp: segments (act.low)
76 );
77end component;
78
79component sn_humanio_demu_rbus is -- human i/o swi,btn,led only /w rbus
80 generic (
81 DEBOUNCE : boolean := true; -- instantiate debouncer for SWI,BTN
82 RB_ADDR : slv16 := x"fef0");
83 port (
84 CLK : in slbit; -- clock
85 RESET : in slbit := '0'; -- reset
86 CE_MSEC : in slbit; -- 1 ms clock enable
87 RB_MREQ : in rb_mreq_type; -- rbus: request
88 RB_SRES : out rb_sres_type; -- rbus: response
89 SWI : out slv8; -- switch settings, debounced
90 BTN : out slv4; -- button settings, debounced
91 LED : in slv8; -- led data
92 DSP_DAT : in slv16; -- display data
93 DSP_DP : in slv4; -- display decimal points
94 I_SWI : in slv8; -- pad-i: switches
95 I_BTN : in slv6; -- pad-i: buttons
96 O_LED : out slv8 -- pad-o: leds
97 );
98end component;
99
100component sn_humanio_emu_rbus is -- sn_humanio rbus emulator
101 generic (
102 SWIDTH : positive := 8; -- SWI port width
103 BWIDTH : positive := 4; -- BTN port width
104 LWIDTH : positive := 8; -- LED port width
105 DCWIDTH : positive := 2; -- digit counter width (2 or 3)
106 RB_ADDR : slv16 := x"fef0");
107 port (
108 CLK : in slbit; -- clock
109 RESET : in slbit := '0'; -- reset
110 RB_MREQ : in rb_mreq_type; -- rbus: request
111 RB_SRES : out rb_sres_type; -- rbus: response
112 SWI : out slv(SWIDTH-1 downto 0); -- switch settings, debounced
113 BTN : out slv(BWIDTH-1 downto 0); -- button settings, debounced
114 LED : in slv(LWIDTH-1 downto 0); -- led data
115 DSP_DAT : in slv(4*(2**DCWIDTH)-1 downto 0); -- display data
116 DSP_DP : in slv((2**DCWIDTH)-1 downto 0) -- display decimal points
117 );
118end component;
119
120component rgbdrv_analog_rbus is -- rgb analog from rbus
121 generic (
122 DWIDTH : positive := 8; -- dimmer width
123 ACTLOW : slbit := '0'; -- invert output polarity
124 RB_ADDR : slv16 := x"0000");
125 port (
126 CLK : in slbit; -- clock
127 RESET : in slbit := '0'; -- reset
128 RB_MREQ : in rb_mreq_type; -- rbus: request
129 RB_SRES : out rb_sres_type; -- rbus: response
130 RGBCNTL : in slv3; -- rgb control
131 DIMCNTL : in slv(DWIDTH-1 downto 0);-- dim control
132 O_RGBLED : out slv3 -- pad-o: rgb led
133 );
134end component;
135
136end package bpgenrbuslib;
Definition: rblib.vhd:32
RB_ADDR slv16 := x"0000"
in DIMCNTL slv( DWIDTH- 1 downto 0)
in RB_MREQ rb_mreq_type
out RB_SRES rb_sres_type
in RESET slbit := '0'
std_logic_vector( 2 downto 0) slv3
Definition: slvtypes.vhd:35
std_logic_vector( 15 downto 0) slv16
Definition: slvtypes.vhd:48
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector( 7 downto 0) slv8
Definition: slvtypes.vhd:40
std_logic_vector slv
Definition: slvtypes.vhd:31
in DSP_DP slv(( 2** DCWIDTH)- 1 downto 0)
RB_ADDR slv16 := x"fef0"
in DSP_DAT slv( 4*( 2** DCWIDTH)- 1 downto 0)
out SWI slv( SWIDTH- 1 downto 0)
out BTN slv( BWIDTH- 1 downto 0)
in RB_MREQ rb_mreq_type
out RB_SRES rb_sres_type
in LED slv( LWIDTH- 1 downto 0)
in DSP_DP slv(( 2** DCWIDTH)- 1 downto 0)
DEBOUNCE boolean := true
out O_LED slv( LWIDTH- 1 downto 0)
RB_ADDR slv16 := x"fef0"
in DSP_DAT slv( 4*( 2** DCWIDTH)- 1 downto 0)
DCWIDTH positive := 2
out SWI slv( SWIDTH- 1 downto 0)
in I_BTN slv( BWIDTH- 1 downto 0)
LWIDTH positive := 8
in I_SWI slv( SWIDTH- 1 downto 0)
SWIDTH positive := 8
out BTN slv( BWIDTH- 1 downto 0)
in RB_MREQ rb_mreq_type
BWIDTH positive := 4
out O_ANO_N slv(( 2** DCWIDTH)- 1 downto 0)
out RB_SRES rb_sres_type
in LED slv( LWIDTH- 1 downto 0)
in RESET slbit := '0'