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

Subversion Repositories w11

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

Details | Compare with Previous | View Log

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