home .. forth .. misc mail list archive ..

No Subject


Subject: Circular stacks on F21

Dear MISC readers,

Sorry, I just reposted a message I composed on 6-1 rather than this message.
Sorry, it was a typo.  :-(

It seems the message I posted on 6/1 was rather large (9K) so I am sorry
to send it out again.

This was the message I intended to post.  (about circular stacks on F21)

>Thanks Jeff and Penio, for the response.... never expected
>such an interesting response, re the floodfill.
>One point not answered though... when the chip powers-up
>or is reset, do the stack registers initialise at zero
>(they would in any "normal" microprocessor, but MuP21 is
>a very unique creation!).
>regards, Barry Kauler

It was irregularities in the reset circuit that was the problem with
P8 that recently delayed F21.   When the reset circuit didn't power up
in the expected state it caused problems.  It would greatly simplify
the design if power up logic states can be predicted.  So far it is
an unsolved problem.  I posted a question about it in comp.lsi, but
have not had any good answers.

I have been testing F21 in the OKAD simulator.  F21 has an array of
16 stack registers that are circular.  That is, if you push 0 0 then
you get 0 0 in T and N.  Then if you push 1 2, you get T=2 N=1 S2=0 S3=0,
now if you continue to push
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17

Now you have T=17 N=16    and the sixteen register data stack =
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 

So now 18 !A+ would store the follow in memory

17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0

At this point T=15 N=14  so 16 more !A+ will store

15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0  in memory again! and again

T=15 and N=14

This shows that 16 of the data stack and 16 of the return stack
registers are circular.

I don't know if P21 works this way or not.  The behaviour would be the
same for flood fill as it would if it just keeps filling N.  If the
stack is filled with a single pattern then flood fill would work
with either a real LIFO buffer or a circular stack.  I have not
actually run a test on the P21 chip, to see how the stacks were
actually constructed, nor do I have a copy of OKAD with the P21
chip layout to examine its operation with the OKAD simulator.

I will ask Chuck, or anyone with the time could write a simple test
for a real P21 chip to fill the stack with 0 1 2 3 4 5 and then
see what A!+ would get.  Of course the first six A!+ would give
5 4 3 2 1 0, then 0 0 0 0 0 from a hardware LIFO buffer, or
3 2 1 0 again if there is a circular stack of 4 locations in 
addition to T and N.

I don't think this is the way it was done on P21, but I have never
tested it.  And as I say Chuck's flood fill would work either way
if the stack if filled with the same pattern.

Anyway F21 does have a 16 deep circular stack register array for
both data and return stacks.  With T and N the data stack is 18
deep, but only 16 are circular.  With R the return stack is 17 
deep, but only 16 are circular.

Jeff Fox