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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.74/] [rtl/] [ibus/] [iblib.vhd] - Blame information for rev 38

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 36 wfjm
-- $Id: iblib.vhd 770 2016-05-28 14:15:00Z mueller $
2 2 wfjm
--
3 36 wfjm
-- Copyright 2008-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
-- Package Name:   iblib
16
-- Description:    Definitions for ibus interface and bus entities
17
--
18
-- Dependencies:   -
19 36 wfjm
-- Tool versions:  ise 8.1-14.7; viv 2014.4-2016.1; ghdl 0.18-0.33
20 2 wfjm
-- Revision History: 
21
-- Date         Rev Version  Comment
22 36 wfjm
-- 2016-05-28   770   2.1.1  use type natural for vec,pri fields of intmap_type
23 30 wfjm
-- 2015-04-24   668   2.1    add ibd_ibmon
24 8 wfjm
-- 2010-10-23   335   2.0.1  add ib_sel; add ib_sres_or_mon
25
-- 2010-10-17   333   2.0    ibus V2 interface: use aval,re,we,rmw
26 2 wfjm
-- 2010-06-11   303   1.1    added racc,cacc signals to ib_mreq_type
27
-- 2009-06-01   221   1.0.1  added dip signal to ib_mreq_type
28
-- 2008-08-22   161   1.0    Initial version (extracted from pdp11.vhd)
29
------------------------------------------------------------------------------
30
 
31
library ieee;
32
use ieee.std_logic_1164.all;
33 30 wfjm
use ieee.numeric_std.all;
34 2 wfjm
 
35
use work.slvtypes.all;
36
 
37
package iblib is
38
 
39
type ib_mreq_type is record             -- ibus - master request
40 8 wfjm
  aval : slbit;                         -- address valid
41
  re   : slbit;                         -- read enable
42 2 wfjm
  we   : slbit;                         -- write enable
43 8 wfjm
  rmw  : slbit;                         -- read-modify-write
44 2 wfjm
  be0  : slbit;                         -- byte enable low
45
  be1  : slbit;                         -- byte enable high
46
  cacc : slbit;                         -- console access
47
  racc : slbit;                         -- remote access
48
  addr : slv13_1;                       -- address bit(12:1)
49
  din  : slv16;                         -- data (input to slave)
50
end record ib_mreq_type;
51
 
52
constant ib_mreq_init : ib_mreq_type :=
53 8 wfjm
  ('0','0','0','0',                     -- aval, re, we, rmw
54
   '0','0','0','0',                     -- be0, be1, cacc, racc
55 2 wfjm
   (others=>'0'),                       -- addr
56
   (others=>'0'));                      -- din
57
 
58
type ib_sres_type is record             -- ibus - slave response
59
  ack  : slbit;                         -- acknowledge
60
  busy : slbit;                         -- busy
61
  dout : slv16;                         -- data (output from slave)
62
end record ib_sres_type;
63
 
64
constant ib_sres_init : ib_sres_type :=
65
  ('0','0',                             -- ack, busy
66
   (others=>'0'));                      -- dout
67
 
68
type ib_sres_vector is array (natural range <>) of ib_sres_type;
69
 
70
subtype ibf_byte1  is integer range 15 downto 8;
71
subtype ibf_byte0  is integer range  7 downto 0;
72
 
73 8 wfjm
component ib_sel is                     -- ibus address select logic
74
  generic (
75
    IB_ADDR : slv16;                    -- ibus address base
76
    SAWIDTH : natural := 0);            -- device subaddress space width
77
  port (
78
    CLK : in slbit;                     -- clock
79
    IB_MREQ : in ib_mreq_type;          -- ibus request
80
    SEL : out slbit                     -- select state bit
81
  );
82
end component;
83
 
84 2 wfjm
component ib_sres_or_2 is               -- ibus result or, 2 input
85
  port (
86
    IB_SRES_1 :  in ib_sres_type;                 -- ib_sres input 1
87
    IB_SRES_2 :  in ib_sres_type := ib_sres_init; -- ib_sres input 2
88
    IB_SRES_OR : out ib_sres_type       -- ib_sres or'ed output
89
  );
90
end component;
91
component ib_sres_or_3 is               -- ibus result or, 3 input
92
  port (
93
    IB_SRES_1 :  in ib_sres_type;                 -- ib_sres input 1
94
    IB_SRES_2 :  in ib_sres_type := ib_sres_init; -- ib_sres input 2
95
    IB_SRES_3 :  in ib_sres_type := ib_sres_init; -- ib_sres input 3
96
    IB_SRES_OR : out ib_sres_type       -- ib_sres or'ed output
97
  );
98
end component;
99
component ib_sres_or_4 is               -- ibus result or, 4 input
100
  port (
101
    IB_SRES_1 :  in ib_sres_type;                 -- ib_sres input 1
102
    IB_SRES_2 :  in ib_sres_type := ib_sres_init; -- ib_sres input 2
103
    IB_SRES_3 :  in ib_sres_type := ib_sres_init; -- ib_sres input 3
104
    IB_SRES_4 :  in ib_sres_type := ib_sres_init; -- ib_sres input 4
105
    IB_SRES_OR : out ib_sres_type       -- ib_sres or'ed output
106
  );
107
end component;
108
 
109
component ib_sres_or_gen is             -- ibus result or, generic
110
  generic (
111
    WIDTH : natural := 4);              -- number of input ports
112
  port (
113
    IB_SRES_IN : in ib_sres_vector(1 to WIDTH); -- ib_sres input array
114
    IB_SRES_OR : out ib_sres_type               -- ib_sres or'ed output
115
  );
116
end component;
117
 
118
type intmap_type is record              -- interrupt map entry type
119 36 wfjm
  vec : natural;                        -- vector address
120
  pri : natural;                        -- priority
121 2 wfjm
end record intmap_type;
122
constant intmap_init : intmap_type := (0,0);
123
 
124
type intmap_array_type is array (15 downto 0) of intmap_type;
125
constant intmap_array_init : intmap_array_type := (others=>intmap_init);
126
 
127
component ib_intmap is                  -- external interrupt mapper
128
  generic (
129
    INTMAP : intmap_array_type := intmap_array_init);
130
  port (
131
    EI_REQ : in slv16_1;                -- interrupt request lines
132
    EI_ACKM : in slbit;                 -- interrupt acknowledge (from master)
133
    EI_ACK : out slv16_1;               -- interrupt acknowledge (to requestor)
134
    EI_PRI : out slv3;                  -- interrupt priority
135
    EI_VECT : out slv9_2                -- interrupt vector
136
  );
137
end component;
138 9 wfjm
 
139 30 wfjm
component ibd_ibmon is                  -- ibus dev: ibus monitor
140
  generic (
141
    IB_ADDR : slv16 := slv(to_unsigned(8#160000#,16));
142
    AWIDTH : natural := 9);
143
  port (
144
    CLK  : in slbit;                    -- clock
145
    RESET : in slbit;                   -- reset
146
    IB_MREQ : in ib_mreq_type;          -- ibus: request
147
    IB_SRES : out ib_sres_type;         -- ibus: response
148
    IB_SRES_SUM : in ib_sres_type       -- ibus: response (sum for monitor)
149
  );
150
end component;
151
 
152 9 wfjm
--
153
-- components for use in test benches (not synthesizable)
154
--
155 2 wfjm
 
156 9 wfjm
component ib_sres_or_mon is             -- ibus result or monitor
157
  port (
158
    IB_SRES_1 :  in ib_sres_type;                 -- ib_sres input 1
159
    IB_SRES_2 :  in ib_sres_type := ib_sres_init; -- ib_sres input 2
160
    IB_SRES_3 :  in ib_sres_type := ib_sres_init; -- ib_sres input 3
161
    IB_SRES_4 :  in ib_sres_type := ib_sres_init  -- ib_sres input 4
162
  );
163
end component;
164
 
165 2 wfjm
end package iblib;

powered by: WebSVN 2.1.0

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