Verimag

The BIP Language

The following pages introduce the BIP language with the help of small examples

Please refer to the full documentation for more details.

BIP Language & Syntax

The BIP language is used to define ’’types’’ (for components and connector) and describe component architectures (assembly of instances of types). The following sections introduce briefly how to define and instantiate BIP types.

Port Type

Ports are used for the coordination of the components. A port type can carry variables that are used for transferring data during an interaction with other components. Both interactions and data transfers are defined in connector types (see below). A port type is characterized by :

  • a type name ;
  • a list, possibly empty, of data variables parameters.

Port Type : Example

port type ePort // no associated variable(s)

port type IntPort(int x) // associated integer variable x

Atomic Component Type

Atomic components are the leaves of the components hierarchy. An atomic type is characterized by :

  • a type name ;
  • a list of data parameters used when instantiating the type ;
  • a set of data variables ;
  • a set of clocks
  • a set of internal and exported (for synchronization with other components) ports ;
  • a behavior.

The behavior is given as a Petri net, it is defined by :

  • a set of states
  • an initial transition
  • a set of transitions.

Transitions may be guarded by boolean conditions on data variables and timing constraints on clocks (i.e. interval constraint and urgency type), can execute clock actions (i.e. reset, freeze or resume of the subset of clocks) and data transformations defined by a block of code. Notice that the initial transition can only execute clock actions and a block of code.

Atomic Component Type : Example

atomic type HelloWorld(int n)
 data string msg = "Hello BIP world"
 data int x

        port ePort print()
 export port ePort idle()
 export port IntPort(x)

 place S1, S2
 initial to S1 do x=n;

 on print from S1 to S2 provided true do printf("%s %d", msg.c_str(), x);
 on idle  from S2 to S1 provided true do sleep(1);
end

Compound Component Type

A compound type defines a level of the hierarchy. It contains instances of others component types (i.e. sub-components), instances of connector types for linking components and priorities to schedule the interactions between these components.

A compound component offers the same interface as an atom, hence externally, there is no difference between a compound and an atom. Inner ports from sub-components can be exported.

Compound Component Type : Example

compound type Team
 component Producer P
 component Consumer C

 connector RDV Communicate (P.prod, C.cons)
 connector Singleton P_work(P.work)
 connector Singleton C_work(C.work)
end

Connector Type

Connectors define the synchronization protocol (’’rendez-vous’’, broadcast, …) between ports and the data transfers associated with them. A connector type is characterized by :

  • a type name
  • a list of port parameters
  • an exported port, if any (used to build hierarchical connectors)
  • a set of up/down actions for the data transfers

Connector Type : Examples

connector type Singleton(ePort p)
 define [p] // set of enabled interactions: {p}
end

connector type RendezVous(IntPort p1, IntPort p2)
 define [p1 p2] // set of enabled interactions: {p1 p2}
 on p1 p2 up {} down {p2.x = p1.x;}
end

connector type Broadcast(IntPort p1, IntPort p2, IntPort p3)
 define [p1' p2 p3]  // set of enabled interactions: {p1}, {p1 p2}, {p1 p3}, {p1 p2 p3}
 on p1       up {} down {}
 on p1 p2    up {} down {p2.x = p1.x;}
 on p1 p3    up {} down {p3.x = p1.x;}
 on p1 p2 p3 up {} down {p2.x = p1.x; p3.x = p1.x;}
end

Examples & Tutorials

Coming soon.


Contact | Plan du site | Site réalisé avec SPIP 2.1.26 + AHUNTSIC [CC License]

Visiteurs connectés : 28 ; visites : 472201