1
0
mirror of https://github.com/simh/simh.git synced 2026-01-25 19:56:25 +00:00

SHOW IOSPACE, again

Show IOSPACE doesn't always get the number of devices right due to device creativity.

o The distinction between UNIT and DEVICE has blurred
o MUX devices merge several physical devices into one device/unit
o Dynamic device sizing has made things more volatile.

This edit solves the problem for SHOW IOSPACE by adding an (optional) word to the DIBs.
The word contains the amount of IO space consumed by each instance of the physical device that's being emulated.
E.G., if it's a DZ11, the device is the DZ11 module, or 8 lines, even though the MUX device may support 32.

This enables SHOW IOSPACE to determine the number of physical devices being emulated, which is what folks need when configuring software.  The word may have other uses - in a generic dynamic device sizing routine - which is why the amount of IOSPACE per device was chosen rather than the 'number of physical devices.'

The edit should not make any existing device regress.  If the new word (ulnt) is zero (not initialized), SHOW IOSPACE will default to the number of units in the device, or if there's no device (CPUs), 1 as before.  If it is present, the number of devices is the calculated as total allocation/allocation-per-device.

The edit updates all the devices that seem to require this treatment, and all the processors that define the UNIBUS/QBUS DIBs.
This commit is contained in:
Timothe Litt
2013-07-11 15:39:15 -04:00
parent 95e54dc60e
commit 91c7d26095
34 changed files with 57 additions and 32 deletions

View File

@@ -613,6 +613,7 @@ struct pdp_dib {
int32 vloc; /* locator */
int32 vec; /* value */
int32 (*ack[VEC_DEVMAX])(void); /* ack routines */
uint32 ulnt; /* IO length per unit */
};
typedef struct pdp_dib DIB;

View File

@@ -1129,8 +1129,8 @@ while (done == 0) { /* sort ascending */
}
}
} /* end while */
fprintf (st, " Address Vector BR Device\n"
"----------------- -------- -- ------\n");
fprintf (st, " Address Vector BR # Device\n"
"----------------- -------- -- -- ------\n");
for (i = 0; dib_tab[i] != NULL; i++) { /* print table */
for (j = 0, dptr = NULL; sim_devices[j] != NULL; j++) {
if (((DIB*) sim_devices[j]->ctxt) == dib_tab[i]) {
@@ -1156,7 +1156,8 @@ for (i = 0; dib_tab[i] != NULL; i++) { /* print table */
(dib_tab[i]->vloc<=19)? 5: 4);
else
fprintf (st, " ");
fprintf (st, " %s\n", dptr? sim_dname (dptr): "CPU");
fprintf (st, " %2u %s\n", (dib_tab[i]->ulnt? dib_tab[i]->lnt/dib_tab[i]->ulnt:
(dptr? dptr->numunits: 1)), dptr? sim_dname (dptr): "CPU");
}
return SCPE_OK;
}

View File

@@ -387,7 +387,7 @@ t_stat rp_set_size (UNIT *uptr, int32 val, char *cptr, void *desc);
DIB rp_dib = {
IOBA_RP, IOLN_RP, &rp_rd, &rp_wr,
1, IVCL (RP), VEC_RP, { &rp_inta }
1, IVCL (RP), VEC_RP, { &rp_inta }, IOLN_RP
};
UNIT rp_unit[] = {

View File

@@ -359,7 +359,7 @@ t_stat tu_map_err (UNIT *uptr, t_stat st, t_bool qdt);
DIB tu_dib = {
IOBA_TU, IOLN_TU, &tu_rd, &tu_wr,
1, IVCL (TU), VEC_TU, { &tu_inta }
1, IVCL (TU), VEC_TU, { &tu_inta }, IOLN_TU,
};
UNIT tu_unit[] = {