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

Subversion Repositories w11

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

Details | Compare with Previous | View Log

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