w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
ibd_iist.vhd
Go to the documentation of this file.
1-- $Id: ibd_iist.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2009-2016 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: ibd_iist - syn
7-- Description: ibus dev(loc): IIST
8--
9-- Dependencies: -
10-- Test bench: -
11-- Target Devices: generic
12-- Tool versions: ise 8.2-14.7; viv 2014.4-2016.1; ghdl 0.18-0.33
13--
14-- Synthesized (xst):
15-- Date Rev ise Target flop lutl lutm slic t peri
16-- 2010-10-17 333 12.1 M53d xc3s1000-4 112 510 0 291 s 15.8
17-- 2010-10-17 314 12.1 M53d xc3s1000-4 111 504 0 290 s 15.6
18-- 2009-06-01 223 10.1.03 K39 xc3s1000-4 111 439 0 256 s 9.8
19-- 2009-06-01 221 10.1.03 K39 xc3s1000-4 111 449 0 258 s 13.3
20--
21-- Revision History:
22-- Date Rev Version Comment
23-- 2016-05-22 767 0.8.2 don't init N_REGS (vivado fix for fsm inference)
24-- 2011-11-18 427 0.8.1 now numeric_std clean
25-- 2010-10-17 333 0.8 use ibus V2 interface
26-- 2009-06-07 224 0.7 send inverted stc_stp; remove pgc_err; honor msk_im
27-- also for dcf_dcf and exc_rte; add iist_mreq and
28-- iist_sreq, boot and lock interfaces
29-- 2009-06-05 223 0.6 level interrupt, parity logic, exc.ui logic
30-- st logic modified (partially tested)
31-- 2009-06-01 221 0.5 Initial version (untested, lock&boot missing)
32------------------------------------------------------------------------------
33
34library ieee;
35use ieee.std_logic_1164.all;
36use ieee.numeric_std.all;
37
38use work.slvtypes.all;
39use work.iblib.all;
40use work.ibdlib.all;
41
42-- ----------------------------------------------------------------------------
43entity ibd_iist is -- ibus dev(loc): IIST
44 -- fixed address: 177500
45 generic (
46 SID : slv2 := "00"); -- self id
47 port (
48 CLK : in slbit; -- clock
49 CE_USEC : in slbit; -- usec pulse
50 RESET : in slbit; -- system reset
51 BRESET : in slbit; -- ibus reset
52 IB_MREQ : in ib_mreq_type; -- ibus request
53 IB_SRES : out ib_sres_type; -- ibus response
54 EI_REQ : out slbit; -- interrupt request
55 EI_ACK : in slbit; -- interrupt acknowledge
56 IIST_BUS : in iist_bus_type; -- iist bus (input from all iist's)
57 IIST_OUT : out iist_line_type; -- iist output
58 IIST_MREQ : out iist_mreq_type; -- iist->cpu requests
59 IIST_SRES : in iist_sres_type -- cpu->iist responses
60 );
61end ibd_iist;
62
63architecture syn of ibd_iist is
64
65 constant ibaddr_iist : slv16 := slv(to_unsigned(8#177500#,16));
66
67 constant tdlysnd : natural := 150; -- send delay timer
68
69 constant ibaddr_acr : slv1 := "0"; -- acr address offset
70 constant ibaddr_adr : slv1 := "1"; -- adr address offset
71
72 constant acr_ibf_clr : integer := 15; -- clear flag
73 subtype acr_ibf_sid is integer range 9 downto 8; -- self id
74 subtype acr_ibf_ac is integer range 3 downto 0; -- ac code
75
76 constant ac_pge : slv4 := "0000"; -- 0 program generated enables
77 constant ac_pgc : slv4 := "0001"; -- 1 program generated control/status
78 constant ac_ste : slv4 := "0010"; -- 2 sanity timer enables
79 constant ac_stc : slv4 := "0011"; -- 3 sanity timer control/status
80 constant ac_msk : slv4 := "0100"; -- 4 input masks
81 constant ac_pgf : slv4 := "0101"; -- 5 program generated flags
82 constant ac_stf : slv4 := "0110"; -- 6 sanity timer flags
83 constant ac_dcf : slv4 := "0111"; -- 7 disconnect flags
84 constant ac_exc : slv4 := "1000"; -- 10 exceptions
85 constant ac_mtc : slv4 := "1101"; -- 15 maintenance control
86
87 subtype pge_ibf_pbe is integer range 11 downto 8; -- pg boot ena
88 subtype pge_ibf_pie is integer range 3 downto 0; -- pg int ena
89
90 constant pgc_ibf_err : integer := 15; -- error
91 constant pgc_ibf_grj : integer := 14; -- go reject
92 constant pgc_ibf_pgrmr : integer := 13; -- pg req refused
93 constant pgc_ibf_strmr : integer := 12; -- st req refused
94 constant pgc_ibf_rdy : integer := 11; -- ready flag
95 subtype pgc_ibf_sid is integer range 9 downto 8; -- self id
96 constant pgc_ibf_ip : integer := 3; -- int pending
97 constant pgc_ibf_ie : integer := 2; -- int enable
98 constant pgc_ibf_ptp : integer := 1; -- pg parity
99 constant pgc_ibf_go : integer := 0; -- go flag
100
101 subtype ste_ibf_sbe is integer range 11 downto 8; -- st boot enable
102 subtype ste_ibf_sie is integer range 3 downto 0; -- st int enable
103
104 subtype stc_ibf_count is integer range 15 downto 8; -- count
105 constant stc_ibf_tmo : integer := 3; -- timeout
106 constant stc_ibf_lke : integer := 2; -- lockup enable
107 constant stc_ibf_stp : integer := 1; -- st parity
108 constant stc_ibf_enb : integer := 0; -- enable
109
110 subtype msk_ibf_bm is integer range 11 downto 8; -- boot mask
111 subtype msk_ibf_im is integer range 3 downto 0; -- int mask
112
113 subtype pgf_ibf_pbf is integer range 11 downto 8; -- boot flags
114 subtype pgf_ibf_pif is integer range 3 downto 0; -- int flags
115
116 subtype stf_ibf_sbf is integer range 11 downto 8; -- boot flags
117 subtype stf_ibf_sif is integer range 3 downto 0; -- int flags
118
119 subtype dcf_ibf_brk is integer range 11 downto 8; -- break flags
120 subtype dcf_ibf_dcf is integer range 3 downto 0; -- disconnect flags
121
122 subtype exc_ibf_ui is integer range 11 downto 8; -- unexpected int
123 subtype exc_ibf_rte is integer range 3 downto 0; -- transm. error
124
125 constant mtc_ibf_mttp : integer := 11; -- maint. type
126 constant mtc_ibf_mfrm : integer := 10; -- maint. frame err
127 subtype mtc_ibf_mid is integer range 9 downto 8; -- maint. id
128 constant mtc_ibf_dsbt : integer := 3; -- disable boot
129 constant mtc_ibf_enmxd : integer := 2; -- enable maint mux
130 constant mtc_ibf_enmlp : integer := 1; -- enable maint loop
131 constant mtc_ibf_dsdrv : integer := 0; -- disable driver
132
133 type state_type is (
134 s_idle, -- idle state
135 s_clear, -- handle acr clr
136 s_stsnd, -- handle st transmit
137 s_pgsnd -- handle pg transmit
138 );
139
140 type regs_type is record -- state registers
141 ibsel : slbit; -- ibus select
142 acr_ac : slv4; -- acr: ac
143 pge_pbe : slv4; -- pge: pg boot ena
144 pge_pie : slv4; -- pge: pg int ena
145 pgc_grj : slbit; -- pgc: go reject
146 pgc_pgrmr : slbit; -- pgc: pg req refused
147 pgc_strmr : slbit; -- pgc: st req refused
148 pgc_ie : slbit; -- pgc: int enable
149 pgc_ptp : slbit; -- pgc: pg parity
150 ste_sbe : slv4; -- ste: st boot enable
151 ste_sie : slv4; -- ste: st int enable
152 stc_count : slv8; -- stc: count
153 stc_tmo : slbit; -- stc: timeout
154 stc_lke : slbit; -- stc: lockup enable
155 stc_stp : slbit; -- stc: st parity
156 stc_enb : slbit; -- stc: enable
157 msk_bm : slv4; -- msk: boot mask
158 msk_im : slv4; -- msk: int mask
159 pgf_pbf : slv4; -- pgf: boot flags
160 pgf_pif : slv4; -- pgf: int flags
161 stf_sbf : slv4; -- stf: boot flags
162 stf_sif : slv4; -- stf: int flags
163 dcf_brk : slv4; -- dcf: break flags
164 dcf_dcf : slv4; -- dcf: disconnect flags
165 exc_ui : slv4; -- exc: unexpected int
166 exc_rte : slv4; -- exc: transm. error
167 mtc_mttp : slbit; -- mtc: maint. type
168 mtc_mfrm : slbit; -- mtc: maint. frame err
169 mtc_mid : slv2; -- mtc: maint. id
170 mtc_dsbt : slbit; -- mtc: disable boot
171 mtc_enmxd : slbit; -- mtc: enable maint mux
172 mtc_enmlp : slbit; -- mtc: enable maint loop
173 mtc_dsdrv : slbit; -- mtc: disable driver
174 state : state_type; -- state
175 req_clear : slbit; -- request clear
176 req_stsnd : slbit; -- request sanity timer transmit
177 req_pgsnd : slbit; -- request prog. gen. transmit
178 tcnt256 : slv8; -- usec clock divider for st clock
179 tcntsnd : slv8; -- timer for transmit delay
180 req_lock : slbit; -- cpu lock request
181 req_boot : slbit; -- cpu boot request
182 end record regs_type;
183
184 constant regs_init : regs_type := (
185 '0', -- ibsel
186 "0000", -- acr_ac
187 "0000","0000", -- pge_pbe, pge_pie
188 '0', -- pgc_grj
189 '0','0', -- pgc_pgrmr, pgc_strmr
190 '0','0', -- pgc_ie, pgc_ptp
191 "0000","0000", -- ste_sbe, ste_sie
192 (others=>'0'), -- stc_count
193 '0','0', -- stc_tmo, stc_lke
194 '0','0', -- stc_stp, stc_enb
195 "0000","0000", -- msk_bm, msk_im
196 "0000","0000", -- pgf_pbf, pgf_pif
197 "0000","0000", -- stf_sbf, stf_sif
198 "0000","0000", -- dcf_brk, dcf_dcf
199 "0000","0000", -- exc_ui, exc_rte
200 '0','0', -- mtc_mttp, mtc_mfrm
201 "00", -- mtc_mid
202 '0','0', -- mtc_dsbt, mtc_enmxd
203 '0','0', -- mtc_enmlp, mtc_dsdrv
204 s_idle, -- state
205 '0', -- req_clear
206 '0','0', -- req_stsnd, req_pgsnd
207 (others=>'0'), -- tcnt256
208 (others=>'0'), -- tcntsnd
209 '0','0' -- req_lock, req_boot
210 );
211
213 signal N_REGS : regs_type; -- don't init (vivado fix for fsm infer)
214
215begin
216
217 proc_regs: process (CLK)
218 begin
219 if rising_edge(CLK) then
220 if BRESET = '1' or -- BRESET is 1 for system and ibus reset
221 R_REGS.req_clear='1' then
222 R_REGS <= regs_init; --
223 if RESET = '0' then -- if RESET=0 we do just an ibus reset
224 R_REGS.pgf_pbf <= N_REGS.pgf_pbf; -- don't reset pg boot flags
225 R_REGS.stf_sbf <= N_REGS.stf_sbf; -- don't reset st boot flags
226 R_REGS.tcnt256 <= N_REGS.tcnt256; -- don't reset st clock divider
227 end if;
228 else
229 R_REGS <= N_REGS;
230 end if;
231 end if;
232 end process proc_regs;
233
234 proc_next : process (R_REGS, CE_USEC, IB_MREQ,
235 IIST_BUS(0), IIST_BUS(1), IIST_BUS(2), IIST_BUS(3),
236 IIST_SRES)
237 variable r : regs_type := regs_init;
238 variable n : regs_type := regs_init;
239 variable ibhold : slbit := '0';
240 variable idout : slv16 := (others=>'0');
241 variable ibreq : slbit := '0';
242 variable ibrd : slbit := '0';
243 variable ibw0 : slbit := '0';
244 variable ibw1 : slbit := '0';
245 variable int_or : slbit := '0';
246 variable tcnt256_end : slbit := '0';
247 variable tcntsnd_end : slbit := '0';
248 variable eff_id : slv2 := "00";
249 variable eff_bus : iist_bus_type := iist_bus_init;
250 variable par_err : slbit := '0';
251 variable act_ibit : slbit := '0';
252 variable act_bbit : slbit := '0';
253 variable iout : iist_line_type := iist_line_init;
254 begin
255
256 r := R_REGS;
257 n := R_REGS;
258
259 ibhold := '0';
260 idout := (others=>'0');
261 ibreq := IB_MREQ.re or IB_MREQ.we;
262 ibrd := IB_MREQ.re;
263 ibw0 := IB_MREQ.we and IB_MREQ.be0;
264 ibw1 := IB_MREQ.we and IB_MREQ.be1;
265
266 int_or := r.pgc_grj or r.pgc_pgrmr or r.pgc_strmr;
267 for i in r.dcf_dcf'range loop
268 int_or := int_or or r.dcf_dcf(i) or
269 r.exc_rte(i) or
270 r.pgf_pif(i) or
271 r.stf_sif(i);
272 end loop; -- i
273
274 tcnt256_end := '0';
275 if CE_USEC='1' and r.stc_enb='1'then -- if st enabled on every usec
276 n.tcnt256 := slv(unsigned(r.tcnt256) + 1); -- advance 8 bit counter
277 if unsigned(r.tcnt256) = 255 then -- if wrap
278 tcnt256_end := '1'; -- signal 256 usec passed
279 end if;
280 end if;
281
282 tcntsnd_end := '0';
283 n.tcntsnd := slv(unsigned(r.tcntsnd) + 1); -- advance send timer counter
284 if unsigned(r.tcntsnd) = tdlysnd-1 then -- if delay time reached
285 tcntsnd_end := '1'; -- signal end
286 end if;
287
288 eff_id := SID; -- effective self-id, normally SID
289 if r.mtc_enmxd = '1' then -- if maint. mux enabled
290 eff_id := r.mtc_mid; -- use maint. id
291 end if;
292
293 eff_bus := IIST_BUS;
294
295 par_err := '0';
296 act_ibit := '0';
297 act_bbit := '0';
298 iout := iist_line_init; -- default state of out line
299
300 -- ibus address decoder
301 n.ibsel := '0';
302 if IB_MREQ.aval='1' and
303 IB_MREQ.addr(12 downto 2)=ibaddr_iist(12 downto 2) then
304 n.ibsel := '1';
305 end if;
306
307 -- internal state machine
308 case r.state is
309 when s_idle => -- idle state
310 n.tcntsnd := (others=>'0'); -- keep send delay timer zero
311 if r.req_stsnd = '1' then -- sanity timer request pending
312 n.state := s_stsnd;
313 elsif r.req_pgsnd = '1' then -- prog. gen. request pending
314 n.state := s_pgsnd;
315 end if;
316
317 when s_clear => -- handle acr clr
318 ibhold := r.ibsel; -- keep req pending if selected
319 -- r.req_clear is set when in this state and cause a reset in prog_regs
320 -- --> n.req_clear := '0';
321 -- --> n.state := s_idle;
322
323 when s_stsnd => -- handle st transmit
324 if tcntsnd_end = '1' then -- send delay expired
325 n.req_stsnd := '0'; -- clear st transmit request
326 iout.req := '1'; -- do transmit
327 iout.stf := '1'; -- signal type = st
328 iout.imask := r.ste_sie; -- int enables
329 iout.bmask := r.ste_sbe; -- boot enables
330 iout.par := not r.stc_stp; -- send parity (odd incl. stf!)
331 iout.frm := '0'; -- frame always ok
332 n.state := s_idle;
333 end if;
334
335 when s_pgsnd => -- handle pg transmit
336 if tcntsnd_end = '1' then -- send delay expired
337 n.req_pgsnd := '0'; -- clear pg transmit request
338 iout.req := '1'; -- do transmit
339 iout.stf := '0'; -- signal type = pg
340 iout.imask := r.pge_pie; -- int enables
341 iout.bmask := r.pge_pbe; -- boot enables
342 iout.par := r.pgc_ptp; -- send parity
343 iout.frm := '0'; -- frame always ok
344 n.state := s_idle;
345 end if;
346
347 when others => null;
348 end case;
349
350 if r.mtc_enmxd = '1' then -- if maintenance mux enabled
351 iout.stf := r.mtc_mttp; -- force type from mtc_mttp
352 iout.frm := r.mtc_mfrm; -- force frame from mtc_mfrm
353 end if;
354
355 -- ibus transactions
356 if r.ibsel = '1' and ibhold='0' then
357
358 if IB_MREQ.addr(1 downto 1) = "0" then -- ACR -- access control reg -----
359
360 idout(acr_ibf_sid) := SID;
361 idout(acr_ibf_ac) := r.acr_ac;
362
363 if ibw1 = '1' then
364 if IB_MREQ.din(acr_ibf_clr) = '1' then
365 n.req_clear := '1';
366 n.state := s_clear;
367 end if;
368 end if;
369 if ibw0 = '1' then
370 n.acr_ac := IB_MREQ.din(acr_ibf_ac);
371 end if;
372
373 else -- ADR -- access data reg --------
374 case r.acr_ac is
375
376 when ac_pge => -- PGE -- program gen enables --------
377
378 idout(pge_ibf_pbe) := r.pge_pbe;
379 idout(pge_ibf_pie) := r.pge_pie;
380
381 if IB_MREQ.we = '1' then
382
383 if r.req_pgsnd = '0' then -- no pg transmit pending
384 if ibw1 = '1' then
385 n.pge_pbe := IB_MREQ.din(pge_ibf_pbe);
386 end if;
387 if ibw0 = '1' then
388 n.pge_pie := IB_MREQ.din(pge_ibf_pie);
389 end if;
390 else -- if collision with pg transmit
391 n.pgc_pgrmr := '1'; -- set pge refused flag
392 end if;
393
394 end if;
395
396 when ac_pgc => -- PGC -- program gen control/status -
397
398 idout(pgc_ibf_err) := r.pgc_grj or r.pgc_pgrmr or r.pgc_strmr;
399 idout(pgc_ibf_grj) := r.pgc_grj;
400 idout(pgc_ibf_pgrmr) := r.pgc_pgrmr;
401 idout(pgc_ibf_strmr) := r.pgc_strmr;
402 idout(pgc_ibf_rdy) := not r.req_pgsnd;
403 idout(pgc_ibf_sid) := eff_id;
404 idout(pgc_ibf_ip) := int_or;
405 idout(pgc_ibf_ie) := r.pgc_ie;
406 idout(pgc_ibf_ptp) := r.pgc_ptp;
407
408 if ibw1 = '1' then
409 if IB_MREQ.din(pgc_ibf_err) = '1' then -- '1' written into ERR
410 n.pgc_grj := '0'; -- clears GRJ
411 n.pgc_pgrmr := '0'; -- clears PGRMR
412 n.pgc_strmr := '0'; -- clears STRMR
413 end if;
414 end if;
415 if ibw0 = '1' then
416 n.pgc_ie := IB_MREQ.din(pgc_ibf_ie);
417 n.pgc_ptp := IB_MREQ.din(pgc_ibf_ptp);
418 if IB_MREQ.din(pgc_ibf_go) = '1' then -- GO bit set
419 if r.req_pgsnd = '0' then -- if ready (no pgsnd pend)
420 n.req_pgsnd := '1'; -- request pgsnd
421 else -- if not ready
422 n.pgc_grj := '1'; -- set go reject flag
423 end if;
424 end if;
425 end if;
426
427 when ac_ste => -- STE -- sanity timer enables -------
428
429 idout(ste_ibf_sbe) := r.ste_sbe;
430 idout(ste_ibf_sie) := r.ste_sie;
431
432 if IB_MREQ.we = '1' then
433
434 if r.req_stsnd = '0' then -- no st transmit pending
435 if ibw1 = '1' then
436 n.ste_sbe := IB_MREQ.din(ste_ibf_sbe);
437 end if;
438 if ibw0 = '1' then
439 n.ste_sie := IB_MREQ.din(ste_ibf_sie);
440 end if;
441
442 else -- if collision with st transmit
443 n.pgc_strmr := '1'; -- set ste refused flag
444 end if;
445
446 end if;
447
448 when ac_stc => -- STC -- sanity timer control/status
449
450 idout(stc_ibf_count) := r.stc_count;
451 idout(stc_ibf_tmo) := r.stc_tmo;
452 idout(stc_ibf_lke) := r.stc_lke;
453 idout(stc_ibf_stp) := r.stc_stp;
454 idout(stc_ibf_enb) := r.stc_enb;
455
456 if ibw1 = '1' then
457 n.stc_count := IB_MREQ.din(stc_ibf_count); -- reset st count
458 n.tcnt256 := (others=>'0'); -- reset usec count
459 end if;
460 if ibw0 = '1' then
461 if IB_MREQ.din(stc_ibf_tmo) = '1' then -- 1 written into TMO
462 n.stc_tmo := '0';
463 end if;
464 n.stc_lke := IB_MREQ.din(stc_ibf_lke);
465 n.stc_stp := IB_MREQ.din(stc_ibf_stp);
466 n.stc_enb := IB_MREQ.din(stc_ibf_enb);
467 end if;
468
469 when ac_msk => -- MSK -- input masks ----------------
470
471 idout(msk_ibf_bm) := r.msk_bm;
472 idout(msk_ibf_im) := r.msk_im;
473
474 if ibw1 = '1' then
475 n.msk_bm := IB_MREQ.din(msk_ibf_bm);
476 end if;
477 if ibw0 = '1' then
478 n.msk_im := IB_MREQ.din(msk_ibf_im);
479 end if;
480
481 when ac_pgf => -- PGF -- program generated flags ----
482
483 idout(pgf_ibf_pbf) := r.pgf_pbf;
484 idout(pgf_ibf_pif) := r.pgf_pif;
485
486 if ibw1 = '1' then
487 n.pgf_pbf := r.pgf_pbf and not IB_MREQ.din(pgf_ibf_pbf);
488 end if;
489 if ibw0 = '1' then
490 n.pgf_pif := r.pgf_pif and not IB_MREQ.din(pgf_ibf_pif);
491 end if;
492
493 when ac_stf => -- STF -- sanity timer flags ---------
494
495 idout(stf_ibf_sbf) := r.stf_sbf;
496 idout(stf_ibf_sif) := r.stf_sif;
497
498 if ibw1 = '1' then
499 n.stf_sbf := r.stf_sbf and not IB_MREQ.din(stf_ibf_sbf);
500 end if;
501 if ibw0 = '1' then
502 n.stf_sif := r.stf_sif and not IB_MREQ.din(stf_ibf_sif);
503 end if;
504
505 when ac_dcf => -- DCE -- disconnect flags -----------
506
507 idout(dcf_ibf_brk) := r.dcf_brk;
508 idout(dcf_ibf_dcf) := r.dcf_dcf;
509
510 if ibw0 = '1' then
511 n.dcf_dcf := r.dcf_dcf and not IB_MREQ.din(dcf_ibf_dcf);
512 end if;
513
514 when ac_exc => -- EXC -- exceptions -----------------
515
516 idout(exc_ibf_ui) := r.exc_ui;
517 idout(exc_ibf_rte) := r.exc_rte;
518
519 if ibw1 = '1' then
520 n.exc_ui := r.exc_ui and not IB_MREQ.din(exc_ibf_ui);
521 end if;
522 if ibw0 = '1' then
523 n.exc_rte := r.exc_rte and not IB_MREQ.din(exc_ibf_rte);
524 end if;
525
526 when ac_mtc => -- MTC -- maintenance control --------
527
528 idout(mtc_ibf_mttp) := r.mtc_mttp;
529 idout(mtc_ibf_mfrm) := r.mtc_mfrm;
530 idout(mtc_ibf_mid) := r.mtc_mid;
531 idout(mtc_ibf_dsbt) := r.mtc_dsbt;
532 idout(mtc_ibf_enmxd) := r.mtc_enmxd;
533 idout(mtc_ibf_enmlp) := r.mtc_enmlp;
534 idout(mtc_ibf_dsdrv) := r.mtc_dsdrv;
535
536 if ibw1 = '1' then
537 n.mtc_mttp := IB_MREQ.din(mtc_ibf_mttp);
538 n.mtc_mfrm := IB_MREQ.din(mtc_ibf_mfrm);
539 n.mtc_mid := IB_MREQ.din(mtc_ibf_mid);
540 end if;
541 if ibw0 = '1' then
542 n.mtc_dsbt := IB_MREQ.din(mtc_ibf_dsbt);
543 n.mtc_enmxd := IB_MREQ.din(mtc_ibf_enmxd);
544 n.mtc_enmlp := IB_MREQ.din(mtc_ibf_enmlp);
545 n.mtc_dsdrv := IB_MREQ.din(mtc_ibf_dsdrv);
546 end if;
547
548 when others => -- access to undefined AC code -------
549 null;
550
551 end case;
552
553 if unsigned(r.acr_ac) <= unsigned(ac_exc) then -- if ac 0,..,10
554 if IB_MREQ.rmw = '0' then -- if not 1st part of rmw
555 n.acr_ac := slv(unsigned(r.acr_ac) + 1); -- autoincrement
556 end if;
557 end if;
558
559 end if;
560
561 end if;
562
563 -- sanity timer
564
565 if tcnt256_end = '1' then -- if 256 usec expired (and enabled)
566 n.stc_count := slv(unsigned(r.stc_count) - 1);
567 if unsigned(r.stc_count) = 0 then -- if sanity timer expired
568 n.stc_tmo := '1'; -- set timeout flag
569 n.req_stsnd := '1'; -- request st transmit
570 if r.stc_lke = '1' then -- if lockup enabled
571 n.req_lock := '1'; -- request lockup
572 end if;
573 end if;
574 end if;
575
576 -- process iist bus inputs
577
578 if r.mtc_enmlp = '1' then -- if mainentance loop
579 for i in eff_bus'range loop
580 eff_bus(i) := iout; -- local signal on all input ports
581 eff_bus(i).dcf := '0'; -- all ports considered connected
582 end loop; -- i
583 end if;
584
585 for i in eff_bus'range loop
586
587 par_err := eff_bus(i).stf xor
588 eff_bus(i).imask(0) xor eff_bus(i).imask(1) xor
589 eff_bus(i).imask(2) xor eff_bus(i).imask(3) xor
590 eff_bus(i).bmask(0) xor eff_bus(i).bmask(1) xor
591 eff_bus(i).bmask(2) xor eff_bus(i).bmask(3) xor
592 not eff_bus(i).par;
593
594 act_ibit := eff_bus(i).imask(to_integer(unsigned(eff_id)));
595 act_bbit := eff_bus(i).bmask(to_integer(unsigned(eff_id)));
596
597 n.dcf_brk(i) := eff_bus(i).dcf; -- trace dcf state in brk
598
599 if eff_bus(i).dcf = '1' then -- if disconnected
600 if r.msk_im(i) = '0' then -- if not disabled
601 n.dcf_dcf(i) := '1'; -- set dcf flag
602 end if;
603
604 else -- if connected
605 if eff_bus(i).req = '1' then -- request received ?
606 if eff_bus(i).frm='1' or -- frame error seen ?
607 par_err='1' then -- parity error seen ?
608 if r.msk_im(i) = '0' then -- if not disabled
609 n.exc_rte(i) := '1'; -- set rte flag
610 end if;
611
612 else -- here if valid request seen
613 if act_ibit = '1' then -- interrupt request
614 if r.msk_im(i) = '1' then -- if disabled
615 n.exc_ui(i) := '1'; -- set ui flag
616 else -- if enabled
617 n.req_lock := '0'; -- release lock
618 if eff_bus(i).stf = '0' then -- and pg request
619 n.pgf_pif(i) := '1'; -- set pif flag
620 else -- and st request
621 n.stf_sif(i) := '1'; -- set sif flag
622 end if;
623 end if;
624 end if; -- act_ibit='1'
625
626 if act_bbit = '1' then -- boot request
627 if r.msk_bm(i) = '1' then -- if msk disabled
628 n.exc_ui(i) := '1'; -- set ui flag
629 else -- if msk enabled
630 if r.mtc_dsbt = '0' then -- if mtc enabled
631 n.req_lock := '0'; -- release lock
632 n.req_boot := '1'; -- request boot
633 end if;
634 if eff_bus(i).stf = '0' then -- and pg request
635 n.pgf_pbf(i) := '1'; -- set pbf flag
636 else -- and st request
637 n.stf_sbf(i) := '1'; -- set sbf flag
638 end if;
639 end if;
640 end if; -- act_bbit='1'
641
642 end if;
643
644 end if;
645 end if;
646 end loop;
647
648 -- process cpu->iist responses
649 if IIST_SRES.ack_lock = '1' then
650 n.req_lock := '0';
651 end if;
652 if IIST_SRES.ack_boot = '1' then
653 n.req_boot := '0';
654 end if;
655
656 N_REGS <= n;
657
658 IB_SRES.dout <= idout;
659 IB_SRES.ack <= r.ibsel and ibreq;
660 IB_SRES.busy <= ibhold and ibreq;
661
662 EI_REQ <= r.pgc_ie and int_or;
663
664 if r.mtc_dsdrv = '1' then -- if driver disconnected
665 iout.dcf := '1'; -- set dcf flag
666 iout.req := '0'; -- suppress requests
667 end if;
668 IIST_OUT <= iout; -- and finally send it out...
669
670 IIST_MREQ.lock <= r.req_lock;
671 IIST_MREQ.boot <= r.req_boot;
672
673 end process proc_next;
674
675
676end syn;
integer range 3 downto 0 msk_ibf_im
Definition: ibd_iist.vhd:111
integer range 3 downto 0 pge_ibf_pie
Definition: ibd_iist.vhd:88
slv4 := "0110" ac_stf
Definition: ibd_iist.vhd:82
slv4 := "0100" ac_msk
Definition: ibd_iist.vhd:80
integer := 3 stc_ibf_tmo
Definition: ibd_iist.vhd:105
integer range 11 downto 8 ste_ibf_sbe
Definition: ibd_iist.vhd:101
integer range 11 downto 8 exc_ibf_ui
Definition: ibd_iist.vhd:122
integer range 11 downto 8 dcf_ibf_brk
Definition: ibd_iist.vhd:119
integer range 15 downto 8 stc_ibf_count
Definition: ibd_iist.vhd:104
integer := 0 mtc_ibf_dsdrv
Definition: ibd_iist.vhd:131
integer := 11 mtc_ibf_mttp
Definition: ibd_iist.vhd:125
integer range 11 downto 8 pge_ibf_pbe
Definition: ibd_iist.vhd:87
slv4 := "0001" ac_pgc
Definition: ibd_iist.vhd:77
integer := 2 pgc_ibf_ie
Definition: ibd_iist.vhd:97
slv4 := "1101" ac_mtc
Definition: ibd_iist.vhd:85
slv4 := "0000" ac_pge
Definition: ibd_iist.vhd:76
integer range 3 downto 0 stf_ibf_sif
Definition: ibd_iist.vhd:117
slv16 := slv( to_unsigned( 8#177500#, 16) ) ibaddr_iist
Definition: ibd_iist.vhd:65
integer range 3 downto 0 pgf_ibf_pif
Definition: ibd_iist.vhd:114
integer range 3 downto 0 dcf_ibf_dcf
Definition: ibd_iist.vhd:120
integer range 3 downto 0 ste_ibf_sie
Definition: ibd_iist.vhd:102
integer range 11 downto 8 stf_ibf_sbf
Definition: ibd_iist.vhd:116
integer := 12 pgc_ibf_strmr
Definition: ibd_iist.vhd:93
integer range 11 downto 8 msk_ibf_bm
Definition: ibd_iist.vhd:110
integer := 3 mtc_ibf_dsbt
Definition: ibd_iist.vhd:128
integer := 2 stc_ibf_lke
Definition: ibd_iist.vhd:106
integer := 0 stc_ibf_enb
Definition: ibd_iist.vhd:108
slv1 := "0" ibaddr_acr
Definition: ibd_iist.vhd:69
regs_type :=( '0', "0000", "0000", "0000", '0', '0', '0', '0', '0', "0000", "0000",( others => '0'), '0', '0', '0', '0', "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", "0000", '0', '0', "00", '0', '0', '0', '0', s_idle, '0', '0', '0',( others => '0'),( others => '0'), '0', '0') regs_init
Definition: ibd_iist.vhd:184
integer := 3 pgc_ibf_ip
Definition: ibd_iist.vhd:96
regs_type := regs_init R_REGS
Definition: ibd_iist.vhd:212
slv4 := "0010" ac_ste
Definition: ibd_iist.vhd:78
(s_idle,s_clear,s_stsnd,s_pgsnd) state_type
Definition: ibd_iist.vhd:133
regs_type N_REGS
Definition: ibd_iist.vhd:213
integer := 10 mtc_ibf_mfrm
Definition: ibd_iist.vhd:126
integer range 9 downto 8 pgc_ibf_sid
Definition: ibd_iist.vhd:95
integer := 0 pgc_ibf_go
Definition: ibd_iist.vhd:99
slv4 := "0111" ac_dcf
Definition: ibd_iist.vhd:83
integer := 15 pgc_ibf_err
Definition: ibd_iist.vhd:90
integer := 2 mtc_ibf_enmxd
Definition: ibd_iist.vhd:129
integer := 1 stc_ibf_stp
Definition: ibd_iist.vhd:107
integer range 9 downto 8 acr_ibf_sid
Definition: ibd_iist.vhd:73
integer := 15 acr_ibf_clr
Definition: ibd_iist.vhd:72
integer := 1 mtc_ibf_enmlp
Definition: ibd_iist.vhd:130
natural := 150 tdlysnd
Definition: ibd_iist.vhd:67
integer range 11 downto 8 pgf_ibf_pbf
Definition: ibd_iist.vhd:113
slv4 := "1000" ac_exc
Definition: ibd_iist.vhd:84
integer range 3 downto 0 exc_ibf_rte
Definition: ibd_iist.vhd:123
integer range 3 downto 0 acr_ibf_ac
Definition: ibd_iist.vhd:74
slv4 := "0101" ac_pgf
Definition: ibd_iist.vhd:81
integer := 13 pgc_ibf_pgrmr
Definition: ibd_iist.vhd:92
integer := 1 pgc_ibf_ptp
Definition: ibd_iist.vhd:98
slv4 := "0011" ac_stc
Definition: ibd_iist.vhd:79
integer range 9 downto 8 mtc_ibf_mid
Definition: ibd_iist.vhd:127
integer := 11 pgc_ibf_rdy
Definition: ibd_iist.vhd:94
integer := 14 pgc_ibf_grj
Definition: ibd_iist.vhd:91
slv1 := "1" ibaddr_adr
Definition: ibd_iist.vhd:70
out EI_REQ slbit
Definition: ibd_iist.vhd:54
in RESET slbit
Definition: ibd_iist.vhd:50
out IIST_OUT iist_line_type
Definition: ibd_iist.vhd:57
in CE_USEC slbit
Definition: ibd_iist.vhd:49
out IIST_MREQ iist_mreq_type
Definition: ibd_iist.vhd:58
SID slv2 := "00"
Definition: ibd_iist.vhd:46
in BRESET slbit
Definition: ibd_iist.vhd:51
in IIST_SRES iist_sres_type
Definition: ibd_iist.vhd:60
in IIST_BUS iist_bus_type
Definition: ibd_iist.vhd:56
in CLK slbit
Definition: ibd_iist.vhd:48
in IB_MREQ ib_mreq_type
Definition: ibd_iist.vhd:52
out IB_SRES ib_sres_type
Definition: ibd_iist.vhd:53
in EI_ACK slbit
Definition: ibd_iist.vhd:55
Definition: iblib.vhd:33
std_logic_vector( 3 downto 0) slv4
Definition: slvtypes.vhd:36
std_logic_vector( 0 downto 0) slv1
Definition: slvtypes.vhd:33
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( 1 downto 0) slv2
Definition: slvtypes.vhd:34
std_logic_vector slv
Definition: slvtypes.vhd:31