Skip to content

Commit 25f053e

Browse files
committed
KA10: Added switch for DF10 vs DF10C.
Fix bug in interrupt handling in KI when EPT not at 0. Fix bug with handling of CCW_COMP flag on DF10 devices.
1 parent cc6f8ee commit 25f053e

9 files changed

+142
-81
lines changed

PDP10/kx10_cpu.c

+22-14
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ int pi_restore; /* Restore previous level */
162162
int pi_hold; /* Hold onto interrupt */
163163
int modify; /* Modify cycle */
164164
int xct_flag; /* XCT flags */
165+
int pi_vect; /* Last pi location used for IRQ */
165166
#if KI | KL | KS
166167
uint64 ARX; /* Extension to AR */
167168
uint64 BRX; /* Extension to BR */
@@ -184,13 +185,11 @@ int t20_page; /* Tops 20 paging selected */
184185
int ptr_flg; /* Access to pointer value */
185186
int extend = 0; /* Process extended instruction */
186187
int fe_xct = 0; /* Execute instruction at address */
187-
int pi_vect; /* Last pi location used for IRQ */
188188
#if KS_ITS
189189
uint64 qua_time; /* Quantum clock value */
190190
uint8 pi_act; /* Current active PI level */
191191
#endif
192192
#elif KL
193-
int pi_vect; /* Last pi location used for IRQ */
194193
int ext_ac; /* Extended instruction AC */
195194
uint8 prev_ctx; /* Previous AC context */
196195
uint16 irq_enable; /* Apr IRQ enable bits */
@@ -404,7 +403,14 @@ t_bool build_dev_tab (void);
404403
#define DEFMEM 256
405404
#endif
406405

407-
UNIT cpu_unit[] = { { UDATA (&rtc_srv, UNIT_IDLE|UNIT_FIX|UNIT_BINK|UNIT_TWOSEG, DEFMEM * 1024) },
406+
#if KI_22BIT
407+
#define DF_FLAG UNIT_DF10C
408+
#else
409+
#define DF_FLAG 0
410+
#endif
411+
412+
UNIT cpu_unit[] = { { UDATA (&rtc_srv,
413+
UNIT_IDLE|UNIT_FIX|UNIT_BINK|UNIT_TWOSEG|DF_FLAG, DEFMEM * 1024) },
408414
#if ITS
409415
{ UDATA (&qua_srv, UNIT_IDLE|UNIT_DIS, 0) }
410416
#endif
@@ -630,6 +636,12 @@ MTAB cpu_mod[] = {
630636
{ UNIT_M_MPX, 0, NULL, "NOMPX", NULL, NULL, NULL,
631637
"Disables the MPX device"},
632638
#endif
639+
#if KI | KL
640+
{ UNIT_M_DF10, 0, "DF10", "DF10", NULL, NULL, NULL,
641+
"18 bit DF10"},
642+
{ UNIT_M_DF10, UNIT_DF10C, "DF10C", "DF10C", NULL, NULL, NULL,
643+
"22 bit DF10C"},
644+
#endif
633645
#if PDP6 | KA | KI
634646
{ UNIT_MAOFF, UNIT_MAOFF, "MAOFF", "MAOFF", NULL, NULL,
635647
NULL, "Interrupts relocated to 140"},
@@ -656,6 +668,7 @@ DEBTAB cpu_debug[] = {
656668
{0, 0}
657669
};
658670

671+
659672
DEVICE cpu_dev = {
660673
"CPU", &cpu_unit[0], cpu_reg, cpu_mod,
661674
1+ITS+KL, 8, 22, 1, 8, 36,
@@ -1770,7 +1783,7 @@ void check_apr_irq() {
17701783
void cty_interrupt()
17711784
{
17721785
irq_flags |= CON_IRQ;
1773-
sim_debug(DEBUG_IRQ, &cpu_dev, "cty interrupt %06o\n", irq_enable);
1786+
sim_debug(DEBUG_IRQ, &cpu_dev, "cty interrupt %06o\n", irq_enable);
17741787
check_apr_irq();
17751788
}
17761789

@@ -4686,11 +4699,12 @@ if ((reason = build_dev_tab ()) != SCPE_OK) /* build, chk dib_tab */
46864699
#if KL
46874700
sect = cur_sect = 0;
46884701
extend = 0;
4689-
pi_vect = AB;
46904702
#endif
4703+
pi_vect = AB;
46914704
Mem_read_nopage();
46924705
goto no_fetch;
46934706
#elif PDP6 | KA
4707+
pi_vect = AB;
46944708
goto fetch;
46954709
#endif
46964710
}
@@ -12049,16 +12063,13 @@ if ((reason = build_dev_tab ()) != SCPE_OK) /* build, chk dib_tab */
1204912063
trap_flag = 0;
1205012064
}
1205112065
#endif
12066+
/* Check if I/O and BLKI/O or DATAI/O */
1205212067
if ((IR & 0700) == 0700 && ((AC & 04) == 0)) {
1205312068
pi_hold = pi_ov;
12054-
if ((!pi_hold) & f_inst_fetch) {
12069+
if ((!pi_hold) && f_inst_fetch) {
1205512070
pi_cycle = 0;
1205612071
} else {
12057-
#if KL | KS
1205812072
AB = pi_vect | pi_ov;
12059-
#else
12060-
AB = 040 | (pi_enc << 1) | maoff | pi_ov;
12061-
#endif
1206212073
#if KI | KL
1206312074
Mem_read_nopage();
1206412075
#elif KS
@@ -12069,14 +12080,11 @@ if ((reason = build_dev_tab ()) != SCPE_OK) /* build, chk dib_tab */
1206912080
goto no_fetch;
1207012081
}
1207112082
} else if (pi_hold && !f_pc_inh) {
12083+
/* Check if I/O, then check if IRQ was raised */
1207212084
if ((IR & 0700) == 0700) {
1207312085
(void)check_irq_level();
1207412086
}
12075-
#if KL | KS
1207612087
AB = pi_vect | pi_ov;
12077-
#else
12078-
AB = 040 | (pi_enc << 1) | maoff | pi_ov;
12079-
#endif
1208012088
pi_ov = 0;
1208112089
pi_hold = 0;
1208212090
#if KI | KL

PDP10/kx10_defs.h

+20-11
Original file line numberDiff line numberDiff line change
@@ -346,11 +346,9 @@ extern DEBTAB crd_debug[];
346346
#define API_MASK 0000000007
347347
#define PI_ENABLE 0000000010 /* Clear DONE */
348348
#define BUSY 0000000020 /* STOP */
349-
#define CCW_COMP 0000000040 /* Write Final CCW */
350349
/* RH10 / RH20 interrupt */
351350
#define IADR_ATTN 0000000000040LL /* Interrupt on attention */
352351
#define IARD_RAE 0000000000100LL /* Interrupt on register access error */
353-
#define CCW_COMP_1 0000000040000LL /* Control word written. */
354352

355353
#if KI
356354
#define DEF_SERIAL 514 /* Default DEC test machine */
@@ -423,6 +421,10 @@ extern DEBTAB crd_debug[];
423421
#define UNIT_V_MPX (UNIT_V_WAITS + 1)
424422
#define UNIT_M_MPX (1 << UNIT_V_MPX)
425423
#define UNIT_MPX (UNIT_M_MPX) /* MPX Device for ITS */
424+
#define UNIT_V_DF10 (UNIT_V_MPX + 1) /* DF10 18 bit or 22 bit */
425+
#define UNIT_M_DF10 (1 << UNIT_V_DF10)
426+
#define UNIT_DF10C (UNIT_M_DF10)
427+
#define UNIT_DF10 0
426428
#define CNTRL_V_RH (UNIT_V_UF + 4)
427429
#define CNTRL_M_RH 7
428430
#define GET_CNTRL_RH(x) (((x) >> CNTRL_V_RH) & CNTRL_M_RH)
@@ -525,6 +527,8 @@ extern DEVICE dz_dev;
525527
extern DEVICE kmc_dev;
526528
extern DEVICE dup_dev;
527529
extern DEVICE tcu_dev;
530+
extern DEVICE ddc_dev;
531+
extern DEVICE tym_dev;
528532

529533
#if KS
530534

@@ -620,9 +624,11 @@ struct df10 {
620624
uint32 wcr; /* CUrrent word count */
621625
uint32 cda; /* Current transfer address */
622626
uint32 devnum; /* Device number */
623-
t_uint64 buf; /* Data buffer */
627+
uint64 buf; /* Data buffer */
624628
uint8 nxmerr; /* Bit to set for NXM */
625-
uint8 ccw_comp; /* Have we written out CCW */
629+
uint64 amask; /* Address mask */
630+
uint64 wmask; /* Word mask */
631+
int cshift; /* Shift amount */
626632
} ;
627633

628634
/* RH10/RH20 Interface */
@@ -660,7 +666,7 @@ struct pdp_dib {
660666
t_addr (*irq)(uint32 dev, t_addr addr);
661667
struct rh_if *rh;
662668
};
663-
669+
664670
#define RH10_DEV 01000
665671
#define RH20_DEV 02000
666672
struct rh_dev {
@@ -678,6 +684,7 @@ void df10_setup(struct df10 *df, uint32 addr);
678684
int df10_fetch(struct df10 *df);
679685
int df10_read(struct df10 *df);
680686
int df10_write(struct df10 *df);
687+
void df10_init(struct df10 *df, uint32 dev_num, uint8 nxmerr);
681688
#if PDP6_DEV
682689
int dct_read(int u, t_uint64 *data, int c);
683690
int dct_write(int u, t_uint64 *data, int c);
@@ -715,7 +722,7 @@ extern void ka10_lights_clear_aux (int);
715722
#if !(PDP6 | KS)
716723
#define NUM_DEVS_LP 1
717724
#endif
718-
#if !(KL | KS)
725+
#if !(KS)
719726
#define NUM_DEVS_PT 1
720727
#define NUM_DEVS_CR 1
721728
#define NUM_DEVS_CP 1
@@ -748,24 +755,25 @@ extern void ka10_lights_clear_aux (int);
748755
#define NUM_DEVS_DUP 2
749756
#define NUM_DEVS_KMC 2
750757
#if KS_ITS
751-
#define NUM_DEVS_IMP KS_ITS
752758
#define NUM_DEVS_CH11 KS_ITS
753759
#endif
754760
#endif
755761
#if KA | KI
756762
#define NUM_DEVS_RC 1
757-
#define NUM_DEVS_DT 1
758763
#define NUM_DEVS_DK 1
759-
#define NUM_DEVS_DP 2
764+
#define NUM_DEVS_DDC 1
760765
#endif
761766
#if KS
762767
#define NUM_DEVS_RP 1
763768
#elif KA | KI | KL
769+
#define NUM_DEVS_DT 1
770+
#define NUM_DEVS_DP 2
764771
#define NUM_DEVS_RP 4
765772
#define NUM_DEVS_RS 1
766773
#endif
767774
#if !(PDP6)
768775
#define NUM_DEVS_TU 1
776+
#define NUM_DEVS_IMP 1
769777
#endif
770778
#if KA
771779
#define NUM_DEVS_PMP WAITS
@@ -780,19 +788,20 @@ extern void ka10_lights_clear_aux (int);
780788
#define NUM_DEVS_MTY ITS
781789
#define NUM_DEVS_TEN11 ITS
782790
#define NUM_DEVS_AUXCPU ITS
783-
#define NUM_DEVS_IMP ITS
784791
#define NUM_DEVS_CH10 ITS
785792
#define NUM_DEVS_DPK ITS
786793
#define NUM_DEVS_AI ITS
787794
#endif
788795
#if KL_ITS
789796
#define NUM_DEVS_PD KL_ITS
790-
#define NUM_DEVS_IMP KL_ITS
791797
#define NUM_DEVS_CH10 KL_ITS
792798
#endif
793799
#if MAGIC_SWITCH && !KA && !ITS
794800
#error "Magic switch only valid on KA10 with ITS mods"
795801
#endif
802+
#if KI
803+
#define NUM_DEVS_TYM 1
804+
#endif
796805

797806
/* Global data */
798807

0 commit comments

Comments
 (0)