AMulet 2.0
AIG Multiplier Verification Tool
gate.cpp File Reference

contains the class Gate and further functions to organize the gate structure, such as initializing the gate constraints More...

#include "gate.h"
Include dependency graph for gate.cpp:

Functions

Gategate (unsigned lit)
 
void allocate_gates (bool assert)
 
void mark_aig_outputs ()
 
Gatederive_ha_and_gate (const Gate *n)
 
void set_xor ()
 
bool upper_half_xor_output ()
 
Gatexor_left_child (const Gate *n)
 
Gatexor_right_child (const Gate *n)
 
void mark_xor_chain_in_last_slice ()
 
void set_parents_and_children (bool set_children)
 
Polynomialnegative_poly (const Var *v)
 
Polynomialpositive_poly (const Var *v)
 
void init_gate_constraints ()
 
void delete_gates ()
 

Variables

bool xor_chain = 0
 set to true when the last slice contains an xor_chain More...
 
bool booth = 0
 set to true when the multiplier contains a booth pattern More...
 
bool signed_mult = 0
 set to true when a signed or unsigned multiplier is verified More...
 
Gate ** gates
 Gate ** where all gates are stored. More...
 
unsigned num_gates
 Counts the number of gates. More...
 

Detailed Description

contains the class Gate and further functions to organize the gate structure, such as initializing the gate constraints

Part of AMulet2.0 : AIG Multiplier Verification Tool. Copyright (C) 2020 Daniela Kaufmann, Johannes Kepler University Linz

Function Documentation

void allocate_gates ( bool  assert = 1)

Allocate the Gate** gates and filling it

void delete_gates ( )

Deletes Gate** gates by calling destructur of Gate

Gate* derive_ha_and_gate ( const Gate n)

For the xor output n, derive the corresponding carry output of an half-adder

Parameters
nGate* that is an xor output
Returns
Gate* that is the AND output of an half-adder
Gate* gate ( unsigned  lit)

Returns the gate with aiger value 'lit'

Parameters
litunsigned integer
Returns
Gate*
void init_gate_constraints ( )

Initializes all gate constraints in the gates[]

void mark_aig_outputs ( )

Mark those gates that are outputs in the aig

void mark_xor_chain_in_last_slice ( )

Mark all gates in the xor_chain in the last slice

Polynomial* negative_poly ( const Var v)

Defines the polynomial '1-v'

Parameters
vVar*
Returns
: Polynomial*
Polynomial* positive_poly ( const Var v)

Defines the polynomial 'v'

Parameters
vVar*
Returns
Polynomial*
void set_parents_and_children ( bool  set_children)

For all gates set the parents and children

Parameters
set_childrenindicate whether children will be set (0 in -substitute)
void set_xor ( )

Identifies XOR gates in an AIG

bool upper_half_xor_output ( )

Identifies whether the output gates of slice N until NN-2 are XOR gates

Returns
True when output gates of bigger slices are all xor gates
Gate* xor_left_child ( const Gate n)

Returns the 'left' child of an XOR

Parameters
nGate that is root of XOR
Returns
Gate*
Gate* xor_right_child ( const Gate n)

Returns the 'right' child of an XOR

Parameters
nGate that is root of XOR
Returns
Gate*

Variable Documentation

bool booth = 0

set to true when the multiplier contains a booth pattern

Gate** gates

Gate ** where all gates are stored.

unsigned num_gates

Counts the number of gates.

bool signed_mult = 0

set to true when a signed or unsigned multiplier is verified

bool xor_chain = 0

set to true when the last slice contains an xor_chain