Frequently Asked Questions

From Lyra

Jump to: navigation, search

What is the main difference between Lyra and CSP?

The primary difference between Lyra and CSP is the use of conjunctive composition of rendezvous. Conjunction means the occurrence of several rendezvous simultaneously as required by a process. CSP is created for modeling software where conjunction does not apply naturally (or is too expensive to realize). But for hardware modeling, conjunction is fundamental. For example, an operation may require two types of resources to be performed, and both resources may require some arbitration. In CSP, since there is no conjunction, the resources will have to be acquired sequentially, which may cause a deadlock. A safe way is thus to create some coordinator process/logic explicitly to prevent such deadlock, or to define critical regions and use a lock to guard the regions. Either way, there is a gap between the model and the actual hardware to be manually filled. In Lyra, with conjunction, such coordination is done by the global scheduler. Programmer can focus on the behavior of the individual operation. The scheduler automatically fills in the gap.

What does conjunctive composition imply?

Conjunctive composition implies the use of schedulers. With conjunction, a process is not able to progress simply based on local knowledge. For example, if a process α requires the occurrence of rendezvous A to progress, and its counterparty β requires rendezvous A and rendezvous B (with process γ) to occur simultaneously, then α cannot determine if it is able to progress simply by its knowledge of A. All three processes must be coordinated to advance jointly.

Software-oriented models such as CSP and CCS does not include conjunction so they don't need to deal with scheduling. This is because software processes may not have their intention fully exposed (such as in the form of a state diagram), and the processes may be dynamically created. All these make efficient scheduling nearly impossible. In hardware, scheduling can be done efficiently.

Does Lyra model data flow networks?

In Lyra, the simplest way to model a dataflow network is direct mapping. Every DF computation node maps into a process, and every FIFO channel maps into a pair of single-state processes sharing a circular buffer (a reader and a writer. The two processes can be merged into a "product" process if one desires). The nodes interacts with the reader and writer processes for token consumption and production. The circular buffer needs to be pre-seeded with initial tokens, in the same way as how a DF model is initialized. The FIFO construct will be turned into a syntax sugar in the future, making it easier to create DF models.