VAX,PDP11: Fix behavior of simulator when multiple DMC devices are in use concurrently. Fix for issue #51.
The interrupt acknowledgment logic for the transmit interrupt inadvertently cleared the device interrupt pending flag even when other devices potentially had pending interrupts. Added line specific indications in the debug output for packet trace debugging.
This commit is contained in:
parent
da134ebb2a
commit
ffda4c1c41
2 changed files with 23 additions and 10 deletions
|
@ -194,6 +194,7 @@ static t_stat ddcmp_tmxr_get_packet_ln (TMLN *lp, const uint8 **pbuf, uint16 *ps
|
|||
{
|
||||
int32 c;
|
||||
size_t payloadsize;
|
||||
char msg[32];
|
||||
|
||||
while (TMXR_VALID & (c = tmxr_getc_ln (lp))) {
|
||||
c &= ~TMXR_VALID;
|
||||
|
@ -224,7 +225,11 @@ while (TMXR_VALID & (c = tmxr_getc_ln (lp))) {
|
|||
*pbuf = lp->rxpb;
|
||||
*psize = DDCMP_HEADER_SIZE;
|
||||
lp->rxpboffset = 0;
|
||||
ddcmp_packet_trace (DDCMP_DBG_PRCV, lp->mp->dptr, "<<< RCV Packet", lp->rxpb, *psize);
|
||||
if (lp->mp->lines > 1)
|
||||
sprintf (msg, "Line%d: <<< RCV Packet", (int)(lp-lp->mp->ldsc));
|
||||
else
|
||||
strcpy (msg, "<<< RCV Packet");
|
||||
ddcmp_packet_trace (DDCMP_DBG_PRCV, lp->mp->dptr, msg, lp->rxpb, *psize);
|
||||
return SCPE_OK;
|
||||
}
|
||||
payloadsize = ((lp->rxpb[2] & 0x3F) << 8)| lp->rxpb[1];
|
||||
|
@ -232,7 +237,11 @@ while (TMXR_VALID & (c = tmxr_getc_ln (lp))) {
|
|||
++lp->rxpcnt;
|
||||
*pbuf = lp->rxpb;
|
||||
*psize = 10 + payloadsize;
|
||||
ddcmp_packet_trace (DDCMP_DBG_PRCV, lp->mp->dptr, "<<< RCV Packet", lp->rxpb, *psize);
|
||||
if (lp->mp->lines > 1)
|
||||
sprintf (msg, "Line%d: <<< RCV Packet", (int)(lp-lp->mp->ldsc));
|
||||
else
|
||||
strcpy (msg, "<<< RCV Packet");
|
||||
ddcmp_packet_trace (DDCMP_DBG_PRCV, lp->mp->dptr, msg, lp->rxpb, *psize);
|
||||
lp->rxpboffset = 0;
|
||||
return SCPE_OK;
|
||||
}
|
||||
|
@ -264,6 +273,7 @@ return SCPE_LOST;
|
|||
static t_stat ddcmp_tmxr_put_packet_ln (TMLN *lp, const uint8 *buf, size_t size)
|
||||
{
|
||||
t_stat r;
|
||||
char msg[32];
|
||||
|
||||
if (!lp->conn)
|
||||
return SCPE_LOST;
|
||||
|
@ -278,7 +288,11 @@ if (lp->txpbsize < size) {
|
|||
memcpy (lp->txpb, buf, size);
|
||||
lp->txppsize = size;
|
||||
lp->txppoffset = 0;
|
||||
ddcmp_packet_trace (DDCMP_DBG_PXMT, lp->mp->dptr, ">>> XMT Packet", lp->txpb, lp->txppsize);
|
||||
if (lp->mp->lines > 1)
|
||||
sprintf (msg, "Line%d: >>> XMT Packet", (int)(lp-lp->mp->ldsc));
|
||||
else
|
||||
strcpy (msg, ">>> XMT Packet");
|
||||
ddcmp_packet_trace (DDCMP_DBG_PXMT, lp->mp->dptr, msg, lp->txpb, lp->txppsize);
|
||||
++lp->txpcnt;
|
||||
while ((lp->txppoffset < lp->txppsize) &&
|
||||
(SCPE_OK == (r = tmxr_putc_ln (lp, lp->txpb[lp->txppoffset]))))
|
||||
|
|
|
@ -1692,7 +1692,7 @@ void dmc_setinint(CTLR *controller)
|
|||
if (!dmc_is_iei_set(controller))
|
||||
return;
|
||||
if (!controller->in_int) {
|
||||
sim_debug(DBG_INT, controller->device, "SET_INT(RX:%s%d)\n", controller->device->name, controller->index);
|
||||
sim_debug(DBG_INT, controller->device, "SET_INT(RX:%s%d) summary=0x%x\n", controller->device->name, controller->index, dmc_ini_summary);
|
||||
}
|
||||
controller->in_int = 1;
|
||||
dmc_ini_summary |= (1u << controller->index);
|
||||
|
@ -1703,7 +1703,7 @@ void dmc_clrinint(CTLR *controller)
|
|||
{
|
||||
controller->in_int = 0;
|
||||
if (dmc_ini_summary & (1u << controller->index)) {
|
||||
sim_debug(DBG_INT, controller->device, "CLR_INT(RX:%s%d)\n", controller->device->name, controller->index);
|
||||
sim_debug(DBG_INT, controller->device, "CLR_INT(RX:%s%d) summary=0x%x\n", controller->device->name, controller->index, dmc_ini_summary);
|
||||
}
|
||||
dmc_ini_summary &= ~(1u << controller->index);
|
||||
if (!dmc_ini_summary)
|
||||
|
@ -1717,7 +1717,7 @@ void dmc_setoutint(CTLR *controller)
|
|||
if (!dmc_is_ieo_set(controller))
|
||||
return;
|
||||
if (!controller->out_int) {
|
||||
sim_debug(DBG_INT, controller->device, "SET_INT(TX:%s%d)\n", controller->device->name, controller->index);
|
||||
sim_debug(DBG_INT, controller->device, "SET_INT(TX:%s%d) summary=0x%x\n", controller->device->name, controller->index, dmc_outi_summary );
|
||||
}
|
||||
controller->out_int = 1;
|
||||
dmc_outi_summary |= (1u << controller->index);
|
||||
|
@ -1728,14 +1728,13 @@ void dmc_clroutint(CTLR *controller)
|
|||
{
|
||||
controller->out_int = 0;
|
||||
if (dmc_outi_summary & (1u << controller->index)) {
|
||||
sim_debug(DBG_INT, controller->device, "CLR_INT(TX:%s%d)\n", controller->device->name, controller->index);
|
||||
sim_debug(DBG_INT, controller->device, "CLR_INT(TX:%s%d) summary=0x%x\n", controller->device->name, controller->index, dmc_outi_summary);
|
||||
}
|
||||
dmc_outi_summary &= ~(1u << controller->index);
|
||||
if (!dmc_outi_summary)
|
||||
CLR_INT(DMCTX);
|
||||
else
|
||||
SET_INT(DMCTX);
|
||||
CLR_INT(DMCTX);
|
||||
}
|
||||
|
||||
int dmc_getsel(int addr)
|
||||
|
@ -3397,7 +3396,7 @@ for (i=0; i<DMC_NUMDEVICE+DMP_NUMDEVICE; i++) {
|
|||
DIB *dib = (DIB *)controller->device->ctxt;
|
||||
ans = dib->vec + (8 * (int)(controller->unit - controller->device->units));
|
||||
dmc_clrinint(controller);
|
||||
sim_debug(DBG_INT, controller->device, "RXINTA Device %d - Vector: 0x%x\n", (int)(controller->unit-controller->device->units), ans);
|
||||
sim_debug(DBG_INT, controller->device, "RXINTA Device %d - Vector: 0x%x(0%3o)\n", (int)(controller->unit-controller->device->units), ans, ans);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3416,7 +3415,7 @@ for (i=0; i<DMC_NUMDEVICE+DMP_NUMDEVICE; i++) {
|
|||
DIB *dib = (DIB *)controller->device->ctxt;
|
||||
ans = dib->vec + 4 + (8 * (int)(controller->unit - controller->device->units));
|
||||
dmc_clroutint(controller);
|
||||
sim_debug(DBG_INT, controller->device, "TXINTA Device %d - Vector: 0x%x\n", (int)(controller->unit-controller->device->units), ans);
|
||||
sim_debug(DBG_INT, controller->device, "TXINTA Device %d - Vector: 0x%x(0%3o)\n", (int)(controller->unit-controller->device->units), ans, ans);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue