w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
iblib.vhd
Go to the documentation of this file.
1-- $Id: iblib.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2008-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Package Name: iblib
7-- Description: Definitions for ibus interface and bus entities
8--
9-- Dependencies: -
10-- Tool versions: ise 8.1-14.7; viv 2014.4-2018.3; ghdl 0.18-0.35
11-- Revision History:
12-- Date Rev Version Comment
13-- 2019-04-23 1136 2.2.4 add CLK port to ib_intmap,ib_intmap24
14-- 2019-04-14 1131 2.2.3 ib_rlim_gen: add CPUSUSP port; RLIM_CEV now slv8
15-- 2019-03-17 1123 2.2.2 add ib_rlim_gen,ib_rlim_slv
16-- 2019-02-10 1111 2.2.1 add ibd_ibtst
17-- 2017-01-28 846 2.2 add ib_intmap24
18-- 2016-05-28 770 2.1.1 use type natural for vec,pri fields of intmap_type
19-- 2015-04-24 668 2.1 add ibd_ibmon
20-- 2010-10-23 335 2.0.1 add ib_sel; add ib_sres_or_mon
21-- 2010-10-17 333 2.0 ibus V2 interface: use aval,re,we,rmw
22-- 2010-06-11 303 1.1 added racc,cacc signals to ib_mreq_type
23-- 2009-06-01 221 1.0.1 added dip signal to ib_mreq_type
24-- 2008-08-22 161 1.0 Initial version (extracted from pdp11.vhd)
25------------------------------------------------------------------------------
26
27library ieee;
28use ieee.std_logic_1164.all;
29use ieee.numeric_std.all;
30
31use work.slvtypes.all;
32
33package iblib is
34
35type ib_mreq_type is record -- ibus - master request
36 aval : slbit; -- address valid
37 re : slbit; -- read enable
38 we : slbit; -- write enable
39 rmw : slbit; -- read-modify-write
40 be0 : slbit; -- byte enable low
41 be1 : slbit; -- byte enable high
42 cacc : slbit; -- console access
43 racc : slbit; -- remote access
44 addr : slv13_1; -- address bit(12:1)
45 din : slv16; -- data (input to slave)
46end record ib_mreq_type;
47
49 ('0','0','0','0', -- aval, re, we, rmw
50 '0','0','0','0', -- be0, be1, cacc, racc
51 (others=>'0'), -- addr
52 (others=>'0')); -- din
53
54type ib_sres_type is record -- ibus - slave response
55 ack : slbit; -- acknowledge
56 busy : slbit; -- busy
57 dout : slv16; -- data (output from slave)
58end record ib_sres_type;
59
61 ('0','0', -- ack, busy
62 (others=>'0')); -- dout
63
64type ib_sres_vector is array (natural range <>) of ib_sres_type;
65
66subtype ibf_byte1 is integer range 15 downto 8;
67subtype ibf_byte0 is integer range 7 downto 0;
68
69component ib_sel is -- ibus address select logic
70 generic (
71 IB_ADDR : slv16; -- ibus address base
72 SAWIDTH : natural := 0); -- device subaddress space width
73 port (
74 CLK : in slbit; -- clock
75 IB_MREQ : in ib_mreq_type; -- ibus request
76 SEL : out slbit -- select state bit
77 );
78end component;
79
80component ib_sres_or_2 is -- ibus result or, 2 input
81 port (
82 IB_SRES_1 : in ib_sres_type; -- ib_sres input 1
83 IB_SRES_2 : in ib_sres_type := ib_sres_init; -- ib_sres input 2
84 IB_SRES_OR : out ib_sres_type -- ib_sres or'ed output
85 );
86end component;
87component ib_sres_or_3 is -- ibus result or, 3 input
88 port (
89 IB_SRES_1 : in ib_sres_type; -- ib_sres input 1
90 IB_SRES_2 : in ib_sres_type := ib_sres_init; -- ib_sres input 2
91 IB_SRES_3 : in ib_sres_type := ib_sres_init; -- ib_sres input 3
92 IB_SRES_OR : out ib_sres_type -- ib_sres or'ed output
93 );
94end component;
95component ib_sres_or_4 is -- ibus result or, 4 input
96 port (
97 IB_SRES_1 : in ib_sres_type; -- ib_sres input 1
98 IB_SRES_2 : in ib_sres_type := ib_sres_init; -- ib_sres input 2
99 IB_SRES_3 : in ib_sres_type := ib_sres_init; -- ib_sres input 3
100 IB_SRES_4 : in ib_sres_type := ib_sres_init; -- ib_sres input 4
101 IB_SRES_OR : out ib_sres_type -- ib_sres or'ed output
102 );
103end component;
104
105component ib_sres_or_gen is -- ibus result or, generic
106 generic (
107 WIDTH : natural := 4); -- number of input ports
108 port (
109 IB_SRES_IN : in ib_sres_vector(1 to WIDTH); -- ib_sres input array
110 IB_SRES_OR : out ib_sres_type -- ib_sres or'ed output
111 );
112end component;
113
114type intmap_type is record -- interrupt map entry type
115 vec : natural; -- vector address
116 pri : natural; -- priority
117end record intmap_type;
118constant intmap_init : intmap_type := (0,0);
119
120type intmap_array_type is array (15 downto 0) of intmap_type;
122
123component ib_intmap is -- external interrupt mapper (15 line)
124 generic (
125 INTMAP : intmap_array_type := intmap_array_init);
126 port (
127 CLK : in slbit; -- clock
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 );
134end component;
135
136type intmap24_array_type is array (23 downto 0) of intmap_type;
138
139component ib_intmap24 is -- external interrupt mapper (23 line)
140 generic (
141 INTMAP : intmap24_array_type := intmap24_array_init);
142 port (
143 CLK : in slbit; -- clock
144 EI_REQ : in slv24_1; -- interrupt request lines
145 EI_ACKM : in slbit; -- interrupt acknowledge (from master)
146 EI_ACK : out slv24_1; -- interrupt acknowledge (to requestor)
147 EI_PRI : out slv3; -- interrupt priority
148 EI_VECT : out slv9_2 -- interrupt vector
149 );
150end component;
151
152component ibd_ibmon is -- ibus dev: ibus monitor
153 generic (
154 IB_ADDR : slv16 := slv(to_unsigned(8#160000#,16));
155 AWIDTH : natural := 9);
156 port (
157 CLK : in slbit; -- clock
158 RESET : in slbit; -- reset
159 IB_MREQ : in ib_mreq_type; -- ibus: request
160 IB_SRES : out ib_sres_type; -- ibus: response
161 IB_SRES_SUM : in ib_sres_type -- ibus: response (sum for monitor)
162 );
163end component;
164
165component ibd_ibtst is -- ibus dev(rem): ibus tester
166 generic (
167 IB_ADDR : slv16 := slv(to_unsigned(8#170000#,16)));
168 port (
169 CLK : in slbit; -- clock
170 RESET : in slbit; -- reset
171 IB_MREQ : in ib_mreq_type; -- ibus request
172 IB_SRES : out ib_sres_type -- ibus response
173 );
174end component;
175
176component ib_rlim_gen is -- ibus rate limter - master
177 port (
178 CLK : in slbit; -- clock
179 CE_USEC : in slbit; -- usec pulse
180 RESET : in slbit; -- system reset
181 CPUSUSP : in slbit; -- cpu suspended
182 RLIM_CEV : out slv8 -- clock enable vector
183 );
184end component;
185
186component ib_rlim_slv is -- ibus rate limter - slave
187 port (
188 CLK : in slbit; -- clock
189 RESET : in slbit; -- system reset
190 RLIM_CEV : in slv8; -- clock enable vector
191 SEL : in slv3; -- rlim select
192 START : in slbit; -- start timer
193 STOP : in slbit; -- stop timer
194 DONE : out slbit; -- 1 cycle pulse when expired
195 BUSY : out slbit -- timer running
196 );
197end component;
198
199--
200-- components for use in test benches (not synthesizable)
201--
202
203component ib_sres_or_mon is -- ibus result or monitor
204 port (
205 IB_SRES_1 : in ib_sres_type; -- ib_sres input 1
206 IB_SRES_2 : in ib_sres_type := ib_sres_init; -- ib_sres input 2
207 IB_SRES_3 : in ib_sres_type := ib_sres_init; -- ib_sres input 3
208 IB_SRES_4 : in ib_sres_type := ib_sres_init -- ib_sres input 4
209 );
210end component;
211
212end package iblib;
out EI_PRI slv3
Definition: ib_intmap24.vhd:42
in EI_REQ slv24_1
Definition: ib_intmap24.vhd:39
out EI_VECT slv9_2
Definition: ib_intmap24.vhd:44
INTMAP intmap24_array_type := intmap24_array_init
Definition: ib_intmap24.vhd:36
in CLK slbit
Definition: ib_intmap24.vhd:38
out EI_ACK slv24_1
Definition: ib_intmap24.vhd:41
in EI_ACKM slbit
Definition: ib_intmap24.vhd:40
out EI_PRI slv3
Definition: ib_intmap.vhd:48
INTMAP intmap_array_type := intmap_array_init
Definition: ib_intmap.vhd:42
out EI_VECT slv9_2
Definition: ib_intmap.vhd:50
in CLK slbit
Definition: ib_intmap.vhd:44
in EI_REQ slv16_1
Definition: ib_intmap.vhd:45
out EI_ACK slv16_1
Definition: ib_intmap.vhd:47
in EI_ACKM slbit
Definition: ib_intmap.vhd:46
in RESET slbit
Definition: ib_rlim_gen.vhd:43
in CE_USEC slbit
Definition: ib_rlim_gen.vhd:42
in CLK slbit
Definition: ib_rlim_gen.vhd:41
in CPUSUSP slbit
Definition: ib_rlim_gen.vhd:44
out RLIM_CEV slv8
Definition: ib_rlim_gen.vhd:46
in STOP slbit
Definition: ib_rlim_slv.vhd:46
in RESET slbit
Definition: ib_rlim_slv.vhd:42
out BUSY slbit
Definition: ib_rlim_slv.vhd:49
out DONE slbit
Definition: ib_rlim_slv.vhd:47
in CLK slbit
Definition: ib_rlim_slv.vhd:41
in SEL slv3
Definition: ib_rlim_slv.vhd:44
in RLIM_CEV slv8
Definition: ib_rlim_slv.vhd:43
in START slbit
Definition: ib_rlim_slv.vhd:45
out SEL slbit
Definition: ib_sel.vhd:35
IB_ADDR slv16
Definition: ib_sel.vhd:29
SAWIDTH natural := 0
Definition: ib_sel.vhd:30
in CLK slbit
Definition: ib_sel.vhd:32
in IB_MREQ ib_mreq_type
Definition: ib_sel.vhd:33
in IB_SRES_2 ib_sres_type := ib_sres_init
out IB_SRES_OR ib_sres_type
in IB_SRES_1 ib_sres_type
in IB_SRES_2 ib_sres_type := ib_sres_init
in IB_SRES_3 ib_sres_type := ib_sres_init
out IB_SRES_OR ib_sres_type
in IB_SRES_1 ib_sres_type
in IB_SRES_2 ib_sres_type := ib_sres_init
in IB_SRES_3 ib_sres_type := ib_sres_init
out IB_SRES_OR ib_sres_type
in IB_SRES_4 ib_sres_type := ib_sres_init
in IB_SRES_1 ib_sres_type
in IB_SRES_2 ib_sres_type
in IB_SRES_3 ib_sres_type := ib_sres_init
in IB_SRES_4 ib_sres_type := ib_sres_init
in IB_SRES_1 ib_sres_type
in RESET slbit
Definition: ibd_ibmon.vhd:95
in IB_SRES_SUM ib_sres_type
Definition: ibd_ibmon.vhd:99
AWIDTH natural := 9
Definition: ibd_ibmon.vhd:92
in CLK slbit
Definition: ibd_ibmon.vhd:94
in IB_MREQ ib_mreq_type
Definition: ibd_ibmon.vhd:96
out IB_SRES ib_sres_type
Definition: ibd_ibmon.vhd:97
IB_ADDR slv16 := slv( to_unsigned( 8#160000#, 16) )
Definition: ibd_ibmon.vhd:91
in RESET slbit
Definition: ibd_ibtst.vhd:62
in CLK slbit
Definition: ibd_ibtst.vhd:61
in IB_MREQ ib_mreq_type
Definition: ibd_ibtst.vhd:63
out IB_SRES ib_sres_type
Definition: ibd_ibtst.vhd:65
IB_ADDR slv16 := slv( to_unsigned( 8#170000#, 16) )
Definition: ibd_ibtst.vhd:59
Definition: iblib.vhd:33
array(natural range <> ) of ib_sres_type ib_sres_vector
Definition: iblib.vhd:64
intmap_type :=( 0, 0) intmap_init
Definition: iblib.vhd:118
integer range 15 downto 8 ibf_byte1
Definition: iblib.vhd:66
ib_sres_type :=( '0', '0',( others => '0')) ib_sres_init
Definition: iblib.vhd:60
( 23 downto 0) intmap_type intmap24_array_type
Definition: iblib.vhd:136
intmap_type
Definition: iblib.vhd:114
ib_sres_type
Definition: iblib.vhd:54
integer range 7 downto 0 ibf_byte0
Definition: iblib.vhd:67
intmap_array_type :=( others => intmap_init) intmap_array_init
Definition: iblib.vhd:121
ib_mreq_type
Definition: iblib.vhd:35
ib_mreq_type :=( '0', '0', '0', '0', '0', '0', '0', '0',( others => '0'),( others => '0')) ib_mreq_init
Definition: iblib.vhd:48
( 15 downto 0) intmap_type intmap_array_type
Definition: iblib.vhd:120
intmap24_array_type :=( others => intmap_init) intmap24_array_init
Definition: iblib.vhd:137
std_logic_vector( 2 downto 0) slv3
Definition: slvtypes.vhd:35
std_logic_vector( 8 downto 2) slv9_2
Definition: slvtypes.vhd:65
std_logic_vector( 12 downto 1) slv13_1
Definition: slvtypes.vhd:66
std_logic_vector( 15 downto 1) slv16_1
Definition: slvtypes.vhd:67
std_logic_vector( 23 downto 1) slv24_1
Definition: slvtypes.vhd:70
std_logic_vector( 15 downto 0) slv16
Definition: slvtypes.vhd:48
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector( 7 downto 0) slv8
Definition: slvtypes.vhd:40
std_logic_vector slv
Definition: slvtypes.vhd:31