Newsgroups: comp.sys.transputer
From: phil@tweety.mrad.com.au (Phil Nitschke)
Subject: Memory-Mapped Interfaces; PORTs vs PLACEd variables
Organization: MRad Pty Ltd, Australia
Date: 20 Jun 1994 07:52:11 GMT
Message-ID: <PHIL.94Jun20172212@tweety.mrad.com.au>


I am designing some Occam code for a real-time hardware system where
the embedded transputers control various aspects of the hardware using
a memory-mapped interface.

I am seeking people's opinions on the following two methods of
addressing the memory-mapped hardware:

        (a)     Using normal variables which are PLACE'd at the desired
                location and written-to/read-from by variable
                assignment;

                        VAL filter.address IS #20000008 :
                        INT16 filter.control :
                        PLACE filter.control AT filter.address :

                        SEQ
                          filter.control := #04C0(INT16)
                          -- etc

        (b)     Using PORTs which are PLACE'd at the desired location
                and addressed as primitive channels.

                        VAL filter.address IS #20000008 :
                        PORT of INT16 filter.control :
                        PLACE filter.control AT filter.address :

                        SEQ
                          filter.control ! #04C0(INT16)
                          -- etc

I want to know if there are any performance (or other) advantages that
could be obtained by using one method in preference to the other?

  (I note that, when using PORTs, the compiler should locate all
  instances of PARallel processes writing to the same address/PORT, but
  compilers might NOT be designed to detect parallel accesses of two
  variables that are PLACE'd at the same location.  Thus option (b)
  would appear more "safe").

If there are significant (email) replies, I will summarise.

Thanks,


--
Phil Nitschke
MRad Pty Ltd.

