1 | #ifndef UTILITIES_H_ |
---|
2 | #define UTILITIES_H_ |
---|
3 | #include "ntk.h" |
---|
4 | #include "ord.h" |
---|
5 | #include "part.h" |
---|
6 | #include "maig.h" |
---|
7 | #include "ntmaig.h" |
---|
8 | #include "fsm.h" |
---|
9 | #include "ctlp.h" |
---|
10 | #include "ctlsp.h" |
---|
11 | #include "mcInt.h" |
---|
12 | #include "grabInt.h" |
---|
13 | #include "bmc.h" |
---|
14 | #include "bmcInt.h" |
---|
15 | #include "satInt.h" |
---|
16 | #include <stdio.h> |
---|
17 | #include <stdlib.h> |
---|
18 | |
---|
19 | |
---|
20 | static int |
---|
21 | nodenameCompare( |
---|
22 | const void * node1, |
---|
23 | const void * node2) |
---|
24 | { |
---|
25 | Ntk_Node_t *v1, *v2; |
---|
26 | char *name1, *name2; |
---|
27 | |
---|
28 | v1 = *(Ntk_Node_t **)(node1); |
---|
29 | v2 = *(Ntk_Node_t **)(node2); |
---|
30 | name1 = Ntk_NodeReadName(v1); |
---|
31 | name2 = Ntk_NodeReadName(v2); |
---|
32 | |
---|
33 | return (strcmp(name1, name2)); |
---|
34 | } |
---|
35 | |
---|
36 | // Read blifmv file |
---|
37 | Hrc_Manager_t * rlmv(FILE * file); |
---|
38 | //flatten_hier |
---|
39 | // @ return the network |
---|
40 | Ntk_Network_t * flatten_hier(Hrc_Manager_t * hmgr); |
---|
41 | // Build_partition_maigs |
---|
42 | // @ return table node_ntk to aigTable |
---|
43 | st_table * build_partition_maigs(Ntk_Network_t * ntk); |
---|
44 | void printNodeToMvFaigTable(st_table* nodeToMvfAigTable); |
---|
45 | // print name of table containing Ntk_Node_t |
---|
46 | void printLatch(st_table* CoiTable); |
---|
47 | // generate all node of a network |
---|
48 | // @return a table with all node of a given network |
---|
49 | st_table * generateAllLatches(Ntk_Network_t * ntk); |
---|
50 | // Create unroll circuit k steps |
---|
51 | // Build SAT instance |
---|
52 | // Create clauses database |
---|
53 | // BmcOption_t *options = BmcOptionAlloc(); |
---|
54 | // BmcCnfClauses_t *cnfClauses = NIL(BmcCnfClauses_t); |
---|
55 | // cnfClauses = BmcCnfClausesAlloc(); |
---|
56 | void build_unroll_circuit(Ntk_Network_t * ntk, int bound,BmcOption_t * options,BmcCnfClauses_t* cnfClauses); |
---|
57 | void printSATAssig( array_t* result); |
---|
58 | void printCNFIndex(BmcCnfClauses_t* cnfClauses); |
---|
59 | void printCNFClauses(BmcCnfClauses_t* cnfClauses); |
---|
60 | void printClauseLits(satManager_t *cm,long concl,FILE * file); |
---|
61 | int getClsIndex(long concl,int numVarInCnf); |
---|
62 | void printSatArrayCore(satManager_t *cm,satArray_t *clauseIndexInCore); |
---|
63 | void printSatArrayCoreToCnf(satManager_t *cm,satArray_t *clauseIndexInCore, char *filename); |
---|
64 | // Check Sat |
---|
65 | // @return array_t empty if unsat |
---|
66 | // else print cex with : |
---|
67 | // BmcPrintCounterExample(ntk1,nodeToMvfAigTable,cnfClauses,result,steps,CoiTable,options, NIL(array_t)); |
---|
68 | |
---|
69 | array_t * checkSATCircus( satManager_t *cm,BmcOption_t * options, boolean unsatcore, satArray_t *clauseIndexInCore); |
---|
70 | int findIndex(BmcCnfClauses_t* cnfClauses , char * nodeName); |
---|
71 | // Add val to state register |
---|
72 | mdd_t * buildBdd4StateVal(array_t* stateName, int max, array_t * val, mdd_manager * mddManager); |
---|
73 | void addObjState(array_t* stateName, int max, array_t * val, int steps,BmcCnfClauses_t *cnfClauses); |
---|
74 | |
---|
75 | #endif |
---|