Differences
This shows you the differences between two versions of the page.
prs [2020/04/29 16:55] – created rajit | prs [2020/04/29 16:57] (current) – removed rajit | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ===== The prs sublanguage ===== | ||
- | |||
- | The '' | ||
- | |||
- | < | ||
- | a -> b- | ||
- | ~a -> b+ | ||
- | </ | ||
- | |||
- | The left-hand side of a production rule is a Boolean expression, and the right hand side specifies the action to be taken when the Boolean expression is true. A more complete example of an inverter in ACT would be: | ||
- | |||
- | < | ||
- | bool a, b; | ||
- | prs { | ||
- | a -> b- | ||
- | ~a -> b+ | ||
- | } | ||
- | </ | ||
- | |||
- | A two-input NAND gate with inputs '' | ||
- | |||
- | < | ||
- | prs { | ||
- | a & b -> c- | ||
- | ~a | ~b -> c+ | ||
- | } | ||
- | </ | ||
- | |||
- | A two-input inverting C-element would be: | ||
- | |||
- | < | ||
- | prs { | ||
- | a & b -> c- | ||
- | ~a & ~b -> c+ | ||
- | } | ||
- | </ | ||
- | |||
- | Note that the expressive power of production rules makes it equally easy to specify state-holding gates (like an inverting C-element) and combinational gates (like a NAND gate). | ||
- | |||
- | |||
- | ==== The three types of arrows ==== | ||
- | |||
- | The syntax above is sufficient to be able to specify the Boolean conditions for arbitrary pull-up and pull-down networks, and uses a " | ||
- | |||
- | The first common case is a combinational gate like an inverter or NAND. In a combinational gate, the Boolean expression for the pull-up is the complement of the Boolean expression for the pull-down. In this case we can simply specify one, and use the '' | ||
- | < | ||
- | prs { | ||
- | a & b => c- | ||
- | } | ||
- | </ | ||
- | |||
- | Note that this is the same as specifying | ||
- | < | ||
- | prs { | ||
- | ~a | ~b => c+ | ||
- | } | ||
- | </ | ||
- | |||
- | In both cases, ACT generates the second production rule from the first one by complementing the Boolean expression and changing the direction of the signal transition ('' | ||
- | |||
- | The second common case is that of C-elements. To specify the two-input C-element above, you can also write | ||
- | < | ||
- | prs { | ||
- | a & b #> c- | ||
- | } | ||
- | </ | ||
- | In this case, ACT generates the second production rule by complementing each variable in the Boolean expression. | ||
- | ==== Loops ==== | ||
- | |||
- | When defining parameterized circuits, it is helpful to also have the corresponding parametrized production rules that implement the circuit. There are two loop constructs available that use the same " | ||
- | |||
- | < | ||
- | bool x[5], y[5]; | ||
- | |||
- | prs { | ||
- | (i:5: x[i] => y[i]-) | ||
- | } | ||
- | </ | ||
- | |||
- | The example above creates five inverters when the circuit is expanded. '' | ||
- | |||
- | < | ||
- | bool x[5], y; | ||
- | |||
- | prs { | ||
- | (&i:5: x[i]) => y- | ||
- | } | ||
- | </ | ||
- | |||
- | The example above is a 5-input NAND gate. Here the replication construct is used with ''&'' | ||
- | |||
- | < | ||
- | ... | ||
- | prs { | ||
- | x[0] & x[1] & x[2] & x[3] & x[4] => y- | ||
- | } | ||
- | </ | ||
- | |||
- | Similarly, '' | ||
- | |||
- | < | ||
- | prs { | ||
- | en & (|i:5: x[i]) -> y- | ||
- | ~en -> y+ | ||
- | } | ||
- | </ | ||
- | |||
- | ==== CMOS implementation ==== | ||
- | |||
- | The ACT tools provide automated support for converting production rules into a transistor-level implementation. This is done in a way that is entirely under user control, so the way the production rules are written is strictly followed when creating the transistors that implement the production rules. | ||
- | |||
- | === Implementable rules === | ||
- | |||
- | In what follows, we assume that the production rule expression is written in negation-normal form((Negation-normal form for a Boolean expression corresponds to a Boolean expression where the negation symbol can only appear on a variable. In other words, an expression like '' | ||
- | |||
- | For a production rule to be // | ||
- | < | ||
- | a & b -> c+ | ||
- | a & b -> d- | ||
- | ~a | ~b -> e+ | ||
- | </ | ||
- | |||
- | === Transistor sizing and flavors === | ||
- | |||
- | The width, length, flavor, and folding of a transistor can be specified as part of the syntax of production rules. The following examples illustrate the syntax. | ||
- | < | ||
- | a <10> & b <10> -> c- | ||
- | </ | ||
- | In this example, the widths of the transistor for '' | ||
- | |||
- | < | ||
- | a < | ||
- | </ | ||
- | In this example, the transistor specified is one with a width of 20 units and length of 4 units. The default values of width and length for p-type and n-type devices are specified in the [[config: | ||
- | |||
- | < | ||
- | a < | ||
- | </ | ||
- | Transistors come in different //flavors// in a modern technology. The flavors supported by ACT are specified in the top-level ACT [[config: | ||
- | |||
- | Finally, it is often the case that multiple transistors in an expression use the same sizing information. | ||
- | < | ||
- | a <10> & b -> c- | ||
- | </ | ||
- | In this example, the sizing for '' | ||
- | |||
- | === Gate ordering === | ||
- | |||
- | A rule of the form | ||
- | < | ||
- | a & b -> c- | ||
- | </ | ||
- | it could be implemented with a series transistor chain. However, if the gates of the two series transistors are exchanged, the Boolean expression is still logically the same value although the circuit characteristics (e.g. delay) might be different. | ||
- | |||
- | ACT imposes a strict interpretation on gate ordering, since a circuit designer might have carefully chosen the gate ordering for their circuit. The interpretation is that, since the output is on the right hand side of the production rule, the gate closest to the output corresponds to the rightmost variable. So, in the example above, the gate order would be that '' | ||
- | |||
- | === Multi-finger transistors === | ||
- | |||
- | A multi-fingered transistor can be manually specified if necessary. The example | ||
- | < | ||
- | (a <10> | a< | ||
- | </ | ||
- | would have the effect of using two multi-fingered transistors, | ||
- | < | ||
- | a< | ||
- | </ | ||
- | or, using the implicit sizing rules, as | ||
- | < | ||
- | | ||
- | </ | ||
- | |||
- | |||
- | |||