SAKURA, A BRIEF DESCRIPTION Nori Suzuki and Rod Burstall July 81 Filed on: SakuraDescription.txt Last edit: July 14, 1981 11:51 AM This is a short description of Sakura to enable other people to experiment with the language and provide us with feedback. Sakura is a language for specifying the behaviour of hardware devices. It is based on Mesa, but has facilities for concurrency which we hope will be easier to use for hardware description than the Mesa facilities. Our intention is to implement Sakura as a Mesa front end, i.e. to write a tranlator into Mesa. Mesa will be available as a sublanguage (perhaps with some restrictions, yet to be defined), and the translator will simply pass out most of the Mesa text untouched. The concurrency is handled by a scheduler which makes random choices about what to run next but in a reasonably fair way so that the apparent time taken by each operation is not widely variable; thus delaying one process allows the others to "settle down". We can define devices which have some code, internal state and input and output to communicate with other devices. To make a network of devices we define some connectors and say how they connect the devices together. We can also give a circuit of a device as a network of other devices. We may attach a guardian to a device which intercepts its input signals and checks that they conform to some conditions. Because the language is an extension of mesa we will use the Mesa syntax class names from the Mesa Manual and indicate new syntax classes peculiar to Sakura by underlining them. We will us S, . . . , S to mean a (possibly empty) sequence of S's separated by commas (similarly for other separators). Device declarations A device is defined with a heading similar to a Mesa procedure declaration, an Input list, an Output list, a Guardian and a body with three parts State, Dataflow and Control. The Guardian gives conditions for acceptable input, the State gives the local variables which are affected by concurrent processes, the Dataflow serves to instantly update values of dependent variables and the Control corresponds to the usual idea of procedure body, giving the "code" for the device. These will be described in more detail below. The device body can include a circuit consisting of a whole network of devices (see the section on circuits below). DeviceDeclaration ::= Identifier: DEVICE[ParameterList] = { IN Idlist: TypeSpecification, . . . ,Idlist: TypeSpecification OUT Idlist: TypeSpecification, . . . ,Idlist: TypeSpecification GUARDIAN Block DeviceBody} DeviceBody ::= STATE DeclarationSeries DATAFLOW Transfer; . . . ; Transfer CONTROL Block Example:(1792)\b28B985i7I105i7I27i10I68v7V61i8I401b20B559v7V83u17U263u8U10u8U18f6 -- FIRST IN FIRST OUT BUFFER DEFINITION Fifo: DEVICE [Init, WriteRequest, ReadRequest: BOOLEAN, DataIn:CARDINAL] RETURNS [SpaceAv, DataAv: BOOLEAN, DataOut: CARDINAL] = { GUARDIAN {Initialized: BOOLEAN := FALSE; DO PAR { WHEN Init UP _ IF ReadRequest OR WriteRequest THEN ERROR; Initialized := TRUE || WHEN ReadRequest UP _ IF NOT Initialized OR Init OR NOT DataAv THEN ERROR || WHEN WriteRequest UP _ IF NOT Initialized OR Init OR NOT SpaceAv THEN ERROR } ENDLOOP } STATE A: ARRAY[1..37] of CARDINAL; rp, wp: BOOLEAN DATAFLOW DataAv <= NOT ReadRequest AND rp