Problemadvanced
Interface synthesis
Also called interface transducer synthesis, protocol converter synthesis.
Generate the logic that lets two blocks with different communication protocols exchange data correctly, from timing diagrams or protocol automata.
Interface synthesis builds the glue logic between two hardware blocks that talk with different protocols, for example a sender that pushes each datum and waits for an acknowledge, and a receiver that requests each datum before it takes one. The input is a description of each protocol, as timing diagrams or as finite automata over signal events, and a requirement on the data that flows between them, such as in-order delivery with a buffer of bounded size. The output is a converter, a finite state machine with a small datapath, that sits between the blocks, never refuses an event either block may produce, and keeps the requirement in every run. Seen this way, the converter is a winning strategy in a safety game played against the two protocols.
In plain words
Two chips want to pass numbers to each other, but they follow different etiquette. One says "here is a number, tell me when you got it". The other says "I am ready, give me a number". Neither can change. We must build a small go-between that speaks both languages. It must accept whatever either side says at any moment, it may hold a few numbers in a small store, and it decides when to answer. It must never lose a number, never make one up, never overfill its store and never leave both sides stuck. Finding such a go-between is like finding a way to win a game against two players who may act at any time.
Definition
Protocols. A protocol is a deterministic finite automaton whose actions are split into outputs , which the block produces when it chooses, and inputs , which it waits for. Some actions carry a datum: the sender has an output that hands over one datum, and the receiver has an input that takes one.
Converter. A converter is a deterministic finite automaton over , with a buffer of at most data. Its inputs are the outputs of and , and its outputs are their inputs. The closed system is the product , built as in the product construction: an action takes place when every component whose alphabet contains it takes it together. Each datum taken from enters the buffer, and each datum given to leaves it in first-in first-out order.
Correctness. is correct when, in every reachable state of the closed system:
- Receptive. Every output that or can produce in its current state is accepted by . A block is never blocked by the converter.
- Buffer. The buffer holds between and data. So no datum is lost by overflow, and none is given to that was not taken from .
- No deadlock. Some action is enabled.
The timing is an interleaving: the protocols may produce any enabled output at any moment, and the converter chooses when to produce its own.
Problem. Given , and , decide whether a correct converter exists, and build one. The optimization form asks for the least , or for a converter with the fewest states.
Variants
- Timing diagrams. Borriello and Katz (1987) take the two sides as timing diagrams, sequences of signal events with bounds on the delays between them, and produce interface logic that meets both. Delays then matter, not only the order of events.
- Liveness. Ask also that every datum taken from reaches eventually. This is no longer a safety requirement, and the game becomes a Büchi or parity game.
- General specifications. Replace the buffer rule by an automaton that accepts the correct orders of events, and take its product with the arena. Passerone, de Alfaro, Henzinger and Sangiovanni-Vincentelli (2002) treat this form, where checking that two protocols can be converted and building the converter are one computation.
- Width and rate conversion. The sides use different data widths, such as 32 bits against 8 bits, or different rates, and the converter splits or packs words.
- Clock domains. The two blocks run on different clocks. The converter then needs synchronizers and an asynchronous buffer, and its correctness depends on clock domain crossing rules beyond the protocol automata.
- Generated interfaces in high-level synthesis. A C function argument becomes a port with a fixed protocol, such as a handshake, a stream or a memory bus, and the tool generates the adapter. Latency-insensitive design fixes one protocol for all blocks so that no converter is needed between them.
Examples
A push sender and a pull receiver. The sender has the states : in it outputs a datum and goes to , where it waits for the input and goes back to . The receiver has the states : in it outputs and goes to , where it waits for a datum and goes back to . The converter takes and , and produces and . A state of the closed system is with the number of buffered data.
- No buffer, . At the start, may output before has asked for anything. The converter must accept it, and it cannot pass it on, since is in . So the buffer would hold 1 datum, and no correct converter exists.
- One place, . Take into the buffer. Wait for , then give the datum as , and only then send . The reachable states are the six triples , , , , and . The last one arises when asks again before the converter has acknowledged. In each of them the buffer holds at most 1 and some action is enabled. While the buffer is full, waits in for and cannot send again.
- Acknowledging at once fails for every . If the converter sends as soon as it takes , then may send again and again while never outputs . After data the buffer overflows. So the choice of when to acknowledge decides correctness.
The least buffer for this pair is 1.
Known algorithms
- Safety games. Build the arena of the product of , and the buffer, mark the states that break a rule, and compute the set of states from which the protocols can force a bad state, an attractor, in time linear in the arena. A converter exists exactly when the initial state is outside it. See games on graphs.
- Fixed points over the protocol product. Passerone et al. (2002) compute the converter as a greatest fixed point over the product of the protocols, and the same computation decides whether the protocols can be converted at all.
- Timing diagram synthesis. Borriello and Katz (1987) derive the interface logic from the events and timing constraints of the two diagrams.
- Supervisory control. The same question, a controller that may only disable controllable events, is the subject of supervisory control theory for discrete event systems.
- Reactive synthesis. For specifications in temporal logic, see reactive synthesis.
Bounds
Arena size. With the buffer rule, the arena has at most states, and at most moves from each. With a specification automaton , multiply by . The attractor is linear in the arena, so for two protocols the problem takes time polynomial in their sizes and in .
Monotone in the buffer. A converter that is correct for is correct for , since a buffer that never holds more than data never holds more than . So the least is well defined when some works, and the example shows a pair where it is 1.
Many components. When several protocols are composed, the arena is the product of all of them, and its size is the product of their sizes, exponential in their number.
Reductions
To a safety game. Build the arena whose vertices are the triples with , plus one bad vertex. The protocols play the environment: from each vertex, they may take any enabled output, and the moves that raise above lead to the bad vertex. The converter plays the controller: it may take one of its outputs that is enabled in the protocols, where giving a datum needs , or wait. A vertex with no enabled action at all also leads to the bad vertex. A correct converter is a strategy for the controller that never reaches the bad vertex. Conversely, every such strategy gives a correct converter, since the moves of the environment are exactly the outputs that the converter must accept. Safety games have winning strategies that depend only on the current vertex, so the converter needs no more states than the arena.
Applications
- IP integration. Systems on chip combine blocks from many sources, and bus bridges and protocol adapters connect a handshake interface to a stream or a memory bus.
- High-level synthesis. Function arguments become hardware interfaces, and the tool inserts adapters between the generated datapath and the system bus.
- Verification. Checking that a given converter is correct is the same game with the controller fixed, a reachability check on the closed system.
References
- Roberto Passerone, Luca de Alfaro, Thomas A. Henzinger and Alberto L. Sangiovanni-Vincentelli, Convertibility verification and converter synthesis: two faces of the same coin, Proceedings of the IEEE/ACM International Conference on Computer-Aided Design, 132 to 139, 2002, whole paper (protocols as automata, the converter as a winning strategy of a game against the protocols, and its computation)
- Gaetano Borriello and Randy H. Katz, Synthesis and optimization of interface transducer logic, Proceedings of the IEEE International Conference on Computer-Aided Design, 1987, whole paper (interface logic synthesized from timing diagrams of the two sides; general locator)
- Erich Grädel, Wolfgang Thomas and Thomas Wilke (editors), Automata, Logics, and Infinite Games, Lecture Notes in Computer Science 2500, Springer (2002), Chapter 2, Infinite Games (safety games and attractors; general locator)
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag A1GTWT Edit this page History Report an error Markdown