Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: KA630: how does console I/O actually work?



On 2023-12-26 04:36, Mouse wrote:
Are you sure it is supposed to be edge triggered?

No.  I did not record why I did that; to tbe best of my current memory,
I implemented simple level-triggered interrupts, with DONE&IE as the
interrupt condition, and it didn't work right.  (Note that, unless I've
totally misread the code, simh does the equivalent of edge-triggered as
well.)

I just checked simh, and it appears to clear the interrupt pending as soon as the data register is read, which to me definitely means it's not edge triggered, but level triggered.

Basically, the code looks like this:

int32 rxdb_rd (void)
{
int32 t = tti_unit.buf;                                 /* char + error */

if (tti_csr & CSR_DONE) { /* Input pending ? */
    tti_csr = tti_csr & ~CSR_DONE;                      /* clr done */
    tti_unit.buf = tti_unit.buf & 0377;                 /* clr errors */
    CLR_INT (TTI);
sim_activate_after_abs (&tti_unit, tti_unit.wait); /* check soon for more \
input */
    }
return t;
}



Note the CLR_INT (TTI); in there. Which will happen independent of if the CPU have picked up the interrupt or not. The code basically follows the documentation, which says that the DONE flags is cleared when you read out the data. And the interrupt request is a combination of DONE and IE. So at that point, the conditions for an interrupt goes away.

Tried to find some docs, but the KA630 manual I found don't
explicitly say one thing or the other.  Could you point to where
assumptions about edge interrupts exist in the code, or are defined
in some doc?

No, because I don't have any such.  I would have been delighted to have
found anything that precise about the SLU interrupt hardware.  I've had
to experiment and see what works.  That's why I'm asking after someone
who knows enough to give a precise enough description to write an
emulator to.

The manual that I read was a bit fuzzy, but my reading would have suggested it's level triggered as well. But I don't think the wording was definite enough to say beyond doubt. But the fact that simh also seems to think it's level triggered makes me feel more confident. After all, I would assume Bob knows these details pretty well. :-)

  Johnny

--
Johnny Billquist                  || "I'm on a bus
                                  ||  on a psychedelic trip
email: bqt%softjar.se@localhost             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol


Home | Main Index | Thread Index | Old Index