🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

5 total messages Started by Steve Warwick Tue, 12 Dec 1989 01:16
MC56000 brain dead??
#2388
Author: Steve Warwick
Date: Tue, 12 Dec 1989 01:16
39 lines
2259 bytes
I have been looking into using the Motorola DSP56000 for use as more than
just a DSP engine - taking on additional system control and i/o functions.
I have come across an apparently insurmountable problem in the stack handling
of this chip, and am wondering if others have found an efficint workaround.

The internal hardware stack is used for subroutine calls, interrupts and
maintaining information on nested Do structures, but for all its uses, it
is only 15 levels deep. In systems which must handle a number of separate 
tasks and/or written in a modular style, along with much of the code written
in 'C' this stack limitation seems absurdly small. 

Motorola provided two methods of dealing with this, both seem poorly thought 
out.

1)  "overflow" and "underflow" indicators in the status register exist
which tell you that you are on the 0 or 15'th level. This is fine in cases 
where each subroutine call and interrupt will check the stack to see if there
is still room, and block move the stack accordingly, but if the program is
primarily 'C', no such automatic checking exists.

2)  overflow exception interrupt occurrs when the stack pointer goes from
0 to 15 or 15 to 0. Here, the offending instruction's PC is not saved, and 
no method of stack buffering can be implemented. 

has anyone actually run into such problems and have a method of dealing
with the stack limitation? In the ideal world, the stack interrupt would 
have occurred before we run out of room on the stack itself, allowing 
an exception routine to buffer the stack as needed. Else, allowed the user
to specify an area of internal XY ram as a stack base and forgot about the 
15 double words. 

I am concerned that the 96000 will also have this problem, which will be
a suprising limitation for a 32 bit processor!!

Thanks, 

Steve Warwick
sdw@hpsad
 
Re: MC56000 brain dead??
#2390
Author: Bart Massey
Date: Sat, 16 Dec 1989 23:08
41 lines
2370 bytes
I'm sure others have responded to or will respond to this as well, but just
thought I'd throw in my 0.5 inverse cents worth (fractions only :-).

In article <9520009@hpsad.HP.COM> sdw@hpsad.HP.COM (Steve Warwick) writes:
> I have been looking into using the Motorola DSP56000 for use as more than
> just a DSP engine - taking on additional system control and i/o functions.
> I have come across an apparently insurmountable problem in the stack handling
> of this chip, and am wondering if others have found an efficint workaround.
...
> has anyone actually run into such problems and have a method of dealing
> with the stack limitation? In the ideal world, the stack interrupt would 
> have occurred before we run out of room on the stack itself, allowing 
> an exception routine to buffer the stack as needed. Else, allowed the user
> to specify an area of internal XY ram as a stack base and forgot about the 
> 15 double words. 

As you have surmised, the internal stack is kind of useless for C code.  The
Motorola 56K compiler uses the same solution my assembly code does --
allocate R7 as the stack pointer, and forget the internal stack.  Actually,
interrupt handling will still happen on the internal stack, limiting one to
16 (8?) levels of nested interrupt -- big deal.  Also, in my assembly code,
I'm using the internal stack for jsr and for do nesting, since I can
guarantee that they will be 3-4 levels deep at most -- the C compiler really
hasn't this option...

> I am concerned that the 96000 will also have this problem, which will be
> a suprising limitation for a 32 bit processor!!

The rumor mill has it that this limitation will in fact also exist in the
96K.

					Bart Massey
					
					Tektronix, Inc.
					TV Systems Engineering
					M.S. 58-639
					P.O. Box 500
					Beaverton, OR 97077
					(503) 627-5320

					..tektronix!videovax.tv.tek.com!bart
Re: MC56000 brain dead??
#2393
Author: Brian WILLOUGHBY
Date: Fri, 22 Dec 1989 03:42
16 lines
1168 bytes

Remember that the 56000 is designed as a Digital Signal Processor.  I hardly
think that Motorola intended it as a general purpose 32 bit processor.  Thus
I would disagree that its hardware stack limitations are a "flaw".

For speed purposes, I think their internal stack is much faster than an
external stack.  As an internal stack, it is therefore more limited in size
than a normal external stack.  This speed improvement does more good for DSP
programming than any consideration for high level language support.

Brian Willoughby
UUCP:           ...!{tikal, sun, uunet, elwood}!microsoft!brianw
InterNet:       microsoft!brianw@uunet.UU.NET
  or:           microsoft!brianw@Sun.COM
Bitnet          brianw@microsoft.UUCP
Re: MC56000 brain dead??
#2394
Author: Chuck McManis
Date: Wed, 27 Dec 1989 20:41
52 lines
3139 bytes
Minor flame ahead ... Hmmm, is it just me or is this a bit absurd ?

In article <9520009@hpsad.HP.COM> sdw@hpsad.HP.COM (Steve Warwick) writes:
>I have been looking into using the Motorola DSP56000 for use as more than
>just a DSP engine - taking on additional system control and i/o functions.

Why? A DSP is a DSP, it isn't a general purpose CPU. Why do you want to 
make it into one? You can add any number of cheap micros on the board 
next to it if you want a CPU.

[Dealing with the small stack ...]

>1)  "overflow" and "underflow" indicators in the status register exist
>which tell you that you are on the 0 or 15'th level. This is fine in cases 
>where each subroutine call and interrupt will check the stack to see if there
>is still room, and block move the stack accordingly, but if the program is
>primarily 'C', no such automatic checking exists.

Well, if I were writing a C compiler for the 56000 and I knew of the stack
limitation (which I surely would), I would have the compiler generate all
of this stack checking code at the entrance to, and exit from each call. Or,
I wouldn't even use the "real" stack, and instead use a pointer off into some
random RAM and "pretend" it was a stack. The compiler writer can do all this
magic easily. 

>2)  overflow exception interrupt occurrs when the stack pointer goes from
>0 to 15 or 15 to 0. Here, the offending instruction's PC is not saved, and 
>no method of stack buffering can be implemented. 

So stay away from using the real stack except for interrupts or exception
processing.

>has anyone actually run into such problems and have a method of dealing
>with the stack limitation? In the ideal world, the stack interrupt would 
>have occurred before we run out of room on the stack itself, allowing 
>an exception routine to buffer the stack as needed. Else, allowed the user
>to specify an area of internal XY ram as a stack base and forgot about the 
>15 double words. 

Why not buy a different processing unit? It seems the 56000 is ill suited
to your needs. I don't know if you would consider yourself primarily a 
software person or a hardware person, but it seems that considering 
different hardware is in order here. Just a sanity check mind you, you
probably have compelling reasons why you want to use the DSP as a CPU
but normally when such fundamental problems occur they are a signal that
the peg is square and the hole is round.


--Chuck McManis
uucp: {anywhere}!sun!cmcmanis   BIX: cmcmanis  ARPAnet: cmcmanis@Eng.Sun.COM
These opinions are my own and no one elses, but you knew that didn't you.
"If it didn't have bones in it, it wouldn't be crunchy now would it?!"
Re: MC56000 brain dead??
#2403
Author: Steve Warwick
Date: Tue, 02 Jan 1990 22:44
18 lines
1164 bytes
As indicated by Pete Percosan from Motorola, the C compiler DOES
correctly deal with the hardware stack limitation by transferring
the return address to the software stack upon subroutine entry, and 
restoring it upon exit, effectivly bypassing the hardware stack.
This has also been verified by simulation. Overhead is two moves
per subroutine call.

 As he correctly asserts, since the processor has a limited number
 of external interrupts,
the 15 level stack is sufficient as long as the `do' construct is not
overused. Again, a software stack can be used to buffer nested do loops
written in assembler if necessary. I am not shure whether the Motorola
C compiler even uses the do loop construction..

Thanks for your replies, 

Steven Warwick
sdw@hpsad
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads