OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.74/] [rtl/] [vlib/] [rbus/] [rblib.vhd] - Blame information for rev 38

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 35 wfjm
-- $Id: rblib.vhd 741 2016-03-12 23:49:03Z mueller $
2 2 wfjm
--
3 35 wfjm
-- Copyright 2007-2016 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4 2 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 9 wfjm
-- Package Name:   rblib
16
-- Description:    Definitions for rbus interface and bus entities
17 2 wfjm
--
18
-- Dependencies:   -
19 35 wfjm
-- Tool versions:  ise 8.2-14.7; viv 2014.4-2015.4; ghdl 0.18-0.33
20 9 wfjm
--
21 2 wfjm
-- Revision History: 
22
-- Date         Rev Version  Comment
23 35 wfjm
-- 2016-03-12   741   4.1    add rb_sres_6
24 27 wfjm
-- 2014-09-14   593   4.0    use new rlink v4 iface and 4 bit STAT
25
-- 2014-08-15   583   3.5    rb_mreq addr now 16 bit
26 17 wfjm
-- 2011-12-23   444   3.1    CLK_CYCLE now integer
27 12 wfjm
-- 2011-08-13   405   3.0.3  add in direction for  FADDR,SEL ports
28 9 wfjm
-- 2010-12-26   349   3.0.2  add rb_sel
29
-- 2010-12-22   346   3.0.1  add rb_mon and rb_mon_sb;
30
-- 2010-12-04   343   3.0    extracted from rrilib and rritblib;
31
--                           rbus V3 interface: use aval,re,we
32
--                           ... rrilib history removed ...
33 2 wfjm
-- 2007-09-09    81   1.0    Initial version 
34
------------------------------------------------------------------------------
35
 
36
library ieee;
37
use ieee.std_logic_1164.all;
38
 
39
use work.slvtypes.all;
40
 
41 9 wfjm
package rblib is
42 2 wfjm
 
43 9 wfjm
type rb_mreq_type is record             -- rbus - master request
44
  aval : slbit;                         -- address valid
45
  re   : slbit;                         -- read enable
46 2 wfjm
  we   : slbit;                         -- write enable
47
  init : slbit;                         -- init
48 27 wfjm
  addr : slv16;                         -- address
49 2 wfjm
  din  : slv16;                         -- data (input to slave)
50
end record rb_mreq_type;
51
 
52
constant rb_mreq_init : rb_mreq_type :=
53 9 wfjm
  ('0','0','0','0',                     -- aval, re, we, init
54 2 wfjm
   (others=>'0'),                       -- addr
55
   (others=>'0'));                      -- din
56
 
57 9 wfjm
type rb_sres_type is record             -- rbus - slave response
58 2 wfjm
  ack  : slbit;                         -- acknowledge
59
  busy : slbit;                         -- busy
60
  err  : slbit;                         -- error
61
  dout : slv16;                         -- data (output from slave)
62
end record rb_sres_type;
63
 
64
constant rb_sres_init : rb_sres_type :=
65
  ('0','0','0',                         -- ack, busy, err
66
   (others=>'0'));                      -- dout
67
 
68 9 wfjm
component rb_sel is                     -- rbus address select logic
69 2 wfjm
  generic (
70 27 wfjm
    RB_ADDR : slv16;                    -- rbus address base
71 9 wfjm
    SAWIDTH : natural := 0);            -- device subaddress space width
72 2 wfjm
  port (
73 9 wfjm
    CLK : in slbit;                     -- clock
74
    RB_MREQ : in rb_mreq_type;          -- rbus request
75
    SEL : out slbit                     -- select state bit
76 2 wfjm
  );
77
end component;
78
 
79 9 wfjm
component rb_sres_or_2 is               -- rbus result or, 2 input
80 2 wfjm
  port (
81
    RB_SRES_1  :  in rb_sres_type;                 -- rb_sres input 1
82
    RB_SRES_2  :  in rb_sres_type := rb_sres_init; -- rb_sres input 2
83
    RB_SRES_OR : out rb_sres_type       -- rb_sres or'ed output
84
  );
85
end component;
86 9 wfjm
component rb_sres_or_3 is               -- rbus result or, 3 input
87 2 wfjm
  port (
88
    RB_SRES_1  :  in rb_sres_type;                 -- rb_sres input 1
89
    RB_SRES_2  :  in rb_sres_type := rb_sres_init; -- rb_sres input 2
90
    RB_SRES_3  :  in rb_sres_type := rb_sres_init; -- rb_sres input 3
91
    RB_SRES_OR : out rb_sres_type       -- rb_sres or'ed output
92
  );
93
end component;
94 9 wfjm
component rb_sres_or_4 is               -- rbus result or, 4 input
95 2 wfjm
  port (
96
    RB_SRES_1  :  in rb_sres_type;                 -- rb_sres input 1
97
    RB_SRES_2  :  in rb_sres_type := rb_sres_init; -- rb_sres input 2
98
    RB_SRES_3  :  in rb_sres_type := rb_sres_init; -- rb_sres input 3
99
    RB_SRES_4  :  in rb_sres_type := rb_sres_init; -- rb_sres input 4
100
    RB_SRES_OR : out rb_sres_type       -- rb_sres or'ed output
101
  );
102
end component;
103 35 wfjm
component rb_sres_or_6 is               -- rbus result or, 6 input
104
  port (
105
    RB_SRES_1  :  in rb_sres_type;                 -- rb_sres input 1
106
    RB_SRES_2  :  in rb_sres_type := rb_sres_init; -- rb_sres input 2
107
    RB_SRES_3  :  in rb_sres_type := rb_sres_init; -- rb_sres input 3
108
    RB_SRES_4  :  in rb_sres_type := rb_sres_init; -- rb_sres input 4
109
    RB_SRES_5  :  in rb_sres_type := rb_sres_init; -- rb_sres input 5
110
    RB_SRES_6  :  in rb_sres_type := rb_sres_init; -- rb_sres input 6
111
    RB_SRES_OR : out rb_sres_type       -- rb_sres or'ed output
112
  );
113
end component;
114 2 wfjm
 
115 9 wfjm
component rbus_aif is                   -- rbus, abstract interface
116
  port (
117
    CLK  : in slbit;                    -- clock
118
    RESET  : in slbit := '0';           -- reset
119
    RB_MREQ : in rb_mreq_type;          -- rbus: request
120
    RB_SRES : out rb_sres_type;         -- rbus: response
121
    RB_LAM : out slv16;                 -- rbus: look at me
122 27 wfjm
    RB_STAT : out slv4                  -- rbus: status flags
123 9 wfjm
  );
124
end component;
125
 
126
component rb_wreg_rw_3 is               -- rbus: wide register r/w 3 bit select
127 2 wfjm
  generic (
128
    DWIDTH : positive := 16);
129
  port (
130
    CLK  : in slbit;                    -- clock
131
    RESET  : in slbit;                  -- reset
132 12 wfjm
    FADDR : in slv3;                    -- field address
133
    SEL : in slbit;                     -- select
134 2 wfjm
    DATA : out slv(DWIDTH-1 downto 0);  -- data
135 9 wfjm
    RB_MREQ :  in rb_mreq_type;         -- rbus request
136
    RB_SRES : out rb_sres_type          -- rbus response
137 2 wfjm
  );
138
end component;
139
 
140 9 wfjm
component rb_wreg_w_3 is                -- rbus: wide register w-o 3 bit select
141 2 wfjm
  generic (
142
    DWIDTH : positive := 16);
143
  port (
144
    CLK  : in slbit;                    -- clock
145
    RESET  : in slbit;                  -- reset
146 12 wfjm
    FADDR : in slv3;                    -- field address
147
    SEL : in slbit;                     -- select
148 2 wfjm
    DATA : out slv(DWIDTH-1 downto 0);  -- data
149 9 wfjm
    RB_MREQ :  in rb_mreq_type;         -- rbus request
150
    RB_SRES : out rb_sres_type          -- rbus response
151 2 wfjm
  );
152
end component;
153
 
154 9 wfjm
component rb_wreg_r_3 is                -- rbus: wide register r-o 3 bit select
155 2 wfjm
  generic (
156
    DWIDTH : positive := 16);
157
  port (
158 12 wfjm
    FADDR : in slv3;                    -- field address
159
    SEL : in slbit;                     -- select
160 2 wfjm
    DATA : in slv(DWIDTH-1 downto 0);   -- data
161 9 wfjm
    RB_SRES : out rb_sres_type          -- rbus response
162 2 wfjm
  );
163
end component;
164
 
165 9 wfjm
--
166
-- components for use in test benches (not synthesizable)
167
--
168
 
169
component rb_sres_or_mon is             -- rbus result or monitor
170
  port (
171 35 wfjm
    RB_SRES_1  :  in rb_sres_type;                 -- rb_sres input 1
172
    RB_SRES_2  :  in rb_sres_type;                 -- rb_sres input 2
173 9 wfjm
    RB_SRES_3  :  in rb_sres_type := rb_sres_init; -- rb_sres input 3
174 35 wfjm
    RB_SRES_4  :  in rb_sres_type := rb_sres_init; -- rb_sres input 4
175
    RB_SRES_5  :  in rb_sres_type := rb_sres_init; -- rb_sres input 5
176
    RB_SRES_6  :  in rb_sres_type := rb_sres_init  -- rb_sres input 6
177 9 wfjm
  );
178
end component;
179
 
180
-- simbus sb_cntl field usage for rbus
181 27 wfjm
constant sbcntl_sbf_rbmon : integer := 13;
182 9 wfjm
 
183
component rb_mon is                     -- rbus monitor
184
  generic (
185
    DBASE : positive :=  2);            -- base for writing data values
186
  port (
187
    CLK  : in slbit;                    -- clock
188 17 wfjm
    CLK_CYCLE : in integer := 0;        -- clock cycle number
189 9 wfjm
    ENA  : in slbit := '1';             -- enable monitor output
190
    RB_MREQ : in rb_mreq_type;          -- rbus: request
191
    RB_SRES : in rb_sres_type;          -- rbus: response
192
    RB_LAM : in slv16 := (others=>'0'); -- rbus: look at me
193 27 wfjm
    RB_STAT : in slv4                   -- rbus: status flags
194 9 wfjm
  );
195
end component;
196
 
197
component rb_mon_sb is                  -- simbus wrapper for rbus monitor
198
  generic (
199
    DBASE : positive :=  2;             -- base for writing data values
200
    ENAPIN : integer := sbcntl_sbf_rbmon); -- SB_CNTL signal to use for enable
201
  port (
202
    CLK  : in slbit;                    -- clock
203
    RB_MREQ : in rb_mreq_type;          -- rbus: request
204
    RB_SRES : in rb_sres_type;          -- rbus: response
205
    RB_LAM : in slv16 := (others=>'0'); -- rbus: look at me
206 27 wfjm
    RB_STAT : in slv4                   -- rbus: status flags
207 9 wfjm
  );
208
end component;
209
 
210 12 wfjm
end package rblib;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.