From 471ea3efce63949c9872de8463c55232c7b46e50 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Fri, 5 Apr 2013 14:52:27 -0700 Subject: [PATCH] Added SHOW CPU MEMORY to the MicroVAX I simulator --- PDP11/pdp11_io_lib.c | 2 +- VAX/vax610_defs.h | 7 +++++-- VAX/vax610_mem.c | 29 ++++++++++++++++++++++++++++- scp.c | 1 + 4 files changed, 35 insertions(+), 4 deletions(-) diff --git a/PDP11/pdp11_io_lib.c b/PDP11/pdp11_io_lib.c index 10bdfe3a..2e4dd412 100644 --- a/PDP11/pdp11_io_lib.c +++ b/PDP11/pdp11_io_lib.c @@ -351,7 +351,7 @@ AUTO_CON auto_tab[] = {/*c #v am vm fxa fxv */ { { "QBA" }, 1, 0, 0, 0, {017500} }, /* doorbell - fx CSR, no VEC */ { { "MCTL" }, 1, 0, 0, 0, - {012100} }, /* MSV11-P - fx CSR, no VEC */ + {012100} }, /* MSV11-P/MSV11-Q - fx CSR, no VEC */ { { "KE" }, 1, 0, 0, 0, {017300} }, /* KE11-A - fx CSR, no VEC */ { { "KG" }, 1, 0, 0, 0, diff --git a/VAX/vax610_defs.h b/VAX/vax610_defs.h index a3a6a42c..1b59789a 100644 --- a/VAX/vax610_defs.h +++ b/VAX/vax610_defs.h @@ -94,10 +94,13 @@ #define ADDR_IS_MEM(x) (((uint32) (x)) < MEMSIZE) #undef PAMASK #define PAMASK 0x203FFFFF /* KA610 needs a special mask */ -#define MEM_MODIFIERS { UNIT_MSIZE, (1u << 19), NULL, "512k", &cpu_set_size, NULL, NULL, "Set Memory to 512K bytes" },\ +#define MEM_MODIFIERS { UNIT_MSIZE, (1u << 19), NULL, "512K", &cpu_set_size, NULL, NULL, "Set Memory to 512K bytes" },\ + { UNIT_MSIZE, (1u << 19) + (1u << 18), NULL, "768K", &cpu_set_size, NULL, NULL, "Set Memory to 1M bytes" }, \ { UNIT_MSIZE, (1u << 20), NULL, "1M", &cpu_set_size, NULL, NULL, "Set Memory to 1M bytes" }, \ { UNIT_MSIZE, (1u << 21), NULL, "2M", &cpu_set_size, NULL, NULL, "Set Memory to 2M bytes" }, \ - { UNIT_MSIZE, (1u << 22), NULL, "4M", &cpu_set_size, NULL, NULL, "Set Memory to 4M bytes" } + { UNIT_MSIZE, (1u << 22), NULL, "4M", &cpu_set_size, NULL, NULL, "Set Memory to 4M bytes" }, \ + { MTAB_XTD|MTAB_VDV|MTAB_NMO, 0, "MEMORY", NULL, NULL, &cpu_show_memory, NULL, "Display memory configuration" } +extern t_stat cpu_show_memory (FILE* st, UNIT* uptr, int32 val, void* desc); #define CPU_MODEL_MODIFIERS { MTAB_XTD|MTAB_VDV, 0, "LEDS", NULL, \ NULL, &cpu_show_leds, NULL, "Display the CPU LED values" }, \ { MTAB_XTD|MTAB_VDV, 0, "MODEL", NULL, \ diff --git a/VAX/vax610_mem.c b/VAX/vax610_mem.c index bec635c9..ca840272 100644 --- a/VAX/vax610_mem.c +++ b/VAX/vax610_mem.c @@ -73,7 +73,7 @@ DEVICE mctl_dev = { 1, DEV_RDX, 20, 1, DEV_RDX, 8, NULL, NULL, &mctl_reset, NULL, NULL, NULL, - &mctl_dib, DEV_Q18, 0, NULL, NULL, NULL, NULL, NULL, NULL, + &mctl_dib, DEV_QBUS, 0, NULL, NULL, NULL, NULL, NULL, NULL, &mctl_description }; @@ -119,3 +119,30 @@ void rom_wr_B (int32 pa, int32 val) return; } +t_stat cpu_show_memory (FILE* st, UNIT* uptr, int32 val, void* desc) +{ +uint32 memsize = (uint32)(MEMSIZE>>10); +uint32 baseaddr = 0; +uint32 csraddr = mctl_dib.ba; +struct { + uint32 capacity; + char *option; + } boards[] = { + { 4096, "MSV11-QC"}, + { 2048, "MSV11-QB"}, + { 1024, "MSV11-QA"}, + { 512, "MSV11-PL"}, + { 256, "MSV11-PK"}, + { 0, NULL}}; +int32 i; + +while (memsize) { + for (i=0; boards[i].capacity > memsize; ++i) + ; + fprintf(st, "Memory (0x%08x): %3d %sbytes (%s) - CSR: 0x%08x.\n", baseaddr, boards[i].capacity/((boards[i].capacity >= 1024) ? 1024 : 1), (boards[i].capacity >= 1024) ? "M" : "K", boards[i].option, csraddr); + memsize -= boards[i].capacity; + baseaddr += boards[i].capacity*1024; + csraddr += (boards[i].capacity/256)*2; + } +return SCPE_OK; +} diff --git a/scp.c b/scp.c index 9d8ca876..b201c9dc 100644 --- a/scp.c +++ b/scp.c @@ -2560,6 +2560,7 @@ else { (mptr->pstring && (MATCH_CMD (gbuf, mptr->pstring) == 0))) || (!(mptr->mask & MTAB_VDV) && (mptr->mstring && (MATCH_CMD (gbuf, mptr->mstring) == 0)))) { dptr = sim_dflt_dev; + lvl = MTAB_VDV; /* device match */ cptr -= strlen (gbuf) + 1; while (isspace(*cptr)) ++cptr;