1
0
mirror of https://github.com/rcornwell/sims.git synced 2026-03-27 10:20:52 +00:00

KA10: Added interrupt for PD to KL.

This commit is contained in:
Richard Cornwell
2019-09-10 21:20:47 -04:00
parent 38d6a0a58a
commit 65dd4f6d2c
3 changed files with 45 additions and 3 deletions

View File

@@ -42,14 +42,24 @@
#define PD_DEVNUM 0500
#define PD_OFF (1 << DEV_V_UF)
#define PIA_CH u3
#define PIA_FLG 07
#define CLK_IRQ 010
#define TMR_PD 3
int pd_tps = 60;
t_stat pd_devio(uint32 dev, uint64 *data);
const char *pd_description (DEVICE *dptr);
t_stat pd_srv(UNIT *uptr);
t_stat pd_set_on(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat pd_set_off(UNIT *uptr, int32 val, CONST char *cptr, void *desc);
t_stat pd_show_on(FILE *st, UNIT *uptr, int32 val, CONST void *desc);
UNIT pd_unit[] = {
{UDATA(NULL, UNIT_DISABLE, 0)}, /* 0 */
{UDATA(pd_srv, UNIT_IDLE|UNIT_DISABLE, 0)}, /* 0 */
};
DIB pd_dib = {PD_DEVNUM, 1, &pd_devio, NULL};
@@ -91,6 +101,21 @@ t_stat pd_devio(uint32 dev, uint64 *data)
else
*data = pd_ticks();
break;
case CONI:
*data = (uint64)(pd_unit[0].PIA_CH & (CLK_IRQ|PIA_FLG));
break;
case CONO:
pd_unit[0].PIA_CH &= ~(PIA_FLG);
pd_unit[0].PIA_CH |= (int32)(*data & PIA_FLG);
if (pd_unit[0].PIA_CH & PIA_FLG) {
if (!sim_is_active(pd_unit))
sim_activate(pd_unit, 10000);
}
if (*data & CLK_IRQ) {
pd_unit[0].PIA_CH &= ~(CLK_IRQ);
clr_interrupt(PD_DEVNUM);
}
break;
default:
break;
}
@@ -98,6 +123,23 @@ t_stat pd_devio(uint32 dev, uint64 *data)
return SCPE_OK;
}
t_stat
pd_srv(UNIT * uptr)
{
int32 t;
t = sim_rtcn_calb (pd_tps, TMR_PD);
sim_activate_after(uptr, 1000000/pd_tps);
if (uptr->PIA_CH & PIA_FLG) {
uptr->PIA_CH |= CLK_IRQ;
set_interrupt(PD_DEVNUM, uptr->PIA_CH);
} else
sim_cancel(uptr);
return SCPE_OK;
}
const char *pd_description (DEVICE *dptr)
{
return "Paul DeCoriolis clock";

View File

@@ -527,7 +527,7 @@ int auxcpu_write (int addr, t_uint64);
#define NUM_DEVS_TU 1
#define NUM_DEVS_PMP WAITS
#define NUM_DEVS_DKB WAITS
#define NUM_DEVS_PD ITS
#define NUM_DEVS_PD ITS | KL_ITS
#define NUM_DEVS_IMX ITS
#define NUM_DEVS_STK ITS
#define NUM_DEVS_TK10 ITS

View File

@@ -1269,7 +1269,7 @@ KL10D = PDP10
KL10 = ${KL10D}/kx10_cpu.c ${KL10D}/kx10_sys.c ${KL10D}/kx10_df.c \
${KL10D}/kx10_mt.c ${KL10D}/kx10_dc.c ${KL10D}/kx10_rp.c \
${KL10D}/kx10_tu.c ${KL10D}/kx10_rs.c ${KL10D}/kx10_imp.c \
${KL10D}/kl10_fe.c
${KL10D}/kl10_fe.c ${KL10D}/ka10_pd.c
KL10_OPT = -DKL=1 -DUSE_INT64 -I $(KL10D) -DUSE_SIM_CARD ${NETWORK_OPT}
PDP1D = PDP1