w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
ib_intmap24.vhd
Go to the documentation of this file.
1-- $Id: ib_intmap24.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2017-2019 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: ib_intmap24 - syn
7-- Description: pdp11: external interrupt mapper (23 line)
8--
9-- Dependencies: -
10-- Test bench: tb/tb_pdp11_core (implicit)
11-- Target Devices: generic
12-- Tool versions: ise 14.7; viv 2016.4-2017.2; ghdl 0.33-0.35
13--
14-- Synthesized:
15-- Date Rev viv Target flop lutl lutm bram slic MHz
16-- 2016-05-26 641 2016.4 xc7a100t-1 0 48 0 0 - -
17-- 2015-02-22 641 i 14.7 xc6slx16-2 0 38 0 0 20 -
18--
19-- Revision History:
20-- Date Rev Version Comment
21-- 2019-04-23 1136 1.1 BUGFIX: ensure ACK send to correct device
22-- 2017-01-28 846 1.0 Initial version (cloned from ib_intmap.vhd)
23------------------------------------------------------------------------------
24
25library ieee;
26use ieee.std_logic_1164.all;
27use ieee.numeric_std.all;
28
29use work.slvtypes.all;
30use work.iblib.all;
31
32-- ----------------------------------------------------------------------------
33
34entity ib_intmap24 is -- external interrupt mapper (23 line)
35 generic (
36 INTMAP : intmap24_array_type := intmap24_array_init);
37 port (
38 CLK : in slbit; -- clock
39 EI_REQ : in slv24_1; -- interrupt request lines
40 EI_ACKM : in slbit; -- interrupt acknowledge (from master)
41 EI_ACK : out slv24_1; -- interrupt acknowledge (to requestor)
42 EI_PRI : out slv3; -- interrupt priority
43 EI_VECT : out slv9_2 -- interrupt vector
44 );
45end ib_intmap24;
46
47architecture syn of ib_intmap24 is
48
49 signal EI_LINE : slv5 := (others=>'0'); -- external interrupt line
50 signal R_LINE : slv5 := (others=>'0'); -- line on last cycle
51
52 type intp_type is array (23 downto 0) of slv3;
53 type intv_type is array (23 downto 0) of slv9;
54
55 constant conf_intp : intp_type :=
56 (slv(to_unsigned(INTMAP(23).pri,3)), -- line 23
57 slv(to_unsigned(INTMAP(22).pri,3)), -- line 22
58 slv(to_unsigned(INTMAP(21).pri,3)), -- line 21
59 slv(to_unsigned(INTMAP(20).pri,3)), -- line 20
60 slv(to_unsigned(INTMAP(19).pri,3)), -- line 19
61 slv(to_unsigned(INTMAP(18).pri,3)), -- line 18
62 slv(to_unsigned(INTMAP(17).pri,3)), -- line 17
63 slv(to_unsigned(INTMAP(16).pri,3)), -- line 16
64 slv(to_unsigned(INTMAP(15).pri,3)), -- line 15
65 slv(to_unsigned(INTMAP(14).pri,3)), -- line 14
66 slv(to_unsigned(INTMAP(13).pri,3)), -- line 13
67 slv(to_unsigned(INTMAP(12).pri,3)), -- line 12
68 slv(to_unsigned(INTMAP(11).pri,3)), -- line 11
69 slv(to_unsigned(INTMAP(10).pri,3)), -- line 10
70 slv(to_unsigned(INTMAP( 9).pri,3)), -- line 9
71 slv(to_unsigned(INTMAP( 8).pri,3)), -- line 8
72 slv(to_unsigned(INTMAP( 7).pri,3)), -- line 7
73 slv(to_unsigned(INTMAP( 6).pri,3)), -- line 6
74 slv(to_unsigned(INTMAP( 5).pri,3)), -- line 5
75 slv(to_unsigned(INTMAP( 4).pri,3)), -- line 4
76 slv(to_unsigned(INTMAP( 3).pri,3)), -- line 3
77 slv(to_unsigned(INTMAP( 2).pri,3)), -- line 2
78 slv(to_unsigned(INTMAP( 1).pri,3)), -- line 1
79 slv(to_unsigned( 0,3)) -- line 0 (always 0 !!)
80 );
81
82 constant conf_intv : intv_type :=
83 (
84 slv(to_unsigned(INTMAP(23).vec,9)), -- line 23
85 slv(to_unsigned(INTMAP(22).vec,9)), -- line 22
86 slv(to_unsigned(INTMAP(21).vec,9)), -- line 21
87 slv(to_unsigned(INTMAP(20).vec,9)), -- line 20
88 slv(to_unsigned(INTMAP(19).vec,9)), -- line 19
89 slv(to_unsigned(INTMAP(18).vec,9)), -- line 18
90 slv(to_unsigned(INTMAP(17).vec,9)), -- line 17
91 slv(to_unsigned(INTMAP(16).vec,9)), -- line 16
92 slv(to_unsigned(INTMAP(15).vec,9)), -- line 15
93 slv(to_unsigned(INTMAP(14).vec,9)), -- line 14
94 slv(to_unsigned(INTMAP(13).vec,9)), -- line 13
95 slv(to_unsigned(INTMAP(12).vec,9)), -- line 12
96 slv(to_unsigned(INTMAP(11).vec,9)), -- line 11
97 slv(to_unsigned(INTMAP(10).vec,9)), -- line 10
98 slv(to_unsigned(INTMAP( 9).vec,9)), -- line 9
99 slv(to_unsigned(INTMAP( 8).vec,9)), -- line 8
100 slv(to_unsigned(INTMAP( 7).vec,9)), -- line 7
101 slv(to_unsigned(INTMAP( 6).vec,9)), -- line 6
102 slv(to_unsigned(INTMAP( 5).vec,9)), -- line 5
103 slv(to_unsigned(INTMAP( 4).vec,9)), -- line 4
104 slv(to_unsigned(INTMAP( 3).vec,9)), -- line 3
105 slv(to_unsigned(INTMAP( 2).vec,9)), -- line 2
106 slv(to_unsigned(INTMAP( 1).vec,9)), -- line 1
107 slv(to_unsigned( 0,9)) -- line 0 (always 0 !!)
108 );
109
110-- attribute PRIORITY_EXTRACT : string;
111-- attribute PRIORITY_EXTRACT of EI_LINE : signal is "force";
112
113begin
114
115 EI_LINE <= "10111" when EI_REQ(23)='1' else
116 "10110" when EI_REQ(22)='1' else
117 "10101" when EI_REQ(21)='1' else
118 "10100" when EI_REQ(20)='1' else
119 "10011" when EI_REQ(19)='1' else
120 "10010" when EI_REQ(18)='1' else
121 "10001" when EI_REQ(17)='1' else
122 "10000" when EI_REQ(16)='1' else
123 "01111" when EI_REQ(15)='1' else
124 "01110" when EI_REQ(14)='1' else
125 "01101" when EI_REQ(13)='1' else
126 "01100" when EI_REQ(12)='1' else
127 "01011" when EI_REQ(11)='1' else
128 "01010" when EI_REQ(10)='1' else
129 "01001" when EI_REQ( 9)='1' else
130 "01000" when EI_REQ( 8)='1' else
131 "00111" when EI_REQ( 7)='1' else
132 "00110" when EI_REQ( 6)='1' else
133 "00101" when EI_REQ( 5)='1' else
134 "00100" when EI_REQ( 4)='1' else
135 "00011" when EI_REQ( 3)='1' else
136 "00010" when EI_REQ( 2)='1' else
137 "00001" when EI_REQ( 1)='1' else
138 "00000";
139
140 proc_line: process (CLK)
141 begin
142 if rising_edge(CLK) then
143 R_LINE <= EI_LINE;
144 end if;
145 end process proc_line;
146
147 -- Note: EI_ACKM comes one cycle after vector is latched ! Therefore
148 -- - use EI_LINE to select vector to send to EI_PRI and EI_VECT
149 -- - use R_LINE to select EI_ACM line for acknowledge
150 proc_intmap : process (EI_LINE, EI_ACKM, R_LINE)
151 variable ilinecur : integer := 0;
152 variable ilinelst : integer := 0;
153 variable iei_ack : slv24 := (others=>'0');
154 begin
155
156 ilinecur := to_integer(unsigned(EI_LINE));
157 ilinelst := to_integer(unsigned(R_LINE));
158
159 -- send info of currently highest priority request
160 EI_PRI <= conf_intp(ilinecur);
161 EI_VECT <= conf_intv(ilinecur)(8 downto 2);
162
163 -- route acknowledge back to winner line of last cycle
164 iei_ack := (others=>'0');
165 if EI_ACKM = '1' then
166 iei_ack(ilinelst) := '1';
167 end if;
168 EI_ACK <= iei_ack(EI_ACK'range);
169
170 end process proc_intmap;
171
172end syn;
( 23 downto 0) slv3 intp_type
Definition: ib_intmap24.vhd:52
intv_type :=( slv( to_unsigned( INTMAP( 23).vec, 9) ), slv( to_unsigned( INTMAP( 22).vec, 9) ), slv( to_unsigned( INTMAP( 21).vec, 9) ), slv( to_unsigned( INTMAP( 20).vec, 9) ), slv( to_unsigned( INTMAP( 19).vec, 9) ), slv( to_unsigned( INTMAP( 18).vec, 9) ), slv( to_unsigned( INTMAP( 17).vec, 9) ), slv( to_unsigned( INTMAP( 16).vec, 9) ), slv( to_unsigned( INTMAP( 15).vec, 9) ), slv( to_unsigned( INTMAP( 14).vec, 9) ), slv( to_unsigned( INTMAP( 13).vec, 9) ), slv( to_unsigned( INTMAP( 12).vec, 9) ), slv( to_unsigned( INTMAP( 11).vec, 9) ), slv( to_unsigned( INTMAP( 10).vec, 9) ), slv( to_unsigned( INTMAP( 9).vec, 9) ), slv( to_unsigned( INTMAP( 8).vec, 9) ), slv( to_unsigned( INTMAP( 7).vec, 9) ), slv( to_unsigned( INTMAP( 6).vec, 9) ), slv( to_unsigned( INTMAP( 5).vec, 9) ), slv( to_unsigned( INTMAP( 4).vec, 9) ), slv( to_unsigned( INTMAP( 3).vec, 9) ), slv( to_unsigned( INTMAP( 2).vec, 9) ), slv( to_unsigned( INTMAP( 1).vec, 9) ), slv( to_unsigned( 0, 9) )) conf_intv
Definition: ib_intmap24.vhd:82
slv5 :=( others => '0') EI_LINE
Definition: ib_intmap24.vhd:49
slv5 :=( others => '0') R_LINE
Definition: ib_intmap24.vhd:50
( 23 downto 0) slv9 intv_type
Definition: ib_intmap24.vhd:53
intp_type :=( slv( to_unsigned( INTMAP( 23).pri, 3) ), slv( to_unsigned( INTMAP( 22).pri, 3) ), slv( to_unsigned( INTMAP( 21).pri, 3) ), slv( to_unsigned( INTMAP( 20).pri, 3) ), slv( to_unsigned( INTMAP( 19).pri, 3) ), slv( to_unsigned( INTMAP( 18).pri, 3) ), slv( to_unsigned( INTMAP( 17).pri, 3) ), slv( to_unsigned( INTMAP( 16).pri, 3) ), slv( to_unsigned( INTMAP( 15).pri, 3) ), slv( to_unsigned( INTMAP( 14).pri, 3) ), slv( to_unsigned( INTMAP( 13).pri, 3) ), slv( to_unsigned( INTMAP( 12).pri, 3) ), slv( to_unsigned( INTMAP( 11).pri, 3) ), slv( to_unsigned( INTMAP( 10).pri, 3) ), slv( to_unsigned( INTMAP( 9).pri, 3) ), slv( to_unsigned( INTMAP( 8).pri, 3) ), slv( to_unsigned( INTMAP( 7).pri, 3) ), slv( to_unsigned( INTMAP( 6).pri, 3) ), slv( to_unsigned( INTMAP( 5).pri, 3) ), slv( to_unsigned( INTMAP( 4).pri, 3) ), slv( to_unsigned( INTMAP( 3).pri, 3) ), slv( to_unsigned( INTMAP( 2).pri, 3) ), slv( to_unsigned( INTMAP( 1).pri, 3) ), slv( to_unsigned( 0, 3) )) conf_intp
Definition: ib_intmap24.vhd:55
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
Definition: iblib.vhd:33
std_logic_vector( 4 downto 0) slv5
Definition: slvtypes.vhd:37
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( 23 downto 1) slv24_1
Definition: slvtypes.vhd:70
std_logic_vector( 8 downto 0) slv9
Definition: slvtypes.vhd:41
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector( 23 downto 0) slv24
Definition: slvtypes.vhd:57
std_logic_vector slv
Definition: slvtypes.vhd:31