Using Interfaces to Analyze Compositionality Haiyang Zheng and

  • Slides: 23
Download presentation
Using Interfaces to Analyze Compositionality Haiyang Zheng and Rachel Zhou EE 290 N Class

Using Interfaces to Analyze Compositionality Haiyang Zheng and Rachel Zhou EE 290 N Class Project Presentation Dec. 10, 2004

Outline • Introduction and motivation. • Study and development of several interfaces for discrete-event

Outline • Introduction and motivation. • Study and development of several interfaces for discrete-event models. • Applying the previously developed interfaces on dataflow and process network models. • Conclusion.

Introduction • What is a composition? – A product of mixing or combining various

Introduction • What is a composition? – A product of mixing or combining various elements or ingredients. (From Merriam-Webster Online. ) • What is a valid composition? – The interface of a composition should be indistinguishable from its elements. • An interface of an actor can be a set of ports and parameters. – The behavior of a composition should be the same as that of before being composed. • A behavior includes not only ports and parameters but also the signals going through the ports. • Can we reason about the behavioral validity of a composition by analyzing its interfaces only?

An Example without Composition A discrete-event model that has a unique behavior. A delta-causal

An Example without Composition A discrete-event model that has a unique behavior. A delta-causal process.

An Example with Composition What about the existence and uniqueness of the behavior of

An Example with Composition What about the existence and uniqueness of the behavior of the following model (modified from the previous example by introducing a hierarchy)? The causality property is missing. An interface only consisting of ports and parameters is insufficient to reason about the behavior of the composite actor.

A Refined Interface • This interface includes function dependencies of an actor. – A

A Refined Interface • This interface includes function dependencies of an actor. – A function dependency of an actor is a data dependency relation that an output port has on an input port of the same actor in the same firing. • This interface is a graph, where nodes are ports and directed edges represent data dependencies. Interfaces Function Dependency (No data dependency. ) Function Dependency (Output depends on input. )

A Refined Interface (Continued) • Interfaces (graphs) of component actors can be composed with

A Refined Interface (Continued) • Interfaces (graphs) of component actors can be composed with communication dependencies to construct another graph. • The interface of a composite actor is an abstraction of the resulted graph. Communication Dependency Abstraction

Revisiting Example What about the existence and uniqueness of the behavior of the following

Revisiting Example What about the existence and uniqueness of the behavior of the following model (modified from the previous example by introducing a hierarchy)? A strictly causal process. The new interface containing function dependency is still insufficient to reason about the behavior of the composite actor.

A Weighted Interface • This interface contains weighted function dependencies. • Each input-output pair

A Weighted Interface • This interface contains weighted function dependencies. • Each input-output pair has a directed edge going from input to output. • Each edge has a weight, where the weight represents the amount of delay between input and output. 1. 0 A directed edge with weight 1. 0. 0 A directed edge with weight 0. 0. infinity A directed edge with weight infinity. x A directed edge with weight x.

A Weighted Interface (Cont. ) • This interface distinguishes delta causality from strict causality.

A Weighted Interface (Cont. ) • This interface distinguishes delta causality from strict causality. • If an edge has a weight depending on states, this interface may not help much. 0. 0 1. 0 0. 0 Sum 1. 0 Abstraction Replace Timed. Delay with 0. 0 x 0. 0 Sum Abstraction x

Revisiting Example What about the existence and uniqueness of the behavior of the following

Revisiting Example What about the existence and uniqueness of the behavior of the following model (modified from the previous example by introducing a hierarchy)? A delta causal process. The new interface containing weighted function dependency is sufficient to reason about the behavior of the composite actor.

A More Complex DE Model • We can conclude from the analysis of interfaces

A More Complex DE Model • We can conclude from the analysis of interfaces that the following model has a unique behavior and it is a valid composition according to the DE semantics. – A DE simulator may complain about a direct feedback loop. – However, if a DE simulator can simulate the model, it does give the same behavior as that of a flattened model. Before composition Firing order of Actors p 5 0. 0 p 1 0. 0 p 3 0. 0 p 2 0. 0 p 4 0. 0 p 6 Index for Firings of Composite (t, 1) (t, 2) p 1 p 2 p 3 p 4 a a b b After composition (t, 1, 1) (t, 1, 2) (t, 2, 1) (t, 2, 2) p 1 p 2 p 3 p 4 a a b b

Where are we… • Introduction and motivation. • Study and improvement of several interfaces

Where are we… • Introduction and motivation. • Study and improvement of several interfaces for discrete-event models. • Applying the previously developed interfaces on dataflow and process network models. • Conclusion.

Composition Example 1 in Dataflow SDF A 2 D B C E F A

Composition Example 1 in Dataflow SDF A 2 D B C E F A consistent SDF graph. SDF A D 2 B C E F Composition in SDF adds constraints on the number of firings of actor B and E in the firing vector. This makes the whole model inconsistent. This is an invalid composition.

Decomposition using Function Dependency SDF A 2 D B C E F SDF One

Decomposition using Function Dependency SDF A 2 D B C E F SDF One solution is to perform function dependency analysis and decomposition. SDF A 2 B C E F SDF D Schedules for actor B and E are actually independent, but composition adds constraint on them. Only necessary decomposition is performed so maximum compositionality is preserved.

Composition Example 2 in Dataflow A consistent SDF graph. Schedulability is lost if hierarchy

Composition Example 2 in Dataflow A consistent SDF graph. Schedulability is lost if hierarchy is introduced. The graph becomes deadlock.

Weighted Interface for Dataflow • Nodes represent ports and directed edges represent data and

Weighted Interface for Dataflow • Nodes represent ports and directed edges represent data and communication dependencies. • Each node has a weight, which represents the number of initial tokens available at this node (port). • A directed edge represents dependency between the weight of its sink node on that of its source node. k k+1 k k k 0 k

Dataflow Example 2 Revisited k k k+1 k+1 k k+1 Abstraction The interface exposes

Dataflow Example 2 Revisited k k k+1 k+1 k k+1 Abstraction The interface exposes the necessary information to analyze deadlock correctly.

Dataflow Example 3 {0} k {0} 2 2 3 A B 3 A symbolic

Dataflow Example 3 {0} k {0} 2 2 3 A B 3 A symbolic representation of the interface. When k = 1, Therefore, actor B has enough tokens to fire and the deadlock is resolved.

Dataflow Example 1 Revisited SDF A D 2 m n B E m n

Dataflow Example 1 Revisited SDF A D 2 m n B E m n C F Similarly, we can use symbolic representation (weighted interfaces) for the rate signature of the composite actor. The variable m and n give 2 degrees of freedom on the composite actor schedule. m and n can be determined by the outside constraint (balance equations) and the minimum solution requirement.

Artificial Local Deadlock in Process Network PN A B C D E F Artificial

Artificial Local Deadlock in Process Network PN A B C D E F Artificial local deadlock is not handled by Parks’ algorithm. PN PN A B C PN D E F One solution is to introduce a new hierarchy for each disconnected graph. Each inside PN director is responsible to detect its own deadlock.

Conclusion • We developed several interfaces to analyze compositionality of models with different models

Conclusion • We developed several interfaces to analyze compositionality of models with different models of computation. • Future work will be to develop more useful interfaces.

The End. Thanks!

The End. Thanks!