Professional Documents
Culture Documents
transputer
From: tbjorkho@james.abo.fi (Tom Bj|rkholm AT)
Subject: FAQ
Organization: Abo Akademi University, Finland
Date: Mon, 4 Oct 1993 22:40:03 GMT
Contents:
A. Introduction Level
A1. Flynn's taxonomy
A2. The Transputer
A3. Communication: Links and Channels
A4. Timesharing
A5. The words "process", "task" and "thread"
A6. Iserver, afserver, pserver
A7. Languages
A8. Porting
A9. Alternate
A10. Timers, sleeping and wakeup.
A11. Events (Interrupts)
A12. Resetting and booting
A13. Shared variables
A14. Free Software
A15. B004 and TRAM
A16. Suppliers and Prices
B. More Advanced Topics
B1. Communication performance
B2. Performance tuning with priorities
C. Further Reading
Q. Questions and Answers
Q1. Can you have more than one channel on a link?
-------------------------------------------------------------------------
Copyright C 1993 Tom Bjorkholm
This text might be freely copied and redistributed as long as this
copyright message is included.
A. Introduction Level
Single instruction, multiple data stream (SIMD) computers have been around
for a while. Famous computers like the AMT Distributed Array Processor,
the Connection Machine, and the Maspar MP-1 are all SIMD. SIMD computers
have a (possible large) number of processing elements that all
simultaneously execute the same instruction, but on different data sets.
Both SIMD and MIMD computers can be sub-divided into two groups:
Shared memory systems and distributed memory systems. In a shared
memory system there is one single shared RAM memory for all processing
elements. Every processor can access any memory location, so there is
no need for message passing. A serious problem with shared memory systems
is that only one processor at a time can use the memory bus. Thus the
memory bus becomes a bottle neck, and the system scales poorly to really
big systems.
In the distributed memory system every processing element has its own
memory. In this way the memory bus does not become a bottle neck. The
drawback with this is that processing elements (processors) cannot read
each others memory. Thus all information exchange between processing
elements has to be done by explicit message passing.
The key idea in the design of the transputer is that it should be programmed
with communicating sequential processes (see the reference to Hoare's book
below). There are two machine instructions on the transputers for communication
"in" and "out", that both take three arguments: the memory address to communicate
at, the address of the message buffer, and the message length. (Actually there
are a few more instructions available, but do not worry about those now.)
On every transputer there is four special memory addresses that will cause
the message to be sent on an external link, instead of waiting for a process
on the same processor. Likewise, there are four special memory addresses for
receiving messages from the external links. The links are bidirectional, so
each link holds two channels - one in each direction. The link channels are
used in exactly the same way as the intraprocessor channels: i.e. the same
machine instructions are used, and the communication is blocking.
The links are DMA driven, so the processor can work on other processes while
the communication completes.
The link protocol on the T2, T4 and T8-series of transputers is a byte stream
protocol. The hardware never communicates the size of the messages, that is
left to the programmer (or OS). In this way it is possible (but not recommended)
for the sender to send one message with 1 KB of data and for the receiver to
receive two messages of 0.5 KB each. This is sometimes used to simplify
multiplexers, but more often it is a programming error if it occurs.
The links are high speed serial links designed for short distance communication.
The specification for the simple twisted pair cable links is 30 cm, generally
universities are stretching the specs a bit and twisted pair cables of 2 - 4
meters are not uncommon. (Different systems such as RS-422 and optical links
exist for reliable communication over longer links.)
A4. Timesharing
The transputer has a wonderfully simple scheme for process scheduling implemented
in hardware. The hardware manages two lists of process pointers in memory.
One list keeps the pointers to all high priority processes, and one the pointers
to all low priority processes.
These lists keep only pointers to processes that are ready to run. Processes that
are blocked are managed elsewhere.
The first high priority process runs until it has completed, or blocked. After
that the next high priority process will run until it completes, and do on.
The low priority processes will run only if no high priority process can run.
Because of this behaviour you should never do computation in a high priority
process. (Inmos has somewhere stated that high priority should only be used
for processes that will complete within 1 microsecond.)
Low priority processes are given a time slice of one "tick" (64 microseconds).
(As long as there are no high priority processes:) The first process in the
low priority list will run for on "tick", after that it will be descheduled at
the first scheduling point in the program. At the descheduling the instruction
pointer (program counter) is stored on the stack and the stack pointer is
put at the end of the low priority process pointer list, i.e. round robin
scheduling is achieved.
The only thing that identifies the descheduled process is the pointer to the
stack with the program counter, and the stack variables. As the stack is always
word aligned, the least significant bit of the stack pointer can be used to
indicate priority ( 0 for high, and 1 for low).
High priority processes are sometimes called urgent processes and low priority
processes called normal, or not urgent.
This far the word "process" has been used for something that has its own program
counter, and own variables. This is also the normal use of the word. However,
one should be aware of the fact that the word "process" has a few other meanings,
too.
The designers of the occam programming language (the first one to be supplied
with the transputer) chose to name their procedures processes. In the abstract
reasoning about the program this makes sense: processes might follow after
each other, or work in parallel.
The word "task" usually refers to a traditional main program with its own
variables. The only way a task can communicate with the rest of the world is
though channels. In a parallel program there are usually many tasks.
In occam a thread is splitted into two or more threads by the PAR statement.
It is not clear weather the word "process" refers to a thread or to a task.
A hardware designer usually means a thread, and an OS designer usually
means a task, when he says "process".
It is also the iserver that resets and boots (see below) the transputer
system.
A7. Languages
Despite the previous paragraph there are some things that talk in favour
of some of the languages, in some circumstances.
Occam was the first language supplied with the transputer. It was
especially designed for CSP. Thus the parallel algorithms are very
clearly expressed in occam. Occam is also a very good language if you
want to do formal reasoning about your programs, as the language
deliberately lacks some features that make formal reasoning difficult
(like dynamic memory allocation). Whether or not you choose occam as
your programming language, you should learn it if you want to really
join the transputer community -- occam is considered general knowledge.
A8. Porting
A9. Alternate
The occam ALT statement is equivalent to the low level alternate construction
described above.
The transputer has two on chip timers. The high priority timer that is
incremented once every microsecond, and the low priority timer that is
incremented once every 64:th microsecond. The timer (of the same priority
as the current thread) can be inspected. There is also a special
machine instruction "tin" (timer input) that will block the current
thread until the timer is "after" a specified time. The tin instruction
is very similar to the "in" instruction, hence the similar naming.
The occam construct "clock ? AFTER t" does a "tin t", i.e. it waits
until the timer value is after t. Using these kind of constructs it
is very easy to sleep for a specified time. This, combined with the
timesharing and the channels, makes it easy to program real time
systems on the transputer.
The timer input (wait) is very similar to channel input. Just as you
might expect it is also possible to include a timer in the alternate
constructs. On PACT C or in occam the ALT construct remains syntactically
the same, one channel input is just replaced by a timer input. This
is how timeouts in communication is implemented.
(The process, that listens to the event channel, never receive any real
input - it is just unblocked. Thus it makes most sense to try to input a
byte.)
The transputer has one reset and one analyse pin. The transputer is
reset by pulsing the reset pin. If the analyse pin is held high
when the reset pin is pulsed, the transputer is analysed instead
of reset.
When booting from a link the transputer initially listens on all links
to determine where boot code is comming from. If the fist byte to be
received on a link is 0, then a word of address is input followed by a
word of data to put on that address. The transputer then returns to
its previous state.
If the value of the first byte is 1, then a word of address is also input,
but this address is read. And the data is output on the link. The
transputer then returns to its previous state.
If the first byte received is 2 or greater then that many bytes of code
will be input from the link and placed in memory starting at MEMSTART.
This code will then be executed.
As (almost) all useful transputer programs are longer than 256 bytes,
this initial code is a bootstrap code that loads the real program and
then transfers control to the real program.
There is some free software available for the transputer. See the
FTP sites lists for information about where to obtain the free software.
One of the early products from Inmos was the B004 board. This was a
PC add in card with one processor, some RAM, and a device driver.
The B004 has become a de facto standard. Most PC add in boards today
are B004 compatible, as this insures that software will work without
modifications. Inmos has launched a complete program of BXXX boards,
with different feature, for different architectures.
Several years after the B004, Inmos introduced the TRAMs. TRAM
is short for TRAnsputer Module. The idea is that a processor
and some memory is put on a small card, with a standard interface,
the TRAM. There are motherboards that take a number of TRAMs.
The user can now build his/her own "Lego" computer by choosing
TRAMs with suitable amounts of memory and plugging them into
the TRAM motherboard. There are also special TRAMs for ethernet
access, SCSI, HPIB etc.
A few suppliers are listed here together with the price of their products.
This is only included to give an indication about the price level of
transputer products - and thus enable non transputer users to see if they
can afford a transputer system or not. One should be aware of the fact
that unlisted vendors could have competitive prices.
Ingenieursbureau Bieware
P. O. Box 717
NL-2700 AS Zoetermeer
The Netherlands
Phone: +31 79 61 09 09
Fax: +31 79 61 55 55
Parallel Programming Education Kits, B004 compatible plug in card for PC's
with 2 T400/20 MHz with 1 MB of RAM each. Comes with a limited version of
occam 2 and a limited PACT C. Approx. price US$ 1000.- excl. VAT
Archipel S.A.
P.A.E. des Glaisins
1 rue du Bulloz
74940 Annecy le Vieux
France
Phone: +33 50 64 06 66
Fax: +33 506 40 734
Email: fest@archipel.fr
Transputer cards for Sun Sparc Stations.
If you need more addresses to Inmos offices worldwide - try the FTP
server unix.henca.ac.uk.
The communication time over a link can be modelled in the following way:
It should also be noted that the links are DMA driven (as stated in A3).
Thus the key to efficient communication is to send big packets and overlap
the communication with calculations.
Processor 1: Processor 2:
A A
C C C and B can happen concurrently but
idle B <---> B idle C happened to be scheduled before B
D D
C. Further Reading
General notice: The books described here are the books that I have access
to. I believe that there are newer versions available for some of the older
Inmos books.
@book{hoare,
Author = "C. A. R. Hoare",
Title = "Communicating Sequential Processes",
Publisher = "Prentice Hall",
Year = 1985}
@book{inmos:ref,
Author = "Inmos",
Title = "Transputer Reference Manual",
publisher = "Prentice Hall",
address = "Hempstead, UK",
year = 1988,
Note = "ISBN 0-13-929001-X"}
@book{inmos:t9000,
Author = "Inmos",
Title = "The T9000 Transputer - Products Overview Manual",
publisher = "Inmos",
address = "Bristol, UK",
year = 1991}
@book{may:networks,
Editor = "M. D. May and P. W. Thompson and P. H. Welch",
Title = "Networks, Routers \& Transputers: Function, Performance and
Application",
Publisher = "IOS Press",
Year = 1993}
@book{inmos:instr,
Author = "Inmos",
Title = "Transputer Instruction Set, A Compiler Writer's Guide",
publisher = "Prentice Hall",
address = "Hempstead, UK",
year = 1988,
Note = "ISBN 0-13-929100-8"}
@book{roberts,
Author = "John Roberts",
Title = "Transputer Assembly Language Programming",
Publisher = "Van Nostrand Reinhold",
Address = "New York, U. S. A.",
Year = 1992,
Note= "ISBN 0-442-00872-4" }
@misc{plumb,
Author = "Colin Plumb",
Title = "An Introduction to Transputer Assembly Language",
Howpublished = "Distributed as electronic mail by the author in 1988",
Year = "1987",
Note = "Copyright Cogent Research, Inc."}
@book{gerlach,
Author = "Uwe Gerlach",
Title = "Das Transputerbuch",
Publisher = "Markt \& Technik",
Address = "Haar bei Munchen, Germany",
Year = 1991,
Note = "ISBN 3-87791-019-X" }
A book about how to build your own transputer boards for a variety
of uses. The book comes with PC plug in transputer board (without
components). There are several prints for transputer boards and
interface cards in the book. The book also includes a chapter with
the most used transputer assembly commands. (In German).
@techreport{inmos:iserver,
Author = "Bob Green",
Title = "Iserver 1.42 Specification",
Institution = "Inmos Ltd",
Year = 1990,
Month = "June",
Number = "SW-0102-3",
Note = "DRAFT"}
@book{inmos:tasystems,
Author = "Inmos",
Title = "The Transputer Applications Notebook - Systems and Performance",
Publisher = "Inmos",
Address = "Bristol, U. K.",
Edition = "First",
Year = 1989}
@book{inmos:databook,
Author = "Inmos",
Title = "The Transputer Databook",
Publisher = "Inmos",
Address = "Bristol, U. K.",
Edition = "Second",
Year = 1989}
@book{trew:past,
Editor = "Arthur Trew and Greg Wilson",
Title = "Past, Present, Parallel",
Publisher = "Springer-{V}erlag",
Year = 1991 ,
Address = "Berlin, Germany"}
@techreport{barret:occam3,
Author = "Geoff Barret",
Title = "occam 3 reference manual",
Institution = "Inmos",
Year = 1992,
Note = "Draft - March 31"}
The link hardware can handle only one channel (in each direction).
If more than one channel is needed on a single link a multiplexer
task has to be inserted on both ends of the link.
The idea with the VCR is to allow virtual channels between any two
processes, independent of the hardware architecture.
---
--
Tom Bjorkholm
Process Design Laboratory Phone: +358 21 654 863
Department of Chemical Engineering Fax: +358 21 654 479
Abo Akademi University Internet: tbjorkho@ra.abo.fi
Biskopsgatan 8 or: tbjorkholm@finabo.abo.fi
SF-20500 Abo Bitnet: TBJORKHOLM@FINABO
FINLAND Nordunet: ABOVAX::TBJORKHOLM