Thread View: comp.sys.transputer
4 messages
4 total messages
Started by paszkows
Tue, 01 Nov 1988 08:29
Splitting up channel comms
Author: paszkows
Date: Tue, 01 Nov 1988 08:29
Date: Tue, 01 Nov 1988 08:29
46 lines
1655 bytes
1655 bytes
I have two 32 bit words, which for example are made up as follows:
lint 1 bits 00-07 byte1
bits 07-23 int1
bits 23-31 int2 lsb
lint 2 bits 00-07 int2 msb
bits 08-15 byte2
bits 16-31 int3
I wish to transmit the two 32 bit integers over a link, but receive them in
the format in which they are made up.
In effect I do
CHAN OF ANY chan.out, chan.in
SEQ
chan.out ! lint1
chan.out ! lint2
SEQ
chan.in ? byte1
chan.in ? int1
chan.in ? int2
chan.in ? byte2
chan.in ? int3
At present I have tried this over a channel ( not a link yet ) and it does not
work. As far as I am aware, when this is transmitted over a link, the two 32
bit words are chopped into eight bytes, with associated start, one, stop bits,
so the input link is not aware of the format they are transmitted in, so it
ought to be able to receive them as above.
At a guess, because we have a CHAN OF ANY protocol, is not an identity byte,
describing what format the next data is in, sent? ( ie: tt.out.int etc.. )
Can anyone verify that this will, or if not, can explain why not and why the
comms over the channel, as described above, does not work.
Thanks.
Re: Splitting up channel comms
Author: paszkows
Date: Wed, 02 Nov 1988 13:09
Date: Wed, 02 Nov 1988 13:09
54 lines
1842 bytes
1842 bytes
In article <675@prlhp1.prl.philips.co.uk> paszkows@prlhp1.UUCP () writes:
>
>
> chan.out ! lint1
> chan.out ! lint2
>
>
> SEQ
> chan.in ? byte1
> chan.in ? int1
> chan.in ? int2
> chan.in ? byte2
> chan.in ? int3
>
>
Having posed the problem, I have managed to solve it myself. Read on for the
solution.
Occam 2 reference manual states that with a PROTOCOL OF ANY, the data sent
is mapped into its constituent bytes, and output as an array.
Input on this channel inputs the array of bytes and converts ( by retyping
conversion ) the value to the type of the receiving variable.
I am not convinced that the last statement holds true ( opinions ? ) as I
had to do the retyping manually.
Anyway, on input channel, read the data into a BYTE array of length equal to
that of the sent data as shown below.
-- retype the bytes into required format.
BYTE byte1 RETYPES inword[5]
BYTE byte1 RETYPES inword[0] :
INT16 inta RETYPES [inword FROM 0 FOR 2 ]
INT16 intb RETYPES [inword FROM 3 FOR 2 ]
INT16 intc RETYPES [inword FROM 6 FOR 2 ]
INT32 int1, int2 : -- the data being sent.
CHAN OF ANY channel.a :
SEQ
PAR
SEQ
channel.a ! int1
channel.a ! int2
SEQ
channel.a ? [ inword FROM 0 FOR 4 ] -- receive 4 bytes making up int1
channel.a ? [ inword FROM 4 FOR 4 ] -- receive 4 bytes making up int2
Occam I versus Occam II
Author: Steve Stevenson
Date: Fri, 04 Nov 1988 13:06
Date: Fri, 04 Nov 1988 13:06
10 lines
825 bytes
825 bytes
I'm writing an article about our experiences with Occam I. I need a succinct list of the the exact differences in I and II. Can any one provide? Thanks in advance.-- Steve Stevenson fpst@hubcap.clemson.edu (aka D. E. Stevenson), fpst@prism.clemson.csnet Department of Computer Science, comp.parallel Clemson University, Clemson, SC 29634-1906 (803)656-5880.mabell
Re: Increasing Transputer Efficiency
Author: Phil Winder
Date: Sun, 06 Nov 1988 18:55
Date: Sun, 06 Nov 1988 18:55
49 lines
2384 bytes
2384 bytes
Referring to C.P. Winder, ``Parallel Processing with the DisPuter'', in
Developments using occam, Ed. Jon Kerridge, IOS (1988), a paper presented
at the 8th oUG meeting at Sheffield this March, <paszkows@prlhp1> notes that
instruction throughput may be increased by up to 40% by suppressing run-time
range checking. He asks:
> My question is how do you do this? ( For information the software is written
> using Inmos' TDS system ).
The essentials of the program used to obtain these figures are given below:
--1
a[i] := b[c[i]] -- contrived example. []INT a, b, c: INT i:
a[i] := b[c[i]]
--2
a[i] := b[i] + c[i] -- slightly less contrived example
a[i] := b[i] + c[i]
Using a T414B-20 on-chip memory with the TDS2-beta release software gave:
checking on: 69; 77
checking off: 45; 53
cycles. Smaller speed increases will follow from typical code. It is not
advisable to disable all the error-checking except for highly trusted
sections of code, but other efficiency measures I describe may be more
acceptable. For example, did you know that assignment of a constant to a local
variable in on-chip RAM can take 9 cycles? (2.2 MIPS for T414-20)
To answer the question, a simple compiler switch can disable run-time checking
on all versions of PC-based TDS that I've seen.
In response to <paszkows@prlhp1>'s follow-up article: beware RETYPEing ! The
compiler will allow you to RETYPE at will but it only works if the word
boundaries are aligned correctly. So,
[5]BYTE byte :
INT int RETYPES [byte FROM 1 FOR 4] :
looks OK but doesn't work.
-Phil.
-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~-~
Phil Winder cpw@uk.ac.oxford.prg
Programming Research Group
Oxford University Computer Laboratory
8-11 Keble Road
Oxford. OX1 3QD
United Kingdom.
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