1 |
13 |
wfjm |
-- $Id: rbdlib.vhd 427 2011-11-19 21:04:11Z mueller $
|
2 |
9 |
wfjm |
--
|
3 |
13 |
wfjm |
-- Copyright 2010-2011 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
4 |
9 |
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 |
|
|
-- Package Name: rbdlib
|
16 |
|
|
-- Description: Definitions for rbus devices
|
17 |
|
|
--
|
18 |
|
|
-- Dependencies: -
|
19 |
13 |
wfjm |
-- Tool versions: xst 12.1, 13.1; ghdl 0.29
|
20 |
9 |
wfjm |
--
|
21 |
|
|
-- Revision History:
|
22 |
|
|
-- Date Rev Version Comment
|
23 |
13 |
wfjm |
-- 2011-11-19 427 1.2.1 now numeric_std clean
|
24 |
9 |
wfjm |
-- 2010-12-29 351 1.2 new address layout; add rbd_timer
|
25 |
|
|
-- 2010-12-27 349 1.1 now correct defs for _rbmon and _eyemon
|
26 |
|
|
-- 2010-12-04 343 1.0 Initial version
|
27 |
|
|
------------------------------------------------------------------------------
|
28 |
|
|
--
|
29 |
|
|
-- base addresses of some standard rbus devices
|
30 |
|
|
--
|
31 |
|
|
-- rbd_rbmon 111111xx -++-- these three used as monitors
|
32 |
|
|
-- rbd_eyemon 111110xx /
|
33 |
|
|
-- rbd_rlstat 1111011x /
|
34 |
|
|
-- rbd_bram 1111010x \
|
35 |
|
|
-- rbd_tester 111100xx +- all five used in test benchs
|
36 |
|
|
--
|
37 |
|
|
|
38 |
|
|
|
39 |
|
|
library ieee;
|
40 |
|
|
use ieee.std_logic_1164.all;
|
41 |
13 |
wfjm |
use ieee.numeric_std.all;
|
42 |
9 |
wfjm |
|
43 |
|
|
use work.slvtypes.all;
|
44 |
|
|
use work.rblib.all;
|
45 |
|
|
|
46 |
|
|
package rbdlib is
|
47 |
13 |
wfjm |
|
48 |
|
|
-- ise 13.1 xst can bug check if generic defaults in a package are defined via
|
49 |
|
|
-- 'slv(to_unsigned())'. The conv_ construct prior to numeric_std was ok.
|
50 |
|
|
-- As workaround the ibus default addresses are defined here as constant.
|
51 |
|
|
constant rbaddr_tester : slv8 := slv(to_unsigned(2#11110000#,8));
|
52 |
|
|
constant rbaddr_bram : slv8 := slv(to_unsigned(2#11110100#,8));
|
53 |
|
|
constant rbaddr_rbmon : slv8 := slv(to_unsigned(2#11111100#,8));
|
54 |
|
|
constant rbaddr_eyemon : slv8 := slv(to_unsigned(2#11111000#,8));
|
55 |
|
|
constant rbaddr_timer : slv8 := slv(to_unsigned(2#00000000#,8));
|
56 |
9 |
wfjm |
|
57 |
|
|
component rbd_tester is -- rbus dev: rbus tester
|
58 |
|
|
-- complete rbus_aif interface
|
59 |
|
|
generic (
|
60 |
13 |
wfjm |
RB_ADDR : slv8 := rbaddr_tester);
|
61 |
9 |
wfjm |
port (
|
62 |
|
|
CLK : in slbit; -- clock
|
63 |
|
|
RESET : in slbit; -- reset
|
64 |
|
|
RB_MREQ : in rb_mreq_type; -- rbus: request
|
65 |
|
|
RB_SRES : out rb_sres_type; -- rbus: response
|
66 |
|
|
RB_LAM : out slv16; -- rbus: look at me
|
67 |
|
|
RB_STAT : out slv3 -- rbus: status flags
|
68 |
|
|
);
|
69 |
|
|
end component;
|
70 |
|
|
|
71 |
|
|
component rbd_bram is -- rbus dev: bram test target
|
72 |
|
|
-- incomplete rbus_aif interface
|
73 |
|
|
generic (
|
74 |
13 |
wfjm |
RB_ADDR : slv8 := rbaddr_bram);
|
75 |
9 |
wfjm |
port (
|
76 |
|
|
CLK : in slbit; -- clock
|
77 |
|
|
RESET : in slbit; -- reset
|
78 |
|
|
RB_MREQ : in rb_mreq_type; -- rbus: request
|
79 |
|
|
RB_SRES : out rb_sres_type -- rbus: response
|
80 |
|
|
);
|
81 |
|
|
end component;
|
82 |
|
|
|
83 |
|
|
component rbd_rbmon is -- rbus dev: rbus monitor
|
84 |
|
|
generic (
|
85 |
13 |
wfjm |
RB_ADDR : slv8 := rbaddr_rbmon;
|
86 |
9 |
wfjm |
AWIDTH : positive := 9);
|
87 |
|
|
port (
|
88 |
|
|
CLK : in slbit; -- clock
|
89 |
|
|
RESET : in slbit; -- reset
|
90 |
|
|
RB_MREQ : in rb_mreq_type; -- rbus: request
|
91 |
|
|
RB_SRES : out rb_sres_type; -- rbus: response
|
92 |
|
|
RB_SRES_SUM : in rb_sres_type -- rbus: response (sum for monitor)
|
93 |
|
|
);
|
94 |
|
|
end component;
|
95 |
|
|
|
96 |
|
|
component rbd_eyemon is -- rbus dev: eye monitor for serport's
|
97 |
|
|
generic (
|
98 |
13 |
wfjm |
RB_ADDR : slv8 := rbaddr_eyemon;
|
99 |
|
|
RDIV : slv8 := (others=>'0'));
|
100 |
9 |
wfjm |
port (
|
101 |
|
|
CLK : in slbit; -- clock
|
102 |
|
|
RESET : in slbit; -- reset
|
103 |
|
|
RB_MREQ : in rb_mreq_type; -- rbus: request
|
104 |
|
|
RB_SRES : out rb_sres_type; -- rbus: response
|
105 |
|
|
RXSD : in slbit; -- rx: serial data
|
106 |
|
|
RXACT : in slbit -- rx: active (start seen)
|
107 |
|
|
);
|
108 |
|
|
end component;
|
109 |
|
|
|
110 |
|
|
component rbd_timer is -- rbus dev: usec precision timer
|
111 |
|
|
generic (
|
112 |
13 |
wfjm |
RB_ADDR : slv8 := rbaddr_timer);
|
113 |
9 |
wfjm |
port (
|
114 |
|
|
CLK : in slbit; -- clock
|
115 |
|
|
CE_USEC : in slbit; -- usec pulse
|
116 |
|
|
RESET : in slbit; -- reset
|
117 |
|
|
RB_MREQ : in rb_mreq_type; -- rbus: request
|
118 |
|
|
RB_SRES : out rb_sres_type; -- rbus: response
|
119 |
|
|
DONE : out slbit; -- mark last timer cycle
|
120 |
|
|
BUSY : out slbit -- timer running
|
121 |
|
|
);
|
122 |
|
|
end component;
|
123 |
|
|
|
124 |
|
|
end package rbdlib;
|