Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
language:langs:prs [2020/04/29 12:56]
rajit created
language:langs:prs [2022/07/10 15:01] (current)
rajit [Direct transistor specifications]
Line 3: Line 3:
 The ''prs'' sublanguage is used to specify production rules. Production rules are the syntax used by ACT to specify pull-up and pull-down networks for a gate. For example, an inverter with input ''a'' and output ''b'' would be specified by the following production rule: The ''prs'' sublanguage is used to specify production rules. Production rules are the syntax used by ACT to specify pull-up and pull-down networks for a gate. For example, an inverter with input ''a'' and output ''b'' would be specified by the following production rule:
  
-<code>+<code act>
    a -> b-    a -> b-
   ~a -> b+   ~a -> b+
Line 10: Line 10:
 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: 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:
  
-<code>+<code act>
 bool a, b; bool a, b;
 prs { prs {
Line 20: Line 20:
 A two-input NAND gate with inputs ''a'' and ''b'' and output ''c'' would be: A two-input NAND gate with inputs ''a'' and ''b'' and output ''c'' would be:
  
-<code>+<code act>
 prs { prs {
   a & b -> c-   a & b -> c-
Line 29: Line 29:
 A two-input inverting C-element would be: A two-input inverting C-element would be:
  
-<code>+<code act>
 prs { prs {
   a & b -> c-   a & b -> c-
Line 44: Line 44:
  
 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 ''= >'' arrow to let ACT know that this is a combinational gate---i.e., the second production rule can be automatically generated from the given rule. The following is the same two-input NAND gate specified using a more compact syntax: 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 ''= >'' arrow to let ACT know that this is a combinational gate---i.e., the second production rule can be automatically generated from the given rule. The following is the same two-input NAND gate specified using a more compact syntax:
-<code>+<code act>
 prs { prs {
    a & b => c-    a & b => c-
Line 51: Line 51:
  
 Note that this is the same as specifying Note that this is the same as specifying
-<code>+<code act>
 prs { prs {
    ~a | ~b => c+    ~a | ~b => c+
Line 60: Line 60:
  
 The second common case is that of C-elements. To specify the two-input C-element above, you can also write The second common case is that of C-elements. To specify the two-input C-element above, you can also write
-<code>+<code act>
 prs { prs {
    a & b #> c-    a & b #> c-
Line 70: Line 70:
 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 "repetition" syntax within the body of the prs sublanguage. 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 "repetition" syntax within the body of the prs sublanguage.
  
-<code>+<code act>
 bool x[5], y[5]; bool x[5], y[5];
  
Line 80: Line 80:
 The example above creates five inverters when the circuit is expanded. ''i'' is the loop variable, and the body of the loop is simply replicated. The example above creates five inverters when the circuit is expanded. ''i'' is the loop variable, and the body of the loop is simply replicated.
  
-<code>+<code act>
 bool x[5], y; bool x[5], y;
  
Line 90: Line 90:
 The example above is a 5-input NAND gate. Here the replication construct is used with ''&'' as the separator, which is the same as: The example above is a 5-input NAND gate. Here the replication construct is used with ''&'' as the separator, which is the same as:
  
-<code>+<code act>
 ... ...
 prs { prs {
Line 99: Line 99:
 Similarly, ''|'' can also be used as a separator. Note that these can be combined with other expressions as needed, as in the following example: Similarly, ''|'' can also be used as a separator. Note that these can be combined with other expressions as needed, as in the following example:
  
-<code>+<code act>
 prs {  prs { 
   en & (|i:5: x[i]) -> y-   en & (|i:5: x[i]) -> y-
Line 108: Line 108:
 ==== CMOS implementation ==== ==== 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.+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. The tool that performs this conversion is ''prs2net''.
  
 === Implementable rules === === Implementable rules ===
Line 115: Line 115:
  
 For a production rule to be //CMOS-implementable//, we require that all variables in the pull-up network are inverted, and all variables in the pull-down network are un-inverted. So in the example  below, the first rule is not CMOS-implementable while the second and third rules are. For a production rule to be //CMOS-implementable//, we require that all variables in the pull-up network are inverted, and all variables in the pull-down network are un-inverted. So in the example  below, the first rule is not CMOS-implementable while the second and third rules are.
-<code>+<code act>
   a & b -> c+   a & b -> c+
   a & b -> d-   a & b -> d-
   ~a | ~b -> e+   ~a | ~b -> e+
 </code> </code>
 +This is because ''prs2net'' uses CMOS to implement the rules. In CMOS, pull-down networks are implemented with n-type transistors that turn on when the input is high (true). while pull-up networks are implemented with p-type transistors that turn on when the input is low (false).
  
 === Transistor sizing and flavors === === 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. 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.
-<code>+<code act>
   a <10> & b <10> -> c-   a <10> & b <10> -> c-
 </code> </code>
 In this example, the widths of the transistor for ''a'' and ''b'' are both 10 units. The value is dimensionless, and is converted into physical dimensions using the ''lambda'' parameter specified in the [[config:netlist|netlist configuration options]] file. In this example, the widths of the transistor for ''a'' and ''b'' are both 10 units. The value is dimensionless, and is converted into physical dimensions using the ''lambda'' parameter specified in the [[config:netlist|netlist configuration options]] file.
  
-<code>+<code act>
   a <20,4> & b <20,4> -> c-   a <20,4> & b <20,4> -> c-
 </code>   </code>  
 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:netlist|netlist configuration file]]. In the earlier example, the standard length for the transistors would be used (which is typically set to the minimum valid length for the technology in the case of digital circuits). 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:netlist|netlist configuration file]]. In the earlier example, the standard length for the transistors would be used (which is typically set to the minimum valid length for the technology in the case of digital circuits).
  
-<code>+<code act>
   a <10,lvt> & b<10,lvt> -> c-   a <10,lvt> & b<10,lvt> -> c-
 </code> </code>
-Transistors come in different //flavors// in a modern technology. The flavors supported by ACT are specified in the top-level ACT [[config:start|configuration]]. Here, the ''lvt'' flavor is being specified. The standard names that we use are ''svt'' (for standard Vt), ''lvt'', and ''hvt'' but these are configuration options.+Transistors come in different //flavors// in a modern technology. The flavors supported by ACT are specified in the top-level ACT [[config:start|configuration]]. Here, the ''lvt'' flavor is being specified. The standard names that we use are ''svt'' (for standard Vt), ''lvt'' (for low Vt), and ''hvt'' (for high Vt).
  
 Finally, it is often the case that multiple transistors in an expression use the same sizing information.  Finally, it is often the case that multiple transistors in an expression use the same sizing information. 
-<code>+<code act>
  a <10> & b -> c-  a <10> & b -> c-
 </code> </code>
Line 148: Line 149:
  
 A rule of the form A rule of the form
-<code>+<code act>
  a & b -> c-  a & b -> c-
 </code> </code>
Line 158: Line 159:
  
 A multi-fingered transistor can be manually specified if necessary. The example A multi-fingered transistor can be manually specified if necessary. The example
-<code>+<code act>
   (a <10> | a<10>) & (b<10> | b<10>) -> c-   (a <10> | a<10>) & (b<10> | b<10>) -> c-
 </code> </code>
 would have the effect of using two multi-fingered transistors, with an effective width of 20 units each. This can be also specified as follows: would have the effect of using two multi-fingered transistors, with an effective width of 20 units each. This can be also specified as follows:
-<code>+<code act>
   a<20;2> & b<20;2> -> c-   a<20;2> & b<20;2> -> c-
 </code> </code>
 or, using the implicit sizing rules, as or, using the implicit sizing rules, as
-<code>+<code act>
  a<20;2> & b -> c-  a<20;2> & b -> c-
 </code> </code>
  
 +Some additional details of how you can control the circuit being generated from the production rules is described in the [[tools:netgen|prs2net]] documentation.
  
 +=== Leakage adjustment ===
  
 +The leakage adjustment [[config:netlist|parameter]] can be used to increase the length of any minimum length device. This can be turned on in the ''sizing'' body, or by using 
 +<code act>
 +prs * {
 +  ...
 +}
 +</code>
 +The ''*'' before the opening brace says that the leakage adjustment parameter should be used. Note that leakage adjustment applies to the entire process/cell, even if the parameter is specified only in one of the ''prs'' blocks or ''sizing'' blocks.
  
 +==== Direct transistor specifications ====
 +
 +In case this syntax is not sufficient, the ''prs'' language also includes support for specifying individual transistors. Since these are typically used as pass gates or transmission gates in digital circuits, we use the following syntax:
 +<code act>
 +prs {
 +   passp <10,4> (gate, source, drain)   /* p-type device, with specified sizing */
 +   passn <20,8> (gate, source, drain)   /* n-type device with specified sizing */
 +}
 +</code>
 +
 +Note that automatic staticizer (keeper) generation is only triggered when a production rule is specified. If part of your circuit for an output signal is described using production rules and part of it is described using transistors, then staticizer generation will likely be triggered; you can turn this off using the ''[keeper=0]'' [[tools:netgen#Attributes|attribute]].
 +
 +==== Explicit capacitors ====
 +
 +The ''prs'' sublanguage can also be used for designing mixed-signal circuits. Explicit capacitors can be specified in the following manner:
 +<code act>
 +prs {
 +  cap (node1, node2); /* explicit capacitor of one unit size between the two nodes */
 +  cap<10> (node1, node2); /* capacitor of size 10 units */
 +  cap<10,5> (node1, node2) /* capacitor of size 10*5 units */
 +}
 +</code>
 +The unit  capacitor is specified in the netlist configuration file; if it is unspecified, the value of 1fF is used.