[Simh] Watch

Bob Supnik bob at supnik.org
Mon Apr 11 13:50:10 EDT 2016


Sigh... just looked through ka630_* modules.

Anyway, the byte access/word addressing is in the spec. So the code is 
allowing writes to bytes that don't exist. Further, it is trying to deal 
with lengths other than byte or word, and the access and control paths 
don't exist in the hardware.

VMS uses strictly byte reads and writes to access the watch registers. I 
don't know what the console ROM might be doing; sources are not available.

/Bob

/* NVR: non-volatile RAM - stored in a buffered file */

int32 nvr_rd (int32 pa)
{
int32 rg = (pa - NVRBASE) & ~01;      /* force even; ignore odd bytes */
int32 result;

if (rg < 14)                                             /* watch chip */
     result = wtc_rd (pa);
else
    result = nvr[rg];

sim_debug (DBG_REG, &nvr_dev, "nvr_rd(pa=0x%X) returns: 0x%X\n", pa, 
result);

return result;
}

void nvr_wr (int32 pa, int32 val, int32 lnt)
{
int32 rg = (pa - NVRBASE) & ~01;

if (rg < 14)                                             /* watch chip */
     wtc_wr (pa, val, lnt);
else
     nvr[rg] = (uint8) val;

//  sim_debug (DBG_REG, &nvr_dev, "nvr_wr(pa=0x%X,val=0x%04X,lnt=%d) 
nvr[%02X] was %04X now %04X\n", pa, val, lnt, rg, orig_nvr, nvr[rg] | 
(nvr[rg+1] << 8));
     }
}

/* NVR examine */

t_stat nvr_ex (t_value *vptr, t_addr exta, UNIT *uptr, int32 sw)
{
uint32 addr = (uint32) exta;

if ((vptr == NULL) || (addr & 01))
     return SCPE_ARG;
if (addr >= NVRBASE+NVRASIZE)
     return SCPE_NXM;
*vptr = nvr[addr];
return SCPE_OK;
}

/* NVR deposit */

t_stat nvr_dep (t_value val, t_addr exta, UNIT *uptr, int32 sw)
{
uint32 addr = (uint32) exta;

if (addr & 01)
     return SCPE_ARG;
if (addr >= NVRBASE+NVRASIZE)
     return SCPE_NXM;
nvr[addr] = (uint8) val;
return SCPE_OK;
}

Note also that the specification of NVR as "4, 16, 32" should be "2, 16, 
16". It's a byte-wide memory, but because odd addresses don't work, it 
has to be specified this way for save/restore.

/Bob

On 4/11/2016 12:00 PM, simh-request at trailing-edge.com wrote:
>
> ------------------------------
>
> Message: 2
> Date: Mon, 11 Apr 2016 08:51:08 -0700
> From: Mark Pizzolato<Mark at infocomm.com>
> To:"simh at trailing-edge.com"  <simh at trailing-edge.com>
> Subject: Re: [Simh] MicroVAX II time
> Message-ID:
> 	<03006E3FC39B5A48AB9DBCCC101090A82DD620F171 at REDROOF2.alohasunset.com>
> Content-Type: text/plain; charset="utf-8"

> Actually, the watch chip is implemented it is implemented as a separate module
> and DEVICE in VAX/vax_watch.c.
>
> The nvr initializes the valid bit in the watch check when the NVR is attached and
> clears it when NVR is detached.
>
> Well, I didn’t check the details about 16bit or byte access, but the watch chip
> works correctly for me if I use Wilm's config and point it at my generic test disk.
> I get prompted for time IF I don't attach the NVR and don't if I do.
>



More information about the Simh mailing list