Made the VAX model visible with a SHOW CPU MODEL command for all simulators and made the model persist across a SAVE/RESTORE for the VAX simulators with a settable model

This commit is contained in:
Mark Pizzolato 2013-01-14 06:53:48 -08:00
parent 5f44b2e7db
commit 8720c8c87b
16 changed files with 43 additions and 22 deletions

View file

@ -329,9 +329,6 @@ int32 Map_ReadW (uint32 ba, int32 bc, uint16 *buf);
int32 Map_WriteB (uint32 ba, int32 bc, uint8 *buf);
int32 Map_WriteW (uint32 ba, int32 bc, uint16 *buf);
int32 clk_cosched (int32 wait);
t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc);
t_stat cpu_show_leds (FILE *st, UNIT *uptr, int32 val, void *desc);
#include "pdp11_io_lib.h"

View file

@ -57,6 +57,7 @@ extern int32 p1;
extern int32 trpirq, mem_err;
int32 conisp, conpc, conpsl; /* console reg */
int32 sys_model = 0;
char cpu_boot_cmd[CBUFSIZE] = { 0 }; /* boot command */
static struct boot_dev boot_tab[] = {

View file

@ -109,6 +109,9 @@
{ UNIT_MSIZE, (1u << 23), NULL, "8M", &cpu_set_size }, \
{ UNIT_MSIZE, (1u << 23) + (1u << 22), NULL, "12M", &cpu_set_size }, \
{ UNIT_MSIZE, (1u << 24), NULL, "16M", &cpu_set_size }
#define CPU_MODEL_MODIFIERS \
{ MTAB_XTD|MTAB_VDV, 0, "MODEL", NULL, \
NULL, &cpu_show_model },
/* Qbus I/O page */
@ -380,10 +383,6 @@ int32 Map_ReadW (uint32 ba, int32 bc, uint16 *buf);
int32 Map_WriteB (uint32 ba, int32 bc, uint8 *buf);
int32 Map_WriteW (uint32 ba, int32 bc, uint16 *buf);
int32 clk_cosched (int32 wait);
t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc);
#include "pdp11_io_lib.h"
#endif

View file

@ -55,6 +55,7 @@
#define UNIT_NODELAY (1u << UNIT_V_NODELAY)
t_stat vax630_boot (int32 flag, char *ptr);
int32 sys_model = 0;
/* Special boot command, overrides regular boot */

View file

@ -128,6 +128,9 @@
#define MEM_MODIFIERS { UNIT_MSIZE, (1u << 20), NULL, "1M", &cpu_set_size }, \
{ UNIT_MSIZE, (1u << 21), NULL, "2M", &cpu_set_size }, \
{ UNIT_MSIZE, (1u << 22), NULL, "4M", &cpu_set_size }
#define CPU_MODEL_MODIFIERS \
{ MTAB_XTD|MTAB_VDV, 0, "MODEL", NULL, \
NULL, &cpu_show_model },
/* Unibus I/O registers */
@ -354,7 +357,6 @@ int32 Map_WriteW (uint32 ba, int32 bc, uint16 *buf);
t_stat show_nexus (FILE *st, UNIT *uptr, int32 val, void *desc);
void sbi_set_errcnf (void);
int32 clk_cosched (int32 wait);
#include "pdp11_io_lib.h"

View file

@ -43,6 +43,7 @@
#endif /* DONT_USE_INTERNAL_ROM */
static char cpu_boot_cmd[CBUFSIZE] = { 0 }; /* boot command */
int32 sys_model = 0;
/* VAX-11/730 boot device definitions */
@ -563,6 +564,12 @@ SP = PC = 512;
return SCPE_OK;
}
t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc)
{
fprintf (st, "model=VAX 11/730");
return SCPE_OK;
}
/* SYSB reset */
t_stat sysb_reset (DEVICE *dptr)

View file

@ -71,6 +71,7 @@ uint32 nexus_req[NEXUS_HLVL]; /* nexus int req */
uint32 cmi_err = 0;
uint32 cmi_cadr = 0;
char cpu_boot_cmd[CBUFSIZE] = { 0 }; /* boot command */
int32 sys_model = 0;
static t_stat (*nexusR[NEXUS_NUM])(int32 *dat, int32 ad, int32 md);
static t_stat (*nexusW[NEXUS_NUM])(int32 dat, int32 ad, int32 md);
@ -648,6 +649,12 @@ SP = PC = 512;
return SCPE_OK;
}
t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc)
{
fprintf (st, "model=VAX 11/750");
return SCPE_OK;
}
/* CMI reset */
t_stat cmi_reset (DEVICE *dptr)

View file

@ -150,6 +150,9 @@
{ UNIT_MSIZE, (1u << 21), NULL, "2M", &cpu_set_size }, \
{ UNIT_MSIZE, (1u << 22), NULL, "4M", &cpu_set_size }, \
{ UNIT_MSIZE, (1u << 23), NULL, "8M", &cpu_set_size }
#define CPU_MODEL_MODIFIERS \
{ MTAB_XTD|MTAB_VDV, 0, "MODEL", NULL, \
NULL, &cpu_show_model },
/* Unibus I/O registers */
@ -407,7 +410,6 @@ t_stat mba_show_num (FILE *st, UNIT *uptr, int32 val, void *desc);
t_stat show_nexus (FILE *st, UNIT *uptr, int32 val, void *desc);
void sbi_set_errcnf (void);
int32 clk_cosched (int32 wait);
#include "pdp11_io_lib.h"

View file

@ -423,10 +423,6 @@ t_stat mba_show_num (FILE *st, UNIT *uptr, int32 val, void *desc);
t_stat show_nexus (FILE *st, UNIT *uptr, int32 val, void *desc);
void sbi_set_errcnf (void);
int32 clk_cosched (int32 wait);
t_stat cpu_set_model (UNIT *uptr, int32 val, char *cptr, void *desc);
t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc);
#include "pdp11_io_lib.h"

View file

@ -829,6 +829,6 @@ return SCPE_OK;
t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc)
{
fprintf (st, "model=%s", (sys_model ? "785" : "780"));
fprintf (st, "model=VAX 11/%s", (sys_model ? "785" : "780"));
return SCPE_OK;
}

View file

@ -728,6 +728,6 @@ return SCPE_OK;
t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc)
{
fprintf (st, "model=%s", (sys_model ? "8650" : "8600"));
fprintf (st, "model=VAX %s", (sys_model ? "8650" : "8600"));
return SCPE_OK;
}

View file

@ -456,10 +456,6 @@ t_stat mba_show_num (FILE *st, UNIT *uptr, int32 val, void *desc);
t_stat show_nexus (FILE *st, UNIT *uptr, int32 val, void *desc);
void sbi_set_errcnf (void);
int32 clk_cosched (int32 wait);
t_stat cpu_set_model (UNIT *uptr, int32 val, char *cptr, void *desc);
t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc);
#include "pdp11_io_lib.h"

View file

@ -307,6 +307,7 @@ const uint32 align[4] = {
extern t_stat build_dib_tab (void);
extern UNIT rom_unit, nvr_unit;
extern int32 sys_model;
extern int32 op_ashq (int32 *opnd, int32 *rh, int32 *flg);
extern int32 op_emul (int32 mpy, int32 mpc, int32 *rh);
extern int32 op_ediv (int32 *opnd, int32 *rh, int32 *flg);
@ -456,6 +457,7 @@ REG cpu_reg[] = {
{ HRDATA (PCQP, pcq_p, 6), REG_HRO },
{ HRDATA (BADABO, badabo, 32), REG_HRO },
{ HRDATA (WRU, sim_int_char, 8) },
{ HRDATA (MODEL, sys_model, 32), REG_HRO },
{ NULL }
};

View file

@ -751,6 +751,10 @@ void cpu_idle (void);
#define BOOT_CODE_ARRAY NULL
#define BOOT_CODE_SIZE 0
#endif
extern t_stat cpu_load_bootcode (const char *filename, const unsigned char *builtin_code, size_t size, t_bool rom, t_addr offset);
extern t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc);
extern t_stat cpu_set_model (UNIT *uptr, int32 val, char *cptr, void *desc);
extern int32 clk_cosched (int32 wait);
#endif /* _VAX_DEFS_H */

View file

@ -64,6 +64,7 @@
#define UNIT_NODELAY (1u << UNIT_V_NODELAY)
t_stat vax_boot (int32 flag, char *ptr);
int32 sys_model = 0;
/* Special boot command, overrides regular boot */
@ -1573,7 +1574,6 @@ return run_cmd (flag, "CPU");
t_stat cpu_boot (int32 unitno, DEVICE *dptr)
{
extern t_stat load_cmd (int32 flag, char *cptr);
t_stat r;
PC = ROMBASE;
@ -1591,6 +1591,12 @@ sysd_powerup ();
return SCPE_OK;
}
t_stat cpu_show_model (FILE *st, UNIT *uptr, int32 val, void *desc)
{
fprintf (st, "model=VAX 3900");
return SCPE_OK;
}
/* SYSD reset */
t_stat sysd_reset (DEVICE *dptr)

View file

@ -126,6 +126,9 @@
{ UNIT_MSIZE, (1u << 27), NULL, "128M", &cpu_set_size }, \
{ UNIT_MSIZE, (1u << 28), NULL, "256M", &cpu_set_size }, \
{ UNIT_MSIZE, (1u << 29), NULL, "512M", &cpu_set_size }
#define CPU_MODEL_MODIFIERS \
{ MTAB_XTD|MTAB_VDV, 0, "MODEL", NULL, \
NULL, &cpu_show_model },
/* Cache diagnostic space */
@ -427,8 +430,6 @@ int32 Map_ReadW (uint32 ba, int32 bc, uint16 *buf);
int32 Map_WriteB (uint32 ba, int32 bc, uint8 *buf);
int32 Map_WriteW (uint32 ba, int32 bc, uint16 *buf);
int32 clk_cosched (int32 wait);
#include "pdp11_io_lib.h"
#endif