w11 - vhd 0.794
W11 CPU core and support modules
Loading...
Searching...
No Matches
ibdr_rhrp.vhd
Go to the documentation of this file.
1-- $Id: ibdr_rhrp.vhd 1181 2019-07-08 17:00:50Z mueller $
2-- SPDX-License-Identifier: GPL-3.0-or-later
3-- Copyright 2015-2016 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4--
5------------------------------------------------------------------------------
6-- Module Name: ibdr_rhrp - syn
7-- Description: ibus dev(rem): RHRP
8--
9-- Dependencies: ram_1swar_gen
10-- Test bench: -
11-- Target Devices: generic
12-- Tool versions: ise 14.7; viv 2014.4-2016.1; ghdl 0.31-0.33
13--
14-- Synthesized (xst):
15-- Date Rev ise Target flop lutl lutm slic t peri
16-- 2015-06-20 692 14.7 131013 xc6slx16-2 212 406 8 142 s 8.7
17-- 2015-05-14 680 14.7 131013 xc6slx16-2 211 408 8 131 s 8.8
18-- 2015-04-06 664 14.7 131013 xc6slx16-2 177 331 8 112 s 8.7
19--
20-- Revision History:
21-- Date Rev Version Comment
22-- 2016-05-22 767 1.0.4 don't init N_REGS (vivado fix for fsm inference)
23-- 2015-06-20 692 1.0.3 BUGFIX: fix func-go when drive/init busy checks
24-- 2015-06-05 690 1.0.2 use 'not unit' for lsb of rpsn to avoid SI detect
25-- BUGFIX: set rmr only for write to busy unit
26-- 2015-05-15 682 1.0.1 correct ibsel range select logic
27-- 2015-05-14 680 1.0 Initial version
28-- 2015-03-15 658 0.1 First draft
29------------------------------------------------------------------------------
30
31library ieee;
32use ieee.std_logic_1164.all;
33use ieee.numeric_std.all;
34
35use work.slvtypes.all;
36use work.memlib.all;
37use work.iblib.all;
38
39-- ----------------------------------------------------------------------------
40entity ibdr_rhrp is -- ibus dev(rem): RH+RP
41 -- fixed address: 176700
42 port (
43 CLK : in slbit; -- clock
44 CE_USEC : in slbit; -- usec pulse
45 BRESET : in slbit; -- ibus reset
46 ITIMER : in slbit; -- instruction timer
47 RB_LAM : out slbit; -- remote attention
48 IB_MREQ : in ib_mreq_type; -- ibus request
49 IB_SRES : out ib_sres_type; -- ibus response
50 EI_REQ : out slbit; -- interrupt request
51 EI_ACK : in slbit -- interrupt acknowledge
52 );
53
54 -- by default xst uses a binary encoding for the main fsm.
55 -- that give quite sub-optimal results, so force one-hot
56 attribute fsm_encoding : string;
57 attribute fsm_encoding of ibdr_rhrp : entity is "one-hot";
58
59end entity ibdr_rhrp;
60
61architecture syn of ibdr_rhrp is
62
63 constant ibaddr_rhrp : slv16 := slv(to_unsigned(8#176700#,16));
64
65 -- nam rw mb rp rm storage
66 constant ibaddr_cs1 : slv5 := "00000"; -- cs1 rw 0 rpcs1 rmcs1 m d,6+r
67 constant ibaddr_wc : slv5 := "00001"; -- wc rw - rpwc rmwc m 0,7
68 constant ibaddr_ba : slv5 := "00010"; -- ba rw - rpba rmba m 1,7
69 constant ibaddr_da : slv5 := "00011"; -- da rw 5 rpda rmda m d,0
70 constant ibaddr_cs2 : slv5 := "00100"; -- cs2 rw - rpcs2 rmcs2 r cs2*
71 constant ibaddr_ds : slv5 := "00101"; -- ds r- 1 rpds rmds r ds*
72 constant ibaddr_er1 : slv5 := "00110"; -- er1 rw 2 rper1 rmer1 r er1*
73 constant ibaddr_as : slv5 := "00111"; -- as rw 4 rpas rmas r as*
74 constant ibaddr_la : slv5 := "01000"; -- la r- 7 rpla rmla r sc
75 constant ibaddr_db : slv5 := "01001"; -- db r? - rpdb rmdb m 2,7
76 constant ibaddr_mr1 : slv5 := "01010"; -- mr1 rw 3 rpmr1 rmmr1 m d,3
77 constant ibaddr_dt : slv5 := "01011"; -- dt r- 6 rpdt rmdt r dt*+map
78 constant ibaddr_sn : slv5 := "01100"; -- sn r- 10 rpsn rmsn <map>
79 constant ibaddr_of : slv5 := "01101"; -- of rw 11 rpof rmof m d,1
80 constant ibaddr_dc : slv5 := "01110"; -- dc rw 12 rpdc rmdc m d,2
81 constant ibaddr_m13 : slv5 := "01111"; -- m13 rw 13 rpcc m =dc!
82 -- rw 13 rmhr m d,4
83 constant ibaddr_m14 : slv5 := "10000"; -- m14 rw 14 rper2 =0
84 -- rw 14 rmmr2 m d,5
85 constant ibaddr_m15 : slv5 := "10001"; -- m15 rw 15 rper3 =0
86 -- rw 15 rmer2 =0
87 constant ibaddr_ec1 : slv5 := "10010"; -- ec1 r- 16 rpec1 rmec1 =0
88 constant ibaddr_ec2 : slv5 := "10011"; -- ec1 r- 17 rpec2 rmec2 =0
89 constant ibaddr_bae : slv5 := "10100"; -- bae rw - rpbae rmbae r bae
90 constant ibaddr_cs3 : slv5 := "10101"; -- cs3 rw - rpcs3 rmcs3 r cs3*
91
92 constant omux_cs1 : slv4 := "0000";
93 constant omux_cs2 : slv4 := "0001";
94 constant omux_ds : slv4 := "0010";
95 constant omux_er1 : slv4 := "0011";
96 constant omux_as : slv4 := "0100";
97 constant omux_la : slv4 := "0101";
98 constant omux_dt : slv4 := "0110";
99 constant omux_sn : slv4 := "0111";
100 constant omux_bae : slv4 := "1000";
101 constant omux_cs3 : slv4 := "1001";
102 constant omux_mem : slv4 := "1010";
103 constant omux_zero : slv4 := "1111";
104
105 constant amapc_da : slv3 := "000";
106 constant amapc_mr1 : slv3 := "011";
107 constant amapc_of : slv3 := "001";
108 constant amapc_dc : slv3 := "010";
109 constant amapc_hr : slv3 := "100";
110 constant amapc_mr2 : slv3 := "101";
111 constant amapc_cs1 : slv3 := "110";
112 constant amapc_ext : slv3 := "111";
113
114 constant amapr_wc : slv2 := "00";
115 constant amapr_ba : slv2 := "01";
116 constant amapr_db : slv2 := "10";
117
118 subtype amap_f_unit is integer range 4 downto 3; -- unit part
119 subtype amap_f_reg is integer range 2 downto 0; -- reg part
120
121 constant clrmode_breset : slv2 := "00";
122 constant clrmode_cs2clr : slv2 := "01";
123 constant clrmode_fdclr : slv2 := "10";
124 constant clrmode_fpres : slv2 := "11";
125
126 constant cs1_ibf_sc : integer := 15; -- special condition
127 constant cs1_ibf_tre : integer := 14; -- transfer error
128 constant cs1_ibf_dva : integer := 11; -- drive available
129 subtype cs1_ibf_bae is integer range 9 downto 8; -- bus addr ext (1:0)
130 constant cs1_ibf_rdy : integer := 7; -- controller ready
131 constant cs1_ibf_ie : integer := 6; -- interrupt enable
132 subtype cs1_ibf_func is integer range 5 downto 1; -- function code
133 constant cs1_ibf_go : integer := 0; -- interrupt enable
134
135 constant func_noop : slv5 := "00000"; -- func: noop
136 constant func_unl : slv5 := "00001"; -- func: unload
137 constant func_seek : slv5 := "00010"; -- func: seek
138 constant func_recal : slv5 := "00011"; -- func: recalibrate
139 constant func_dclr : slv5 := "00100"; -- func: drive clear
140 constant func_pore : slv5 := "00101"; -- func: port release
141 constant func_offs : slv5 := "00110"; -- func: offset
142 constant func_retc : slv5 := "00111"; -- func: return to center
143 constant func_pres : slv5 := "01000"; -- func: readin preset
144 constant func_pack : slv5 := "01001"; -- func: pack acknowledge
145 constant func_sear : slv5 := "01100"; -- func: search
146 constant func_xfer : slv5 := "10100"; -- used to check for xfer type funcs
147 constant func_wcd : slv5 := "10100"; -- func: write check data
148 constant func_wchd : slv5 := "10101"; -- func: write check header&data
149 constant func_write : slv5 := "11000"; -- func: write
150 constant func_whd : slv5 := "11001"; -- func: write header&data
151 constant func_read : slv5 := "11100"; -- func: read
152 constant func_rhd : slv5 := "11101"; -- func: read header&data
153
154 constant rfunc_wunit : slv5 := "00001"; -- rem func: write runit
155 constant rfunc_cunit : slv5 := "00010"; -- rem func: copy funit->runit
156 constant rfunc_done : slv5 := "00011"; -- rem func: done (set rdy)
157 constant rfunc_widly : slv5 := "00100"; -- rem func: write idly
158
159 -- cs1 usage for rem functions
160 subtype cs1_ibf_runit is integer range 9 downto 8; -- new runit (_wunit)
161 constant cs1_ibf_rata : integer := 8; -- use ata (_done)
162 subtype cs1_ibf_ridly is integer range 15 downto 8; -- new idly (_widly)
163
164 subtype da_ibf_ta is integer range 12 downto 8; -- track addr
165 subtype da_ibf_sa is integer range 5 downto 0; -- sector addr
166
167 constant cs2_ibf_rwco : integer := 15; -- rem: write check odd word
168 constant cs2_ibf_wce : integer := 14; -- write check error
169 constant cs2_ibf_ned : integer := 12; -- non-existent drive
170 constant cs2_ibf_nem : integer := 11; -- non-existent memory
171 constant cs2_ibf_pge : integer := 10; -- programming error
172 constant cs2_ibf_mxf : integer := 9; -- missed transfer
173 constant cs2_ibf_or : integer := 7; -- output ready
174 constant cs2_ibf_ir : integer := 6; -- input ready
175 constant cs2_ibf_clr : integer := 5; -- clear controller
176 constant cs2_ibf_pat : integer := 4; -- parity test
177 constant cs2_ibf_bai : integer := 3; -- bus address inhibit
178 constant cs2_ibf_unit2 : integer := 2; -- unit select msb
179 subtype cs2_ibf_unit is integer range 1 downto 0; -- unit select
180
181 constant ds_ibf_ata : integer := 15; -- attention
182 constant ds_ibf_erp : integer := 14; -- any errors in er1 or er2
183 constant ds_ibf_pip : integer := 13; -- positioning in progress
184 constant ds_ibf_mol : integer := 12; -- medium online (ATTACHED)
185 constant ds_ibf_wrl : integer := 11; -- write locked
186 constant ds_ibf_lbt : integer := 10; -- last block transfered
187 constant ds_ibf_dpr : integer := 8; -- drive present (ENABLED)
188 constant ds_ibf_dry : integer := 7; -- drive ready
189 constant ds_ibf_vv : integer := 6; -- volume valid
190 constant ds_ibf_om : integer := 0; -- offset mode
191
192 constant er1_ibf_uns : integer := 14; -- drive unsafe
193 constant er1_ibf_wle : integer := 11; -- write lock error
194 constant er1_ibf_iae : integer := 10; -- invalid address error
195 constant er1_ibf_aoe : integer := 9; -- address overflow error
196 constant er1_ibf_rmr : integer := 2; -- register modification refused
197 constant er1_ibf_ilf : integer := 0; -- illegal function
198
199 subtype la_ibf_sc is integer range 11 downto 6; -- current sector
200
201 constant dt_ibf_rm : integer := 2; -- rm cntl
202 constant dt_ibf_e1 : integer := 1; -- encoded type bit 1
203 constant dt_ibf_e0 : integer := 0; -- encoded type bit 0
204
205 constant dte_rp04 : slv3 := "000"; -- encoded dt for rp04 rm=0
206 constant dte_rp06 : slv3 := "001"; -- encoded dt for rp06 rm=0
207 constant dte_rm03 : slv3 := "100"; -- encoded dt for rm03 rm=1
208 constant dte_rm80 : slv3 := "101"; -- encoded dt for rm80 rm=1
209 constant dte_rm05 : slv3 := "110"; -- encoded dt for rm05 rm=1
210 constant dte_rp07 : slv3 := "111"; -- encoded dt for rp07 rm=1
211
212 subtype dc_ibf_ca is integer range 9 downto 0; -- cyclinder addr
213
214 subtype bae_ibf_bae is integer range 5 downto 0; -- bus addr ext.
215
216 constant cs3_ibf_wco : integer := 12; -- write check odd
217 constant cs3_ibf_wce : integer := 11; -- write check even
218 constant cs3_ibf_ie : integer := 6; -- interrupt enable
219 constant cs3_ibf_rseardone : integer := 3; -- rem: sear done flag
220 constant cs3_ibf_rpackdone : integer := 2; -- rem: pack done flag
221 constant cs3_ibf_rporedone : integer := 1; -- rem: pore done flag
222 constant cs3_ibf_rseekdone : integer := 0; -- rem: seek done flag
223
224 -- RP controller type disks
225 constant rp04_dtyp : slv6 := slv(to_unsigned( 8#20#, 6));
226 constant rp04_camax : slv10 := slv(to_unsigned( 411-1, 10));
227 constant rp04_tamax : slv5 := slv(to_unsigned( 19-1, 5));
228 constant rp04_samax : slv6 := slv(to_unsigned( 22-1, 6));
229
230 constant rp06_dtyp : slv6 := slv(to_unsigned( 8#22#, 6));
231 constant rp06_camax : slv10 := slv(to_unsigned( 815-1, 10));
232 constant rp06_tamax : slv5 := slv(to_unsigned( 19-1, 5));
233 constant rp06_samax : slv6 := slv(to_unsigned( 22-1, 6));
234
235 -- RM controller type disks (Note: rp07 has a RM stype controller!)
236 constant rm03_dtyp : slv6 := slv(to_unsigned( 8#24#, 6));
237 constant rm03_camax : slv10 := slv(to_unsigned( 823-1, 10));
238 constant rm03_tamax : slv5 := slv(to_unsigned( 5-1, 5));
239 constant rm03_samax : slv6 := slv(to_unsigned( 32-1, 6));
240
241 constant rm80_dtyp : slv6 := slv(to_unsigned( 8#26#, 6));
242 constant rm80_camax : slv10 := slv(to_unsigned( 559-1, 10));
243 constant rm80_tamax : slv5 := slv(to_unsigned( 14-1, 5));
244 constant rm80_samax : slv6 := slv(to_unsigned( 31-1, 6));
245
246 constant rm05_dtyp : slv6 := slv(to_unsigned( 8#27#, 6));
247 constant rm05_camax : slv10 := slv(to_unsigned( 823-1, 10));
248 constant rm05_tamax : slv5 := slv(to_unsigned( 19-1, 5));
249 constant rm05_samax : slv6 := slv(to_unsigned( 32-1, 6));
250
251 constant rp07_dtyp : slv6 := slv(to_unsigned( 8#42#, 6));
252 constant rp07_camax : slv10 := slv(to_unsigned( 630-1, 10));
253 constant rp07_tamax : slv5 := slv(to_unsigned( 32-1, 5));
254 constant rp07_samax : slv6 := slv(to_unsigned( 50-1, 6));
255
256 type state_type is (
257 s_idle, -- idle: handle ibus
258 s_wcs1, -- wcs1: write cs1
259 s_wcs2, -- wcs2: write cs2
260 s_wcs3, -- wcs3: write cs3
261 s_wer1, -- wer1: write er1 (rem only)
262 s_was, -- was: write as
263 s_wdt, -- wdt: write dt (rem only)
264 s_wds, -- wdt: write ds (rem only)
265 s_wbae, -- wbae: write bae
266 s_wmem, -- wmem: write mem (DA,MR1,OF,DC,MR2)
267 s_wmembe, -- wmem: write mem with be (WC,BA,DB)
268 s_whr, -- whr: write hr (holding reg only)
269 s_funcchk, -- funcchk: check function go
270 s_funcgo, -- funcgo: handle function go
271 s_chkdc, -- chkdc: handle dc check
272 s_chkda, -- chksa: handle da check
273 s_chkdo, -- chkdo: execute function
274 s_read, -- read: all register reads
275 s_setrmr, -- set rmr flag
276 s_oot_clr0, -- OOT clr0: state 0
277 s_oot_clr1, -- OOT clr1: state 1
278 s_oot_clr2 -- OOT clr2: state 2
279 );
280
281 type regs_type is record -- state registers
282 ibsel : slbit; -- ibus select
283 state : state_type; -- state
284 amap : slv5; -- mem mapped address
285 omux : slv4; -- omux select
286 dinmsk : slv16; -- mbreq.din masked
287 dtrm : slv4; -- dt: drive rm controller
288 dte1 : slv4; -- dt: drive type bit 1
289 dte0 : slv4; -- dt: drive type bit 0
290 bae : slv6; -- bae: bus addr extension (in cs1&bae)
291 cs1sc : slbit; -- cs1: special condition
292 cs1tre : slbit; -- cs1: transfer error
293 cs1rdy : slbit; -- cs1: controller ready
294 cs1ie : slbit; -- cs1: interrupt enable
295 ffunc : slv5; -- func code (frozen on ext func go)
296 fxfer : slbit; -- func is xfer
297 cs2wce : slbit; -- cs2: write check error
298 cs2ned : slbit; -- cs2: non-existent drive
299 cs2nem : slbit; -- cs2: non-existent memory
300 cs2pge : slbit; -- cs2: programming error
301 cs2mxf : slbit; -- cs2: missed transfer
302 cs2pat : slbit; -- cs2: parity test
303 cs2bai : slbit; -- cs2: bus address inhibit
304 cs2unit2: slbit; -- cs2: unit lsb
305 cs2unit : slv2; -- unit (ibus view)
306 funit : slv2; -- unit (frozen on ext func go)
307 runit : slv2; -- unit (remote view)
308 eunit : slv2; -- unit (effective)
309 dsata : slv4; -- ds: attention
310 dserp : slv4; -- ds: error summary (or of er1+er2)
311 dspip : slv4; -- ds: positioning in progress
312 dsmol : slv4; -- ds: medium online (ATTACHED)
313 dswrl : slv4; -- ds: write locked
314 dslbt : slv4; -- ds: last block transfered
315 dsdpr : slv4; -- ds: drive present (ENABLED)
316 dsvv : slv4; -- ds: volume valid
317 dsom : slv4; -- ds: offset mode
318 er1uns : slv4; -- er1: dive unsafe
319 er1wle : slv4; -- er1: write lock error
320 er1iae : slv4; -- er1: invalid address error
321 er1aoe : slv4; -- er1: address overflow error
322 er1rmr : slv4; -- er1: register modificaton refused
323 er1ilf : slv4; -- er1: illegal function
324 cs3wco : slbit; -- cs3: write check odd word
325 idlyval : slv8; -- int delay value
326 idlycnt : slv8; -- int delay counter
327 seekdone: slbit; -- cs3 rem: seek done
328 poredone: slbit; -- cs3 rem: port rel done
329 packdone: slbit; -- cs3 rem: pack ack done
330 seardone: slbit; -- cs3 rem: search done
331 ned : slbit; -- current drive non-existent
332 cerm : slbit; -- current eff. drive rm controller
333 dtyp : slv6; -- current drive type (5:0)
334 camax : slv10; -- current max cylinder address
335 tamax : slv5; -- current max track address
336 samax : slv6; -- current max sector address
337 uscnt : slv7; -- usec counter
338 sc : slv6; -- current sector counter
339 clrmode : slv2; -- clear: mode
340 clrreg : slv3; -- clear: register counter
341 ireq : slbit; -- interrupt request flag
342 end record regs_type;
343
344 constant regs_init : regs_type := (
345 '0', -- ibsel
346 s_idle, -- state
347 (others=>'0'), -- amap,
348 (others=>'0'), -- omux,
349 (others=>'0'), -- dinmsk,
350 (others=>'0'), -- dtrm
351 (others=>'0'), -- dte1
352 (others=>'0'), -- dte0
353 (others=>'0'), -- bae,
354 '0','0','1','0', -- cs1sc,cs1tre,cs1rdy,cs1ie
355 (others=>'0'), -- ffunc
356 '0', -- fxfer
357 '0','0','0','0', -- cs2wce,cs2ned,cs2nem,cs2pge
358 '0','0','0', -- cs2mxf,cs2pat,cs2bai
359 '0', -- cs2unit2
360 (others=>'0'), -- cs2unit
361 (others=>'0'), -- funit
362 (others=>'0'), -- runit
363 (others=>'0'), -- eunit
364 (others=>'0'), -- dsata
365 (others=>'0'), -- dserp
366 (others=>'0'), -- dspip
367 (others=>'0'), -- dsmol
368 (others=>'0'), -- dswrl
369 (others=>'0'), -- dslbt
370 (others=>'0'), -- dsdpr
371 (others=>'0'), -- dsvv
372 (others=>'0'), -- dsom
373 (others=>'0'), -- er1uns
374 (others=>'0'), -- er1wle
375 (others=>'0'), -- er1iae
376 (others=>'0'), -- er1aoe
377 (others=>'0'), -- er1rmr
378 (others=>'0'), -- er1ilf
379 '0', -- cs3wco
380 x"0a", -- idlyval (default delay=10)
381 (others=>'0'), -- idlycnt
382 '0','0','0','0', -- seekdone,poredone,packdone,seardone
383 '0','0', -- ned,cerm
384 (others=>'0'), -- dtyp
385 (others=>'0'), -- camax
386 (others=>'0'), -- tamax
387 (others=>'0'), -- samax
388 (others=>'0'), -- uscnt
389 (others=>'0'), -- sc
390 (others=>'0'), -- clrmode
391 (others=>'0'), -- clrreg
392 '0' -- ireq
393 );
394
396 signal N_REGS : regs_type; -- don't init (vivado fix for fsm infer)
397
398 signal MEM_1_WE : slbit := '0';
399 signal MEM_0_WE : slbit := '0';
400 signal MEM_ADDR : slv5 := (others=>'0');
401 signal MEM_DIN : slv16 := (others=>'0');
402 signal MEM_DOUT : slv16 := (others=>'0');
403
404 -- the following is unfortunately not accepted by xst:
405 -- attribute fsm_encoding : string;
406 -- attribute fsm_encoding of R_REGS.state : signal is "one-hot";
407
408begin
409
410 MEM_1 : ram_1swar_gen
411 generic map (
412 AWIDTH => 5,
413 DWIDTH => 8)
414 port map (
415 CLK => CLK,
416 WE => MEM_1_WE,
417 ADDR => MEM_ADDR,
418 DI => MEM_DIN(ibf_byte1),
419 DO => MEM_DOUT(ibf_byte1));
420
421 MEM_0 : ram_1swar_gen
422 generic map (
423 AWIDTH => 5,
424 DWIDTH => 8)
425 port map (
426 CLK => CLK,
427 WE => MEM_0_WE,
428 ADDR => MEM_ADDR,
429 DI => MEM_DIN(ibf_byte0),
430 DO => MEM_DOUT(ibf_byte0));
431
432 proc_regs: process (CLK)
433 begin
434 -- BRESET handled in main fsm, not here !!
435 if rising_edge(CLK) then
436 R_REGS <= N_REGS;
437 end if;
438 end process proc_regs;
439
440 proc_next : process (R_REGS, CE_USEC, BRESET, ITIMER, IB_MREQ, MEM_DOUT,
441 EI_ACK)
442 variable r : regs_type := regs_init;
443 variable n : regs_type := regs_init;
444 variable ibhold : slbit := '0';
445 variable idout : slv16 := (others=>'0');
446 variable ibrem : slbit := '0';
447 variable ibreq : slbit := '0';
448 variable ibrd : slbit := '0';
449 variable ibw0 : slbit := '0';
450 variable ibw1 : slbit := '0';
451 variable ibwrem : slbit := '0';
452 variable ilam : slbit := '0';
453 variable iei_req : slbit := '0';
454
455 variable imem_we0 : slbit := '0';
456 variable imem_we1 : slbit := '0';
457 variable imem_addr : slv5 := (others=>'0');
458 variable imem_din : slv16 := (others=>'0');
459
460 variable ieunit : slv2 := (others=>'0');
461
462 variable iomux : slv4 := (others=>'0'); -- omux select
463 variable iamap : slv5 := (others=>'0'); -- mem mapped address
464 variable imask : slv16 := (others=>'0'); -- implemented bits mask
465 variable imbreg : slbit := '0'; -- massbus register
466 variable inormr : slbit := '0'; -- inhibit rmr protect
467
468 variable idte : slv3 := (others=>'0'); -- encoded drive type
469 variable idtyp : slv6 := (others=>'0'); -- drive type (5:0)
470 variable icamax : slv10 := (others=>'0'); -- max cylinder address
471 variable itamax : slv5 := (others=>'0'); -- max track address
472 variable isamax : slv6 := (others=>'0'); -- max sector address
473
474 variable ined : slbit := '0'; -- non-existent drive
475 variable icerm : slbit := '0'; -- effectiv drive is rm
476
477 variable iclrreg : slbit := '0'; -- clr enable
478
479 variable iscinc : slbit := '0'; -- increment r.sc enable
480
481 begin
482
483 r := R_REGS;
484 n := R_REGS;
485
486 ibhold := '0';
487 idout := (others=>'0');
488 ibrem := IB_MREQ.racc;
489 ibreq := IB_MREQ.re or IB_MREQ.we;
490 ibrd := IB_MREQ.re;
491 ibw0 := IB_MREQ.we and IB_MREQ.be0;
492 ibw1 := IB_MREQ.we and IB_MREQ.be1;
493 ibwrem := IB_MREQ.we and ibrem;
494 ilam := '0';
495 iei_req := '0';
496
497 imem_we0 := '0';
498 imem_we1 := '0';
499 imem_addr := r.amap; -- default address (from mapper)
500 imem_din := r.dinmsk; -- default input (from masker)
501
502 ieunit := (others=>'0');
503
504 iomux := (others=>'0');
505 iamap := (others=>'0');
506 imask := (others=>'1'); -- default: all bits ok
507 imbreg := '0';
508 inormr := '0';
509
510 idte := (others=>'0');
511 idtyp := (others=>'0');
512 icamax := (others=>'0');
513 itamax := (others=>'0');
514 isamax := (others=>'0');
515
516 ined := '0';
517 icerm := '0';
518
519 iclrreg := '0';
520
521 iscinc := '0';
522
523 -- ibus address decoder, accept only offsets 0 to ibaddr_cs3
524 n.ibsel := '0';
525 if IB_MREQ.aval = '1' and
526 IB_MREQ.addr(12 downto 6) = ibaddr_rhrp(12 downto 6) and
527 unsigned(IB_MREQ.addr(5 downto 1)) <= unsigned(ibaddr_cs3) then
528 n.ibsel := '1';
529 end if;
530
531 -- internal state machine
532 case r.state is
533 when s_idle => -- idle: handle ibus -----------------
534
535 if r.ibsel='1' then -- selected
536
537 -- determine effective unit number
538 if ibrem = '1' then
539 ieunit := r.runit;
540 else
541 ieunit := r.cs2unit;
542 end if;
543 n.eunit := ieunit;
544
545 -- determine drive properties (always via iunit) FIXME: correct ??
546 idte(2) := r.dtrm(to_integer(unsigned(r.cs2unit)));
547 idte(1) := r.dte1(to_integer(unsigned(r.cs2unit)));
548 idte(0) := r.dte0(to_integer(unsigned(r.cs2unit)));
549 case idte is
550 when dte_rp04 => -- RP04
551 idtyp := rp04_dtyp;
552 icamax := rp04_camax;
553 itamax := rp04_tamax;
554 isamax := rp04_samax;
555 when dte_rp06 => -- RP06
556 idtyp := rp06_dtyp;
557 icamax := rp06_camax;
558 itamax := rp06_tamax;
559 isamax := rp06_samax;
560 when dte_rm03 => -- RM03
561 idtyp := rm03_dtyp;
562 icamax := rm03_camax;
563 itamax := rm03_tamax;
564 isamax := rm03_samax;
565 when dte_rm80 => -- RM80
566 idtyp := rm80_dtyp;
567 icamax := rm80_camax;
568 itamax := rm80_tamax;
569 isamax := rm80_samax;
570 when dte_rm05 => -- RM05
571 idtyp := rm05_dtyp;
572 icamax := rm05_camax;
573 itamax := rm05_tamax;
574 isamax := rm05_samax;
575 when dte_rp07 => -- RP07
576 idtyp := rp07_dtyp;
577 icamax := rp07_camax;
578 itamax := rp07_tamax;
579 isamax := rp07_samax;
580 when others =>
581 idtyp := (others=>'0');
582 icamax := (others=>'0');
583 itamax := (others=>'0');
584 isamax := (others=>'0');
585 end case; -- case idte
586 n.dtyp := idtyp;
587 n.camax := icamax;
588 n.tamax := itamax;
589 n.samax := isamax;
590
591 -- consider drive non-existent if not 'DPR' or unit>=4 selected
592 if r.dsdpr(to_integer(unsigned(r.cs2unit))) = '0' or
593 r.cs2unit2 = '1' then
594 ined := '1';
595 end if;
596 n.ned := ined;
597
598 icerm := r.dtrm(to_integer(unsigned(ieunit)));
599 n.cerm := icerm;
600
601 -- setup mapper
602 case IB_MREQ.addr(5 downto 1) is
603
604 when ibaddr_cs1 => -- RxCS1 control reg 1
605 -- cs1 not flagged mbreg !! ned handling done explicitely
606 iamap := ieunit & amapc_cs1;
607 iomux := omux_cs1;
608
609 when ibaddr_wc => -- RxWC word count
610 iamap := amapr_wc & amapc_ext;
611 iomux := omux_mem;
612
613 when ibaddr_ba => -- RxBA bus address
614 imask := "1111111111111110"; -- lsb ignored
615 iamap := amapr_ba & amapc_ext;
616 iomux := omux_mem;
617
618 when ibaddr_da => -- RxDA disk address
619 imask := "0001111100111111"; -- 000t tttt 00ss ssss
620 iamap := ieunit & amapc_da;
621 iomux := omux_mem;
622 imbreg := '1'; -- mb 5
623
624 when ibaddr_cs2 => -- RxCS2 control reg 2
625 iomux := omux_cs2;
626
627 when ibaddr_ds => -- RxDS drive status
628 iomux := omux_ds;
629 imbreg := '1'; -- mb 1
630
631 when ibaddr_er1 => -- RxER1 error status 1
632 iomux := omux_er1;
633 imbreg := '1'; -- mb 2
634
635 when ibaddr_as => -- RxAS attention summary
636 iomux := omux_as;
637 imbreg := '1'; -- mb 4
638 inormr := '1'; -- AS writes allowed when RDY=0
639
640 when ibaddr_la => -- RxLA look ahead
641 iomux := omux_la;
642 imbreg := '1'; -- mb 7
643
644 when ibaddr_db => -- RxDB data buffer
645 iamap := amapr_db & amapc_ext;
646 iomux := omux_mem;
647
648 when ibaddr_mr1 => -- RxMR1 maintenance reg 1
649 iamap := ieunit & amapc_mr1;
650 iomux := omux_mem;
651 imbreg := '1'; -- mb 3
652 inormr := '1'; -- MR1 writes allowed when RDY=0
653
654 when ibaddr_dt => -- RxDT drive type
655 iomux := omux_dt;
656 imbreg := '1'; -- mb 6
657
658 when ibaddr_sn => -- RxSN serial number
659 iomux := omux_sn;
660 imbreg := '1'; -- mb 10
661
662 when ibaddr_of => -- RxOF offset reg
663 imask := "0001110011111111"; -- 000f eh00 d??? ????
664 iamap := ieunit & amapc_of;
665 iomux := omux_mem;
666 imbreg := '1'; -- mb 11
667
668 when ibaddr_dc => -- RxDC desired cylinder
669 imask := "0000001111111111"; -- 0000 00cc cccc cccc
670 iamap := ieunit & amapc_dc;
671 iomux := omux_mem;
672 imbreg := '1'; -- mb 12
673
674 when ibaddr_m13 =>
675 if icerm = '1' then
676 iamap := ieunit & amapc_hr; -- RMHR holding reg
677 else
678 iamap := ieunit & amapc_dc; -- RPDC current cylinder
679 end if;
680 iomux := omux_mem;
681 imbreg := '1'; -- mb 13
682
683 when ibaddr_m14 =>
684 if icerm = '1' then
685 iamap := ieunit & amapc_mr2; -- RMMR2 maintenance reg 2
686 iomux := omux_mem;
687 else
688 iomux := omux_zero; -- RPER2 error status 2
689 end if;
690 imbreg := '1'; -- mb 14
691
692 when ibaddr_m15 => -- RxER3 error status 3/2
693 iomux := omux_zero;
694 imbreg := '1'; -- mb 15
695
696 when ibaddr_ec1 => -- RxEC1 ecc status 1
697 iomux := omux_zero;
698 imbreg := '1'; -- mb 16
699
700 when ibaddr_ec2 => -- RxEC2 ecc status 2
701 iomux := omux_zero;
702 imbreg := '1'; -- mb 17
703
704 when ibaddr_bae => -- RxBAE bus addr extension
705 iomux := omux_bae;
706
707 when ibaddr_cs3 => -- RxCS3 control reg 3
708 iomux := omux_cs3;
709
710 when others => null; -- doesn't happen, ibsel only for
711 -- subrange up to cs3, and all
712 -- 22 regs are decoded above
713
714 end case; -- case IB_MREQ.addr
715 n.amap := iamap;
716 n.omux := iomux;
717 n.dinmsk := imask and IB_MREQ.din;
718
719 if IB_MREQ.we = '1' then -- write request
720 ibhold := '1'; -- assume follow-up state taken
721 case IB_MREQ.addr(5 downto 1) is
722
723 when ibaddr_cs1 => n.state := s_wcs1; -- RxCS1
724 when ibaddr_wc => n.state := s_wmembe; -- RxWC
725 when ibaddr_ba => n.state := s_wmembe; -- RxBA
726 when ibaddr_da => n.state := s_wmem; -- RxDA
727 when ibaddr_cs2 => n.state := s_wcs2; -- RxCS2
728 when ibaddr_ds => n.state := s_wds; -- RxDS (read-only)
729 when ibaddr_er1 => n.state := s_wer1; -- RxER1 (read-only)
730 when ibaddr_as => n.state := s_was; -- RxAS
731 when ibaddr_la => n.state := s_whr; -- RxLA (read-only)
732 when ibaddr_db => n.state := s_wmembe; -- RxDB
733 when ibaddr_mr1 => n.state := s_wmem; -- RxMR1
734 when ibaddr_dt => n.state := s_wdt; -- RxDT (read-only)
735 when ibaddr_sn => n.state := s_whr; -- RxSN (read-only)
736 when ibaddr_of => n.state := s_wmem; -- RxOF
737 when ibaddr_dc => n.state := s_wmem; -- RxDC
738 when ibaddr_m13 => n.state := s_whr; -- RPCC|RMHR (fits both)
739 when ibaddr_m14 =>
740 if icerm = '1' then
741 n.state := s_wmem; -- RMMR2
742 else
743 n.state := s_whr; -- RPER2
744 end if;
745 when ibaddr_m15 => n.state := s_whr; -- RPER3|RMER2 (fits both)
746 when ibaddr_ec1 => n.state := s_whr; -- RxEC1
747 when ibaddr_ec2 => n.state := s_whr; -- RxEC2
748 when ibaddr_bae => n.state := s_wbae; -- RxBAE
749 when ibaddr_cs3 => n.state := s_wcs3; -- RxCS3
750
751 when others => null; -- doesn't happen, ibsel only for
752 -- subrange up to cs3, and all
753 -- 22 regs are decoded above
754
755 end case; -- case IB_MREQ.addr
756
757 -- some general error catchers
758 if ibrem = '0' and imbreg='1' then -- local massbus write
759 -- for cs1: imbreg=0 !!
760 -- write to non-existent drives
761 if ined = '1' then
762 n.cs2ned := '1';
763 -- write to a busy unit, can be a search/seek or a transfer
764 elsif inormr='0' and -- rmr protected reg
765 (r.dspip(to_integer(unsigned(r.cs2unit)))='1' or -- busy pip
766 (r.cs1rdy='0' and (r.funit = r.cs2unit)) -- busy xfer
767 ) then
768 n.state := s_setrmr;
769 end if;
770 end if;
771
772 elsif IB_MREQ.re = '1' then -- read request
773 if ibrem='0' and imbreg='1' and ined='1' then
774 n.cs2ned := '1'; -- signal error
775 else
776 ibhold := '1';
777 n.state := s_read;
778 end if;
779
780 end if; -- if IB_MREQ.we .. elsif IB_MREQ.re
781
782 -- BRESET and ITIMER can be handled in the 'else' because both can
783 -- never come during an ibus transaction. Done here to keep logic
784 -- path in the 'if' short.
785 else -- if r.ibsel='1'
786 if BRESET = '1' then
787 n.eunit := "00";
788 n.clrmode := clrmode_breset;
789 n.state := s_oot_clr0; -- OOT state, no hold!
790 end if;
791
792 if unsigned(r.idlycnt) = 0 then -- interrupt delay expired
793 n.dsata := r.dsata or r.dspip; -- convert pip's to ata's
794 n.dspip := (others=>'0'); -- and mark them done
795 else
796 if ITIMER = '1' then -- not expired and ITIMER
797 n.idlycnt := slv(unsigned(r.idlycnt) - 1); -- count down
798 end if;
799 end if;
800
801 end if; -- if r.ibsel='1'
802
803 -- s_idle goes up to here !!
804
805 when s_wcs1 => -- wcs1: write cs1 -------------------
806 n.state := s_idle; -- in general return to s_idle
807 imem_addr := r.amap; -- use mapped address
808 imem_din := r.dinmsk; -- use masked input
809
810 if ibrem = '0' then -- loc write access
811
812 if IB_MREQ.be1 = '1' then
813 if IB_MREQ.din(cs1_ibf_tre) = '1' then -- TRE=1 -> clear errors
814 n.cs2wce := '0';
815 n.cs2ned := '0';
816 n.cs2nem := '0';
817 n.cs2pge := '0';
818 n.cs2mxf := '0';
819 end if;
820 if r.cs1rdy = '1' then -- only if RDY
821 n.bae(1 downto 0) := IB_MREQ.din(cs1_ibf_bae); -- update bae
822 end if;
823 end if; -- IB_MREQ.be1 = '1'
824
825 if IB_MREQ.be0 = '1' then
826 n.cs1ie := IB_MREQ.din(cs1_ibf_ie);
827 if IB_MREQ.din(cs1_ibf_ie) = '1' and -- if IE and RDY both 1
828 IB_MREQ.din(cs1_ibf_rdy) = '1'then
829 n.ireq := '1'; -- issue software interrupt
830 end if;
831
832 if r.ned = '0' and -- drive on
833 IB_MREQ.din(cs1_ibf_go) = '1' then -- GO bit set
834 ibhold := '1';
835 n.state := s_funcchk;
836 end if;
837
838 -- FIXME_code: that's likely not fully correct, cs1 func bits are
839 -- stored before all error checks are done...
840 imem_we0 := IB_MREQ.be0; -- remember func field per unit
841
842 if r.ned = '1' then -- loc access and drive off
843 n.cs2ned := '1'; -- signal error
844 end if;
845
846 end if; -- IB_MREQ.be0 = '1'
847
848 else -- rem write access. GO not checked
849 -- always treated as remote function
850 case IB_MREQ.din(cs1_ibf_func) is
851
852 when rfunc_wunit => -- rfunc: wunit ---------------
853 n.runit := IB_MREQ.din(cs1_ibf_runit);
854
855 when rfunc_cunit => -- rfunc: cunit ---------------
856 n.runit := r.funit; -- use unit from last ext func go
857
858 when rfunc_done => -- rfunc: done ----------------
859 n.cs1rdy := '1';
860 if IB_MREQ.din(cs1_ibf_rata) = '0' then
861 n.ireq := r.cs1ie; -- yes, ireq is set from ie !!
862 else
863 n.dsata(to_integer(unsigned(r.funit))) := '1';
864 end if;
865
866 when rfunc_widly => -- rfunc: widly ---------------
867 n.idlyval := IB_MREQ.din(cs1_ibf_ridly);
868
869 when others => null;
870
871 end case;
872 end if;
873
874 when s_wcs2 => -- wcs2: write cs2 -------------------
875 n.state := s_idle; -- in general return to s_idle
876 if ibrem = '1' then -- rem access
877 n.cs3wco := IB_MREQ.din(cs2_ibf_rwco); -- cs3.wco rem set via cs2 !!
878 n.cs2wce := IB_MREQ.din(cs2_ibf_wce);
879 n.cs2nem := IB_MREQ.din(cs2_ibf_nem);
880 n.cs2mxf := IB_MREQ.din(cs2_ibf_mxf); -- FIXME: really used ???
881 else
882 if IB_MREQ.be0 = '1' then
883 n.cs2pat := IB_MREQ.din(cs2_ibf_pat);
884 n.cs2bai := IB_MREQ.din(cs2_ibf_bai);
885 n.cs2unit2 := IB_MREQ.din(cs2_ibf_unit2);
886 n.cs2unit := IB_MREQ.din(cs2_ibf_unit);
887 if IB_MREQ.din(cs2_ibf_clr) = '1' then
888 n.eunit := "00";
889 n.clrmode := clrmode_cs2clr;
890 n.state := s_oot_clr0; -- OOT state, no hold!
891 end if;
892 end if;
893 end if;
894
895 when s_wcs3 => -- wcs3: write cs3 -------------------
896 n.state := s_idle; -- in general return to s_idle
897 if ibrem = '0' then -- loc access
898 if IB_MREQ.be0 = '1' then
899 n.cs1ie := IB_MREQ.din(cs3_ibf_ie);
900 end if;
901 end if;
902
903 when s_wer1 => -- wer1: write er1 (rem only) --------
904 n.state := s_idle; -- in general return to s_idle
905 if ibrem = '1' then -- rem access
906 if IB_MREQ.din(er1_ibf_uns) = '1' then
907 n.er1uns(to_integer(unsigned(r.eunit))) := '1';
908 end if;
909 if IB_MREQ.din(er1_ibf_wle) = '1' then
910 n.er1wle(to_integer(unsigned(r.eunit))) := '1';
911 end if;
912 if IB_MREQ.din(er1_ibf_iae) = '1' then
913 n.er1iae(to_integer(unsigned(r.eunit))) := '1';
914 end if;
915 if IB_MREQ.din(er1_ibf_aoe) = '1' then
916 n.er1aoe(to_integer(unsigned(r.eunit))) := '1';
917 end if;
918 if IB_MREQ.din(er1_ibf_ilf) = '1' then
919 n.er1ilf(to_integer(unsigned(r.eunit))) := '1';
920 end if;
921 else -- loc access
922 ibhold := '1';
923 n.state := s_whr;
924 end if;
925
926 when s_was => -- was: write as ---------------------
927 n.state := s_idle; -- in general return to s_idle
928 -- clear the attention bits marked as '1' in data word (loc and rem !!)
929 n.dsata := r.dsata and not IB_MREQ.din(r.dsata'range);
930 if ibrem = '0' then -- loc access
931 ibhold := '1';
932 n.state := s_whr;
933 end if;
934
935 when s_wdt => -- wdt: write dt ---------------------
936 n.state := s_idle; -- in general return to s_idle
937 if ibrem = '1' then -- rem access
938 n.dtrm(to_integer(unsigned(r.runit))) := IB_MREQ.din(dt_ibf_rm);
939 n.dte1(to_integer(unsigned(r.runit))) := IB_MREQ.din(dt_ibf_e1);
940 n.dte0(to_integer(unsigned(r.runit))) := IB_MREQ.din(dt_ibf_e0);
941 n.state := s_idle;
942 else -- loc access
943 ibhold := '1';
944 n.state := s_whr;
945 end if;
946
947 when s_wds => -- wdt: write ds ---------------------
948 n.state := s_idle; -- in general return to s_idle
949 if ibrem = '1' then -- rem access
950 n.dsmol(to_integer(unsigned(r.runit))) := IB_MREQ.din(ds_ibf_mol);
951 n.dswrl(to_integer(unsigned(r.runit))) := IB_MREQ.din(ds_ibf_wrl);
952 n.dslbt(to_integer(unsigned(r.runit))) := IB_MREQ.din(ds_ibf_lbt);
953 n.dsdpr(to_integer(unsigned(r.runit))) := IB_MREQ.din(ds_ibf_dpr);
954 if IB_MREQ.din(ds_ibf_ata) = '1' then -- set ata on demand
955 n.dsata(to_integer(unsigned(r.runit))) := '1';
956 end if;
957 if IB_MREQ.din(ds_ibf_vv) = '1' then -- clr vv on demand
958 n.dsvv(to_integer(unsigned(r.runit))) := '0';
959 end if;
960 if IB_MREQ.din(ds_ibf_erp) = '1' then -- clr er1 on demand
961 n.er1uns(to_integer(unsigned(r.eunit))) := '0'; -- clr all er1
962 n.er1wle(to_integer(unsigned(r.eunit))) := '0'; -- "
963 n.er1iae(to_integer(unsigned(r.eunit))) := '0'; -- "
964 n.er1aoe(to_integer(unsigned(r.eunit))) := '0'; -- "
965 n.er1rmr(to_integer(unsigned(r.eunit))) := '0'; -- "
966 n.er1ilf(to_integer(unsigned(r.eunit))) := '0'; -- "
967 end if;
968 n.state := s_idle;
969 else -- loc access
970 ibhold := '1'; -- read-only reg, thus noop
971 n.state := s_whr;
972 end if;
973
974 when s_wbae => -- wbae: write bae -------------------
975 n.state := s_idle; -- in general return to s_idle
976 if IB_MREQ.be0 = '1' then
977 n.bae := IB_MREQ.din(bae_ibf_bae);
978 end if;
979
980 when s_wmem => -- wmem: write mem (DA,MR1,OF,DC,MR2)-
981 -- this state only handles massbus registers
982 n.state := s_idle; -- in general return to s_idle
983 imem_addr := r.amap; -- use mapped address
984 imem_din := r.dinmsk; -- use masked input
985
986 if ibrem = '0' then -- loc access
987 imem_we0 := '1'; -- write memory
988 imem_we1 := '1';
989 ibhold := '1';
990 n.state := s_whr;
991 else -- rem access
992 imem_we0 := '1'; -- write memory
993 imem_we1 := '1';
994 end if;
995
996 when s_wmembe => -- wmem: write mem with be (WC,BA,DB)-
997 -- this state only handles controller registers --> no ned checking
998 n.state := s_idle; -- in general return to s_idle
999 imem_we0 := IB_MREQ.be0;
1000 imem_we1 := IB_MREQ.be1;
1001 imem_addr := r.amap;
1002 imem_din := r.dinmsk;
1003
1004 when s_whr => -- whr: write hr ---------------------
1005 n.state := s_idle; -- in general return to s_idle
1006 imem_addr := r.cs2unit & amapc_hr; -- mem address of holding reg
1007 imem_din := not IB_MREQ.din;
1008 if ibrem = '0' then -- loc access
1009 imem_we0 := '1'; -- keep state
1010 imem_we1 := '1';
1011 end if;
1012
1013 when s_funcchk => -- funcchk: check function go --------
1014 n.state := s_idle; -- in general return to s_idle
1015 if r.cs1rdy = '0' and
1016 unsigned(IB_MREQ.din(cs1_ibf_func)) >= unsigned(func_xfer) then
1017 n.cs2pge := '1'; -- issue program error
1018 elsif IB_MREQ.din(cs1_ibf_func) = func_dclr then
1019 n.eunit := r.cs2unit; -- for follow-up states
1020 n.clrmode := clrmode_fdclr;
1021 n.state := s_oot_clr0; -- OOT state, no hold!
1022 elsif r.dserp(to_integer(unsigned(r.cs2unit))) = '1' then
1023 n.er1ilf(to_integer(unsigned(r.cs2unit))) := '1';
1024 else
1025 ibhold := '1';
1026 n.state := s_funcgo;
1027 end if;
1028
1029 when s_funcgo => -- funcgo: handle function go --------
1030 n.state := s_idle; -- in general return to s_idle
1031 n.dsata(to_integer(unsigned(r.cs2unit))) := '0';
1032
1033 case IB_MREQ.din(cs1_ibf_func) is
1034 when func_noop => -- func: noop --------------
1035 null; -- nothing done...
1036
1037 when func_pore => -- func: port release-------
1038 n.poredone := '1'; -- take note in done flag
1039
1040 when func_unl => -- func: unload ------------
1041 -- only for RP, simply clears MOL
1042 if r.dtrm(to_integer(unsigned(r.cs2unit))) = '0' then
1043 n.dsmol(to_integer(unsigned(r.cs2unit))) := '0';
1044 n.dswrl(to_integer(unsigned(r.cs2unit))) := '0';
1045 n.dsvv(to_integer(unsigned(r.cs2unit))) := '0';
1046 n.dsom(to_integer(unsigned(r.cs2unit))) := '0';
1047 else
1048 n.er1ilf(to_integer(unsigned(r.cs2unit))) := '1';
1049 end if;
1050 n.dsata(to_integer(unsigned(r.cs2unit))) := '1';
1051
1052 -- when func_dclr => now handled in funcchk !!
1053
1054 when func_offs | -- func: offset ------------
1055 func_retc => -- func: return to center --
1056
1057 -- currently always immediate completion, so ata set here
1058 n.dsata(to_integer(unsigned(r.cs2unit))) := '1';
1059
1060 if r.dsmol(to_integer(unsigned(r.cs2unit))) = '0' then
1061 n.er1uns(to_integer(unsigned(r.cs2unit))) := '1';
1062 else
1063 if IB_MREQ.din(cs1_ibf_func) = func_offs then
1064 n.dsom(to_integer(unsigned(r.cs2unit))) := '1';
1065 else
1066 n.dsom(to_integer(unsigned(r.cs2unit))) := '0';
1067 end if;
1068 end if;
1069
1070 when func_pres => -- func: readin preset -----
1071 n.dsvv(to_integer(unsigned(r.cs2unit))) := '1';
1072 n.eunit := r.cs2unit; -- for follow-up states
1073 n.clrmode := clrmode_fpres;
1074 n.state := s_oot_clr0; -- OOT state, no hold!
1075
1076 when func_pack => -- func: pack acknowledge --
1077 n.dsvv(to_integer(unsigned(r.cs2unit))) := '1';
1078 n.packdone := '1'; -- take note in done flag
1079
1080 -- seek like and data transfer functions
1081 when func_seek | -- func: seek --------------
1082 func_recal | -- func: recalibrate -------
1083 func_sear | -- func: search ------------
1084 func_wcd | -- func: write check data --
1085 func_wchd | -- func: write check h&d ---
1086 func_write | -- func: write ------------
1087 func_whd | -- func: write header&data -
1088 func_read | -- func: read --------------
1089 func_rhd => -- func: read header&data --
1090
1091 if IB_MREQ.din(cs1_ibf_func) = func_seek then
1092 n.seekdone := '1'; -- take note in done flag
1093 end if;
1094 if IB_MREQ.din(cs1_ibf_func) = func_sear then
1095 n.seardone := '1'; -- take note in done flag
1096 end if;
1097
1098 -- check for transfer functions
1099 n.fxfer := '0';
1100 if unsigned(IB_MREQ.din(cs1_ibf_func)) >= unsigned(func_wcd) then
1101 n.fxfer := '1';
1102 -- in case of write, check for write lock
1103 if IB_MREQ.din(cs1_ibf_func) = func_write or
1104 IB_MREQ.din(cs1_ibf_func) = func_whd then
1105 if r.dswrl(to_integer(unsigned(r.cs2unit))) = '1' then
1106 n.er1wle(to_integer(unsigned(r.cs2unit))) := '1';
1107 end if;
1108 end if;
1109 end if;
1110
1111 if r.dsmol(to_integer(unsigned(r.cs2unit))) = '0' then
1112 n.er1uns(to_integer(unsigned(r.cs2unit))) := '1';
1113 n.dsata(to_integer(unsigned(r.cs2unit))) := '1';
1114 else
1115 ibhold := '1';
1116 n.state := s_chkdc;
1117 end if;
1118
1119 -- illegal function codes
1120 when others =>
1121 n.er1ilf(to_integer(unsigned(r.cs2unit))) := '1';
1122 n.dsata(to_integer(unsigned(r.cs2unit))) := '1';
1123
1124 end case; -- IB_MREQ.din(cs1_ibf_func)
1125
1126 when s_chkdc => -- chkdc: handle dc check ------------
1127 imem_addr := r.cs2unit & amapc_dc; -- mem address of dc reg
1128 if unsigned(MEM_DOUT(dc_ibf_ca)) > unsigned(r.camax) then
1129 n.er1iae(to_integer(unsigned(r.cs2unit))) := '1';
1130 end if;
1131 ibhold := '1';
1132 n.state := s_chkda;
1133
1134 when s_chkda => -- chkda: handle da check ------------
1135 imem_addr := r.cs2unit & amapc_da; -- mem address of da reg
1136 if unsigned(MEM_DOUT(da_ibf_sa)) > unsigned(r.samax) or
1137 unsigned(MEM_DOUT(da_ibf_ta)) > unsigned(r.tamax) then
1138 n.er1iae(to_integer(unsigned(r.cs2unit))) := '1';
1139 end if;
1140 ibhold := '1';
1141 n.state := s_chkdo;
1142
1143 when s_chkdo => -- chkdo: execute function -----------
1144 if r.er1iae(to_integer(unsigned(r.cs2unit))) = '1' or
1145 r.er1wle(to_integer(unsigned(r.cs2unit))) = '1' then
1146 n.dsata(to_integer(unsigned(r.cs2unit))) := '1'; -- ata and done
1147 else
1148 if r.fxfer = '0' then -- must be seek like function
1149 n.dspip(to_integer(unsigned(r.cs2unit))) := '1'; -- pip
1150 n.idlycnt := r.idlyval; -- start delay
1151 else -- must be transfer function
1152 n.ffunc := IB_MREQ.din(cs1_ibf_func); -- latch func
1153 n.funit := r.cs2unit; -- latch unit
1154 n.cs1rdy := '0'; -- controller busy
1155 n.cs2wce := '0'; -- clear errors
1156 n.cs2ned := '0';
1157 n.cs2nem := '0';
1158 n.cs2pge := '0';
1159 n.cs2mxf := '0';
1160 ilam := '1'; -- issue lam
1161 end if;
1162 end if;
1163 n.state := s_idle;
1164
1165 when s_read => -- read: all register reads ----------
1166 n.state := s_idle; -- in general return to s_idle
1167 imem_addr := r.amap;
1168
1169 case r.omux is
1170
1171 when omux_cs1 => -- omux: cs1 reg ---------------
1172 idout(cs1_ibf_sc) := r.cs1sc;
1173 idout(cs1_ibf_tre) := r.cs1tre;
1174 idout(cs1_ibf_dva) := '1';
1175 idout(cs1_ibf_bae) := r.bae(1 downto 0);
1176 idout(cs1_ibf_rdy) := r.cs1rdy;
1177 idout(cs1_ibf_ie) := r.cs1ie;
1178 if ibrem = '0' then -- loc access
1179 idout(cs1_ibf_func) := MEM_DOUT(cs1_ibf_func); --func per unit
1180 if r.ned = '1' then -- drive off
1181 n.cs2ned := '1'; -- signal error
1182 end if;
1183 else -- rem access
1184 idout(cs1_ibf_func) := r.ffunc;
1185 end if;
1186
1187 when omux_cs2 => -- omux: cs2 reg ---------------
1188 idout(cs2_ibf_wce) := r.cs2wce;
1189 idout(cs2_ibf_ned) := r.cs2ned;
1190 idout(cs2_ibf_nem) := r.cs2nem;
1191 idout(cs2_ibf_pge) := r.cs2pge;
1192 idout(cs2_ibf_mxf) := r.cs2mxf;
1193 idout(cs2_ibf_or) := '1';
1194 idout(cs2_ibf_ir) := '1';
1195 idout(cs2_ibf_pat) := r.cs2pat;
1196 idout(cs2_ibf_bai) := r.cs2bai;
1197 idout(cs2_ibf_unit2) := r.cs2unit2;
1198 if ibrem = '0' then -- loc access
1199 idout(cs2_ibf_unit) := r.cs2unit;
1200 else -- rem access
1201 idout(cs2_ibf_unit) := r.funit;
1202 end if;
1203
1204 when omux_ds => -- omux: ds reg ---------------
1205 idout(ds_ibf_ata) := r.dsata(to_integer(unsigned(r.eunit)));
1206 idout(ds_ibf_erp) := r.dserp(to_integer(unsigned(r.eunit)));
1207 idout(ds_ibf_pip) := r.dspip(to_integer(unsigned(r.eunit)));
1208 idout(ds_ibf_mol) := r.dsmol(to_integer(unsigned(r.eunit)));
1209 idout(ds_ibf_wrl) := r.dswrl(to_integer(unsigned(r.eunit)));
1210 idout(ds_ibf_lbt) := r.dslbt(to_integer(unsigned(r.eunit)));
1211 idout(ds_ibf_dpr) := r.dsdpr(to_integer(unsigned(r.eunit)));
1212
1213 -- ds.dry is 0 if mol=0 or if transfer or seek is active on unit
1214 -- the logic below checks for the complement ...
1215 if r.dsmol(to_integer(unsigned(r.eunit))) = '1' then
1216 if (r.cs1rdy = '1' or r.funit /= r.eunit) and
1217 r.dspip(to_integer(unsigned(r.eunit))) = '0' then
1218 idout(ds_ibf_dry) := '1';
1219 end if;
1220 end if;
1221
1222 idout(ds_ibf_vv) := r.dsvv (to_integer(unsigned(r.eunit)));
1223 idout(ds_ibf_om) := r.dsom (to_integer(unsigned(r.eunit)));
1224
1225 when omux_er1 => -- omux: er1 reg ---------------
1226 idout(er1_ibf_uns) := r.er1uns(to_integer(unsigned(r.eunit)));
1227 idout(er1_ibf_wle) := r.er1wle(to_integer(unsigned(r.eunit)));
1228 idout(er1_ibf_iae) := r.er1iae(to_integer(unsigned(r.eunit)));
1229 idout(er1_ibf_aoe) := r.er1aoe(to_integer(unsigned(r.eunit)));
1230 idout(er1_ibf_rmr) := r.er1rmr(to_integer(unsigned(r.eunit)));
1231 idout(er1_ibf_ilf) := r.er1ilf(to_integer(unsigned(r.eunit)));
1232
1233 when omux_as => -- omux: as reg ---------------
1234 idout(r.dsata'range) := r.dsata;
1235
1236 when omux_la => -- omux: la reg ---------------
1237 idout(la_ibf_sc) := r.sc;
1238
1239 when omux_dt => -- omux: dt reg ---------------
1240 if ibrem = '0' then -- loc access
1241 idout(13) := '1'; -- set bit 020000 (movable head)
1242 idout(r.dtyp'range) := r.dtyp;
1243 else -- rem access (read back rem side)
1244 idout(dt_ibf_rm) := r.dtrm(to_integer(unsigned(r.runit)));
1245 idout(dt_ibf_e1) := r.dte1(to_integer(unsigned(r.runit)));
1246 idout(dt_ibf_e0) := r.dte0(to_integer(unsigned(r.runit)));
1247 end if;
1248
1249 when omux_sn => -- omux: sn reg ---------------
1250 -- the serial number is encoded as 4 digit BCD
1251 -- digit 3: always 1
1252 -- digit 2: 1 if RM type; 0 if RP type
1253 -- digit 1: 0-3 based on encoded drive type
1254 -- digit 0: 0-3 taken as complement of unit
1255 -- Note: the 3lsb are the *complement* of the unit number because
1256 -- 211bsd driver code contains a hack to detect SI and CDC
1257 -- drives. For those drives the drive type is encode in the
1258 -- sn register, and one convention is that the 3 lsb of sn
1259 -- equal the unit numnber. To prevent that the SI/CDC hacks
1260 -- are actived the 3lsb are set as complement of the unit !
1261 idout(12) := '1';
1262 idout(8) := r.dtrm(to_integer(unsigned(r.eunit)));
1263 idout(5) := r.dte1(to_integer(unsigned(r.eunit)));
1264 idout(4) := r.dte0(to_integer(unsigned(r.eunit)));
1265 idout(2) := '1';
1266 idout(1) := not r.eunit(1);
1267 idout(0) := not r.eunit(0);
1268
1269 when omux_bae => -- omux: bae reg ---------------
1270 idout(bae_ibf_bae) := r.bae;
1271
1272 when omux_cs3 => -- omux: cs3 reg ---------------
1273 idout(cs3_ibf_wco) := r.cs2wce and r.cs3wco;
1274 idout(cs3_ibf_wce) := r.cs2wce and not r.cs3wco;
1275 idout(cs3_ibf_ie) := r.cs1ie;
1276 if ibrem = '1' then -- rem access
1277 idout(cs3_ibf_rseardone) := r.seardone;
1278 idout(cs3_ibf_rpackdone) := r.packdone;
1279 idout(cs3_ibf_rporedone) := r.poredone;
1280 idout(cs3_ibf_rseekdone) := r.seekdone;
1281 if IB_MREQ.re = '1' then -- if read, do read & clear
1282 n.seardone := '0';
1283 n.packdone := '0';
1284 n.poredone := '0';
1285 n.seekdone := '0';
1286 end if;
1287 end if;
1288
1289 when omux_mem => -- omux: mem output ------------
1290 idout := MEM_DOUT;
1291
1292 when omux_zero => -- omux: zero ------------------
1293 idout := (others=>'0');
1294
1295 when others => null; -- nxr caught before in mapper !
1296 end case; -- case r.omux
1297
1298 when s_setrmr => -- set rmr flag ----------------------
1299 n.er1rmr(to_integer(unsigned(r.cs2unit))) := '1';
1300 n.state := s_idle;
1301
1302 when s_oot_clr0 => -- OOT clr0: state 0 -----------------
1303 if r.clrmode=clrmode_breset or r.clrmode=clrmode_cs2clr then
1304 n.cs1rdy := '1'; -- clear cs1
1305 n.cs1ie := '0';
1306 n.cs2wce := '0'; -- clear cs2
1307 n.cs2ned := '0';
1308 n.cs2nem := '0';
1309 n.cs2pge := '0';
1310 n.cs2mxf := '0';
1311 n.cs2pat := '0';
1312 n.cs2bai := '0';
1313 n.cs2unit2 := '0';
1314 n.cs2unit := (others=>'0');
1315 n.bae := (others=>'0'); -- clear bae
1316 n.ireq := '0'; -- clear iff
1317 end if;
1318
1319 if r.clrmode=clrmode_breset or r.clrmode=clrmode_fdclr then
1320 n.er1uns(to_integer(unsigned(r.eunit))) := '0'; -- clr all er1
1321 n.er1wle(to_integer(unsigned(r.eunit))) := '0'; -- "
1322 n.er1iae(to_integer(unsigned(r.eunit))) := '0'; -- "
1323 n.er1aoe(to_integer(unsigned(r.eunit))) := '0'; -- "
1324 n.er1rmr(to_integer(unsigned(r.eunit))) := '0'; -- "
1325 n.er1ilf(to_integer(unsigned(r.eunit))) := '0'; -- "
1326 end if;
1327
1328 n.cerm := r.dtrm(to_integer(unsigned(ieunit)));
1329
1330 n.clrreg := "000";
1331 ibhold := r.ibsel; -- delay pending request
1332 n.state := s_oot_clr1;
1333
1334 when s_oot_clr1 => -- OOT clr1: state 1 ----------------
1335 imem_addr := r.eunit & r.clrreg;
1336 imem_din := (others=>'0');
1337
1338 iclrreg := '0';
1339 case r.clrmode is
1340
1341 when clrmode_breset => -- BRESET -------------------------
1342 iclrreg := '1'; -- simply clear all (cntl+drives)
1343
1344 when clrmode_cs2clr => -- CS2.CLR (controller clr) -------
1345 case r.clrreg is
1346 when amapc_ext => iclrreg := '1';
1347 when amapc_mr1 => iclrreg := r.cerm;
1348 when others => null;
1349 end case;
1350
1351 when clrmode_fdclr => -- func=DCLR (drive clr) ----------
1352 case r.clrreg is
1353 when amapc_mr1 => iclrreg := r.cerm;
1354 when others => null;
1355 end case;
1356
1357 when clrmode_fpres => -- func=PRESET --------------------
1358 case r.clrreg is
1359 when amapc_da => iclrreg := '1';
1360 when amapc_of => iclrreg := '1';
1361 when amapc_dc => iclrreg := '1';
1362 when others => null;
1363 end case;
1364
1365 when others => null;
1366 end case;
1367 if iclrreg = '1' then
1368 imem_we0 := IB_MREQ.be0;
1369 imem_we1 := IB_MREQ.be1;
1370 end if;
1371 n.clrreg := slv(unsigned(r.clrreg) + 1);
1372
1373 ibhold := r.ibsel; -- delay pending request
1374 if r.clrreg = "111" then -- if last register done
1375 n.state := s_oot_clr2; -- proceed with clr2
1376 end if;
1377
1378 when s_oot_clr2 => -- OOT clr2: state 2 ----------------
1379 n.eunit := slv(unsigned(r.eunit) + 1);
1380
1381 ibhold := r.ibsel; -- delay pending request, so that
1382 -- s_idle can finally process it
1383 if (r.clrmode=clrmode_breset or r.clrmode=clrmode_cs2clr) and
1384 r.eunit /= "11" then
1385 n.state := s_oot_clr0;
1386 else
1387 n.state := s_idle;
1388 end if;
1389
1390 when others => null; -- <> ------------------------------
1391 end case; -- case r.state
1392
1393 -- update cs1tre and cs1sc
1394 n.cs1tre := r.cs2wce or r.cs2ned or r.cs2nem or r.cs2pge or r.cs2mxf;
1395 n.cs1sc := n.cs1tre or r.dsata(0) or r.dsata(1) or r.dsata(2) or r.dsata(3);
1396 -- update dserp
1397 n.dserp := r.er1uns or -- or all er1
1398 r.er1wle or -- "
1399 r.er1iae or -- "
1400 r.er1aoe or -- "
1401 r.er1rmr or -- "
1402 r.er1ilf; -- "
1403
1404 -- handle current sector counter (for RxLA emulation)
1405 -- advance every 128 usec, so generate a pulse every 128 usec
1406 if CE_USEC = '1' then
1407 n.uscnt := slv(unsigned(r.uscnt) + 1);
1408 if unsigned(r.uscnt) = 0 then
1409 iscinc := '1';
1410 end if;
1411 end if;
1412
1413 -- if current sector larger or equal highest sector wrap to zero
1414 -- note: iscinc is also '1' when unit changes, this ensures that
1415 -- the sector counter is always in range when read to ibus.
1416 if iscinc = '1' then
1417 if unsigned(r.sc) >= unsigned(r.samax) then
1418 n.sc := (others=>'0');
1419 else
1420 n.sc := slv(unsigned(r.sc) + 1);
1421 end if;
1422 end if;
1423
1424 -- the RH70 interrupt logic is very unusual
1425 -- 1. done interrupts (rdy 0->1) are edge sensitive (via r.ireq)
1426 -- 2. done interrupts are not canceled when IE is cleared
1427 -- 3. attention interrupts are level sensitive (via r.cs1sc)
1428 -- 4. IE is disabled on interrupt acknowledge
1429
1430 iei_req := r.ireq or (r.cs1sc and r.cs1ie and r.cs1rdy);
1431
1432 if EI_ACK = '1' then -- interrupt executed
1433 n.ireq := '0'; -- cancel request
1434 n.cs1ie := '0'; -- disable interrupts
1435 end if;
1436
1437 N_REGS <= n;
1438
1439 MEM_0_WE <= imem_we0;
1440 MEM_1_WE <= imem_we1;
1441 MEM_ADDR <= imem_addr;
1442 MEM_DIN <= imem_din;
1443
1444 IB_SRES.dout <= idout;
1445 IB_SRES.ack <= r.ibsel and ibreq;
1446 IB_SRES.busy <= ibhold and ibreq;
1447
1448 RB_LAM <= ilam;
1449 EI_REQ <= iei_req;
1450
1451 end process proc_next;
1452
1453
1454end syn;
integer := 14 ds_ibf_erp
Definition: ibdr_rhrp.vhd:182
slv5 := "10100" func_wcd
Definition: ibdr_rhrp.vhd:147
integer := 0 ds_ibf_om
Definition: ibdr_rhrp.vhd:190
integer := 0 er1_ibf_ilf
Definition: ibdr_rhrp.vhd:197
slv5 := "00101" func_pore
Definition: ibdr_rhrp.vhd:140
slv5 := "01111" ibaddr_m13
Definition: ibdr_rhrp.vhd:81
integer := 7 cs2_ibf_or
Definition: ibdr_rhrp.vhd:173
slv16 :=( others => '0') MEM_DOUT
Definition: ibdr_rhrp.vhd:402
slv5 := "00110" ibaddr_er1
Definition: ibdr_rhrp.vhd:72
slv3 := "010" amapc_dc
Definition: ibdr_rhrp.vhd:108
integer := 2 dt_ibf_rm
Definition: ibdr_rhrp.vhd:201
integer := 11 cs1_ibf_dva
Definition: ibdr_rhrp.vhd:128
slv3 := "101" dte_rm80
Definition: ibdr_rhrp.vhd:208
slv5 := "00010" ibaddr_ba
Definition: ibdr_rhrp.vhd:68
integer range 1 downto 0 cs2_ibf_unit
Definition: ibdr_rhrp.vhd:179
integer := 0 cs3_ibf_rseekdone
Definition: ibdr_rhrp.vhd:222
slv4 := "0001" omux_cs2
Definition: ibdr_rhrp.vhd:93
slv5 := "00001" rfunc_wunit
Definition: ibdr_rhrp.vhd:154
slv5 := slv( to_unsigned( 19- 1, 5) ) rm05_tamax
Definition: ibdr_rhrp.vhd:248
integer range 11 downto 6 la_ibf_sc
Definition: ibdr_rhrp.vhd:199
slv10 := slv( to_unsigned( 411- 1, 10) ) rp04_camax
Definition: ibdr_rhrp.vhd:226
slv5 := "00100" func_dclr
Definition: ibdr_rhrp.vhd:139
integer := 14 cs2_ibf_wce
Definition: ibdr_rhrp.vhd:168
(s_idle,s_wcs1,s_wcs2,s_wcs3,s_wer1,s_was,s_wdt,s_wds,s_wbae,s_wmem,s_wmembe,s_whr,s_funcchk,s_funcgo,s_chkdc,s_chkda,s_chkdo,s_read,s_setrmr,s_oot_clr0,s_oot_clr1,s_oot_clr2) state_type
Definition: ibdr_rhrp.vhd:256
slv6 := slv( to_unsigned( 32- 1, 6) ) rm03_samax
Definition: ibdr_rhrp.vhd:239
slv3 := "101" amapc_mr2
Definition: ibdr_rhrp.vhd:110
integer range 15 downto 8 cs1_ibf_ridly
Definition: ibdr_rhrp.vhd:162
integer range 2 downto 0 amap_f_reg
Definition: ibdr_rhrp.vhd:119
slv5 := "01010" ibaddr_mr1
Definition: ibdr_rhrp.vhd:76
slv5 := "11101" func_rhd
Definition: ibdr_rhrp.vhd:152
slv5 :=( others => '0') MEM_ADDR
Definition: ibdr_rhrp.vhd:400
slv5 := "01110" ibaddr_dc
Definition: ibdr_rhrp.vhd:80
integer := 3 cs2_ibf_bai
Definition: ibdr_rhrp.vhd:177
slv5 := "01100" func_sear
Definition: ibdr_rhrp.vhd:145
slv3 := "011" amapc_mr1
Definition: ibdr_rhrp.vhd:106
slv16 :=( others => '0') MEM_DIN
Definition: ibdr_rhrp.vhd:401
integer := 14 cs1_ibf_tre
Definition: ibdr_rhrp.vhd:127
slv5 := "10000" ibaddr_m14
Definition: ibdr_rhrp.vhd:83
integer := 3 cs3_ibf_rseardone
Definition: ibdr_rhrp.vhd:219
slv4 := "0101" omux_la
Definition: ibdr_rhrp.vhd:97
slv5 := "01001" func_pack
Definition: ibdr_rhrp.vhd:144
slv5 := "00001" ibaddr_wc
Definition: ibdr_rhrp.vhd:67
slv4 := "1000" omux_bae
Definition: ibdr_rhrp.vhd:100
slv5 := "00101" ibaddr_ds
Definition: ibdr_rhrp.vhd:71
slv5 := "10011" ibaddr_ec2
Definition: ibdr_rhrp.vhd:88
slv5 := "01001" ibaddr_db
Definition: ibdr_rhrp.vhd:75
slv5 := "00110" func_offs
Definition: ibdr_rhrp.vhd:141
slv5 := "10001" ibaddr_m15
Definition: ibdr_rhrp.vhd:85
integer := 11 ds_ibf_wrl
Definition: ibdr_rhrp.vhd:185
slv5 := slv( to_unsigned( 19- 1, 5) ) rp04_tamax
Definition: ibdr_rhrp.vhd:227
slv3 := "001" dte_rp06
Definition: ibdr_rhrp.vhd:206
integer := 1 dt_ibf_e1
Definition: ibdr_rhrp.vhd:202
integer := 10 ds_ibf_lbt
Definition: ibdr_rhrp.vhd:186
slv5 := "00010" func_seek
Definition: ibdr_rhrp.vhd:137
slv3 := "000" dte_rp04
Definition: ibdr_rhrp.vhd:205
slv5 := "00011" ibaddr_da
Definition: ibdr_rhrp.vhd:69
slv16 := slv( to_unsigned( 8#176700#, 16) ) ibaddr_rhrp
Definition: ibdr_rhrp.vhd:63
integer := 9 er1_ibf_aoe
Definition: ibdr_rhrp.vhd:195
integer := 6 ds_ibf_vv
Definition: ibdr_rhrp.vhd:189
slv3 := "001" amapc_of
Definition: ibdr_rhrp.vhd:107
slv5 := slv( to_unsigned( 32- 1, 5) ) rp07_tamax
Definition: ibdr_rhrp.vhd:253
slv10 := slv( to_unsigned( 559- 1, 10) ) rm80_camax
Definition: ibdr_rhrp.vhd:242
slv3 := "111" amapc_ext
Definition: ibdr_rhrp.vhd:112
slv4 := "0111" omux_sn
Definition: ibdr_rhrp.vhd:99
slv4 := "1001" omux_cs3
Definition: ibdr_rhrp.vhd:101
integer := 7 ds_ibf_dry
Definition: ibdr_rhrp.vhd:188
slv5 := "01100" ibaddr_sn
Definition: ibdr_rhrp.vhd:78
slv3 := "100" amapc_hr
Definition: ibdr_rhrp.vhd:109
integer := 14 er1_ibf_uns
Definition: ibdr_rhrp.vhd:192
integer := 9 cs2_ibf_mxf
Definition: ibdr_rhrp.vhd:172
slv5 := "00000" func_noop
Definition: ibdr_rhrp.vhd:135
slv5 := slv( to_unsigned( 19- 1, 5) ) rp06_tamax
Definition: ibdr_rhrp.vhd:232
slv5 := "10100" func_xfer
Definition: ibdr_rhrp.vhd:146
integer := 2 cs3_ibf_rpackdone
Definition: ibdr_rhrp.vhd:220
slv4 := "0100" omux_as
Definition: ibdr_rhrp.vhd:96
slv3 := "110" dte_rm05
Definition: ibdr_rhrp.vhd:209
slv5 := "01000" func_pres
Definition: ibdr_rhrp.vhd:143
slv5 := "00111" ibaddr_as
Definition: ibdr_rhrp.vhd:73
slv6 := slv( to_unsigned( 8#20#, 6) ) rp04_dtyp
Definition: ibdr_rhrp.vhd:225
slv10 := slv( to_unsigned( 823- 1, 10) ) rm05_camax
Definition: ibdr_rhrp.vhd:247
integer := 11 cs3_ibf_wce
Definition: ibdr_rhrp.vhd:217
slv6 := slv( to_unsigned( 32- 1, 6) ) rm05_samax
Definition: ibdr_rhrp.vhd:249
slv5 := "10101" ibaddr_cs3
Definition: ibdr_rhrp.vhd:90
slv2 := "00" amapr_wc
Definition: ibdr_rhrp.vhd:114
slv6 := slv( to_unsigned( 8#42#, 6) ) rp07_dtyp
Definition: ibdr_rhrp.vhd:251
integer := 10 er1_ibf_iae
Definition: ibdr_rhrp.vhd:194
slv10 := slv( to_unsigned( 815- 1, 10) ) rp06_camax
Definition: ibdr_rhrp.vhd:231
integer := 12 cs2_ibf_ned
Definition: ibdr_rhrp.vhd:169
slv6 := slv( to_unsigned( 8#27#, 6) ) rm05_dtyp
Definition: ibdr_rhrp.vhd:246
integer := 8 ds_ibf_dpr
Definition: ibdr_rhrp.vhd:187
integer := 8 cs1_ibf_rata
Definition: ibdr_rhrp.vhd:161
slv5 := "11000" func_write
Definition: ibdr_rhrp.vhd:149
integer := 15 cs1_ibf_sc
Definition: ibdr_rhrp.vhd:126
integer := 12 cs3_ibf_wco
Definition: ibdr_rhrp.vhd:216
integer := 2 er1_ibf_rmr
Definition: ibdr_rhrp.vhd:196
slbit := '0' MEM_0_WE
Definition: ibdr_rhrp.vhd:399
slv4 := "1111" omux_zero
Definition: ibdr_rhrp.vhd:103
slv5 := "10101" func_wchd
Definition: ibdr_rhrp.vhd:148
integer range 9 downto 8 cs1_ibf_bae
Definition: ibdr_rhrp.vhd:129
slv2 := "10" clrmode_fdclr
Definition: ibdr_rhrp.vhd:123
slv4 := "1010" omux_mem
Definition: ibdr_rhrp.vhd:102
integer := 11 er1_ibf_wle
Definition: ibdr_rhrp.vhd:193
integer := 5 cs2_ibf_clr
Definition: ibdr_rhrp.vhd:175
slv2 := "01" clrmode_cs2clr
Definition: ibdr_rhrp.vhd:122
integer := 15 cs2_ibf_rwco
Definition: ibdr_rhrp.vhd:167
regs_type := regs_init R_REGS
Definition: ibdr_rhrp.vhd:395
slv6 := slv( to_unsigned( 50- 1, 6) ) rp07_samax
Definition: ibdr_rhrp.vhd:254
slv2 := "11" clrmode_fpres
Definition: ibdr_rhrp.vhd:124
integer range 12 downto 8 da_ibf_ta
Definition: ibdr_rhrp.vhd:164
slv6 := slv( to_unsigned( 22- 1, 6) ) rp04_samax
Definition: ibdr_rhrp.vhd:228
integer range 5 downto 1 cs1_ibf_func
Definition: ibdr_rhrp.vhd:132
slv5 := "00100" ibaddr_cs2
Definition: ibdr_rhrp.vhd:70
slv5 := "00010" rfunc_cunit
Definition: ibdr_rhrp.vhd:155
slv5 := "10010" ibaddr_ec1
Definition: ibdr_rhrp.vhd:87
slv5 := "01101" ibaddr_of
Definition: ibdr_rhrp.vhd:79
slv4 := "0010" omux_ds
Definition: ibdr_rhrp.vhd:94
slv5 := "00111" func_retc
Definition: ibdr_rhrp.vhd:142
slv5 := slv( to_unsigned( 14- 1, 5) ) rm80_tamax
Definition: ibdr_rhrp.vhd:243
integer := 2 cs2_ibf_unit2
Definition: ibdr_rhrp.vhd:178
slv5 := "01011" ibaddr_dt
Definition: ibdr_rhrp.vhd:77
regs_type N_REGS
Definition: ibdr_rhrp.vhd:396
regs_type :=( '0', s_idle,( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'), '0', '0', '1', '0',( others => '0'), '0', '0', '0', '0', '0', '0', '0', '0', '0',( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'), '0', x"0a",( others => '0'), '0', '0', '0', '0', '0', '0',( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'),( others => '0'), '0') regs_init
Definition: ibdr_rhrp.vhd:344
slv4 := "0000" omux_cs1
Definition: ibdr_rhrp.vhd:92
slv3 := "100" dte_rm03
Definition: ibdr_rhrp.vhd:207
slv10 := slv( to_unsigned( 630- 1, 10) ) rp07_camax
Definition: ibdr_rhrp.vhd:252
slv3 := "000" amapc_da
Definition: ibdr_rhrp.vhd:105
integer := 7 cs1_ibf_rdy
Definition: ibdr_rhrp.vhd:130
slv5 := "10100" ibaddr_bae
Definition: ibdr_rhrp.vhd:89
slv10 := slv( to_unsigned( 823- 1, 10) ) rm03_camax
Definition: ibdr_rhrp.vhd:237
slv5 := "11100" func_read
Definition: ibdr_rhrp.vhd:151
integer := 15 ds_ibf_ata
Definition: ibdr_rhrp.vhd:181
slv3 := "111" dte_rp07
Definition: ibdr_rhrp.vhd:210
slbit := '0' MEM_1_WE
Definition: ibdr_rhrp.vhd:398
integer range 9 downto 0 dc_ibf_ca
Definition: ibdr_rhrp.vhd:212
slv5 := "00001" func_unl
Definition: ibdr_rhrp.vhd:136
slv2 := "00" clrmode_breset
Definition: ibdr_rhrp.vhd:121
slv6 := slv( to_unsigned( 31- 1, 6) ) rm80_samax
Definition: ibdr_rhrp.vhd:244
integer := 11 cs2_ibf_nem
Definition: ibdr_rhrp.vhd:170
slv5 := slv( to_unsigned( 5- 1, 5) ) rm03_tamax
Definition: ibdr_rhrp.vhd:238
slv5 := "00011" rfunc_done
Definition: ibdr_rhrp.vhd:156
slv5 := "00100" rfunc_widly
Definition: ibdr_rhrp.vhd:157
integer := 10 cs2_ibf_pge
Definition: ibdr_rhrp.vhd:171
integer := 1 cs3_ibf_rporedone
Definition: ibdr_rhrp.vhd:221
slv6 := slv( to_unsigned( 22- 1, 6) ) rp06_samax
Definition: ibdr_rhrp.vhd:233
slv6 := slv( to_unsigned( 8#24#, 6) ) rm03_dtyp
Definition: ibdr_rhrp.vhd:236
slv5 := "00000" ibaddr_cs1
Definition: ibdr_rhrp.vhd:66
integer range 9 downto 8 cs1_ibf_runit
Definition: ibdr_rhrp.vhd:160
slv5 := "00011" func_recal
Definition: ibdr_rhrp.vhd:138
slv5 := "11001" func_whd
Definition: ibdr_rhrp.vhd:150
integer := 12 ds_ibf_mol
Definition: ibdr_rhrp.vhd:184
slv6 := slv( to_unsigned( 8#22#, 6) ) rp06_dtyp
Definition: ibdr_rhrp.vhd:230
integer range 5 downto 0 bae_ibf_bae
Definition: ibdr_rhrp.vhd:214
integer := 0 dt_ibf_e0
Definition: ibdr_rhrp.vhd:203
integer range 4 downto 3 amap_f_unit
Definition: ibdr_rhrp.vhd:118
slv4 := "0110" omux_dt
Definition: ibdr_rhrp.vhd:98
slv5 := "01000" ibaddr_la
Definition: ibdr_rhrp.vhd:74
integer := 6 cs2_ibf_ir
Definition: ibdr_rhrp.vhd:174
slv2 := "10" amapr_db
Definition: ibdr_rhrp.vhd:116
slv3 := "110" amapc_cs1
Definition: ibdr_rhrp.vhd:111
integer := 6 cs3_ibf_ie
Definition: ibdr_rhrp.vhd:218
slv4 := "0011" omux_er1
Definition: ibdr_rhrp.vhd:95
integer := 0 cs1_ibf_go
Definition: ibdr_rhrp.vhd:133
slv2 := "01" amapr_ba
Definition: ibdr_rhrp.vhd:115
slv6 := slv( to_unsigned( 8#26#, 6) ) rm80_dtyp
Definition: ibdr_rhrp.vhd:241
integer := 6 cs1_ibf_ie
Definition: ibdr_rhrp.vhd:131
integer := 4 cs2_ibf_pat
Definition: ibdr_rhrp.vhd:176
integer := 13 ds_ibf_pip
Definition: ibdr_rhrp.vhd:183
integer range 5 downto 0 da_ibf_sa
Definition: ibdr_rhrp.vhd:165
out EI_REQ slbit
Definition: ibdr_rhrp.vhd:50
in CE_USEC slbit
Definition: ibdr_rhrp.vhd:44
in BRESET slbit
Definition: ibdr_rhrp.vhd:45
out RB_LAM slbit
Definition: ibdr_rhrp.vhd:47
in ITIMER slbit
Definition: ibdr_rhrp.vhd:46
string fsm_encoding
Definition: ibdr_rhrp.vhd:56
in CLK slbit
Definition: ibdr_rhrp.vhd:43
in IB_MREQ ib_mreq_type
Definition: ibdr_rhrp.vhd:48
out IB_SRES ib_sres_type
Definition: ibdr_rhrp.vhd:49
in EI_ACK slbit
Definition: ibdr_rhrp.vhd:52
Definition: iblib.vhd:33
in ADDR slv( AWIDTH- 1 downto 0)
out DO slv( DWIDTH- 1 downto 0)
AWIDTH positive := 4
in DI slv( DWIDTH- 1 downto 0)
in CLK slbit
in WE slbit
DWIDTH positive := 16
std_logic_vector( 9 downto 0) slv10
Definition: slvtypes.vhd:42
std_logic_vector( 3 downto 0) slv4
Definition: slvtypes.vhd:36
std_logic_vector( 4 downto 0) slv5
Definition: slvtypes.vhd:37
std_logic_vector( 6 downto 0) slv7
Definition: slvtypes.vhd:39
std_logic_vector( 2 downto 0) slv3
Definition: slvtypes.vhd:35
std_logic_vector( 15 downto 0) slv16
Definition: slvtypes.vhd:48
std_logic slbit
Definition: slvtypes.vhd:30
std_logic_vector( 5 downto 0) slv6
Definition: slvtypes.vhd:38
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