Newsgroups: comp.sys.transputer
From: md@pact.srf.ac.uk (Mark Debbage)
Subject: Re: Southampton Portable (by anyone?) Occam Compiler
Organization: University of Bristol, England
Date: Thu, 24 Mar 1994 09:40:57 GMT
Message-ID: <Cn5xKA.LI1@info.bris.ac.uk>

Oyvind Teig (teig@autro1.UUCP) wrote:

: SPOC - Southampton *Portable* Occam Compiler

: Does it generate ANSI-C source code that could be recompiled and run on

: (Transputer)
: Motorola 68HC11
: Texas 320 DSP
: Intel 188
: Intel 386
: Intel 8051

Yes (with one or two provisos), one of the main objectives of the SPOC 
compiler team was to generate portable ANSI C that would run on any
reasonably competent platform. There are a number of constraints; off 
the top of my head, we assume:

  32-bit flat address space
  2's complement arithmetic
  gcc 64-bit long long support (if you want INT64's)

We also potentially break a number of ANSI C's strict translation 
limits (such as 32 parameters to a function), but this is rarely
a problem.

SPOC currently assumes that the host environment (the one on which
occam-to-C translation is done) is unix. We have tested SunOS 4,
Solaris and Linux. The target system can be anything with an ANSI C 
compiler. Note that the host and the target do not have to be of the 
same endianness. We have tested transputer, Sparc and 486 targets.
We also support source-level debugging through gdb.

Towards the end it was necessary to depend on some operating system 
features to support occam's real-time model. Timer waits, for example, 
were implemented using a unix timer. Additionally, full iserver 
functionality requires unix processes to ensure that system calls 
do not block the simulated occam machine. There is also some 
multi-processor support forthcoming, and this has a dependency on 
message-passing primitives. These O/S dependencies can be turned
off by compile-time switches resulting in reduced functionality
but portable code.

: How about difference in hardware architecture? Is nothing hand-coded
: in assembler?

Of course not! If you are interested in how we achieve this without
sacrificing speed, there is some technical documentation in the 
release and an OUG17 paper. This can all be found on:

  ftp:   unix.hensa.ac.uk
  dir:   /pub/parallel/software/compilers/occam/spoc
  files: spoc.1.1.tar.Z
         README.spoc
         spoc.oug17.ps.Z

My advice is to pick it up, read the documents and have a play.
It really works.

Although I was one of the original author's of SPOC, I'm no longer
at the University of Southampton. I will strive to answer SPOC
queries on the net, but formal bug reports should be send to
Denis Nicole, dan@ecs.soton.ac.uk

Happy occam'ing!

Mark.

Dr. Mark Debbage, md@pact.srf.ac.uk
Inmos, SRF-PACT, 10 Priory Road, Clifton, Bristol BS8 1TU

