Gates

The gates command can be used to obtain an approximate gate count for the design. Since a linked design is essentially a synthesized design mapped to generic gates, X-Amin can perform count of all the logic elements in the design to provide a generic gate-count.

For example, given the following HDL code:

module comp1 (clk, rst, a, b, ld1, ld2, z);
   input clk, rst, a, b, ld1, ld2;
   output z;
   
   reg d;
   always @(posedge clk or posedge rst)
      if (!rst)
         d <= 0;
      else if (ld1)
         d <= a & b;
      else if (ld2)
         d <= a | b;
      else 
         d <= a ^ b;
   assign z = d;
       
endmodule

The gate count report obtained from the gates command is:

> gates
Gate count for space 'comp1'
 Total gates = 20
 FF elements : 1 = 10 gates
 Comb. elements: 10 = 10 gates
> gates -detail
Gate count for space 'comp1'
   Total gates = 20
   FF elements : 1 = 10 gates
   Comb. elements: 10 = 10 gates
   And Gates : 1 = 1 gates
   Imp Gates : 1 = 1 gates
   Limp Gates : 1 = 1 gates
   Nand Gates : 4 = 4 gates
   Nimp Gates : 0 = 0 gates
   Nlimp Gates: 0 = 0 gates
   Nor Gates : 0 = 0 gates
   Or Gates : 2 = 2 gates
   Xnor Gates : 1 = 1 gates
   Xor Gates : 0 = 0 gates

 

The generic gates used within X-Amin are based on Boolean connectives. The common gate types use the standard names (i.e. and, or, etc.) while the less common gate functions use the boolean connective name. The generic gate truth tables are detailed below:

Gate Types

And (conjunction) Gate

And Gate Truth Table
A B Z
0
0
0
0
1
0
1
0
0
1
1
1

 

Imp(lication) Gate

Imp Gate Truth Table
A B Z
0
0
1
0
1
1
1
0
0
1
1
1

 

L(eft)-imp(lication) Gate

Limp Gate Truth Table
A B Z
0
0
1
0
1
0
1
0
1
1
1
1

 

Nand (negated conjunction) Gate

Nand Gate Truth Table
A B Z
0
0
1
0
1
1
1
0
1
1
1
0

 

N(egated) imp(lication) Gate

Nimp Gate Truth Table
A B Z
0
0
0
0
1
0
1
0
1
1
1
0

 

N(egated) l(eft) imp(lication) Gate

Nlimp Gate Truth Table
A B Z
0
0
0
0
1
1
1
0
0
1
1
0

 

Nor (negated disjunction) Gate

Nor Gate Truth Table
A B Z
0
0
1
0
1
0
1
0
0
1
1
0

 

Nxor (biimplication) Gate

Nxor Gate Truth Table
A B Z
0
0
1
0
1
0
1
0
0
1
1
1

 

Or (disjunction) Gate

Or Gate Truth Table
A B Z
0
0
0
0
1
1
1
0
1
1
1
1

 

Xor (exclusive or) Gate

Xor Gate Truth Table
A B Z
0
0
0
0
1
1
1
0
1
1
1
0

 

gates Command

Gates analysis can only be run using the gates command entered in the GUI Command Entry box or on the command line in command-line mode. The gates command format is:

SYNTAX
 (void) gates
   [-detail]
   [-hier]
   [<namespace>...]
   
ARGUMENTS
 -detail
   Report detailed information on the gates used. The
   default is to print a summary report.
 -hier Use hierarchical signal names in the report. The
   default is to use simple signal names.
 <namespace>...
   Produce a gate report for the specified names­
   pace(s). If no namespaces are specified, produce a
   gate report for the current scope.
   

Gates Customization

The Gates Preferences page (Edit->Preferences or the Preferences icon in the Edit toolbar) provides controls for configuring the sizes of the generic gates.