new width inference algorithm

2
http://chess.eecs.berkeley.edu/ February 12, 2009 Center for Hybrid and Embedded Software Systems New Width Inference Algorithm Bert Rodiers Ben Lickly Restricted existing algorithm Only one relation to be inferred at each port Properties of new algorithm Widths are propagated Each relation is only visited once Not all widths can be inferred More expensive algorithm Initialization step: O(total number of relations) Performance Rationale In Ptolemy II relations can have multiple channels, each one representing a sequence of tokens. The number of channels is specified by the width of a relation. Having to explicitly specify the width for each relation can be a tedious job. To make it even worse, the addition of one relation to a multiport might result in a model builder needing to go through the model again to adapt widths. To cope with this you can let the relations infer the width from other relations or other ports with a graph algorithm. Has 2 relations to be inferred connected to it. Old algorithm would fail. Constraints mechanism on ports Width of relation connected to output, has to be equal to True and False input. output.setWidthEquals(trueInp ut); output.setWidthEquals(falseIn put);

Upload: malinda-drakos

Post on 31-Dec-2015

20 views

Category:

Documents


0 download

DESCRIPTION

New Width Inference Algorithm. Bert Rodiers Ben Lickly. Has 2 relations to be inferred connected to it. Old algorithm would fail. Rationale - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: New Width Inference Algorithm

http://chess.eecs.berkeley.edu/

February 12, 2009 Center for Hybrid and Embedded Software Systems

New Width Inference AlgorithmBert Rodiers

Ben Lickly

Restricted existing algorithmOnly one relation to be inferred at each port

Properties of new algorithm•Widths are propagated•Each relation is only visited once

•Not all widths can be inferred•More expensive algorithm•Initialization step: O(total number of relations)

Performance

RationaleIn Ptolemy II relations can have multiple channels, each one representing a sequence of tokens. The number of channels is specified by the width of a relation. Having to explicitly specify the width for each relation can be a tedious job. To make it even worse, the addition of one relation to a multiport might result in a model builder needing to go through the model again to adapt widths. To cope with this you can let the relations infer the width from other relations or other ports with a graph algorithm.

Has 2 relations to be inferred connected to it. Old algorithm would fail.

Constraints mechanism on portsWidth of relation connected to output, has to be equal to True and False input.

output.setWidthEquals(trueInput);output.setWidthEquals(falseInput);

Page 2: New Width Inference Algorithm

http://chess.eecs.berkeley.edu/

Models that fail

A graph algorithm is often a trade-off between completeness of the algorithm and the complexity of the algorithm. There was already an existing fast implementation that had many limitations and hence we tried to come up with a solution that can infer the width for most scenarios without imposing a large performance cost. The algorithm propagates the widths it knows and at multiports tries to infer the widths of other relations from these propagated widths. However there are some cases that don't work.