├── EventDriven.cc ├── Gate and Circuit class ├── ClassCircuit.cc ├── ClassCircuit.h ├── ClassGate.cc ├── ClassGate.h ├── Makefile ├── main.cc ├── parse_bench.l ├── parse_bench.y └── test │ ├── c17.bench │ ├── c17.fault │ ├── c17.refout │ ├── c432.bench │ ├── c432.bigfault │ ├── c432.bigrefout │ ├── c432.medfault │ ├── c432.medrefout │ ├── c432.smallfault │ ├── c432.smallrefout │ ├── ex1.bench │ ├── ex1.fault │ ├── ex1.refout │ ├── ex2.bench │ ├── ex2.fault │ ├── ex2.refout │ ├── target.bench │ ├── target.fault │ ├── target.refout │ ├── target2.bench │ ├── target2.fault │ └── target2.refout ├── PODEM implementation report.pdf ├── PODEM questionnaire.pdf ├── PODEM.cc └── README.md /EventDriven.cc: -------------------------------------------------------------------------------- 1 | // ESE-549 Project 3 Reference Solution 2 | // Peter Milder 3 | 4 | /** @file */ 5 | 6 | 7 | // For you to do: 8 | // Part 1: 9 | // - Write the getObjective() function 10 | // - Write the updateDFrontier() function 11 | // - Write the backtrace() function 12 | // - Write the podemRecursion() function 13 | // Then your basic PODEM implementation should be finished. 14 | // Test this code carefully. 15 | // Note you can also turn on a "checkTest" mode that will use your 16 | // simulator to run the test after you generated it and check that it 17 | // correctly detects the faults. 18 | // 19 | // Part 2: 20 | // - Write the eventDrivenSim() function. 21 | // - Change the simulation calls in your podemRecursion() function 22 | // from using the old simFullCircuit() function to the new 23 | // event-driven simulator. 24 | // Then, your PODEM implementation should run considerably faster 25 | // (probably 8 to 10x faster for large circuits). 26 | // Test everything and then evaluate the speedup. 27 | // A quick way to figure out how long it takes to run something in 28 | // Linux is: 29 | // time ./atpg ... type other params... 30 | 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include "parse_bench.tab.h" 39 | #include "ClassCircuit.h" 40 | #include "ClassGate.h" 41 | #include 42 | #include 43 | #include 44 | 45 | using namespace std; 46 | 47 | /** @brief Just for the parser. Don't touch. */ 48 | extern "C" int yyparse(); 49 | 50 | /** Input file for parser. Don't touch. */ 51 | extern FILE *yyin; 52 | 53 | /** Our circuit. We declare this external so the parser can use it more easily. */ 54 | extern Circuit* myCircuit; 55 | 56 | //-------------------------- 57 | // Helper functions 58 | void printUsage(); 59 | vector constructInputLine(string line); 60 | bool checkTest(Circuit* myCircuit); 61 | string printPIValue(char v); 62 | //-------------------------- 63 | 64 | //---------------------------- 65 | // Functions for logic simulation 66 | void simFullCircuit(Circuit* myCircuit); 67 | void simGateRecursive(Gate* g); 68 | void eventDrivenSim(Circuit* myCircuit, queue q); 69 | char simGate(Gate* g); 70 | char evalGate(vector in, int c, int i); 71 | char EvalXORGate(vector in, int inv); 72 | int LogicNot(int logicVal); 73 | void setValueCheckFault(Gate* g, char gateValue); 74 | //----------------------------- 75 | 76 | //---------------------------- 77 | // Functions for PODEM: 78 | bool podemRecursion(Circuit* myCircuit); 79 | bool getObjective(Gate* &g, char &v, Circuit* myCircuit); 80 | void updateDFrontier(Circuit* myCircuit); 81 | void backtrace(Gate* &pi, char &piVal, Gate* objGate, char objVal, Circuit* myCircuit); 82 | 83 | //-------------------------- 84 | 85 | 86 | /////////////////////////////////////////////////////////// 87 | // Global variables 88 | // These are made global to make your life slightly easier. 89 | 90 | /** Global variable: a vector of Gate pointers for storing the D-Frontier. */ 91 | vector dFrontier; 92 | 93 | /** Global variable: holds a pointer to the gate with stuck-at fault on its output location. */ 94 | Gate* faultLocation; 95 | 96 | /** Global variable: holds the logic value you will need to activate the stuck-at fault. */ 97 | char faultActivationVal; 98 | 99 | /////////////////////////////////////////////////////////// 100 | 101 | 102 | 103 | /** @brief The main function. 104 | * 105 | * You do not need to change anything in the main function, 106 | * although you should understand what is happening 107 | * here. 108 | */ 109 | int main(int argc, char* argv[]) { 110 | 111 | // Check the command line input and usage 112 | if (argc != 4) { 113 | printUsage(); 114 | return 1; 115 | } 116 | 117 | // Parse the bench file and initialize the circuit. (Using C style for our parser.) 118 | FILE *benchFile = fopen(argv[1], "r"); 119 | if (benchFile == NULL) { 120 | cout << "ERROR: Cannot read file " << argv[1] << " for input" << endl; 121 | return 1; 122 | } 123 | yyin=benchFile; 124 | yyparse(); 125 | fclose(benchFile); 126 | 127 | myCircuit->setupCircuit(); 128 | 129 | cout << endl; 130 | 131 | 132 | 133 | // Setup the output text file 134 | ofstream outputStream; 135 | outputStream.open(argv[2]); 136 | if (!outputStream.is_open()) { 137 | cout << "ERROR: Cannot open file " << argv[2] << " for output" << endl; 138 | return 1; 139 | } 140 | 141 | // Open the fault file. 142 | ifstream faultStream; 143 | string faultLocStr; 144 | faultStream.open(argv[3]); 145 | if (!faultStream.is_open()) { 146 | cout << "ERROR: Cannot open fault file " << argv[3] << " for input" << endl; 147 | return 1; 148 | } 149 | 150 | 151 | // For each line in our fault file... 152 | while(getline(faultStream, faultLocStr)) { 153 | 154 | // Clear the old fault 155 | myCircuit->clearFaults(); 156 | 157 | string faultTypeStr; 158 | 159 | if (!(getline(faultStream, faultTypeStr))) { 160 | break; 161 | } 162 | 163 | char faultType = atoi(faultTypeStr.c_str()); 164 | 165 | // set up the fault we are trying to detect 166 | faultLocation = myCircuit->findGateByName(faultLocStr); 167 | faultLocation->set_faultType(faultType); 168 | faultActivationVal = (faultType == FAULT_SA0) ? LOGIC_ONE : LOGIC_ZERO; 169 | 170 | // set all gate values to X 171 | for (int i=0; i < myCircuit->getNumberGates(); i++) { 172 | myCircuit->getGate(i)->setValue(LOGIC_X); 173 | } 174 | 175 | // initialize the D frontier. 176 | dFrontier.clear(); 177 | 178 | // call PODEM recursion function 179 | bool res = podemRecursion(myCircuit); 180 | 181 | // If we succeed, print the test we found to the output file. 182 | if (res == true) { 183 | vector piGates = myCircuit->getPIGates(); 184 | for (int i=0; i < piGates.size(); i++) 185 | outputStream << printPIValue(piGates[i]->getValue()); 186 | outputStream << endl; 187 | } 188 | 189 | // If we failed to find a test, print a message to the output file 190 | else { 191 | outputStream << "none found" << endl; 192 | } 193 | 194 | // Lastly, you can use this to test that your PODEM-generated test 195 | // correctly detects the already-set fault. 196 | // Of course, this assumes that your simulation code is correct. 197 | 198 | // Don't use this code when you are evaluating the runtime of your 199 | // ATPG system because it will add extra time. 200 | if (res == true) { 201 | if (!checkTest(myCircuit)) { 202 | cout << "ERROR: PODEM returned true, but generated test does not detect fault on PO." << endl; 203 | myCircuit->printAllGates(); 204 | assert(false); 205 | } 206 | } 207 | 208 | // Just printing to screen to let you monitor progress 209 | cout << "Fault = " << faultLocation->get_outputName() << " / " << (int)(faultType) << ";"; 210 | if (res == true) 211 | cout << " test found" << endl; 212 | else 213 | cout << " no test found" << endl; 214 | 215 | } 216 | 217 | faultStream.close(); 218 | 219 | // close the output and fault streams 220 | outputStream.close(); 221 | 222 | 223 | return 0; 224 | } 225 | 226 | 227 | ///////////////////////////////////////////////////////////////////// 228 | // Functions in this section are helper functions. 229 | // You should not need to change these, except if you want 230 | // to enable the checkTest function (which will use your simulator 231 | // to attempt to check the test vector computed by PODEM.) 232 | 233 | 234 | /** @brief Print usage information (if user provides incorrect input). 235 | * 236 | * You don't need to touch this. 237 | */ 238 | void printUsage() { 239 | cout << "Usage: ./atpg [bench_file] [output_loc] [fault_file]" << endl << endl; 240 | cout << " bench_file: the target circuit in .bench format" << endl; 241 | cout << " output_loc: location for output file" << endl; 242 | cout << " fault_file: faults to be considered" << endl; 243 | cout << endl; 244 | cout << " The system will generate a test pattern for each fault listed" << endl; 245 | cout << " in fault_file and store the result in output_loc." << endl; 246 | cout << endl; 247 | } 248 | 249 | 250 | // You don't need to touch this. 251 | /** @brief Used to parse in the values from the input file. 252 | * 253 | * You don't need to touch this. 254 | */ 255 | vector constructInputLine(string line) { 256 | 257 | vector inputVals; 258 | 259 | for (int i=0; i poGates = myCircuit->getPOGates(); 303 | for (int i=0; igetValue(); 305 | if ((v == LOGIC_D) || (v == LOGIC_DBAR)) { 306 | return true; 307 | } 308 | } 309 | 310 | // If we didn't find D or D' on any PO, then our test was not successful. 311 | return false; 312 | 313 | } 314 | 315 | 316 | 317 | /** @brief Prints a PI value. 318 | * 319 | * This is just a helper function used when storing the final test you computed. 320 | * You don't need to run or modify this. 321 | */ 322 | string printPIValue(char v) { 323 | switch(v) { 324 | case LOGIC_ZERO: return "0"; 325 | case LOGIC_ONE: return "1"; 326 | case LOGIC_UNSET: return "U"; 327 | case LOGIC_X: return "X"; 328 | case LOGIC_D: return "1"; 329 | case LOGIC_DBAR: return "0"; 330 | } 331 | return ""; 332 | } 333 | 334 | // end of helper functions 335 | ////////////////////////////////////////////////////////////////////// 336 | 337 | ////////////////////////////////////////////////////////////////////// 338 | // Start of functions for circuit simulation. 339 | 340 | 341 | 342 | /** @brief Runs full circuit simulation 343 | * 344 | * Full-circuit simulation: set all non-PI gates to LOGIC_UNSET 345 | * and call the recursive simulate function on all PO gates. 346 | * Don't change this function unless you want to use your Project 2 code. 347 | */ 348 | void simFullCircuit(Circuit* myCircuit) { 349 | for (int i=0; igetNumberGates(); i++) { 350 | Gate* g = myCircuit->getGate(i); 351 | if (g->get_gateType() != GATE_PI) 352 | g->setValue(LOGIC_UNSET); 353 | } 354 | vector circuitPOs = myCircuit->getPOGates(); 355 | for (int i=0; i < circuitPOs.size(); i++) { 356 | simGateRecursive(circuitPOs[i]); 357 | } 358 | } 359 | 360 | 361 | 362 | // Recursive function to find and set the value on Gate* g. 363 | // This function calls simGate and setValueCheckFault. 364 | // Don't change this function. 365 | /** @brief Recursive function to find and set the value on Gate* g. 366 | * \param g The gate to simulate. 367 | * This function prepares Gate* g to to be simulated by recursing 368 | * on its inputs (if needed). 369 | * 370 | * Then it calls \a simGate(g) to calculate the new value. 371 | * 372 | * Lastly, it will set the Gate's output value based on 373 | * the calculated value. 374 | * 375 | * \note Do not change this function. 376 | */ 377 | void simGateRecursive(Gate* g) { 378 | 379 | // If this gate has an already-set value, you are done. 380 | if (g->getValue() != LOGIC_UNSET) 381 | return; 382 | 383 | // Recursively call this function on this gate's predecessors to 384 | // ensure that their values are known. 385 | vector pred = g->get_gateInputs(); 386 | for (int i=0; i 404 | * indicating the remaining gates that need to be evaluated. 405 | */ 406 | void eventDrivenSim(Circuit* myCircuit, queue q) { 407 | 408 | // Basic idea: 409 | // - Keep a queue (input q) of gates whose output values may potentially change 410 | // - while there are still gates in the queue: 411 | // - Pop a gate from this queue. Store its currently-set output value. 412 | // - Based on the gate's inputs, calculate its new output value. Note that you don't 413 | // need to do this from scratch, you can use the simGate() function below. 414 | // - Check to see if the new gate output value differs from the old one. If it does 415 | // add its fanout gates on the queue 416 | Gate* i; 417 | 418 | char gatevalue, newgateval; 419 | vector gatesv; 420 | 421 | while(!q.empty()) 422 | { 423 | i = q.front(); 424 | q.pop(); 425 | 426 | gatevalue = i->getValue(); 427 | 428 | newgateval = simGate(i); 429 | setValueCheckFault(i, newgateval); 430 | 431 | if(newgateval!=gatevalue) 432 | { 433 | gatesv = i->get_gateOutputs(); 434 | 435 | for(int j=0; j pred = g->get_gateInputs(); 460 | vector inputVals; 461 | for (int i=0; igetValue()); 463 | } 464 | 465 | char gateType = g->get_gateType(); 466 | char gateValue; 467 | // Now, set the value of this gate based on its logical function and its input values 468 | switch(gateType) { 469 | case GATE_NAND: { gateValue = evalGate(inputVals, 0, 1); break; } 470 | case GATE_NOR: { gateValue = evalGate(inputVals, 1, 1); break; } 471 | case GATE_AND: { gateValue = evalGate(inputVals, 0, 0); break; } 472 | case GATE_OR: { gateValue = evalGate(inputVals, 1, 0); break; } 473 | case GATE_BUFF: { gateValue = inputVals[0]; break; } 474 | case GATE_NOT: { gateValue = LogicNot(inputVals[0]); break; } 475 | case GATE_XOR: { gateValue = EvalXORGate(inputVals, 0); break; } 476 | case GATE_XNOR: { gateValue = EvalXORGate(inputVals, 1); break; } 477 | case GATE_FANOUT: {gateValue = inputVals[0]; break; } 478 | default: { cout << "ERROR: Do not know how to evaluate gate type " << gateType << endl; assert(false);} 479 | } 480 | 481 | return gateValue; 482 | } 483 | 484 | 485 | /** @brief Evaluate a NAND, NOR, AND, or OR gate. 486 | * \param in The logic value's of this gate's inputs. 487 | * \param c The controlling value of this gate type (e.g. c==0 for an AND or NAND gate) 488 | * \param i The inverting value for this gate (e.g. i==0 for AND and i==1 for NAND) 489 | * \returns The logical value produced by this gate (not including a possible fault on this gate). 490 | * \note You do not need to change this function. 491 | */ 492 | char evalGate(vector in, int c, int i) { 493 | 494 | // Are any of the inputs of this gate the controlling value? 495 | bool anyC = find(in.begin(), in.end(), c) != in.end(); 496 | 497 | // Are any of the inputs of this gate unknown? 498 | bool anyUnknown = (find(in.begin(), in.end(), LOGIC_X) != in.end()); 499 | 500 | int anyD = find(in.begin(), in.end(), LOGIC_D) != in.end(); 501 | int anyDBar = find(in.begin(), in.end(), LOGIC_DBAR) != in.end(); 502 | 503 | 504 | // if any input is c or we have both D and D', then return c^i 505 | if ((anyC) || (anyD && anyDBar)) 506 | return (i) ? LogicNot(c) : c; 507 | 508 | // else if any input is unknown, return unknown 509 | else if (anyUnknown) 510 | return LOGIC_X; 511 | 512 | // else if any input is D, return D^i 513 | else if (anyD) 514 | return (i) ? LOGIC_DBAR : LOGIC_D; 515 | 516 | // else if any input is D', return D'^i 517 | else if (anyDBar) 518 | return (i) ? LOGIC_D : LOGIC_DBAR; 519 | 520 | // else return ~(c^i) 521 | else 522 | return LogicNot((i) ? LogicNot(c) : c); 523 | } 524 | 525 | /** @brief Evaluate an XOR or XNOR gate. 526 | * \param in The logic value's of this gate's inputs. 527 | * \param inv The inverting value for this gate (e.g. i==0 for XOR and i==1 for XNOR) 528 | * \returns The logical value produced by this gate (not including a possible fault on this gate). 529 | * \note You do not need to change this function. 530 | */ 531 | char EvalXORGate(vector in, int inv) { 532 | 533 | // if any unknowns, return unknown 534 | bool anyUnknown = (find(in.begin(), in.end(), LOGIC_X) != in.end()); 535 | if (anyUnknown) 536 | return LOGIC_X; 537 | 538 | // Otherwise, let's count the numbers of ones and zeros for faulty and fault-free circuits. 539 | // This is not required for your project, but this will with with XOR and XNOR with > 2 inputs. 540 | int onesFaultFree = 0; 541 | int onesFaulty = 0; 542 | 543 | for (int i=0; iget_faultType() == FAULT_SA0) && (gateValue == LOGIC_ONE)) 593 | g->setValue(LOGIC_D); 594 | else if ((g->get_faultType() == FAULT_SA0) && (gateValue == LOGIC_DBAR)) 595 | g->setValue(LOGIC_ZERO); 596 | else if ((g->get_faultType() == FAULT_SA1) && (gateValue == LOGIC_ZERO)) 597 | g->setValue(LOGIC_DBAR); 598 | else if ((g->get_faultType() == FAULT_SA1) && (gateValue == LOGIC_D)) 599 | g->setValue(LOGIC_ONE); 600 | else 601 | g->setValue(gateValue); 602 | } 603 | 604 | // End of functions for circuit simulation 605 | //////////////////////////////////////////////////////////// 606 | 607 | 608 | ///////////////////////////////////////////////////////// 609 | // Begin functions for PODEM. 610 | 611 | // TODO 612 | /** @brief PODEM recursion. 613 | * 614 | * \note For Part 1, you must write this, following the pseudocode in class and in the code's comments. 615 | */ 616 | bool podemRecursion(Circuit* myCircuit) { 617 | 618 | // If D or D' is at an output, then return true 619 | char val; 620 | queue queue; 621 | vector opGates = myCircuit->getPOGates(); 622 | for (int i=0; igetValue(); 624 | if ((val == LOGIC_D) || (val == LOGIC_DBAR)) 625 | return true; 626 | } 627 | 628 | Gate* g; 629 | char v; 630 | 631 | // Call the getObjective function. Store the result in g and v. 632 | // If getObjective fails, return false 633 | 634 | bool obj = getObjective(g, v, myCircuit); 635 | /////////// 636 | if (obj == false ) return false; 637 | 638 | Gate* pi; 639 | char piVal; 640 | 641 | // Call the backtrace function. Store the result in pi and piVal. 642 | 643 | backtrace(pi, piVal, g, v, myCircuit); 644 | 645 | // Set the value of pi to piVal. Use your setValueCheckFault function (see above) 646 | // to make sure if there is a fault on the PI gate, it correctly gets set. 647 | 648 | setValueCheckFault(pi, piVal); 649 | vector pigates; 650 | 651 | pigates.clear(); 652 | pigates = pi->get_gateOutputs(); 653 | 654 | for(int j=0; jprintGateInfo(); 666 | //faultLocation->printGateInfo(); 667 | 668 | if (podemRecursion(myCircuit)) return true; 669 | // If the recursive call fails, set the opposite PI value, simulate, it and recurse. 670 | // If this recursive call succeeds, return true. 671 | 672 | char notpiVal; 673 | notpiVal= LogicNot(piVal); 674 | 675 | setValueCheckFault(pi, notpiVal); 676 | 677 | pigates.clear(); 678 | pigates = pi->get_gateOutputs(); 679 | 680 | for(int j=0; jget_gateOutputs(); 696 | 697 | for(int j=0; jgetValue()== LOGIC_X) {g= faultLocation; v=faultActivationVal; 733 | return true;} 734 | 735 | if (faultLocation->getValue()== LOGIC_ONE || faultLocation->getValue()== LOGIC_ZERO) 736 | {return false;} 737 | //setValueCheckFault(faultLocation, faultLocation->getValue()); 738 | 739 | 740 | 741 | // If the fault is already activated, then you will need to 742 | // use the D-frontier to find an objective. 743 | // Before you use the D-frontier you should update it by running: 744 | 745 | updateDFrontier(myCircuit); 746 | 747 | // This function should update the global D-frontier variable 748 | // vector dFrontier; 749 | 750 | // If the D frontier is empty after update, then getObjective fails 751 | // and should return false. 752 | 753 | if (dFrontier.empty()) return false; 754 | 755 | //if (t==1) {cout<<"123";exit(1);} 756 | 757 | // getObjective needs to choose a gate from the D-Frontier. 758 | // For part 1, pick dFrontier[0] if you want to match my reference outputs. 759 | Gate* d; 760 | d = dFrontier[0]; 761 | //if (t==1) {d->printGateInfo();exit(1);} 762 | // Later, a possible optimization is to use the 763 | // SCOAP observability metric or other smart methods to choose this carefully. 764 | 765 | 766 | // Lastly, set the values of g and v based on the 767 | // gate you chose from the D-Frontier. 768 | 769 | 770 | vector dinputs = d->get_gateInputs(); 771 | 772 | 773 | 774 | 775 | for (int i=0; igetValue()== LOGIC_X) 778 | { 779 | g = dinputs[i]; break; 780 | } 781 | } 782 | 783 | if (d->get_gateType()==GATE_AND || d->get_gateType()==GATE_NAND) v=LOGIC_ONE; 784 | else if (d->get_gateType()==GATE_OR || d->get_gateType()==GATE_NOR) v=LOGIC_ZERO; 785 | else if (d->get_gateType()==GATE_XOR || d->get_gateType()==GATE_XNOR) v=LOGIC_ZERO; 786 | else v=LOGIC_X; 787 | 788 | 789 | return true; 790 | 791 | } 792 | 793 | 794 | // A very simple method to update the D frontier. 795 | // TODO: Write this code based on the pseudocode below. 796 | /** @brief A simple method to compute the set of gates on the D frontier. 797 | * 798 | * \note For Part 1, you must write this. The simplest form follows the pseudocode included in the comments. 799 | */ 800 | 801 | void updateDFrontier(Circuit* myCircuit) { 802 | // Procedure: 803 | // - clear the dFrontier vector (stored as the global variable dFrontier -- see the top of the file) 804 | 805 | dFrontier.clear(); 806 | 807 | // - loop over all gates in the circuit; for each gate, check if it should be on D-frontier; if it is, 808 | // add it to the dFrontier vector. 809 | 810 | Gate* G; 811 | int numberofgates = myCircuit->getNumberGates(); 812 | 813 | for (int i=0; i< numberofgates; i++) 814 | { 815 | G = myCircuit->getGate(i); 816 | if (G->getValue() != LOGIC_X) continue; 817 | else 818 | { 819 | vector Ginputs = G->get_gateInputs(); 820 | for (int j=0; jgetValue()== LOGIC_D || Ginputs[j]->getValue() == LOGIC_DBAR) 823 | { 824 | dFrontier.push_back(G); break; 825 | } 826 | 827 | } 828 | 829 | } 830 | 831 | 832 | } 833 | 834 | } 835 | 836 | 837 | // Backtrace: given objective objGate and objVal, then figure out which input (pi) to set 838 | // and which value (piVal) to set it to. 839 | // TODO: write this 840 | 841 | /** @brief PODEM backtrace function 842 | * \param pi Output: A Gate pointer to the primary input your backtrace function found. 843 | * \param piVal Output: The value you want to set that primary input to 844 | * \param objGate Input: The objective Gate (computed by getObjective) 845 | * \param objVal Input: the objective value (computed by getObjective) 846 | * \note Write this function based on the psuedocode from class. 847 | */ 848 | void backtrace(Gate* &pi, char &piVal, Gate* objGate, char objVal, Circuit* myCircuit) { 849 | 850 | pi = objGate;int k1;int cnt=0; 851 | int num_inversions; 852 | char gatetype = pi->get_gateType(); 853 | 854 | if (gatetype == GATE_NOR || gatetype == GATE_NOT || gatetype == GATE_NAND || gatetype == GATE_XNOR) 855 | num_inversions=1; 856 | else num_inversions=0; 857 | 858 | 859 | while (pi->get_gateType()!=GATE_PI) 860 | { 861 | vector gateinputs = pi->get_gateInputs();// 862 | 863 | 864 | for (k1=0; k1getValue()== LOGIC_X) {pi=gateinputs[k1]; break;} 867 | 868 | } 869 | 870 | gatetype = pi->get_gateType(); 871 | if (gatetype == GATE_NOR || gatetype == GATE_NOT || gatetype == GATE_NAND || gatetype == GATE_XNOR) 872 | {num_inversions++; } 873 | } 874 | if (num_inversions%2==1) piVal= LogicNot(objVal); 875 | else piVal = objVal; 876 | 877 | } 878 | 879 | 880 | //////////////////////////////////////////////////////////////////////////// 881 | // Place any new functions you add here, between these two bars. 882 | 883 | 884 | 885 | //////////////////////////////////////////////////////////////////////////// 886 | 887 | 888 | -------------------------------------------------------------------------------- /Gate and Circuit class/ClassCircuit.cc: -------------------------------------------------------------------------------- 1 | 2 | /** \class Circuit 3 | * \brief A circuit contains primary inputs and outputs, and a number of interconnected gates. 4 | * 5 | * The API for interacting with a Circuit includes functions to access the gates in the 6 | * system. Functions you may use in your project include \a getPIGates() and \a getPOGates(), which 7 | * return the inputs and outputs of the circuit. Also useful are \a setPIValues(), which the reference 8 | * code uses to set the values of the inputs of the circuit, and \a clearGateValues() which it uses 9 | * to clear the logical values after each simulation iteration. 10 | * 11 | * An important thing to understand: we will use a special Gate type called a PI to represent 12 | * the circuit's primary inputs. This isn't really a logic gate, it's just a way of 13 | * making it easy to access the inputs. So, when you call \a getPIGates() you will get a vector of 14 | * pointers to the special PI gates. 15 | * 16 | * We don't use a special structure for the primary outputs (POs); instead we simply maintain a 17 | * list of which gates drive the output values. So when you call \a getPOGates() you will get 18 | * a vector of pointers to the normal gates that drive the outputs. 19 | * 20 | * Lastly, note that there are a number of functions here that are only used when the initial 21 | * representation of the circuit is constructed. (This is done for you by the yyparse() function 22 | * (see main.cc). These functions are ones that you will never have to manipulate yourself, and 23 | * they are marked with a note that indicate this. 24 | */ 25 | 26 | #include "ClassCircuit.h" 27 | 28 | /** \brief Construct a new circuit */ 29 | Circuit::Circuit() {} 30 | 31 | /** \brief Add a new gate to the circuit 32 | * \param name a string providing the output name for the gate 33 | * \param ID a unique ID number for the gate (primarily used while parsing the input source file) 34 | * \param gt the type of gate, using the GATE_* marcos defined in ClassGate.h 35 | * \note This function should only need to be run by the parser. 36 | */ 37 | void Circuit::newGate(string name, int ID, int gt) { 38 | Gate* g = new Gate(name, ID, gt); 39 | gates.push_back(g); 40 | 41 | if (gt == GATE_PI) 42 | inputGates.push_back(g); 43 | } 44 | 45 | /** \brief Get pointer to gate \a i from the circuit 46 | * \param i gate number 47 | * \return Pointer to Gate \a i 48 | */ 49 | Gate* Circuit::getGate(int i) { 50 | if (i >= gates.size()) { 51 | cout << "ERROR: Requested gate out of bounds" << endl; 52 | assert(false); 53 | } 54 | return gates[i]; 55 | } 56 | 57 | /** \brief Record the name of a primary output of this circuit. 58 | * \param n Name of the output signal 59 | * \note This function should only need to be run by the parser. 60 | */ 61 | void Circuit::addOutputName(string n) { 62 | outputNames.push_back(n); 63 | } 64 | 65 | /** \brief Print the circuit 66 | */ 67 | void Circuit::printAllGates() { 68 | cout << "Inputs: "; 69 | for (int i=0; iget_outputName() << " "; 71 | cout << endl; 72 | 73 | cout << "Outputs: "; 74 | for (int i=0; iget_outputName() << " "; 76 | cout << endl; 77 | 78 | for (int i=0; iprintGateInfo(); 80 | } 81 | 82 | } 83 | 84 | /** \brief Returns a pointer to the Gate in this circuit with output name \a name. 85 | * \param name A string containing the name of the gate requested 86 | * \return Pointer to the Gate with output given by \a name 87 | * Will fail an assertion if multiple gates with that name are found, or if none are. 88 | * \note This function should probably only need to be called by the parser. 89 | */ 90 | Gate* Circuit::findGateByName(string name) { 91 | Gate* res; 92 | bool found = false; 93 | 94 | for (int i=0; iget_outputName().compare(name) == 0) { 96 | res = gates[i]; 97 | assert(!found); 98 | found = true; 99 | } 100 | } 101 | 102 | if (!found) 103 | cout << "ERROR: Cannot find: " << name << endl; 104 | 105 | assert(found); 106 | return res; 107 | 108 | } 109 | 110 | /** \brief Sets up the circuit data structures after parsing is complete. 111 | * Run this once after parsing, before using the data structure. 112 | * The handout \a main.cc code already does this; you do not need to add it yourself. 113 | */ 114 | void Circuit::setupCircuit() { 115 | 116 | // set-up the vector of output gates based on their pre-stored names 117 | for (int i=0; i names = g->get_gateInputNames(); 125 | for (int j=0; jset_gateOutput(g); 129 | g->set_gateInput(inGate); 130 | } 131 | } 132 | 133 | 134 | // In order for the fault simulator to consider fanout stems and 135 | // branches as different faults, here we find all the gates that have 136 | // fanout > 1, and add special FANOUT gates. 137 | // After this, the only gates that have fanout > 1 will have GATE_FANOUT gates 138 | // as their only output gates. 139 | // 140 | // Example: A = AND(B, C) 141 | // D = OR(A, E) 142 | // F = OR(A, G) 143 | // 144 | // Here we see that A has fanout of two. Our function here will change it to: 145 | // A = AND(B, C) 146 | // D = OR(A_0, E) 147 | // F = OR(A_1, G) 148 | // A_0 = FANOUT(A) 149 | // A_1 = FANOUT(A) 150 | // 151 | // Given this new type of gate, now any possible single-stuck-at gate fault site 152 | // is a gate output. 153 | for (int i=0; i go = g->get_gateOutputs(); 156 | 157 | if ((g->get_gateType() != GATE_FANOUT) && (go.size() > 1)) { 158 | for (int j=0; j go[j] 162 | // After: 163 | // g --> newG --> go[j], where newG is a gate of type FANOUT 164 | 165 | ostringstream ss; 166 | ss << g->get_outputName() << "_" << (int)j; 167 | newGate(ss.str(), gates.size(), GATE_FANOUT); 168 | Gate* newFanoutGate = gates.back(); 169 | 170 | // change g's output[j] to point to newFanoutGate 171 | g->replace_gateOutput(go[j], newFanoutGate); 172 | 173 | // set newFanoutGate's input to point to g 174 | newFanoutGate->set_gateInput(g); 175 | 176 | // change go[j]'s appropriate input to point to newFanoutGate 177 | go[j]->replace_gateInput(g, newFanoutGate); 178 | 179 | // set newFanoutGate's output to point to go[j] 180 | newFanoutGate->set_gateOutput(go[j]); 181 | 182 | 183 | } 184 | } 185 | } 186 | 187 | checkPointerConsistency(); 188 | 189 | } 190 | 191 | /** \brief Initializes the values of the PIs of the circuit. 192 | * \param inputVals the desired input values (using LOGIC_* macros). 193 | */ 194 | void Circuit::setPIValues(vector inputVals) { 195 | if (inputVals.size() != inputGates.size()) { 196 | cout << "ERROR: Incorrect number of input values: " << inputVals.size() << " vs " << inputGates.size() << endl; 197 | assert(false); 198 | } 199 | 200 | for (int i=0; iget_faultType() == FAULT_SA0) && (inputVals[i] == LOGIC_ONE)) 203 | inputGates[i]->setValue(LOGIC_D); 204 | else if ((inputGates[i]->get_faultType() == FAULT_SA0) && (inputVals[i] == LOGIC_DBAR)) 205 | inputGates[i]->setValue(LOGIC_ZERO); 206 | else if ((inputGates[i]->get_faultType() == FAULT_SA1) && (inputVals[i] == LOGIC_ZERO)) 207 | inputGates[i]->setValue(LOGIC_DBAR); 208 | else if ((inputGates[i]->get_faultType() == FAULT_SA1) && (inputVals[i] == LOGIC_D)) 209 | inputGates[i]->setValue(LOGIC_ONE); 210 | else 211 | inputGates[i]->setValue(inputVals[i]); 212 | } 213 | 214 | } 215 | 216 | /** \brief Returns the output values on each PO of this circuit. 217 | */ 218 | vector Circuit::getPOValues() { 219 | vector outVals; 220 | for (int i=0; i < outputGates.size(); i++) 221 | outVals.push_back(outputGates[i]->getValue()); 222 | 223 | return outVals; 224 | } 225 | 226 | /** \brief Get the number of PIs of the circuit. 227 | * \return The number of PIs of the circuit. */ 228 | int Circuit::getNumberPIs() { return inputGates.size(); } 229 | 230 | /** \brief Get the number of POs of the circuit. 231 | * \return The number of POs of the circuit. */ 232 | int Circuit::getNumberPOs() { return outputGates.size(); } 233 | 234 | /** \brief Get the number of gates of the circuit. 235 | * \return The number of gates of the circuit. 236 | */ 237 | int Circuit::getNumberGates() { return gates.size(); } 238 | 239 | /** \brief Clears the value of each gate in the circuit (to LOGIC_UNSET) */ 240 | void Circuit::clearGateValues() { 241 | for (int i=0; isetValue(LOGIC_UNSET); 243 | } 244 | 245 | } 246 | 247 | /** \brief Returns the PI (input) gates. (The PIs of the circuit). 248 | \return a \a vector of the circuit's PIs */ 249 | vector Circuit::getPIGates() { return inputGates; } 250 | 251 | /** \brief Returns the PO (output) gates. (The gates which drive the POs of the circuit.) 252 | \return a \a vector of the circuit's POs */ 253 | vector Circuit::getPOGates() { return outputGates; } 254 | 255 | /** \brief Private function for Circuit to check input and output pointers 256 | * for all gates are set consistently. Just used in setting up circuit. 257 | */ 258 | void Circuit::checkPointerConsistency() { 259 | 260 | for (int i=0; i gi = g->get_gateInputs(); 265 | for (int j=0; j < gi.size(); j++) { 266 | vector gi_go = gi[j]->get_gateOutputs(); 267 | assert(find(gi_go.begin(), gi_go.end(), g) != gi_go.end()); 268 | } 269 | 270 | // every gate in g's output list must have g in its input list 271 | vector go = g->get_gateOutputs(); 272 | for (int j=0; j < go.size(); j++) { 273 | vector go_gi = go[j]->get_gateInputs(); 274 | assert(find(go_gi.begin(), go_gi.end(), g) != go_gi.end()); 275 | } 276 | } 277 | 278 | // check that fanout goes to FANOUT gates only 279 | for (int i=0; i go = g->get_gateOutputs(); 282 | 283 | if (go.size() > 1) { 284 | for (int j=0; jget_gateType() == GATE_FANOUT); 286 | } 287 | } 288 | } 289 | } 290 | 291 | /** \brief Clears faults on all gates 292 | * \note We run this function as part of the setup code; you should not need to run this. 293 | */ 294 | void Circuit::clearFaults() { 295 | for (int i=0; iset_faultType(NOFAULT); 297 | } 298 | } 299 | -------------------------------------------------------------------------------- /Gate and Circuit class/ClassCircuit.h: -------------------------------------------------------------------------------- 1 | #ifndef CLASSCIRCUIT_H 2 | #define CLASSCIRCUIT_H 3 | 4 | #include "ClassGate.h" 5 | #include // assert 6 | #include // cout 7 | #include // vector 8 | #include 9 | 10 | class Circuit{ 11 | private: 12 | vector gates; // Pointers to all gates in the circuit 13 | vector outputGates; // Pointers to all gates driving POs 14 | vector inputGates; // Pointers to all PIs 15 | vector outputNames; // A vector with output names (only used in setup) 16 | void checkPointerConsistency(); // An internal function to check that the Circuit is setup correctly. 17 | 18 | 19 | public: 20 | Circuit(); 21 | void newGate(string name, int ID, int gt); 22 | Gate* getGate(int i); 23 | void addOutputName(string n); 24 | void printAllGates(); 25 | void setupCircuit(); 26 | Gate* findGateByName(string name); 27 | void setPIValues(vector inputVals); 28 | vector getPOValues(); 29 | int getNumberPIs(); 30 | int getNumberPOs(); 31 | int getNumberGates(); 32 | void clearGateValues(); 33 | vector getPIGates(); 34 | vector getPOGates(); 35 | void clearFaults(); 36 | 37 | }; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /Gate and Circuit class/ClassGate.cc: -------------------------------------------------------------------------------- 1 | /** \class Gate 2 | * \brief A Boolean logic gate, with pointers to its input sources and destinations of its outputs. 3 | * 4 | * A \a Gate is a data structure for storing the information about a gate. It contains a number of 5 | * useful things: 6 | * - A variable which indicates what type of gate it is. Note that this will be stored in a number. In 7 | * the top of ClassGate.h, you will find a list of #define macros that give names to each gate type. 8 | * For example, we will use value 0 to represent a NAND gate. However, instead of remembering that, you 9 | * can simply use the macros like: "if (gateType == GATE_NAND)". If you want to get the type of a gate 10 | * object, call the get_gateType() function. 11 | * 12 | * One important thing to note: if this gate represents a primary input (PI) of the circuit, then 13 | * the gate will be of type GATE_PI. 14 | * 15 | * - Vectors of pointers to this gate's predecessors and successors. The predecessors are the gates 16 | * whose outputs are the inputs to this gate. (If this gate is a PI, then it has no predecessors.) 17 | * The successors are the gates who take in the input of this gate. (If this gate drives a PO, then 18 | * it has no successors. You can access these vectors by running the \a get_gateInputs() and 19 | * \a get_gateOutputs() functions. 20 | * 21 | * - A logical value that indicates the output value of the gate in the current simulation. Currently, 22 | * legal values are, 0, 1, D, B ("not D"), X, and "unset." The "unset" value indicates that the 23 | * value is unknown because it has not yet been computed. The X value indicates a true "unknown" 24 | * input value. You can get the value of a gate's output by using the \a getValue() function, and 25 | * set it using the \a setValue() function. 26 | * 27 | * These values are encoded as numbers, but (like the gate type) you will use macros defined at the 28 | * top of ClassGate.h (instead of hard-coding the numbers into the system). For example, to set the 29 | * value of a gate to 1, you would call setValue(LOGIC_ONE). 30 | * 31 | * - Added for Project 2: the ability to specify a stuck-at fault on the Gate's output. You can set 32 | * with \a set_faultType(char f) where \a f is NOFAULT, FAULT_SA0, or FAULT_SA1. You can view 33 | * the fault type by calling \a get_faultType() which returns one of those three values. 34 | * 35 | */ 36 | 37 | #include "ClassGate.h" 38 | 39 | /** \brief Constructor for a new Gate. 40 | * \param name a string providing the output name for the gate 41 | * \param ID a unique ID number for the gate (primarily used while parsing the input source file) 42 | * \param gt the type of gate, using the GATE_* marcos defined in ClassGate.h 43 | */ 44 | Gate::Gate(string name, int ID, int gt) { 45 | outputName = name; 46 | gateID = ID; 47 | gateType = gt; 48 | gateValue = LOGIC_UNSET; 49 | } 50 | 51 | /** \brief Get the gate type for this gate. 52 | * \return The gate type, using the GATE_* macros defined in ClassGate.h 53 | */ 54 | char Gate::get_gateType() { return gateType; } 55 | 56 | /** \brief Get the gate's output pointers. 57 | * \return A vector of pointers to the gates that this gate's output connects to. 58 | */ 59 | vector Gate::get_gateOutputs() { return gateOutputs; } 60 | 61 | /** \brief Add a pointer to Gate \a x as an output destination of this gate. 62 | * \param x A pointer to a Gate that takes this Gate's output as input. 63 | * \note This code should only need to be run by the setupCircuit() function of Circut. You should never have to run this. 64 | */ 65 | void Gate::set_gateOutput(Gate* x) { gateOutputs.push_back(x); } 66 | 67 | 68 | /** \brief In this Gate's output list, replace the pointer to \a oldGate with a pointer to \a newGate. 69 | * \param oldGate Old gate to remove 70 | * \param newGate New pointer 71 | * \note This code should only need to be run by the setupCircuit() function of Circut. You should never have to run this. 72 | */ 73 | void Gate::replace_gateOutput(Gate* oldGate, Gate* newGate) { 74 | for (int i=0; i < gateOutputs.size(); i++) { 75 | if (gateOutputs[i] == oldGate) { 76 | gateOutputs[i] = newGate; 77 | return; 78 | } 79 | } 80 | 81 | assert(false); 82 | return; 83 | } 84 | 85 | /** \brief Get the gate's input pointers. 86 | * \return A vector of pointers to the gates whose outputs connect to this gate's inputs. 87 | */ 88 | vector Gate::get_gateInputs() { return gateInputs; } 89 | 90 | /** \brief Add a pointer to Gate \a x as an input source of this gate. 91 | * \param x A pointer to a Gate whose output is an input to this gate. 92 | * \note This code should only need to be run by the setupCircuit() function of Circut. You should never have to run this. 93 | */ 94 | void Gate::set_gateInput(Gate* x) { 95 | gateInputs.push_back(x); 96 | } 97 | 98 | /** \brief In this Gate's input list, replace the pointer to \a oldGate with a pointer to \a newGate. 99 | * \param oldGate Old gate to remove 100 | * \param newGate New pointer 101 | * \note This code should only need to be run by the setupCircuit() function of Circut. You should never have to run this. 102 | */ 103 | void Gate::replace_gateInput(Gate* oldGate, Gate* newGate) { 104 | for (int i=0; i < gateInputs.size(); i++) { 105 | if (gateInputs[i] == oldGate) { 106 | gateInputs[i] = newGate; 107 | return; 108 | } 109 | } 110 | 111 | assert(false); 112 | return; 113 | } 114 | 115 | /** \brief Get the name of output of this gate. 116 | * \return A string containing the name of the output of this gate. 117 | */ 118 | string Gate::get_outputName() { return outputName; } 119 | 120 | 121 | /** \brief Print information about this gate. 122 | */ 123 | void Gate::printGateInfo() { 124 | cout << "Gate " << gateID << ": " << outputName; 125 | 126 | if (faultType == FAULT_SA0) 127 | cout << "/0"; 128 | if (faultType == FAULT_SA1) 129 | cout << "/1"; 130 | 131 | cout << " = " << gateTypeName() << "("; 132 | 133 | if (gateInputs.size() > 0) { 134 | for (int j=0; j < gateInputs.size()-1; j++) { 135 | cout << gateInputs[j]->get_outputName(); 136 | cout << ", "; 137 | } 138 | cout << gateInputs[gateInputs.size()-1]->get_outputName(); 139 | } 140 | 141 | cout << ")"; 142 | if (gateValue != LOGIC_UNSET) 143 | cout << " = " << printLogicVal(gateValue) << ";"; 144 | else 145 | cout << ";"; 146 | 147 | cout << endl; 148 | } 149 | 150 | /** \brief Convert a logic value (e.g. LOGIC_ZERO) to a printable string (e.g. "0"). 151 | * \param val The logic value (based on the macros in ClassGate.h) 152 | */ 153 | string Gate::printLogicVal(int val) { 154 | switch(val) { 155 | case LOGIC_ZERO: return "0"; 156 | case LOGIC_ONE: return "1"; 157 | case LOGIC_UNSET: return "U"; 158 | case LOGIC_X: return "X"; 159 | case LOGIC_D: return "D"; 160 | case LOGIC_DBAR: return "B"; 161 | } 162 | 163 | cout << "ERROR: Do not know how to print logic value " << val << " in Gate::printLogicVal(int val)" << endl; 164 | return ""; 165 | } 166 | 167 | /** \brief Get this gate's type as a string (e.g., GATE_NAND --> "NAND"). 168 | * \return A string with the name of this gate's type. 169 | */ 170 | string Gate::gateTypeName() { 171 | // macros defined in ClassGate.h 172 | switch(gateType) { 173 | case GATE_NAND: return "NAND"; 174 | case GATE_NOR: return "NOR"; 175 | case GATE_AND: return "AND"; 176 | case GATE_OR: return "OR"; 177 | case GATE_XOR: return "XOR"; 178 | case GATE_XNOR: return "XNOR"; 179 | case GATE_BUFF: return "BUFF"; 180 | case GATE_NOT: return "NOT"; 181 | case GATE_PI: return "PI"; 182 | case GATE_FANOUT: return "FANOUT"; 183 | default: return "ERROR"; 184 | } 185 | } 186 | 187 | /** \brief Sets the value of this gate. 188 | * \param val The logic value (based on the LOGIC_* marcos in ClassGate.h). 189 | */ 190 | void Gate::setValue(int val) { 191 | gateValue = val; 192 | } 193 | 194 | /** \brief Gets the value of this gate's output. 195 | * 196 | * \return The logic value (based on the LOGIC_* marcos in ClassGate.h). 197 | */ 198 | char Gate::getValue() { 199 | return gateValue; 200 | } 201 | 202 | /** \brief Gets the value of this's gate's output as a string (intended for printing). 203 | * Instead of returning LOGIC_ZERO, etc., it will just return a printable version (e.g. 0) 204 | * \return The logical value of this gate as a string. 205 | */ 206 | string Gate::printValue() { 207 | return printLogicVal(gateValue); 208 | } 209 | 210 | 211 | /** \brief Stores the name of one of this gate's input signals. 212 | * \param n The name of one of this gate's inputs. 213 | * \note Normally, this code should only need to be run by the parser, and its results should only need to be used by the setupCircuit() function of Circut. You should never need to touch this. 214 | */ 215 | void Gate::set_gateInputName(string n) { 216 | inputName.push_back(n); 217 | } 218 | 219 | /** \brief Gets the pre-stored names of this gate's input signals. 220 | * Normally, this code should only need to be run by the setupCircuit() function of Circut. 221 | */ 222 | vector Gate::get_gateInputNames() { 223 | return inputName; 224 | } 225 | 226 | /** \brief Finds which of this gate's inputs is connected to the output of Gate \a g. 227 | * \param g Pointer to the \a Gate we are searching for 228 | * \return An integer value, showing which of this gate's inputs (numbered starting at 0) is connect to \a Gate \a g. 229 | * 230 | * A \a Gate \a t contains \a gateInputs, a vector of pointers to the gates which drive the inputs of \a t. 231 | * This function will tell us which location in \a gateInputs holds \a *g. 232 | * If \a *g is not found, then this function prints a warning and returns -1. 233 | */ 234 | int Gate::getGateInputNumber(Gate *g) { 235 | for (int i=0; i // cout 5 | #include // vector 6 | #include // min_element, find 7 | #include // assert 8 | #include // accumulate 9 | #include // INT_MAX 10 | #include 11 | using namespace std; 12 | 13 | // Marcos for gate types 14 | #define GATE_NAND 0 15 | #define GATE_NOR 1 16 | #define GATE_AND 2 17 | #define GATE_OR 3 18 | #define GATE_XOR 4 19 | #define GATE_XNOR 5 20 | #define GATE_BUFF 6 21 | #define GATE_NOT 7 22 | #define GATE_PI 9 23 | #define GATE_FANOUT 10 24 | 25 | // Macros for logic values 26 | #define LOGIC_UNSET -1 27 | #define LOGIC_ZERO 0 28 | #define LOGIC_ONE 1 29 | #define LOGIC_D 2 30 | #define LOGIC_DBAR 3 31 | #define LOGIC_X 4 32 | 33 | // Macros for fault types 34 | #define NOFAULT -1 35 | #define FAULT_SA0 0 36 | #define FAULT_SA1 1 37 | 38 | class Gate{ 39 | 40 | private: 41 | int gateID; // A unique ID for this gate. 42 | char gateType; // Gate type (macros above: GATE_NAND, etc.) 43 | vector gateInputs; // Stores the pointers to all the gates that this gate's inputs connect to. 44 | vector gateOutputs; // Stores the pointers to all the gates that this gate's output connects to. 45 | string outputName; // The name of the output of this gate 46 | 47 | char gateValue; // The logic value of this gate's output (using macros above: LOGIC_ZERO, etc. 48 | 49 | string printLogicVal(int val); 50 | vector inputName; // A list of the names of the inputs to this gate. 51 | 52 | char faultType; // Type of fault on this gate's output (NOFAULT, FAULT_SA0, FAULT_SA1) 53 | 54 | public: 55 | Gate(string name, int ID, int gt); 56 | 57 | char get_gateType(); 58 | 59 | vector get_gateOutputs(); 60 | void set_gateOutput(Gate* x); 61 | void replace_gateOutput(Gate* oldGate, Gate* newGate); 62 | 63 | vector get_gateInputs(); 64 | void set_gateInput(Gate* x); 65 | void replace_gateInput(Gate* oldGate, Gate* newGate); 66 | 67 | string get_outputName(); 68 | 69 | void printGateInfo(); 70 | string gateTypeName(); 71 | 72 | void setValue(int val); 73 | char getValue(); 74 | string printValue(); 75 | 76 | void set_gateInputName(string n); 77 | vector get_gateInputNames(); 78 | 79 | int getGateInputNumber(Gate *g); 80 | 81 | void set_faultType(char f); 82 | char get_faultType(); 83 | 84 | }; 85 | 86 | #endif 87 | -------------------------------------------------------------------------------- /Gate and Circuit class/Makefile: -------------------------------------------------------------------------------- 1 | CFLAGS = -x c++ 2 | CFLAGS = -x c++ -std=c++11 -Wno-deprecated-register 3 | OPTLEVEL = -O3 4 | SRCPP = main.cc ClassGate.cc ClassCircuit.cc 5 | SRCC = lex.yy.c parse_bench.tab.c 6 | EXECNAME = atpg 7 | 8 | #FLEXLOC = flex 9 | #BISONLOC = bison 10 | #LIBFLAGS = -ll 11 | 12 | FLEXLOC = /home/home4/pmilder/ese549/tools/bin/flex 13 | BISONLOC = /home/home4/pmilder/ese549/tools/bin/bison 14 | LIBFLAGS = -L /home/home4/pmilder/ese549/tools/lib -lfl 15 | 16 | 17 | 18 | all: bison flex 19 | g++ $(CFLAGS) $(SRCC) $(SRCPP) $(LIBFLAGS) -o $(EXECNAME) $(OPTLEVEL) 20 | 21 | debug: bison flex 22 | g++ $(CFLAGS) $(SRCC) $(SRCPP) $(LIBFLAGS) -o $(EXECNAME) -g 23 | 24 | bison: 25 | $(BISONLOC) -d parse_bench.y 26 | 27 | flex: 28 | $(FLEXLOC) parse_bench.l 29 | 30 | clean: 31 | rm -rf parse_bench.tab.c parse_bench.tab.h lex.yy.c $(EXECNAME) *~ atpg.dSYM 32 | 33 | doc: 34 | doxygen doxygen.cfg 35 | cd docs/latex && make pdf 36 | -------------------------------------------------------------------------------- /Gate and Circuit class/main.cc: -------------------------------------------------------------------------------- 1 | // ESE-549 Project 3 Reference Solution 2 | // Peter Milder 3 | 4 | /** @file */ 5 | 6 | 7 | // For you to do: 8 | // Part 1: 9 | // - Write the getObjective() function 10 | // - Write the updateDFrontier() function 11 | // - Write the backtrace() function 12 | // - Write the podemRecursion() function 13 | // Then your basic PODEM implementation should be finished. 14 | // Test this code carefully. 15 | // Note you can also turn on a "checkTest" mode that will use your 16 | // simulator to run the test after you generated it and check that it 17 | // correctly detects the faults. 18 | // 19 | // Part 2: 20 | // - Write the eventDrivenSim() function. 21 | // - Change the simulation calls in your podemRecursion() function 22 | // from using the old simFullCircuit() function to the new 23 | // event-driven simulator. 24 | // Then, your PODEM implementation should run considerably faster 25 | // (probably 8 to 10x faster for large circuits). 26 | // Test everything and then evaluate the speedup. 27 | // A quick way to figure out how long it takes to run something in 28 | // Linux is: 29 | // time ./atpg ... type other params... 30 | 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include "parse_bench.tab.h" 39 | #include "ClassCircuit.h" 40 | #include "ClassGate.h" 41 | #include 42 | #include 43 | #include 44 | 45 | using namespace std; 46 | 47 | /** @brief Just for the parser. Don't touch. */ 48 | extern "C" int yyparse(); 49 | 50 | /** Input file for parser. Don't touch. */ 51 | extern FILE *yyin; 52 | 53 | /** Our circuit. We declare this external so the parser can use it more easily. */ 54 | extern Circuit* myCircuit; 55 | 56 | //-------------------------- 57 | // Helper functions 58 | void printUsage(); 59 | vector constructInputLine(string line); 60 | bool checkTest(Circuit* myCircuit); 61 | string printPIValue(char v); 62 | //-------------------------- 63 | 64 | //---------------------------- 65 | // Functions for logic simulation 66 | void simFullCircuit(Circuit* myCircuit); 67 | void simGateRecursive(Gate* g); 68 | void eventDrivenSim(Circuit* myCircuit, queue q); 69 | char simGate(Gate* g); 70 | char evalGate(vector in, int c, int i); 71 | char EvalXORGate(vector in, int inv); 72 | int LogicNot(int logicVal); 73 | void setValueCheckFault(Gate* g, char gateValue); 74 | //----------------------------- 75 | 76 | //---------------------------- 77 | // Functions for PODEM: 78 | bool podemRecursion(Circuit* myCircuit); 79 | bool getObjective(Gate* &g, char &v, Circuit* myCircuit); 80 | void updateDFrontier(Circuit* myCircuit); 81 | void backtrace(Gate* &pi, char &piVal, Gate* objGate, char objVal, Circuit* myCircuit); 82 | //-------------------------- 83 | 84 | 85 | /////////////////////////////////////////////////////////// 86 | // Global variables 87 | // These are made global to make your life slightly easier. 88 | 89 | /** Global variable: a vector of Gate pointers for storing the D-Frontier. */ 90 | vector dFrontier; 91 | 92 | /** Global variable: holds a pointer to the gate with stuck-at fault on its output location. */ 93 | Gate* faultLocation; 94 | 95 | /** Global variable: holds the logic value you will need to activate the stuck-at fault. */ 96 | char faultActivationVal; 97 | 98 | /////////////////////////////////////////////////////////// 99 | 100 | 101 | 102 | /** @brief The main function. 103 | * 104 | * You do not need to change anything in the main function, 105 | * although you should understand what is happening 106 | * here. 107 | */ 108 | int main(int argc, char* argv[]) { 109 | 110 | // Check the command line input and usage 111 | if (argc != 4) { 112 | printUsage(); 113 | return 1; 114 | } 115 | 116 | // Parse the bench file and initialize the circuit. (Using C style for our parser.) 117 | FILE *benchFile = fopen(argv[1], "r"); 118 | if (benchFile == NULL) { 119 | cout << "ERROR: Cannot read file " << argv[1] << " for input" << endl; 120 | return 1; 121 | } 122 | yyin=benchFile; 123 | yyparse(); 124 | fclose(benchFile); 125 | 126 | myCircuit->setupCircuit(); 127 | cout << endl; 128 | 129 | // Setup the output text file 130 | ofstream outputStream; 131 | outputStream.open(argv[2]); 132 | if (!outputStream.is_open()) { 133 | cout << "ERROR: Cannot open file " << argv[2] << " for output" << endl; 134 | return 1; 135 | } 136 | 137 | // Open the fault file. 138 | ifstream faultStream; 139 | string faultLocStr; 140 | faultStream.open(argv[3]); 141 | if (!faultStream.is_open()) { 142 | cout << "ERROR: Cannot open fault file " << argv[3] << " for input" << endl; 143 | return 1; 144 | } 145 | 146 | 147 | // For each line in our fault file... 148 | while(getline(faultStream, faultLocStr)) { 149 | 150 | // Clear the old fault 151 | myCircuit->clearFaults(); 152 | 153 | string faultTypeStr; 154 | 155 | if (!(getline(faultStream, faultTypeStr))) { 156 | break; 157 | } 158 | 159 | char faultType = atoi(faultTypeStr.c_str()); 160 | 161 | // set up the fault we are trying to detect 162 | faultLocation = myCircuit->findGateByName(faultLocStr); 163 | faultLocation->set_faultType(faultType); 164 | faultActivationVal = (faultType == FAULT_SA0) ? LOGIC_ONE : LOGIC_ZERO; 165 | 166 | // set all gate values to X 167 | for (int i=0; i < myCircuit->getNumberGates(); i++) { 168 | myCircuit->getGate(i)->setValue(LOGIC_X); 169 | } 170 | 171 | // initialize the D frontier. 172 | dFrontier.clear(); 173 | 174 | // call PODEM recursion function 175 | bool res = podemRecursion(myCircuit); 176 | 177 | // If we succeed, print the test we found to the output file. 178 | if (res == true) { 179 | vector piGates = myCircuit->getPIGates(); 180 | for (int i=0; i < piGates.size(); i++) 181 | outputStream << printPIValue(piGates[i]->getValue()); 182 | outputStream << endl; 183 | } 184 | 185 | // If we failed to find a test, print a message to the output file 186 | else { 187 | outputStream << "none found" << endl; 188 | } 189 | 190 | // Lastly, you can use this to test that your PODEM-generated test 191 | // correctly detects the already-set fault. 192 | // Of course, this assumes that your simulation code is correct. 193 | 194 | // Don't use this code when you are evaluating the runtime of your 195 | // ATPG system because it will add extra time. 196 | if (res == true) { 197 | if (!checkTest(myCircuit)) { 198 | cout << "ERROR: PODEM returned true, but generated test does not detect fault on PO." << endl; 199 | myCircuit->printAllGates(); 200 | assert(false); 201 | } 202 | } 203 | 204 | // Just printing to screen to let you monitor progress 205 | cout << "Fault = " << faultLocation->get_outputName() << " / " << (int)(faultType) << ";"; 206 | if (res == true) 207 | cout << " test found" << endl; 208 | else 209 | cout << " no test found" << endl; 210 | 211 | } 212 | 213 | faultStream.close(); 214 | 215 | // close the output and fault streams 216 | outputStream.close(); 217 | 218 | 219 | return 0; 220 | } 221 | 222 | 223 | ///////////////////////////////////////////////////////////////////// 224 | // Functions in this section are helper functions. 225 | // You should not need to change these, except if you want 226 | // to enable the checkTest function (which will use your simulator 227 | // to attempt to check the test vector computed by PODEM.) 228 | 229 | 230 | /** @brief Print usage information (if user provides incorrect input). 231 | * 232 | * You don't need to touch this. 233 | */ 234 | void printUsage() { 235 | cout << "Usage: ./atpg [bench_file] [output_loc] [fault_file]" << endl << endl; 236 | cout << " bench_file: the target circuit in .bench format" << endl; 237 | cout << " output_loc: location for output file" << endl; 238 | cout << " fault_file: faults to be considered" << endl; 239 | cout << endl; 240 | cout << " The system will generate a test pattern for each fault listed" << endl; 241 | cout << " in fault_file and store the result in output_loc." << endl; 242 | cout << endl; 243 | } 244 | 245 | 246 | // You don't need to touch this. 247 | /** @brief Used to parse in the values from the input file. 248 | * 249 | * You don't need to touch this. 250 | */ 251 | vector constructInputLine(string line) { 252 | 253 | vector inputVals; 254 | 255 | for (int i=0; i poGates = myCircuit->getPOGates(); 299 | for (int i=0; igetValue(); 301 | if ((v == LOGIC_D) || (v == LOGIC_DBAR)) { 302 | return true; 303 | } 304 | } 305 | 306 | // If we didn't find D or D' on any PO, then our test was not successful. 307 | return false; 308 | 309 | } 310 | 311 | 312 | 313 | /** @brief Prints a PI value. 314 | * 315 | * This is just a helper function used when storing the final test you computed. 316 | * You don't need to run or modify this. 317 | */ 318 | string printPIValue(char v) { 319 | switch(v) { 320 | case LOGIC_ZERO: return "0"; 321 | case LOGIC_ONE: return "1"; 322 | case LOGIC_UNSET: return "U"; 323 | case LOGIC_X: return "X"; 324 | case LOGIC_D: return "1"; 325 | case LOGIC_DBAR: return "0"; 326 | } 327 | return ""; 328 | } 329 | 330 | // end of helper functions 331 | ////////////////////////////////////////////////////////////////////// 332 | 333 | ////////////////////////////////////////////////////////////////////// 334 | // Start of functions for circuit simulation. 335 | 336 | 337 | 338 | /** @brief Runs full circuit simulation 339 | * 340 | * Full-circuit simulation: set all non-PI gates to LOGIC_UNSET 341 | * and call the recursive simulate function on all PO gates. 342 | * Don't change this function unless you want to use your Project 2 code. 343 | */ 344 | void simFullCircuit(Circuit* myCircuit) { 345 | for (int i=0; igetNumberGates(); i++) { 346 | Gate* g = myCircuit->getGate(i); 347 | if (g->get_gateType() != GATE_PI) 348 | g->setValue(LOGIC_UNSET); 349 | } 350 | vector circuitPOs = myCircuit->getPOGates(); 351 | for (int i=0; i < circuitPOs.size(); i++) { 352 | simGateRecursive(circuitPOs[i]); 353 | } 354 | } 355 | 356 | 357 | 358 | // Recursive function to find and set the value on Gate* g. 359 | // This function calls simGate and setValueCheckFault. 360 | // Don't change this function. 361 | /** @brief Recursive function to find and set the value on Gate* g. 362 | * \param g The gate to simulate. 363 | * This function prepares Gate* g to to be simulated by recursing 364 | * on its inputs (if needed). 365 | * 366 | * Then it calls \a simGate(g) to calculate the new value. 367 | * 368 | * Lastly, it will set the Gate's output value based on 369 | * the calculated value. 370 | * 371 | * \note Do not change this function. 372 | */ 373 | void simGateRecursive(Gate* g) { 374 | 375 | // If this gate has an already-set value, you are done. 376 | if (g->getValue() != LOGIC_UNSET) 377 | return; 378 | 379 | // Recursively call this function on this gate's predecessors to 380 | // ensure that their values are known. 381 | vector pred = g->get_gateInputs(); 382 | for (int i=0; i 400 | * indicating the remaining gates that need to be evaluated. 401 | */ 402 | void eventDrivenSim(Circuit* myCircuit, queue q) { 403 | 404 | // Basic idea: 405 | // - Keep a queue (input q) of gates whose output values may potentially change 406 | // - while there are still gates in the queue: 407 | // - Pop a gate from this queue. Store its currently-set output value. 408 | // - Based on the gate's inputs, calculate its new output value. Note that you don't 409 | // need to do this from scratch, you can use the simGate() function below. 410 | // - Check to see if the new gate output value differs from the old one. If it does 411 | // add its fanout gates on the queue 412 | 413 | } 414 | 415 | 416 | 417 | /** @brief Simulate the value of the given Gate. 418 | * 419 | * This is a gate simulation function -- it will simulate the gate g 420 | * with its current input values and return the output value. 421 | * This function does not deal with the fault. (That comes later.) 422 | * \note You do not need to change this function. 423 | * 424 | */ 425 | char simGate(Gate* g) { 426 | // For convenience, create a vector of the values of this 427 | // gate's inputs. 428 | vector pred = g->get_gateInputs(); 429 | vector inputVals; 430 | for (int i=0; igetValue()); 432 | } 433 | 434 | char gateType = g->get_gateType(); 435 | char gateValue; 436 | // Now, set the value of this gate based on its logical function and its input values 437 | switch(gateType) { 438 | case GATE_NAND: { gateValue = evalGate(inputVals, 0, 1); break; } 439 | case GATE_NOR: { gateValue = evalGate(inputVals, 1, 1); break; } 440 | case GATE_AND: { gateValue = evalGate(inputVals, 0, 0); break; } 441 | case GATE_OR: { gateValue = evalGate(inputVals, 1, 0); break; } 442 | case GATE_BUFF: { gateValue = inputVals[0]; break; } 443 | case GATE_NOT: { gateValue = LogicNot(inputVals[0]); break; } 444 | case GATE_XOR: { gateValue = EvalXORGate(inputVals, 0); break; } 445 | case GATE_XNOR: { gateValue = EvalXORGate(inputVals, 1); break; } 446 | case GATE_FANOUT: {gateValue = inputVals[0]; break; } 447 | default: { cout << "ERROR: Do not know how to evaluate gate type " << gateType << endl; assert(false);} 448 | } 449 | 450 | return gateValue; 451 | } 452 | 453 | 454 | /** @brief Evaluate a NAND, NOR, AND, or OR gate. 455 | * \param in The logic value's of this gate's inputs. 456 | * \param c The controlling value of this gate type (e.g. c==0 for an AND or NAND gate) 457 | * \param i The inverting value for this gate (e.g. i==0 for AND and i==1 for NAND) 458 | * \returns The logical value produced by this gate (not including a possible fault on this gate). 459 | * \note You do not need to change this function. 460 | */ 461 | char evalGate(vector in, int c, int i) { 462 | 463 | // Are any of the inputs of this gate the controlling value? 464 | bool anyC = find(in.begin(), in.end(), c) != in.end(); 465 | 466 | // Are any of the inputs of this gate unknown? 467 | bool anyUnknown = (find(in.begin(), in.end(), LOGIC_X) != in.end()); 468 | 469 | int anyD = find(in.begin(), in.end(), LOGIC_D) != in.end(); 470 | int anyDBar = find(in.begin(), in.end(), LOGIC_DBAR) != in.end(); 471 | 472 | 473 | // if any input is c or we have both D and D', then return c^i 474 | if ((anyC) || (anyD && anyDBar)) 475 | return (i) ? LogicNot(c) : c; 476 | 477 | // else if any input is unknown, return unknown 478 | else if (anyUnknown) 479 | return LOGIC_X; 480 | 481 | // else if any input is D, return D^i 482 | else if (anyD) 483 | return (i) ? LOGIC_DBAR : LOGIC_D; 484 | 485 | // else if any input is D', return D'^i 486 | else if (anyDBar) 487 | return (i) ? LOGIC_D : LOGIC_DBAR; 488 | 489 | // else return ~(c^i) 490 | else 491 | return LogicNot((i) ? LogicNot(c) : c); 492 | } 493 | 494 | /** @brief Evaluate an XOR or XNOR gate. 495 | * \param in The logic value's of this gate's inputs. 496 | * \param inv The inverting value for this gate (e.g. i==0 for XOR and i==1 for XNOR) 497 | * \returns The logical value produced by this gate (not including a possible fault on this gate). 498 | * \note You do not need to change this function. 499 | */ 500 | char EvalXORGate(vector in, int inv) { 501 | 502 | // if any unknowns, return unknown 503 | bool anyUnknown = (find(in.begin(), in.end(), LOGIC_X) != in.end()); 504 | if (anyUnknown) 505 | return LOGIC_X; 506 | 507 | // Otherwise, let's count the numbers of ones and zeros for faulty and fault-free circuits. 508 | // This is not required for your project, but this will with with XOR and XNOR with > 2 inputs. 509 | int onesFaultFree = 0; 510 | int onesFaulty = 0; 511 | 512 | for (int i=0; iget_faultType() == FAULT_SA0) && (gateValue == LOGIC_ONE)) 562 | g->setValue(LOGIC_D); 563 | else if ((g->get_faultType() == FAULT_SA0) && (gateValue == LOGIC_DBAR)) 564 | g->setValue(LOGIC_ZERO); 565 | else if ((g->get_faultType() == FAULT_SA1) && (gateValue == LOGIC_ZERO)) 566 | g->setValue(LOGIC_DBAR); 567 | else if ((g->get_faultType() == FAULT_SA1) && (gateValue == LOGIC_D)) 568 | g->setValue(LOGIC_ONE); 569 | else 570 | g->setValue(gateValue); 571 | } 572 | 573 | // End of functions for circuit simulation 574 | //////////////////////////////////////////////////////////// 575 | 576 | 577 | ///////////////////////////////////////////////////////// 578 | // Begin functions for PODEM. 579 | 580 | // TODO 581 | /** @brief PODEM recursion. 582 | * 583 | * \note For Part 1, you must write this, following the pseudocode in class and in the code's comments. 584 | */ 585 | bool podemRecursion(Circuit* myCircuit) { 586 | 587 | // If D or D' is at an output, then return true 588 | 589 | // Gate* g; 590 | // char v; 591 | 592 | // Call the getObjective function. Store the result in g and v. 593 | // If getObjective fails, return false 594 | 595 | //Gate* pi; 596 | //char piVal; 597 | 598 | // Call the backtrace function. Store the result in pi and piVal. 599 | 600 | // Set the value of pi to piVal. Use your setValueCheckFault function (see above) 601 | // to make sure if there is a fault on the PI gate, it correctly gets set. 602 | 603 | // Now, determine the implications of the input you set by simulating 604 | // the circuit by calling simFullCircuit(myCircuit); 605 | // Important: after you write the event-driven simulator for part 2, replace 606 | // this call to simFullCircuit with a call to launch your event-driven 607 | // simulator. 608 | 609 | // Recursively call this function. If the recursive function succeeds 610 | // return true. 611 | 612 | // If the recursive call fails, set the opposite PI value, simulate, it and recurse. 613 | // If this recursive call succeeds, return true. 614 | 615 | // If we get to here, neither pi=v nor pi = v' worked. So, set pi to value X and 616 | // return false. 617 | 618 | return false; 619 | 620 | } 621 | 622 | // Find the objective for myCircuit. The objective is stored in g, v. 623 | // 624 | // TODO Write this function, based on the pseudocode from 625 | // class or your textbook. 626 | /** @brief PODEM objective function. 627 | * \param g Use this pointer to store the objective Gate your function picks. 628 | * \param v Use this char to store the objective value your function picks. 629 | * \returns True if the function is able to determine an objective, and false if it fails. 630 | * \note For Part 2, you must write this, following the pseudocode in class and the code's comments. 631 | */ 632 | 633 | bool getObjective(Gate* &g, char &v, Circuit* myCircuit) { 634 | 635 | // First you will need to check if the fault is activated yet. 636 | // Note that in the setup above we set up a global variable 637 | // Gate* faultLocation which represents the gate with the stuck-at 638 | // fault on its output. Use that when you check if the fault is 639 | // excited. 640 | 641 | // Another note: if the fault is not excited but the fault 642 | // location value is not X, then we have failed to activate 643 | // the fault. In this case getObjective should fail and Return false. 644 | 645 | 646 | // If the fault is already activated, then you will need to 647 | // use the D-frontier to find an objective. 648 | // Before you use the D-frontier you should update it by running: 649 | 650 | updateDFrontier(myCircuit); 651 | 652 | // This function should update the global D-frontier variable 653 | // vector dFrontier; 654 | 655 | // If the D frontier is empty after update, then getObjective fails 656 | // and should return false. 657 | 658 | // getObjective needs to choose a gate from the D-Frontier. 659 | // For part 1, pick dFrontier[0] if you want to match my reference outputs. 660 | 661 | // Later, a possible optimization is to use the 662 | // SCOAP observability metric or other smart methods to choose this carefully. 663 | 664 | 665 | // Lastly, set the values of g and v based on the 666 | // gate you chose from the D-Frontier. 667 | 668 | return true; 669 | 670 | } 671 | 672 | 673 | // A very simple method to update the D frontier. 674 | // TODO: Write this code based on the pseudocode below. 675 | /** @brief A simple method to compute the set of gates on the D frontier. 676 | * 677 | * \note For Part 1, you must write this. The simplest form follows the pseudocode included in the comments. 678 | */ 679 | 680 | void updateDFrontier(Circuit* myCircuit) { 681 | // Procedure: 682 | // - clear the dFrontier vector (stored as the global variable dFrontier -- see the top of the file) 683 | // - loop over all gates in the circuit; for each gate, check if it should be on D-frontier; if it is, 684 | // add it to the dFrontier vector. 685 | 686 | } 687 | 688 | 689 | // Backtrace: given objective objGate and objVal, then figure out which input (pi) to set 690 | // and which value (piVal) to set it to. 691 | // TODO: write this 692 | 693 | /** @brief PODEM backtrace function 694 | * \param pi Output: A Gate pointer to the primary input your backtrace function found. 695 | * \param piVal Output: The value you want to set that primary input to 696 | * \param objGate Input: The objective Gate (computed by getObjective) 697 | * \param objVal Input: the objective value (computed by getObjective) 698 | * \note Write this function based on the psuedocode from class. 699 | */ 700 | void backtrace(Gate* &pi, char &piVal, Gate* objGate, char objVal, Circuit* myCircuit) { 701 | 702 | } 703 | 704 | 705 | //////////////////////////////////////////////////////////////////////////// 706 | // Place any new functions you add here, between these two bars. 707 | 708 | 709 | 710 | //////////////////////////////////////////////////////////////////////////// 711 | 712 | 713 | -------------------------------------------------------------------------------- /Gate and Circuit class/parse_bench.l: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | #include 4 | #include 5 | using namespace std; 6 | #define YY_DECL extern "C" int yylex() 7 | 8 | #include "parse_bench.tab.h" // to get the token types that we return 9 | 10 | %} 11 | %% 12 | "#"[^\n]*\n ; 13 | NAND return NAND; 14 | nand return NAND; 15 | NOR return NOR; 16 | nor return NOR; 17 | AND return AND; 18 | and return AND; 19 | OR return OR; 20 | or return OR; 21 | XOR return XOR; 22 | xor return XOR; 23 | XNOR return XNOR; 24 | xnor return XNOR; 25 | DFF return DFF; 26 | dff return DFF; 27 | BUFF return BUFF; 28 | buff return BUFF; 29 | NOT return NOT; 30 | not return NOT; 31 | INPUT return INPUT; 32 | input return INPUT; 33 | OUTPUT return OUTPUT; 34 | output return OUTPUT; 35 | \( return LPAREN; 36 | \) return RPAREN; 37 | [\n] ; 38 | [ \t\n] ; 39 | = { return EQUALS;} 40 | , return COMMA; 41 | [a-zA-Z0-9._]+ { yylval.s=strdup(yytext); return IDENTIFIER;} 42 | %% 43 | -------------------------------------------------------------------------------- /Gate and Circuit class/parse_bench.y: -------------------------------------------------------------------------------- 1 | %{ 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "parse_bench.tab.h" 9 | #include "ClassCircuit.h" 10 | #include "ClassGate.h" 11 | 12 | using namespace std; 13 | 14 | Circuit* myCircuit = new Circuit; 15 | 16 | int gate_index=0, gate_ID_val=0; 17 | string temp, temp1; 18 | int i=0; 19 | 20 | // stuff from flex that bison needs to know about: 21 | extern "C" int yylex(); 22 | extern "C" int yyparse(); 23 | 24 | void yyerror(const char *str) { fprintf(stderr,"error: %s\n", str); } 25 | int yywrap() { return 1; } 26 | 27 | void process(string); 28 | 29 | %} 30 | 31 | %token INPUT OUTPUT LPAREN RPAREN EQUALS COMMA 32 | %token NOR AND OR XOR XNOR BUFF NOT DFF NAND 33 | 34 | %union 35 | { 36 | int gatetype; 37 | char *s; 38 | } 39 | 40 | %token IDENTIFIER; 41 | %type id_list; 42 | %type GATE; 43 | %% 44 | 45 | lines: /* empty */ 46 | | lines line 47 | ; 48 | 49 | line: 50 | input_line | output_line | assign_line; 51 | 52 | input_line: 53 | INPUT LPAREN IDENTIFIER RPAREN { 54 | 55 | myCircuit->newGate($3, gate_ID_val, GATE_PI); 56 | gate_ID_val=gate_ID_val+1; 57 | gate_index=gate_index+1; 58 | }; 59 | 60 | output_line: 61 | OUTPUT LPAREN IDENTIFIER RPAREN { 62 | myCircuit->addOutputName($3); 63 | }; 64 | 65 | assign_line: 66 | IDENTIFIER EQUALS GATE LPAREN id_list RPAREN { 67 | int gateID = gate_ID_val; 68 | int gateType = $3; 69 | string assign_out=$1; 70 | 71 | myCircuit->newGate($1, gateID, gateType); 72 | process(temp); 73 | gate_index=gate_index+1; 74 | gate_ID_val=gate_ID_val+1; 75 | temp=""; 76 | }; 77 | 78 | id_list: IDENTIFIER { 79 | temp=temp.append($1); 80 | temp=temp.append(","); 81 | } 82 | | IDENTIFIER COMMA id_list 83 | { 84 | temp1=temp; 85 | temp=""; 86 | temp=temp.append($1); 87 | temp=temp.append(","); 88 | temp.append(temp1); 89 | }; 90 | 91 | GATE: 92 | NAND {$$=GATE_NAND; } 93 | | NOR {$$=GATE_NOR; } 94 | | AND {$$=GATE_AND; } 95 | | OR {$$=GATE_OR; } 96 | | XOR {$$=GATE_XOR; } 97 | | XNOR {$$=GATE_XNOR; } 98 | // | DFF {$$=GATE_DFF; } 99 | | BUFF {$$=GATE_BUFF; } 100 | | NOT {$$=GATE_NOT; } 101 | ; 102 | %% 103 | 104 | void process(string id_list) { 105 | string input; 106 | input = id_list; 107 | 108 | string temp_string=""; 109 | 110 | for(int i=0; i> temp; 116 | temp_string=temp_string.append(temp); 117 | } 118 | else if(input[i]==',') { 119 | myCircuit->getGate(gate_index)->set_gateInputName(temp_string); 120 | temp_string.clear(); 121 | } 122 | } 123 | } 124 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/c17.bench: -------------------------------------------------------------------------------- 1 | # c17 2 | # 5 inputs 3 | # 2 outputs 4 | # 0 inverter 5 | # 6 gates ( 6 NANDs ) 6 | 7 | INPUT(1) 8 | INPUT(2) 9 | INPUT(3) 10 | INPUT(6) 11 | INPUT(7) 12 | 13 | OUTPUT(22) 14 | OUTPUT(23) 15 | 16 | 10 = NAND(1, 3) 17 | 11 = NAND(3, 6) 18 | 16 = NAND(2, 11) 19 | 19 = NAND(11, 7) 20 | 22 = NAND(10, 16) 21 | 23 = NAND(16, 19) 22 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/c17.fault: -------------------------------------------------------------------------------- 1 | 1 2 | 0 3 | 1 4 | 1 5 | 2 6 | 0 7 | 2 8 | 1 9 | 3 10 | 0 11 | 3 12 | 1 13 | 6 14 | 0 15 | 6 16 | 1 17 | 7 18 | 0 19 | 7 20 | 1 21 | 10 22 | 0 23 | 10 24 | 1 25 | 11 26 | 0 27 | 11 28 | 1 29 | 16 30 | 0 31 | 16 32 | 1 33 | 19 34 | 0 35 | 19 36 | 1 37 | 22 38 | 0 39 | 22 40 | 1 41 | 23 42 | 0 43 | 23 44 | 1 45 | 3_0 46 | 0 47 | 3_0 48 | 1 49 | 3_1 50 | 0 51 | 3_1 52 | 1 53 | 11_0 54 | 0 55 | 11_0 56 | 1 57 | 11_1 58 | 0 59 | 11_1 60 | 1 61 | 16_0 62 | 0 63 | 16_0 64 | 1 65 | 16_1 66 | 0 67 | 16_1 68 | 1 69 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/c17.refout: -------------------------------------------------------------------------------- 1 | 101XX 2 | 001XX 3 | X10XX 4 | X00XX 5 | 11111 6 | 11011 7 | X1111 8 | X1101 9 | X00X1 10 | X00X0 11 | 00XXX 12 | 101XX 13 | X10XX 14 | X1111 15 | 00XXX 16 | X10XX 17 | XX11X 18 | X00X1 19 | 1X1XX 20 | 00XXX 21 | X10XX 22 | X011X 23 | 101XX 24 | 100XX 25 | X1111 26 | X101X 27 | X10XX 28 | X111X 29 | X00X1 30 | XX111 31 | 00XXX 32 | X10XX 33 | X011X 34 | X10X0 35 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/c432.bench: -------------------------------------------------------------------------------- 1 | # c432 2 | # 36 inputs 3 | # 7 outputs 4 | # 40 inverters 5 | # 120 gates ( 4 ANDs + 119 NANDs + 19 NORs + 18 XORs ) 6 | 7 | INPUT(1) 8 | INPUT(4) 9 | INPUT(8) 10 | INPUT(11) 11 | INPUT(14) 12 | INPUT(17) 13 | INPUT(21) 14 | INPUT(24) 15 | INPUT(27) 16 | INPUT(30) 17 | INPUT(34) 18 | INPUT(37) 19 | INPUT(40) 20 | INPUT(43) 21 | INPUT(47) 22 | INPUT(50) 23 | INPUT(53) 24 | INPUT(56) 25 | INPUT(60) 26 | INPUT(63) 27 | INPUT(66) 28 | INPUT(69) 29 | INPUT(73) 30 | INPUT(76) 31 | INPUT(79) 32 | INPUT(82) 33 | INPUT(86) 34 | INPUT(89) 35 | INPUT(92) 36 | INPUT(95) 37 | INPUT(99) 38 | INPUT(102) 39 | INPUT(105) 40 | INPUT(108) 41 | INPUT(112) 42 | INPUT(115) 43 | 44 | OUTPUT(223) 45 | OUTPUT(329) 46 | OUTPUT(370) 47 | OUTPUT(421) 48 | OUTPUT(430) 49 | OUTPUT(431) 50 | OUTPUT(432) 51 | 52 | 118 = NOT(1) 53 | 119 = NOT(4) 54 | 122 = NOT(11) 55 | 123 = NOT(17) 56 | 126 = NOT(24) 57 | 127 = NOT(30) 58 | 130 = NOT(37) 59 | 131 = NOT(43) 60 | 134 = NOT(50) 61 | 135 = NOT(56) 62 | 138 = NOT(63) 63 | 139 = NOT(69) 64 | 142 = NOT(76) 65 | 143 = NOT(82) 66 | 146 = NOT(89) 67 | 147 = NOT(95) 68 | 150 = NOT(102) 69 | 151 = NOT(108) 70 | 154 = NAND(118, 4) 71 | 157 = NOR(8, 119) 72 | 158 = NOR(14, 119) 73 | 159 = NAND(122, 17) 74 | 162 = NAND(126, 30) 75 | 165 = NAND(130, 43) 76 | 168 = NAND(134, 56) 77 | 171 = NAND(138, 69) 78 | 174 = NAND(142, 82) 79 | 177 = NAND(146, 95) 80 | 180 = NAND(150, 108) 81 | 183 = NOR(21, 123) 82 | 184 = NOR(27, 123) 83 | 185 = NOR(34, 127) 84 | 186 = NOR(40, 127) 85 | 187 = NOR(47, 131) 86 | 188 = NOR(53, 131) 87 | 189 = NOR(60, 135) 88 | 190 = NOR(66, 135) 89 | 191 = NOR(73, 139) 90 | 192 = NOR(79, 139) 91 | 193 = NOR(86, 143) 92 | 194 = NOR(92, 143) 93 | 195 = NOR(99, 147) 94 | 196 = NOR(105, 147) 95 | 197 = NOR(112, 151) 96 | 198 = NOR(115, 151) 97 | 199 = AND(154, 159, 162, 165, 168, 171, 174, 177, 180) 98 | 203 = NOT(199) 99 | 213 = NOT(199) 100 | 223 = NOT(199) 101 | 224 = XOR(203, 154) 102 | 227 = XOR(203, 159) 103 | 230 = XOR(203, 162) 104 | 233 = XOR(203, 165) 105 | 236 = XOR(203, 168) 106 | 239 = XOR(203, 171) 107 | 242 = NAND(1, 213) 108 | 243 = XOR(203, 174) 109 | 246 = NAND(213, 11) 110 | 247 = XOR(203, 177) 111 | 250 = NAND(213, 24) 112 | 251 = XOR(203, 180) 113 | 254 = NAND(213, 37) 114 | 255 = NAND(213, 50) 115 | 256 = NAND(213, 63) 116 | 257 = NAND(213, 76) 117 | 258 = NAND(213, 89) 118 | 259 = NAND(213, 102) 119 | 260 = NAND(224, 157) 120 | 263 = NAND(224, 158) 121 | 264 = NAND(227, 183) 122 | 267 = NAND(230, 185) 123 | 270 = NAND(233, 187) 124 | 273 = NAND(236, 189) 125 | 276 = NAND(239, 191) 126 | 279 = NAND(243, 193) 127 | 282 = NAND(247, 195) 128 | 285 = NAND(251, 197) 129 | 288 = NAND(227, 184) 130 | 289 = NAND(230, 186) 131 | 290 = NAND(233, 188) 132 | 291 = NAND(236, 190) 133 | 292 = NAND(239, 192) 134 | 293 = NAND(243, 194) 135 | 294 = NAND(247, 196) 136 | 295 = NAND(251, 198) 137 | 296 = AND(260, 264, 267, 270, 273, 276, 279, 282, 285) 138 | 300 = NOT(263) 139 | 301 = NOT(288) 140 | 302 = NOT(289) 141 | 303 = NOT(290) 142 | 304 = NOT(291) 143 | 305 = NOT(292) 144 | 306 = NOT(293) 145 | 307 = NOT(294) 146 | 308 = NOT(295) 147 | 309 = NOT(296) 148 | 319 = NOT(296) 149 | 329 = NOT(296) 150 | 330 = XOR(309, 260) 151 | 331 = XOR(309, 264) 152 | 332 = XOR(309, 267) 153 | 333 = XOR(309, 270) 154 | 334 = NAND(8, 319) 155 | 335 = XOR(309, 273) 156 | 336 = NAND(319, 21) 157 | 337 = XOR(309, 276) 158 | 338 = NAND(319, 34) 159 | 339 = XOR(309, 279) 160 | 340 = NAND(319, 47) 161 | 341 = XOR(309, 282) 162 | 342 = NAND(319, 60) 163 | 343 = XOR(309, 285) 164 | 344 = NAND(319, 73) 165 | 345 = NAND(319, 86) 166 | 346 = NAND(319, 99) 167 | 347 = NAND(319, 112) 168 | 348 = NAND(330, 300) 169 | 349 = NAND(331, 301) 170 | 350 = NAND(332, 302) 171 | 351 = NAND(333, 303) 172 | 352 = NAND(335, 304) 173 | 353 = NAND(337, 305) 174 | 354 = NAND(339, 306) 175 | 355 = NAND(341, 307) 176 | 356 = NAND(343, 308) 177 | 357 = AND(348, 349, 350, 351, 352, 353, 354, 355, 356) 178 | 360 = NOT(357) 179 | 370 = NOT(357) 180 | 371 = NAND(14, 360) 181 | 372 = NAND(360, 27) 182 | 373 = NAND(360, 40) 183 | 374 = NAND(360, 53) 184 | 375 = NAND(360, 66) 185 | 376 = NAND(360, 79) 186 | 377 = NAND(360, 92) 187 | 378 = NAND(360, 105) 188 | 379 = NAND(360, 115) 189 | 380 = NAND(4, 242, 334, 371) 190 | 381 = NAND(246, 336, 372, 17) 191 | 386 = NAND(250, 338, 373, 30) 192 | 393 = NAND(254, 340, 374, 43) 193 | 399 = NAND(255, 342, 375, 56) 194 | 404 = NAND(256, 344, 376, 69) 195 | 407 = NAND(257, 345, 377, 82) 196 | 411 = NAND(258, 346, 378, 95) 197 | 414 = NAND(259, 347, 379, 108) 198 | 415 = NOT(380) 199 | 416 = AND(381, 386, 393, 399, 404, 407, 411, 414) 200 | 417 = NOT(393) 201 | 418 = NOT(404) 202 | 419 = NOT(407) 203 | 420 = NOT(411) 204 | 421 = NOR(415, 416) 205 | 422 = NAND(386, 417) 206 | 425 = NAND(386, 393, 418, 399) 207 | 428 = NAND(399, 393, 419) 208 | 429 = NAND(386, 393, 407, 420) 209 | 430 = NAND(381, 386, 422, 399) 210 | 431 = NAND(381, 386, 425, 428) 211 | 432 = NAND(381, 422, 425, 429) 212 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/c432.bigfault: -------------------------------------------------------------------------------- 1 | 1 2 | 0 3 | 1 4 | 1 5 | 4 6 | 0 7 | 4 8 | 1 9 | 8 10 | 0 11 | 8 12 | 1 13 | 11 14 | 0 15 | 11 16 | 1 17 | 14 18 | 0 19 | 14 20 | 1 21 | 17 22 | 0 23 | 17 24 | 1 25 | 21 26 | 0 27 | 21 28 | 1 29 | 24 30 | 0 31 | 24 32 | 1 33 | 27 34 | 0 35 | 27 36 | 1 37 | 30 38 | 0 39 | 30 40 | 1 41 | 34 42 | 0 43 | 34 44 | 1 45 | 37 46 | 0 47 | 37 48 | 1 49 | 40 50 | 0 51 | 40 52 | 1 53 | 43 54 | 0 55 | 43 56 | 1 57 | 47 58 | 0 59 | 47 60 | 1 61 | 50 62 | 0 63 | 50 64 | 1 65 | 53 66 | 0 67 | 53 68 | 1 69 | 56 70 | 0 71 | 56 72 | 1 73 | 60 74 | 0 75 | 60 76 | 1 77 | 63 78 | 0 79 | 63 80 | 1 81 | 66 82 | 0 83 | 66 84 | 1 85 | 69 86 | 0 87 | 69 88 | 1 89 | 73 90 | 0 91 | 73 92 | 1 93 | 76 94 | 0 95 | 76 96 | 1 97 | 79 98 | 0 99 | 79 100 | 1 101 | 82 102 | 0 103 | 82 104 | 1 105 | 86 106 | 0 107 | 86 108 | 1 109 | 89 110 | 0 111 | 89 112 | 1 113 | 92 114 | 0 115 | 92 116 | 1 117 | 95 118 | 0 119 | 95 120 | 1 121 | 99 122 | 0 123 | 99 124 | 1 125 | 102 126 | 0 127 | 102 128 | 1 129 | 105 130 | 0 131 | 105 132 | 1 133 | 108 134 | 0 135 | 108 136 | 1 137 | 112 138 | 0 139 | 112 140 | 1 141 | 115 142 | 0 143 | 115 144 | 1 145 | 118 146 | 0 147 | 118 148 | 1 149 | 119 150 | 0 151 | 119 152 | 1 153 | 122 154 | 0 155 | 122 156 | 1 157 | 123 158 | 0 159 | 123 160 | 1 161 | 126 162 | 0 163 | 126 164 | 1 165 | 127 166 | 0 167 | 127 168 | 1 169 | 130 170 | 0 171 | 130 172 | 1 173 | 131 174 | 0 175 | 131 176 | 1 177 | 134 178 | 0 179 | 134 180 | 1 181 | 135 182 | 0 183 | 135 184 | 1 185 | 138 186 | 0 187 | 138 188 | 1 189 | 139 190 | 0 191 | 139 192 | 1 193 | 142 194 | 0 195 | 142 196 | 1 197 | 143 198 | 0 199 | 143 200 | 1 201 | 146 202 | 0 203 | 146 204 | 1 205 | 147 206 | 0 207 | 147 208 | 1 209 | 150 210 | 0 211 | 150 212 | 1 213 | 151 214 | 0 215 | 151 216 | 1 217 | 154 218 | 0 219 | 154 220 | 1 221 | 157 222 | 0 223 | 157 224 | 1 225 | 158 226 | 0 227 | 158 228 | 1 229 | 159 230 | 0 231 | 159 232 | 1 233 | 162 234 | 0 235 | 162 236 | 1 237 | 165 238 | 0 239 | 165 240 | 1 241 | 168 242 | 0 243 | 168 244 | 1 245 | 171 246 | 0 247 | 171 248 | 1 249 | 174 250 | 0 251 | 174 252 | 1 253 | 177 254 | 0 255 | 177 256 | 1 257 | 180 258 | 0 259 | 180 260 | 1 261 | 183 262 | 0 263 | 183 264 | 1 265 | 184 266 | 0 267 | 184 268 | 1 269 | 185 270 | 0 271 | 185 272 | 1 273 | 186 274 | 0 275 | 186 276 | 1 277 | 187 278 | 0 279 | 187 280 | 1 281 | 188 282 | 0 283 | 188 284 | 1 285 | 189 286 | 0 287 | 189 288 | 1 289 | 190 290 | 0 291 | 190 292 | 1 293 | 191 294 | 0 295 | 191 296 | 1 297 | 192 298 | 0 299 | 192 300 | 1 301 | 193 302 | 0 303 | 193 304 | 1 305 | 194 306 | 0 307 | 194 308 | 1 309 | 195 310 | 0 311 | 195 312 | 1 313 | 196 314 | 0 315 | 196 316 | 1 317 | 197 318 | 0 319 | 197 320 | 1 321 | 198 322 | 0 323 | 198 324 | 1 325 | 199 326 | 0 327 | 199 328 | 1 329 | 203 330 | 0 331 | 203 332 | 1 333 | 213 334 | 0 335 | 213 336 | 1 337 | 223 338 | 0 339 | 223 340 | 1 341 | 224 342 | 0 343 | 224 344 | 1 345 | 227 346 | 0 347 | 227 348 | 1 349 | 230 350 | 0 351 | 230 352 | 1 353 | 233 354 | 0 355 | 233 356 | 1 357 | 236 358 | 0 359 | 236 360 | 1 361 | 239 362 | 0 363 | 239 364 | 1 365 | 242 366 | 0 367 | 242 368 | 1 369 | 243 370 | 0 371 | 243 372 | 1 373 | 246 374 | 0 375 | 246 376 | 1 377 | 247 378 | 0 379 | 247 380 | 1 381 | 250 382 | 0 383 | 250 384 | 1 385 | 251 386 | 0 387 | 251 388 | 1 389 | 254 390 | 0 391 | 254 392 | 1 393 | 255 394 | 0 395 | 255 396 | 1 397 | 256 398 | 0 399 | 256 400 | 1 401 | 257 402 | 0 403 | 257 404 | 1 405 | 258 406 | 0 407 | 258 408 | 1 409 | 259 410 | 0 411 | 259 412 | 1 413 | 260 414 | 0 415 | 260 416 | 1 417 | 263 418 | 0 419 | 263 420 | 1 421 | 264 422 | 0 423 | 264 424 | 1 425 | 267 426 | 0 427 | 267 428 | 1 429 | 270 430 | 0 431 | 270 432 | 1 433 | 273 434 | 0 435 | 273 436 | 1 437 | 276 438 | 0 439 | 276 440 | 1 441 | 279 442 | 0 443 | 279 444 | 1 445 | 282 446 | 0 447 | 282 448 | 1 449 | 285 450 | 0 451 | 285 452 | 1 453 | 288 454 | 0 455 | 288 456 | 1 457 | 289 458 | 0 459 | 289 460 | 1 461 | 290 462 | 0 463 | 290 464 | 1 465 | 291 466 | 0 467 | 291 468 | 1 469 | 292 470 | 0 471 | 292 472 | 1 473 | 293 474 | 0 475 | 293 476 | 1 477 | 294 478 | 0 479 | 294 480 | 1 481 | 295 482 | 0 483 | 295 484 | 1 485 | 296 486 | 0 487 | 296 488 | 1 489 | 300 490 | 0 491 | 300 492 | 1 493 | 301 494 | 0 495 | 301 496 | 1 497 | 302 498 | 0 499 | 302 500 | 1 501 | 303 502 | 0 503 | 303 504 | 1 505 | 304 506 | 0 507 | 304 508 | 1 509 | 305 510 | 0 511 | 305 512 | 1 513 | 306 514 | 0 515 | 306 516 | 1 517 | 307 518 | 0 519 | 307 520 | 1 521 | 308 522 | 0 523 | 308 524 | 1 525 | 309 526 | 0 527 | 309 528 | 1 529 | 319 530 | 0 531 | 319 532 | 1 533 | 329 534 | 0 535 | 329 536 | 1 537 | 330 538 | 0 539 | 330 540 | 1 541 | 331 542 | 0 543 | 331 544 | 1 545 | 332 546 | 0 547 | 332 548 | 1 549 | 333 550 | 0 551 | 333 552 | 1 553 | 334 554 | 0 555 | 334 556 | 1 557 | 335 558 | 0 559 | 335 560 | 1 561 | 336 562 | 0 563 | 336 564 | 1 565 | 337 566 | 0 567 | 337 568 | 1 569 | 338 570 | 0 571 | 338 572 | 1 573 | 339 574 | 0 575 | 339 576 | 1 577 | 340 578 | 0 579 | 340 580 | 1 581 | 341 582 | 0 583 | 341 584 | 1 585 | 342 586 | 0 587 | 342 588 | 1 589 | 343 590 | 0 591 | 343 592 | 1 593 | 344 594 | 0 595 | 344 596 | 1 597 | 345 598 | 0 599 | 345 600 | 1 601 | 346 602 | 0 603 | 346 604 | 1 605 | 347 606 | 0 607 | 347 608 | 1 609 | 348 610 | 0 611 | 348 612 | 1 613 | 349 614 | 0 615 | 349 616 | 1 617 | 350 618 | 0 619 | 350 620 | 1 621 | 351 622 | 0 623 | 351 624 | 1 625 | 352 626 | 0 627 | 352 628 | 1 629 | 353 630 | 0 631 | 353 632 | 1 633 | 354 634 | 0 635 | 354 636 | 1 637 | 355 638 | 0 639 | 355 640 | 1 641 | 356 642 | 0 643 | 356 644 | 1 645 | 357 646 | 0 647 | 357 648 | 1 649 | 360 650 | 0 651 | 360 652 | 1 653 | 370 654 | 0 655 | 370 656 | 1 657 | 371 658 | 0 659 | 371 660 | 1 661 | 372 662 | 0 663 | 372 664 | 1 665 | 373 666 | 0 667 | 373 668 | 1 669 | 374 670 | 0 671 | 374 672 | 1 673 | 375 674 | 0 675 | 375 676 | 1 677 | 376 678 | 0 679 | 376 680 | 1 681 | 377 682 | 0 683 | 377 684 | 1 685 | 378 686 | 0 687 | 378 688 | 1 689 | 379 690 | 0 691 | 379 692 | 1 693 | 380 694 | 0 695 | 380 696 | 1 697 | 381 698 | 0 699 | 381 700 | 1 701 | 386 702 | 0 703 | 386 704 | 1 705 | 393 706 | 0 707 | 393 708 | 1 709 | 399 710 | 0 711 | 399 712 | 1 713 | 404 714 | 0 715 | 404 716 | 1 717 | 407 718 | 0 719 | 407 720 | 1 721 | 411 722 | 0 723 | 411 724 | 1 725 | 414 726 | 0 727 | 414 728 | 1 729 | 415 730 | 0 731 | 415 732 | 1 733 | 416 734 | 0 735 | 416 736 | 1 737 | 417 738 | 0 739 | 417 740 | 1 741 | 418 742 | 0 743 | 418 744 | 1 745 | 419 746 | 0 747 | 419 748 | 1 749 | 420 750 | 0 751 | 420 752 | 1 753 | 421 754 | 0 755 | 421 756 | 1 757 | 422 758 | 0 759 | 422 760 | 1 761 | 425 762 | 0 763 | 425 764 | 1 765 | 428 766 | 0 767 | 428 768 | 1 769 | 429 770 | 0 771 | 429 772 | 1 773 | 430 774 | 0 775 | 430 776 | 1 777 | 431 778 | 0 779 | 431 780 | 1 781 | 432 782 | 0 783 | 432 784 | 1 785 | 1_0 786 | 0 787 | 1_0 788 | 1 789 | 1_1 790 | 0 791 | 1_1 792 | 1 793 | 4_0 794 | 0 795 | 4_0 796 | 1 797 | 4_1 798 | 0 799 | 4_1 800 | 1 801 | 4_2 802 | 0 803 | 4_2 804 | 1 805 | 8_0 806 | 0 807 | 8_0 808 | 1 809 | 8_1 810 | 0 811 | 8_1 812 | 1 813 | 11_0 814 | 0 815 | 11_0 816 | 1 817 | 11_1 818 | 0 819 | 11_1 820 | 1 821 | 14_0 822 | 0 823 | 14_0 824 | 1 825 | 14_1 826 | 0 827 | 14_1 828 | 1 829 | 17_0 830 | 0 831 | 17_0 832 | 1 833 | 17_1 834 | 0 835 | 17_1 836 | 1 837 | 17_2 838 | 0 839 | 17_2 840 | 1 841 | 21_0 842 | 0 843 | 21_0 844 | 1 845 | 21_1 846 | 0 847 | 21_1 848 | 1 849 | 24_0 850 | 0 851 | 24_0 852 | 1 853 | 24_1 854 | 0 855 | 24_1 856 | 1 857 | 27_0 858 | 0 859 | 27_0 860 | 1 861 | 27_1 862 | 0 863 | 27_1 864 | 1 865 | 30_0 866 | 0 867 | 30_0 868 | 1 869 | 30_1 870 | 0 871 | 30_1 872 | 1 873 | 30_2 874 | 0 875 | 30_2 876 | 1 877 | 34_0 878 | 0 879 | 34_0 880 | 1 881 | 34_1 882 | 0 883 | 34_1 884 | 1 885 | 37_0 886 | 0 887 | 37_0 888 | 1 889 | 37_1 890 | 0 891 | 37_1 892 | 1 893 | 40_0 894 | 0 895 | 40_0 896 | 1 897 | 40_1 898 | 0 899 | 40_1 900 | 1 901 | 43_0 902 | 0 903 | 43_0 904 | 1 905 | 43_1 906 | 0 907 | 43_1 908 | 1 909 | 43_2 910 | 0 911 | 43_2 912 | 1 913 | 47_0 914 | 0 915 | 47_0 916 | 1 917 | 47_1 918 | 0 919 | 47_1 920 | 1 921 | 50_0 922 | 0 923 | 50_0 924 | 1 925 | 50_1 926 | 0 927 | 50_1 928 | 1 929 | 53_0 930 | 0 931 | 53_0 932 | 1 933 | 53_1 934 | 0 935 | 53_1 936 | 1 937 | 56_0 938 | 0 939 | 56_0 940 | 1 941 | 56_1 942 | 0 943 | 56_1 944 | 1 945 | 56_2 946 | 0 947 | 56_2 948 | 1 949 | 60_0 950 | 0 951 | 60_0 952 | 1 953 | 60_1 954 | 0 955 | 60_1 956 | 1 957 | 63_0 958 | 0 959 | 63_0 960 | 1 961 | 63_1 962 | 0 963 | 63_1 964 | 1 965 | 66_0 966 | 0 967 | 66_0 968 | 1 969 | 66_1 970 | 0 971 | 66_1 972 | 1 973 | 69_0 974 | 0 975 | 69_0 976 | 1 977 | 69_1 978 | 0 979 | 69_1 980 | 1 981 | 69_2 982 | 0 983 | 69_2 984 | 1 985 | 73_0 986 | 0 987 | 73_0 988 | 1 989 | 73_1 990 | 0 991 | 73_1 992 | 1 993 | 76_0 994 | 0 995 | 76_0 996 | 1 997 | 76_1 998 | 0 999 | 76_1 1000 | 1 1001 | 79_0 1002 | 0 1003 | 79_0 1004 | 1 1005 | 79_1 1006 | 0 1007 | 79_1 1008 | 1 1009 | 82_0 1010 | 0 1011 | 82_0 1012 | 1 1013 | 82_1 1014 | 0 1015 | 82_1 1016 | 1 1017 | 82_2 1018 | 0 1019 | 82_2 1020 | 1 1021 | 86_0 1022 | 0 1023 | 86_0 1024 | 1 1025 | 86_1 1026 | 0 1027 | 86_1 1028 | 1 1029 | 89_0 1030 | 0 1031 | 89_0 1032 | 1 1033 | 89_1 1034 | 0 1035 | 89_1 1036 | 1 1037 | 92_0 1038 | 0 1039 | 92_0 1040 | 1 1041 | 92_1 1042 | 0 1043 | 92_1 1044 | 1 1045 | 95_0 1046 | 0 1047 | 95_0 1048 | 1 1049 | 95_1 1050 | 0 1051 | 95_1 1052 | 1 1053 | 95_2 1054 | 0 1055 | 95_2 1056 | 1 1057 | 99_0 1058 | 0 1059 | 99_0 1060 | 1 1061 | 99_1 1062 | 0 1063 | 99_1 1064 | 1 1065 | 102_0 1066 | 0 1067 | 102_0 1068 | 1 1069 | 102_1 1070 | 0 1071 | 102_1 1072 | 1 1073 | 105_0 1074 | 0 1075 | 105_0 1076 | 1 1077 | 105_1 1078 | 0 1079 | 105_1 1080 | 1 1081 | 108_0 1082 | 0 1083 | 108_0 1084 | 1 1085 | 108_1 1086 | 0 1087 | 108_1 1088 | 1 1089 | 108_2 1090 | 0 1091 | 108_2 1092 | 1 1093 | 112_0 1094 | 0 1095 | 112_0 1096 | 1 1097 | 112_1 1098 | 0 1099 | 112_1 1100 | 1 1101 | 115_0 1102 | 0 1103 | 115_0 1104 | 1 1105 | 115_1 1106 | 0 1107 | 115_1 1108 | 1 1109 | 119_0 1110 | 0 1111 | 119_0 1112 | 1 1113 | 119_1 1114 | 0 1115 | 119_1 1116 | 1 1117 | 123_0 1118 | 0 1119 | 123_0 1120 | 1 1121 | 123_1 1122 | 0 1123 | 123_1 1124 | 1 1125 | 127_0 1126 | 0 1127 | 127_0 1128 | 1 1129 | 127_1 1130 | 0 1131 | 127_1 1132 | 1 1133 | 131_0 1134 | 0 1135 | 131_0 1136 | 1 1137 | 131_1 1138 | 0 1139 | 131_1 1140 | 1 1141 | 135_0 1142 | 0 1143 | 135_0 1144 | 1 1145 | 135_1 1146 | 0 1147 | 135_1 1148 | 1 1149 | 139_0 1150 | 0 1151 | 139_0 1152 | 1 1153 | 139_1 1154 | 0 1155 | 139_1 1156 | 1 1157 | 143_0 1158 | 0 1159 | 143_0 1160 | 1 1161 | 143_1 1162 | 0 1163 | 143_1 1164 | 1 1165 | 147_0 1166 | 0 1167 | 147_0 1168 | 1 1169 | 147_1 1170 | 0 1171 | 147_1 1172 | 1 1173 | 151_0 1174 | 0 1175 | 151_0 1176 | 1 1177 | 151_1 1178 | 0 1179 | 151_1 1180 | 1 1181 | 154_0 1182 | 0 1183 | 154_0 1184 | 1 1185 | 154_1 1186 | 0 1187 | 154_1 1188 | 1 1189 | 159_0 1190 | 0 1191 | 159_0 1192 | 1 1193 | 159_1 1194 | 0 1195 | 159_1 1196 | 1 1197 | 162_0 1198 | 0 1199 | 162_0 1200 | 1 1201 | 162_1 1202 | 0 1203 | 162_1 1204 | 1 1205 | 165_0 1206 | 0 1207 | 165_0 1208 | 1 1209 | 165_1 1210 | 0 1211 | 165_1 1212 | 1 1213 | 168_0 1214 | 0 1215 | 168_0 1216 | 1 1217 | 168_1 1218 | 0 1219 | 168_1 1220 | 1 1221 | 171_0 1222 | 0 1223 | 171_0 1224 | 1 1225 | 171_1 1226 | 0 1227 | 171_1 1228 | 1 1229 | 174_0 1230 | 0 1231 | 174_0 1232 | 1 1233 | 174_1 1234 | 0 1235 | 174_1 1236 | 1 1237 | 177_0 1238 | 0 1239 | 177_0 1240 | 1 1241 | 177_1 1242 | 0 1243 | 177_1 1244 | 1 1245 | 180_0 1246 | 0 1247 | 180_0 1248 | 1 1249 | 180_1 1250 | 0 1251 | 180_1 1252 | 1 1253 | 199_0 1254 | 0 1255 | 199_0 1256 | 1 1257 | 199_1 1258 | 0 1259 | 199_1 1260 | 1 1261 | 199_2 1262 | 0 1263 | 199_2 1264 | 1 1265 | 203_0 1266 | 0 1267 | 203_0 1268 | 1 1269 | 203_1 1270 | 0 1271 | 203_1 1272 | 1 1273 | 203_2 1274 | 0 1275 | 203_2 1276 | 1 1277 | 203_3 1278 | 0 1279 | 203_3 1280 | 1 1281 | 203_4 1282 | 0 1283 | 203_4 1284 | 1 1285 | 203_5 1286 | 0 1287 | 203_5 1288 | 1 1289 | 203_6 1290 | 0 1291 | 203_6 1292 | 1 1293 | 203_7 1294 | 0 1295 | 203_7 1296 | 1 1297 | 203_8 1298 | 0 1299 | 203_8 1300 | 1 1301 | 213_0 1302 | 0 1303 | 213_0 1304 | 1 1305 | 213_1 1306 | 0 1307 | 213_1 1308 | 1 1309 | 213_2 1310 | 0 1311 | 213_2 1312 | 1 1313 | 213_3 1314 | 0 1315 | 213_3 1316 | 1 1317 | 213_4 1318 | 0 1319 | 213_4 1320 | 1 1321 | 213_5 1322 | 0 1323 | 213_5 1324 | 1 1325 | 213_6 1326 | 0 1327 | 213_6 1328 | 1 1329 | 213_7 1330 | 0 1331 | 213_7 1332 | 1 1333 | 213_8 1334 | 0 1335 | 213_8 1336 | 1 1337 | 224_0 1338 | 0 1339 | 224_0 1340 | 1 1341 | 224_1 1342 | 0 1343 | 224_1 1344 | 1 1345 | 227_0 1346 | 0 1347 | 227_0 1348 | 1 1349 | 227_1 1350 | 0 1351 | 227_1 1352 | 1 1353 | 230_0 1354 | 0 1355 | 230_0 1356 | 1 1357 | 230_1 1358 | 0 1359 | 230_1 1360 | 1 1361 | 233_0 1362 | 0 1363 | 233_0 1364 | 1 1365 | 233_1 1366 | 0 1367 | 233_1 1368 | 1 1369 | 236_0 1370 | 0 1371 | 236_0 1372 | 1 1373 | 236_1 1374 | 0 1375 | 236_1 1376 | 1 1377 | 239_0 1378 | 0 1379 | 239_0 1380 | 1 1381 | 239_1 1382 | 0 1383 | 239_1 1384 | 1 1385 | 243_0 1386 | 0 1387 | 243_0 1388 | 1 1389 | 243_1 1390 | 0 1391 | 243_1 1392 | 1 1393 | 247_0 1394 | 0 1395 | 247_0 1396 | 1 1397 | 247_1 1398 | 0 1399 | 247_1 1400 | 1 1401 | 251_0 1402 | 0 1403 | 251_0 1404 | 1 1405 | 251_1 1406 | 0 1407 | 251_1 1408 | 1 1409 | 260_0 1410 | 0 1411 | 260_0 1412 | 1 1413 | 260_1 1414 | 0 1415 | 260_1 1416 | 1 1417 | 264_0 1418 | 0 1419 | 264_0 1420 | 1 1421 | 264_1 1422 | 0 1423 | 264_1 1424 | 1 1425 | 267_0 1426 | 0 1427 | 267_0 1428 | 1 1429 | 267_1 1430 | 0 1431 | 267_1 1432 | 1 1433 | 270_0 1434 | 0 1435 | 270_0 1436 | 1 1437 | 270_1 1438 | 0 1439 | 270_1 1440 | 1 1441 | 273_0 1442 | 0 1443 | 273_0 1444 | 1 1445 | 273_1 1446 | 0 1447 | 273_1 1448 | 1 1449 | 276_0 1450 | 0 1451 | 276_0 1452 | 1 1453 | 276_1 1454 | 0 1455 | 276_1 1456 | 1 1457 | 279_0 1458 | 0 1459 | 279_0 1460 | 1 1461 | 279_1 1462 | 0 1463 | 279_1 1464 | 1 1465 | 282_0 1466 | 0 1467 | 282_0 1468 | 1 1469 | 282_1 1470 | 0 1471 | 282_1 1472 | 1 1473 | 285_0 1474 | 0 1475 | 285_0 1476 | 1 1477 | 285_1 1478 | 0 1479 | 285_1 1480 | 1 1481 | 296_0 1482 | 0 1483 | 296_0 1484 | 1 1485 | 296_1 1486 | 0 1487 | 296_1 1488 | 1 1489 | 296_2 1490 | 0 1491 | 296_2 1492 | 1 1493 | 309_0 1494 | 0 1495 | 309_0 1496 | 1 1497 | 309_1 1498 | 0 1499 | 309_1 1500 | 1 1501 | 309_2 1502 | 0 1503 | 309_2 1504 | 1 1505 | 309_3 1506 | 0 1507 | 309_3 1508 | 1 1509 | 309_4 1510 | 0 1511 | 309_4 1512 | 1 1513 | 309_5 1514 | 0 1515 | 309_5 1516 | 1 1517 | 309_6 1518 | 0 1519 | 309_6 1520 | 1 1521 | 309_7 1522 | 0 1523 | 309_7 1524 | 1 1525 | 309_8 1526 | 0 1527 | 309_8 1528 | 1 1529 | 319_0 1530 | 0 1531 | 319_0 1532 | 1 1533 | 319_1 1534 | 0 1535 | 319_1 1536 | 1 1537 | 319_2 1538 | 0 1539 | 319_2 1540 | 1 1541 | 319_3 1542 | 0 1543 | 319_3 1544 | 1 1545 | 319_4 1546 | 0 1547 | 319_4 1548 | 1 1549 | 319_5 1550 | 0 1551 | 319_5 1552 | 1 1553 | 319_6 1554 | 0 1555 | 319_6 1556 | 1 1557 | 319_7 1558 | 0 1559 | 319_7 1560 | 1 1561 | 319_8 1562 | 0 1563 | 319_8 1564 | 1 1565 | 357_0 1566 | 0 1567 | 357_0 1568 | 1 1569 | 357_1 1570 | 0 1571 | 357_1 1572 | 1 1573 | 360_0 1574 | 0 1575 | 360_0 1576 | 1 1577 | 360_1 1578 | 0 1579 | 360_1 1580 | 1 1581 | 360_2 1582 | 0 1583 | 360_2 1584 | 1 1585 | 360_3 1586 | 0 1587 | 360_3 1588 | 1 1589 | 360_4 1590 | 0 1591 | 360_4 1592 | 1 1593 | 360_5 1594 | 0 1595 | 360_5 1596 | 1 1597 | 360_6 1598 | 0 1599 | 360_6 1600 | 1 1601 | 360_7 1602 | 0 1603 | 360_7 1604 | 1 1605 | 360_8 1606 | 0 1607 | 360_8 1608 | 1 1609 | 381_0 1610 | 0 1611 | 381_0 1612 | 1 1613 | 381_1 1614 | 0 1615 | 381_1 1616 | 1 1617 | 381_2 1618 | 0 1619 | 381_2 1620 | 1 1621 | 381_3 1622 | 0 1623 | 381_3 1624 | 1 1625 | 386_0 1626 | 0 1627 | 386_0 1628 | 1 1629 | 386_1 1630 | 0 1631 | 386_1 1632 | 1 1633 | 386_2 1634 | 0 1635 | 386_2 1636 | 1 1637 | 386_3 1638 | 0 1639 | 386_3 1640 | 1 1641 | 386_4 1642 | 0 1643 | 386_4 1644 | 1 1645 | 386_5 1646 | 0 1647 | 386_5 1648 | 1 1649 | 393_0 1650 | 0 1651 | 393_0 1652 | 1 1653 | 393_1 1654 | 0 1655 | 393_1 1656 | 1 1657 | 393_2 1658 | 0 1659 | 393_2 1660 | 1 1661 | 393_3 1662 | 0 1663 | 393_3 1664 | 1 1665 | 393_4 1666 | 0 1667 | 393_4 1668 | 1 1669 | 399_0 1670 | 0 1671 | 399_0 1672 | 1 1673 | 399_1 1674 | 0 1675 | 399_1 1676 | 1 1677 | 399_2 1678 | 0 1679 | 399_2 1680 | 1 1681 | 399_3 1682 | 0 1683 | 399_3 1684 | 1 1685 | 404_0 1686 | 0 1687 | 404_0 1688 | 1 1689 | 404_1 1690 | 0 1691 | 404_1 1692 | 1 1693 | 407_0 1694 | 0 1695 | 407_0 1696 | 1 1697 | 407_1 1698 | 0 1699 | 407_1 1700 | 1 1701 | 407_2 1702 | 0 1703 | 407_2 1704 | 1 1705 | 411_0 1706 | 0 1707 | 411_0 1708 | 1 1709 | 411_1 1710 | 0 1711 | 411_1 1712 | 1 1713 | 422_0 1714 | 0 1715 | 422_0 1716 | 1 1717 | 422_1 1718 | 0 1719 | 422_1 1720 | 1 1721 | 425_0 1722 | 0 1723 | 425_0 1724 | 1 1725 | 425_1 1726 | 0 1727 | 425_1 1728 | 1 1729 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/c432.bigrefout: -------------------------------------------------------------------------------- 1 | 11X1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 2 | 01X1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 3 | 01010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 4 | 00010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 5 | 0110X110X110X110X110X110X110X110X11X 6 | 0100X110X110X110X110X110X110X110X11X 7 | 1XX1X1X1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 8 | 1XX0X1X1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 9 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 10 | 01010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 11 | 1XX0X1010XX1XXX1XXX1XXX1XXX1XXX1XXXX 12 | 1XX0X0010XX1XXX1XXX1XXX1XXX1XXX1XXXX 13 | 0110X110X110X110X110X110X110X110X11X 14 | 0110X100X110X110X110X110X110X110X11X 15 | 1XX1XXX1X1X1XXX1XXX1XXX1XXX1XXX1XXXX 16 | 1XX1XXX0X1X1XXX1XXX1XXX1XXX1XXX1XXXX 17 | 010011011XX1XXX1XXX1XXX1XXX1XXX1XXXX 18 | 010011010XX1XXX1XXX1XXX1XXX1XXX1XXXX 19 | 1XX1XXX0X1010XX1XXX1XXX1XXX1XXX1XXXX 20 | 1XX1XXX0X0010XX1XXX1XXX1XXX1XXX1XXXX 21 | 0110X110X110X110X110X110X110X110X11X 22 | 0110X110X100X110X110X110X110X110X11X 23 | 1XX1XXX1XXX1X1X1XXX1XXX1XXX1XXX1XXXX 24 | 1XX1XXX1XXX0X1X1XXX1XXX1XXX1XXX1XXXX 25 | 01011XX0X1011XX1XXX1XXX1XXX1XXX1XXXX 26 | 01011XX0X1010XX1XXX1XXX1XXX1XXX1XXXX 27 | 1XX1XXX1XXX0X1010XX1XXX1XXX1XXX1XXXX 28 | 1XX1XXX1XXX0X0010XX1XXX1XXX1XXX1XXXX 29 | 0110X110X110X110X110X110X110X110X11X 30 | 0110X110X110X100X110X110X110X110X11X 31 | 1XX1XXX1XXX1XXX1X1X1XXX1XXX1XXX1XXXX 32 | 1XX1XXX1XXX1XXX0X1X1XXX1XXX1XXX1XXXX 33 | 01011XX1XXX0X1011XX1XXX1XXX1XXX1XXXX 34 | 01011XX1XXX0X1010XX1XXX1XXX1XXX1XXXX 35 | 1XX1XXX1XXX1XXX0X1010XX1XXX1XXX1XXXX 36 | 1XX1XXX1XXX1XXX0X0010XX1XXX1XXX1XXXX 37 | 0110X110X110X110X110X110X110X110X11X 38 | 0110X110X110X110X100X110X110X110X11X 39 | 1XX1XXX1XXX1XXX1XXX1X1X1XXX1XXX1XXXX 40 | 1XX1XXX1XXX1XXX1XXX0X1X1XXX1XXX1XXXX 41 | 01011XX1XXX1XXX0X1011XX1XXX1XXX1XXXX 42 | 01011XX1XXX1XXX0X1010XX1XXX1XXX1XXXX 43 | 1XX1XXX1XXX1XXX1XXX0X1010XX1XXX1XXXX 44 | 1XX1XXX1XXX1XXX1XXX0X0010XX1XXX1XXXX 45 | 0110X110X110X110X110X110X110X110X11X 46 | 0110X110X110X110X110X100X110X110X11X 47 | 1XX1XXX1XXX1XXX1XXX1XXX1X1X1XXX1XXXX 48 | 1XX1XXX1XXX1XXX1XXX1XXX0X1X1XXX1XXXX 49 | 01011XX1XXX1XXX1XXX0X1011XX1XXX1XXXX 50 | 01011XX1XXX1XXX1XXX0X1010XX1XXX1XXXX 51 | 1XX1XXX1XXX1XXX1XXX1XXX0X1010XX1XXXX 52 | 1XX1XXX1XXX1XXX1XXX1XXX0X0010XX1XXXX 53 | 0110X110X110X110X110X110X110X110X11X 54 | 0110X110X110X110X110X110X100X110X11X 55 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1X1X1XXXX 56 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX0X1X1XXXX 57 | 01011XX1XXX1XXX1XXX1XXX0X1011XX1XXXX 58 | 01011XX1XXX1XXX1XXX1XXX0X1010XX1XXXX 59 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX0X1010XXX 60 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX0X0010XXX 61 | 0110X110X110X110X110X110X110X110X11X 62 | 0110X110X110X110X110X110X110X100X11X 63 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1X1XX 64 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX0X1XX 65 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1011XXX 66 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1010XXX 67 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX0X100 68 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX0X000 69 | 0110X110X110X110X110X110X110X110X11X 70 | 0110X110X110X110X110X110X110X110X10X 71 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X101 72 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X100 73 | 01X1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 74 | 11X1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 75 | X00000X0X0X0X0X0X0X0X0X0X0X0X0X0X0XX 76 | 01000110X110X110X110X110X110X110X11X 77 | 1XX0X1X1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 78 | 1XX1X1X1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 79 | 00XXX00000X0X0X0X0X0X0X0X0X0X0X0X0XX 80 | 0110X1000110X110X110X110X110X110X11X 81 | 1XX1XXX0X1X1XXX1XXX1XXX1XXX1XXX1XXXX 82 | 1XX1XXX1X1X1XXX1XXX1XXX1XXX1XXX1XXXX 83 | 00X0X0XXX00000X0X0X0X0X0X0X0X0X0X0XX 84 | 0110X110X1000110X110X110X110X110X11X 85 | 1XX1XXX1XXX0X1X1XXX1XXX1XXX1XXX1XXXX 86 | 1XX1XXX1XXX1X1X1XXX1XXX1XXX1XXX1XXXX 87 | 00X0X0X0X0XXX00000X0X0X0X0X0X0X0X0XX 88 | 0110X110X110X1000110X110X110X110X11X 89 | 1XX1XXX1XXX1XXX0X1X1XXX1XXX1XXX1XXXX 90 | 1XX1XXX1XXX1XXX1X1X1XXX1XXX1XXX1XXXX 91 | 00X0X0X0X0X0X0XXX00000X0X0X0X0X0X0XX 92 | 0110X110X110X110X1000110X110X110X11X 93 | 1XX1XXX1XXX1XXX1XXX0X1X1XXX1XXX1XXXX 94 | 1XX1XXX1XXX1XXX1XXX1X1X1XXX1XXX1XXXX 95 | 00X0X0X0X0X0X0X0X0XXX00000X0X0X0X0XX 96 | 0110X110X110X110X110X1000110X110X11X 97 | 1XX1XXX1XXX1XXX1XXX1XXX0X1X1XXX1XXXX 98 | 1XX1XXX1XXX1XXX1XXX1XXX1X1X1XXX1XXXX 99 | 00X0X0X0X0X0X0X0X0X0X0XXX00000X0X0XX 100 | 0110X110X110X110X110X110X1000110X11X 101 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX0X1X1XXXX 102 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1X1X1XXXX 103 | 00X0X0X0X0X0X0X0X0X0X0X0X0XXX00000XX 104 | 0110X110X110X110X110X110X110X100011X 105 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX0X1XX 106 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1X1XX 107 | 00X0X0X0X0X0X0X0X0X0X0X0X0X0X0XXX000 108 | 0110X110X110X110X110X110X110X110X100 109 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 110 | 01X1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 111 | 0100X110X110X110X110X110X110X110X11X 112 | 0110X110X110X110X110X110X110X110X11X 113 | 01010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 114 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 115 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 116 | 1XX0X1X1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 117 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 118 | 1XX1XXX0X1X1XXX1XXX1XXX1XXX1XXX1XXXX 119 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 120 | 1XX1XXX1XXX0X1X1XXX1XXX1XXX1XXX1XXXX 121 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 122 | 1XX1XXX1XXX1XXX0X1X1XXX1XXX1XXX1XXXX 123 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 124 | 1XX1XXX1XXX1XXX1XXX0X1X1XXX1XXX1XXXX 125 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 126 | 1XX1XXX1XXX1XXX1XXX1XXX0X1X1XXX1XXXX 127 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 128 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX0X1X1XXXX 129 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 130 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX0X1XX 131 | 0110X100X110X110X110X110X110X110X11X 132 | 0110X110X110X110X110X110X110X110X11X 133 | 010011010XX1XXX1XXX1XXX1XXX1XXX1XXXX 134 | 010011011XX1XXX1XXX1XXX1XXX1XXX1XXXX 135 | 0110X110X100X110X110X110X110X110X11X 136 | 0110X110X110X110X110X110X110X110X11X 137 | 01011XX0X1010XX1XXX1XXX1XXX1XXX1XXXX 138 | 01011XX0X1011XX1XXX1XXX1XXX1XXX1XXXX 139 | 0110X110X110X100X110X110X110X110X11X 140 | 0110X110X110X110X110X110X110X110X11X 141 | 01011XX1XXX0X1010XX1XXX1XXX1XXX1XXXX 142 | 01011XX1XXX0X1011XX1XXX1XXX1XXX1XXXX 143 | 0110X110X110X110X100X110X110X110X11X 144 | 0110X110X110X110X110X110X110X110X11X 145 | 01011XX1XXX1XXX0X1010XX1XXX1XXX1XXXX 146 | 01011XX1XXX1XXX0X1011XX1XXX1XXX1XXXX 147 | 0110X110X110X110X110X100X110X110X11X 148 | 0110X110X110X110X110X110X110X110X11X 149 | 01011XX1XXX1XXX1XXX0X1010XX1XXX1XXXX 150 | 01011XX1XXX1XXX1XXX0X1011XX1XXX1XXXX 151 | 0110X110X110X110X110X110X100X110X11X 152 | 0110X110X110X110X110X110X110X110X11X 153 | 01011XX1XXX1XXX1XXX1XXX0X1010XX1XXXX 154 | 01011XX1XXX1XXX1XXX1XXX0X1011XX1XXXX 155 | 0110X110X110X110X110X110X110X100X11X 156 | 0110X110X110X110X110X110X110X110X11X 157 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1010XXX 158 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1011XXX 159 | 0110X110X110X110X110X110X110X110X10X 160 | 0110X110X110X110X110X110X110X110X11X 161 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X100 162 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X101 163 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 164 | 01XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 165 | 01000100X100X100X100X100X100X100X10X 166 | 11010101X101X101X101X101X101X101X10X 167 | 011111X1X1X1X1X1X1X1XXX1XXX1XXX1XXXX 168 | 110101010101010101010XX1XXX1XXX1XXXX 169 | 01XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 170 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 171 | 01000110X110X110X110X110X110X110X11X 172 | 11010XX1XXX1XXX1XXX1XXX1XXX1XXX0X11X 173 | 0110X1000110X110X110X110X110X110X11X 174 | 1XX1X1010XX1XXX1XXX1XXX1XXX1XXX0X11X 175 | 0110X110X1000110X110X110X110X110X11X 176 | 1XX1XXX1X1010XX1XXX1XXX1XXX1XXX0X11X 177 | 0110X110X110X1000110X110X110X110X11X 178 | 1XX1XXX1XXX1X1010XX1XXX1XXX1XXX0X11X 179 | 0110X110X110X110X1000110X110X110X11X 180 | 1XX1XXX1XXX1XXX1X1010XX1XXX1XXX0X11X 181 | 0110X110X110X110X110X1000110X110X11X 182 | 1XX1XXX1XXX1XXX1XXX1X1010XX1XXX0X11X 183 | 0100010X0XXXXXXXXXXXXXXXXXXXXXXXXXXX 184 | 110001101110111011101110111011101111 185 | 0110X110X110X110X110X110X1000110X11X 186 | 1XX1XXX1XXX1XXX1XXX1XXX1X1010XX0X11X 187 | 1X1111111011101110111X111X111X111X11 188 | 011111X0X110111011101110111011101111 189 | 0110X110X110X110X110X110X110X100011X 190 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1X100011X 191 | 1X1110111111101110111X111X111X111X11 192 | 0110111111X0011011101110111011101110 193 | 0110X110X110X110X110X110X110X110X100 194 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX0X111X100 195 | 1X1110111011111110111X111X111X111X11 196 | 01101110111111X001101110111011101110 197 | 1X1110111011101111111X111X111X111X11 198 | 011011101110111111X00110111011101110 199 | 1X111011101110111011111110111X111X11 200 | 0110111011101110111111X0011011101110 201 | 1X111011101110111011101111111X111X11 202 | 01101110111011101110111111X001101110 203 | 1X1110111011101110111011101111111X11 204 | 011011101110111011101110111111X00110 205 | 101110111011101110111011101110111111 206 | none found 207 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 208 | 0100X110X110X110X110X110X110X110X11X 209 | 110111011101110111011101110111011101 210 | 01010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 211 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 212 | 0110X100X110X110X110X110X110X110X11X 213 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 214 | 0110X110X100X110X110X110X110X110X11X 215 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 216 | 0110X110X110X100X110X110X110X110X11X 217 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 218 | 0110X110X110X110X100X110X110X110X11X 219 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 220 | 0110X110X110X110X110X100X110X110X11X 221 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 222 | 0110X110X110X110X110X110X100X110X11X 223 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 224 | 0110X110X110X110X110X110X110X100X11X 225 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 226 | 0110X110X110X110X110X110X110X110X10X 227 | 110111011101110111011101110111011101 228 | 010011010XX1XXX1XXX1XXX1XXX1XXX1XXXX 229 | 110111011101110111011101110111011101 230 | 01011XX0X1010XX1XXX1XXX1XXX1XXX1XXXX 231 | 110111011101110111011101110111011101 232 | 01011XX1XXX0X1010XX1XXX1XXX1XXX1XXXX 233 | 110111011101110111011101110111011101 234 | 01011XX1XXX1XXX0X1010XX1XXX1XXX1XXXX 235 | 110111011101110111011101110111011101 236 | 01011XX1XXX1XXX1XXX0X1010XX1XXX1XXXX 237 | 110111011101110111011101110111011101 238 | 01011XX1XXX1XXX1XXX1XXX0X1010XX1XXXX 239 | 110111011101110111011101110111011101 240 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1010XXX 241 | 110111011101110111011101110111011101 242 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X100 243 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 244 | 010XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 245 | 01010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 246 | 110111011101110111011101110111011101 247 | 010011010XX1XXX1XXX1XXX1XXX1XXX1XXXX 248 | 110111011101110111011101110111011101 249 | 01011XX0X1010XX1XXX1XXX1XXX1XXX1XXXX 250 | 110111011101110111011101110111011101 251 | 01011XX1XXX0X1010XX1XXX1XXX1XXX1XXXX 252 | 110111011101110111011101110111011101 253 | 01011XX1XXX1XXX0X1010XX1XXX1XXX1XXXX 254 | 110111011101110111011101110111011101 255 | 01011XX1XXX1XXX1XXX0X1010XX1XXX1XXXX 256 | 110111011101110111011101110111011101 257 | 01011XX1XXX1XXX1XXX1XXX0X1010XX1XXXX 258 | 110111011101110111011101110111011101 259 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1010XXX 260 | 110111011101110111011101110111011101 261 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X100 262 | 110111011101110111011101110111011101 263 | 01010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 264 | 111101110111011101110111011101110110 265 | 01001110X110X110X11XXX1XXX1XXX1XXX1X 266 | 111101110111011101110X11XX11XX11XX1X 267 | 010XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 268 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 269 | 01010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 270 | 11110X11XX11XX11XX11XX11XX11XX11X101 271 | 010011010XX1XXX1XXX1XXX1XXX1XXX1XXXX 272 | 1X11X1110X11XX11XX11XX11XX11XX11X101 273 | 01011XX0X1010XX1XXX1XXX1XXX1XXX1XXXX 274 | 1X11XX11X1110X11XX11XX11XX11XX11X101 275 | 01011XX1XXX0X1010XX1XXX1XXX1XXX1XXXX 276 | 1X11XX11XX11X1110X11XX11XX11XX11X101 277 | 0100010X0XXXXXXXXXXXXXXXXXXXXXXXXXXX 278 | 01110XX1XXX1XXX1XXX1XXX1XXX1XXX0X101 279 | 01011XX1XXX1XXX0X1010XX1XXX1XXX1XXXX 280 | 1X11XX11XX11XX11X1110X11XX11XX11X101 281 | 1X1111111011101110111X111X111X111X11 282 | 01001111XXX1XXX1XXX1XXX1XXX1XXX1XXXX 283 | 01011XX1XXX1XXX1XXX0X1010XX1XXX1XXXX 284 | 1X11XX11XX11XX11XX11X1110X11XX11X101 285 | 1X1110111111101110111X111X111X111X11 286 | 01011XX0X111XXX1XXX1XXX1XXX1XXX1XXXX 287 | 01011XX1XXX1XXX1XXX1XXX0X1010XX1XXXX 288 | 1X11XX11XX11XX11XX11XX11X1110X11X101 289 | 1X1110111011111110111X111X111X111X11 290 | 01011XX1XXX0X111XXX1XXX1XXX1XXX1XXXX 291 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1010XXX 292 | 1X11XX11XX11XX11XX11XX11XX11X1110101 293 | 1X1110111011101111111X111X111X111X11 294 | 01011XX1XXX1XXX0X111XXX1XXX1XXX1XXXX 295 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X100 296 | 1X11XX11XX11XX11XX11XX11XX11X1011110 297 | 1X111011101110111011111110111X111X11 298 | 01011XX1XXX1XXX1XXX0X111XXX1XXX1XXXX 299 | 1X111011101110111011101111111X111X11 300 | 01011XX1XXX1XXX1XXX1XXX0X111XXX1XXXX 301 | 1X1110111011101110111011101111111X11 302 | 01011XX1XXX1XXX1XXX1XXX1XXX0X111XXXX 303 | 101110111011101110111011101110111111 304 | none found 305 | 1X111X111X111X111X111X111X111X111X11 306 | 01010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 307 | 1X111X111X111X111X111X111X111X111X11 308 | 010011010XX1XXX1XXX1XXX1XXX1XXX1XXXX 309 | 1X111X111X111X111X111X111X111X111X11 310 | 01011XX0X1010XX1XXX1XXX1XXX1XXX1XXXX 311 | 1X111X111X111X111X111X111X111X111X11 312 | 01011XX1XXX0X1010XX1XXX1XXX1XXX1XXXX 313 | 1X111X111X111X111X111X111X111X111X11 314 | 01011XX1XXX1XXX0X1010XX1XXX1XXX1XXXX 315 | 1X111X111X111X111X111X111X111X111X11 316 | 01011XX1XXX1XXX1XXX0X1010XX1XXX1XXXX 317 | 1X111X111X111X111X111X111X111X111X11 318 | 01011XX1XXX1XXX1XXX1XXX0X1010XX1XXXX 319 | 1X111X111X111X111X111X111X111X111X11 320 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1010XXX 321 | 1X111X111X111X111X111X111X111X111X11 322 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X100 323 | 1X111X111X111X111X111X111X111X111X11 324 | 010X0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 325 | 0100010011001100110X1XXX1XXX1XXX1XX1 326 | 111111111111111111111X111X111X111X11 327 | 010X0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 328 | 1X111X111X111X111X111X111X111X111X11 329 | 0100010X0XXXXXXXXXXXXXXXXXXXXXXXXXXX 330 | 01001110X110X110X110X110X110X110X100 331 | 1X1111111011101110111X111X111X111X11 332 | 010001011XX1XXX1XXXXXXXXXXXXXXXXXXXX 333 | 1X1110111111101110111X111X111X111X11 334 | 01010XX0X1011XX1XXXXXXXXXXXXXXXXXXXX 335 | 1X1110111011111110111X111X111X111X11 336 | 01010XX1XXX0X1011XXXXXXXXXXXXXXXXXXX 337 | 1X1110111011101111111X111X111X111X11 338 | 01010XX1XXX1XXX0X10X1XXXXXXXXXXXXXXX 339 | 1X111011101110111011111110111X111X11 340 | 01010XX1XXX1XXX1XXX0X1011XXXXXXXXXXX 341 | 1X111011101110111011101111111X111X11 342 | 01010XX1XXX1XXX1XXX1XXX0X10X1XXXXXXX 343 | 1X1110111011101110111011101111111X11 344 | 01010XX1XXX1XXX1XXX1XXX1XXX0X10X1XXX 345 | 101110111011101110111011101110111111 346 | none found 347 | X0X1X1111X111X111X111X111X111X111X11 348 | 0100010X0XXXXXXXXXXXXXXXXXXXXXXXXXXX 349 | 01X1XXX1XXX1XXX1XXXXXXXXXXXXXXXXXXXX 350 | 1X1111111011101110111X111X111X111X11 351 | 01X1XXX1XXX1XXX1XXXXXXXXXXXXXXXXXXXX 352 | 1X1110111111101110111X111X111X111X11 353 | 01X1XXX1XXX1XXX1XXXXXXXXXXXXXXXXXXXX 354 | 1X1110111011111110111X111X111X111X11 355 | 01X1XXX1XXX1XXX1XXXXXXXXXXXXXXXXXXXX 356 | 1X1110111011101111111X111X111X111X11 357 | 01X1XXX1XXX1XXX1XXX1XXX1XXXXXXXXXXXX 358 | 1X111011101110111011111110111X111X11 359 | 01X1XXX1XXX1XXX1XXX1XXX1XXXXXXXXXXXX 360 | 1X111011101110111011101111111X111X11 361 | 01X1XXX1XXX1XXX1XXX1XXX1XXX1XXXXXXXX 362 | 1X1110111011101110111011101111111X11 363 | 00X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0XX 364 | 101110111011101110111011101110111111 365 | 0100010X0XXXXXXXXXXXXXXXXXXXXXXXXXXX 366 | X0X1X1111X111X111X111X111X111X111X11 367 | 00X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0XX 368 | 101111111X111X111X111X111X111X111X11 369 | 1X111011101111111X111X111X111X111X11 370 | 01X1XXX1XXX1XXX1XXXXXXXXXXXXXXXXXXXX 371 | 1X111011101110111011111110111X111X11 372 | 01X1XXX1XXX1XXX1XXX1XXX1XXXXXXXXXXXX 373 | 1X111011101110111011101111111X111X11 374 | 01X1XXX1XXX1XXX1XXX1XXX1XXXXXXXXXXXX 375 | 1X111011101110111X111011101111111X11 376 | 01X1XXX1XXX1XXXXXXX1XXX1XXX1XXXXXXXX 377 | X0X1X1111X111X111X111X111X111X111X11 378 | 010X0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 379 | 1X11101111111X111X111X111X111X111X11 380 | 011011111XX0X1100110X110X110X110X11X 381 | 1X11101111111X111X111X111X111X111X11 382 | 011011111XX1XXX0X110111001101110X11X 383 | 1X11101110111X1111111X111X111X111X11 384 | 0110111011111XX1XXX0X11011100110X11X 385 | 1X11101111111X111X111X111X111X111X11 386 | 011011111XX1XXX0X11011111XX0X110011X 387 | 1X1111111X111X111X111X111X111X111X11 388 | 01X1XXX1XXX1XXX1XXXXXXXXXXXXXXXXXXXX 389 | 1X1111111X111X111X111X111X111X111X11 390 | 01111XX1XXX0X11011101110111011101111 391 | 1X1111111X111X111X111X111X111X111X11 392 | 01111XX0X110111011101110111011101111 393 | 11X1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 394 | 01X1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 395 | 110001101110111011101110111011101111 396 | 0100010X0XXXXXXXXXXXXXXXXXXXXXXXXXXX 397 | 01000110X110X110X110X110X110X110X11X 398 | X00000X0X0X0X0X0X0X0X0X0X0X0X0X0X0XX 399 | 01X1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 400 | 00X1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 401 | 0100010X0XXXXXXXXXXXXXXXXXXXXXXXXXXX 402 | 000101111X111X111X111X111X111X111X11 403 | 0110X110X110X110X110X110X110X110X11X 404 | 0100X110X110X110X110X110X110X110X11X 405 | 01110XX1XXX1XXX1XXX1XXX1XXX1XXX0X101 406 | 0100010X0XXXXXXXXXXXXXXXXXXXXXXXXXXX 407 | 1XX1X1X1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 408 | 1XX0X1X1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 409 | 011111X0X110111011101110111011101111 410 | 011011101110111011101110111011101111 411 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 412 | 01010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 413 | 01001110X110X110X110X110X110X110X100 414 | 0100010X0XXXXXXXXXXXXXXXXXXXXXXXXXXX 415 | 0110X1000110X110X110X110X110X110X11X 416 | 00XXX00000X0X0X0X0X0X0X0X0X0X0X0X0XX 417 | 1XX0X1X1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 418 | 1XX0X0X1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 419 | 1X1111111011101110111X111X111X111X11 420 | 1X1X10X1X011101110111X111X111X111X11 421 | 0110X110X110X110X110X110X110X110X11X 422 | 0110X100X110X110X110X110X110X110X11X 423 | 01001111XXX1XXX1XXX1XXX1XXX1XXX1XXXX 424 | 010011011XX1XXX1XXX1XXX1XXX1XXX1XXXX 425 | 1XX1XXX1X1X1XXX1XXX1XXX1XXX1XXX1XXXX 426 | 1XX1XXX0X1X1XXX1XXX1XXX1XXX1XXX1XXXX 427 | 0110111111X0011011101110111011101110 428 | 011011101110011011101110X110X110X11X 429 | 010011011XX1XXX1XXX1XXX1XXX1XXX1XXXX 430 | 010011010XX1XXX1XXX1XXX1XXX1XXX1XXXX 431 | 010001011XX1XXX1XXXXXXXXXXXXXXXXXXXX 432 | 010001010XX1XXX1XXXXXXXXXXXXXXXXXXXX 433 | 0110X110X1000110X110X110X110X110X11X 434 | 00X0X0XXX00000X0X0X0X0X0X0X0X0X0X0XX 435 | 1XX1XXX0X1X1XXX1XXX1XXX1XXX1XXX1XXXX 436 | 1XX1XXX0X0X1XXX1XXX1XXX1XXX1XXX1XXXX 437 | 1X1110111111101110111X111X111X111X11 438 | 1X11101X10X1X01110111X111X111X111X11 439 | 0110X110X110X110X110X110X110X110X11X 440 | 0110X110X100X110X110X110X110X110X11X 441 | 01011XX0X111XXX1XXX1XXX1XXX1XXX1XXXX 442 | 01011XX0X1011XX1XXX1XXX1XXX1XXX1XXXX 443 | 1XX1XXX1XXX1X1X1XXX1XXX1XXX1XXX1XXXX 444 | 1XX1XXX1XXX0X1X1XXX1XXX1XXX1XXX1XXXX 445 | 01101110111111X001101110111011101110 446 | 011011101110111001101110X110X110X11X 447 | 01011XX0X1011XX1XXX1XXX1XXX1XXX1XXXX 448 | 01011XX0X1010XX1XXX1XXX1XXX1XXX1XXXX 449 | 01010XX0X1011XX1XXXXXXXXXXXXXXXXXXXX 450 | 01010XX0X1010XX1XXXXXXXXXXXXXXXXXXXX 451 | 0110X110X110X1000110X110X110X110X11X 452 | 00X0X0X0X0XXX00000X0X0X0X0X0X0X0X0XX 453 | 1XX1XXX1XXX0X1X1XXX1XXX1XXX1XXX1XXXX 454 | 1XX1XXX1XXX0X0X1XXX1XXX1XXX1XXX1XXXX 455 | 1X1110111011111110111X111X111X111X11 456 | 1X111011101X10X1X0111X111X111X111X11 457 | 0110X110X110X110X110X110X110X110X11X 458 | 0110X110X110X100X110X110X110X110X11X 459 | 01011XX1XXX0X111XXX1XXX1XXX1XXX1XXXX 460 | 01011XX1XXX0X1011XX1XXX1XXX1XXX1XXXX 461 | 1XX1XXX1XXX1XXX1X1X1XXX1XXX1XXX1XXXX 462 | 1XX1XXX1XXX1XXX0X1X1XXX1XXX1XXX1XXXX 463 | 011011101110111111X00110111011101110 464 | 011011101110111011100110X110X110X11X 465 | 01011XX1XXX0X1011XX1XXX1XXX1XXX1XXXX 466 | 01011XX1XXX0X1010XX1XXX1XXX1XXX1XXXX 467 | 01010XX1XXX0X1011XXXXXXXXXXXXXXXXXXX 468 | 01010XX1XXX0X1010XXXXXXXXXXXXXXXXXXX 469 | 0110X110X110X110X1000110X110X110X11X 470 | 00X0X0X0X0X0X0XXX00000X0X0X0X0X0X0XX 471 | 1XX1XXX1XXX1XXX0X1X1XXX1XXX1XXX1XXXX 472 | 1XX1XXX1XXX1XXX0X0X1XXX1XXX1XXX1XXXX 473 | 1X1110111011101111111X111X111X111X11 474 | 1X1110111011101X10X1XX111X111X111X11 475 | 0110X110X110X110X110X110X110X110X11X 476 | 0110X110X110X110X100X110X110X110X11X 477 | 01011XX1XXX1XXX0X111XXX1XXX1XXX1XXXX 478 | 01011XX1XXX1XXX0X1011XX1XXX1XXX1XXXX 479 | 1XX1XXX1XXX1XXX1XXX1X1X1XXX1XXX1XXXX 480 | 1XX1XXX1XXX1XXX1XXX0X1X1XXX1XXX1XXXX 481 | 0110111011101110111111X0011011101110 482 | 01101110111011101110111001101110X11X 483 | 01011XX1XXX1XXX0X1011XX1XXX1XXX1XXXX 484 | 01011XX1XXX1XXX0X1010XX1XXX1XXX1XXXX 485 | 01010XX1XXX1XXX0X10X1XXXXXXXXXXXXXXX 486 | 01010XX1XXX1XXX0X10X0XXXXXXXXXXXXXXX 487 | 0110X110X110X110X110X1000110X110X11X 488 | 00X0X0X0X0X0X0X0X0XXX00000X0X0X0X0XX 489 | 1XX1XXX1XXX1XXX1XXX0X1X1XXX1XXX1XXXX 490 | 1XX1XXX1XXX1XXX1XXX0X0X1XXX1XXX1XXXX 491 | 1X111011101110111011111110111X111X11 492 | 1X11101110111011101X10X1X0111X111X11 493 | 0110X110X110X110X110X110X110X110X11X 494 | 0110X110X110X110X110X100X110X110X11X 495 | 01011XX1XXX1XXX1XXX0X111XXX1XXX1XXXX 496 | 01011XX1XXX1XXX1XXX0X1011XX1XXX1XXXX 497 | 1XX1XXX1XXX1XXX1XXX1XXX1X1X1XXX1XXXX 498 | 1XX1XXX1XXX1XXX1XXX1XXX0X1X1XXX1XXXX 499 | 01101110111011101110111111X001101110 500 | 01101110111011101110111011100110X11X 501 | 01011XX1XXX1XXX1XXX0X1011XX1XXX1XXXX 502 | 01011XX1XXX1XXX1XXX0X1010XX1XXX1XXXX 503 | 01010XX1XXX1XXX1XXX0X1011XXXXXXXXXXX 504 | 01010XX1XXX1XXX1XXX0X1010XXXXXXXXXXX 505 | 0110X110X110X110X110X110X1000110X11X 506 | 00X0X0X0X0X0X0X0X0X0X0XXX00000X0X0XX 507 | 1XX1XXX1XXX1XXX1XXX1XXX0X1X1XXX1XXXX 508 | 1XX1XXX1XXX1XXX1XXX1XXX0X0X1XXX1XXXX 509 | 1X111011101110111011101111111X111X11 510 | 1X111011101110111011101X10X1XX111X11 511 | 0110X110X110X110X110X110X110X110X11X 512 | 0110X110X110X110X110X110X100X110X11X 513 | 01011XX1XXX1XXX1XXX1XXX0X111XXX1XXXX 514 | 01011XX1XXX1XXX1XXX1XXX0X1011XX1XXXX 515 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1X1X1XXXX 516 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX0X1X1XXXX 517 | 011011101110111011101110111111X00110 518 | 01101110111011101110111011101110011X 519 | 01011XX1XXX1XXX1XXX1XXX0X1011XX1XXXX 520 | 01011XX1XXX1XXX1XXX1XXX0X1010XX1XXXX 521 | 01010XX1XXX1XXX1XXX1XXX0X10X1XXXXXXX 522 | 01010XX1XXX1XXX1XXX1XXX0X10X0XXXXXXX 523 | 0110X110X110X110X110X110X110X100011X 524 | 00X0X0X0X0X0X0X0X0X0X0X0X0XXX00000XX 525 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX0X1X1XXXX 526 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX0X0X1XXXX 527 | 1X1110111011101110111011101111111X11 528 | 1X1110111011101110111011101X10X1XX11 529 | 0110X110X110X110X110X110X110X110X11X 530 | 0110X110X110X110X110X110X110X100X11X 531 | 01011XX1XXX1XXX1XXX1XXX1XXX0X111XXXX 532 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1011XXX 533 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1X1XX 534 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX0X1XX 535 | none found 536 | 011011101110111011101110111011101110 537 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1011XXX 538 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1010XXX 539 | 01010XX1XXX1XXX1XXX1XXX1XXX0X10X1XXX 540 | 01010XX1XXX1XXX1XXX1XXX1XXX0X10X0XXX 541 | 0110X110X110X110X110X110X110X110X100 542 | 00X0X0X0X0X0X0X0X0X0X0X0X0X0X0XXX000 543 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX0X1XX 544 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX0X0XX 545 | 101110111011101110111011101110111111 546 | 1011101110111011101110111011101X10XX 547 | 0110X110X110X110X110X110X110X110X11X 548 | 0110X110X110X110X110X110X110X110X10X 549 | none found 550 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X100 551 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X101 552 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X100 553 | none found 554 | 01001110X110X110X110X110X110X110X100 555 | X000X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0XX 556 | 0100X110X110X110X110X110X110X110X11X 557 | X0X000X0X0X0X0X0X0X0X0X0X0X0X0X0X0XX 558 | 01010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 559 | 00XXX000X0X0X0X0X0X0X0X0X0X0X0X0X0XX 560 | 0110X100X110X110X110X110X110X110X11X 561 | 00XXX0X000X0X0X0X0X0X0X0X0X0X0X0X0XX 562 | 010011010XX1XXX1XXX1XXX1XXX1XXX1XXXX 563 | 00X0X0XXX000X0X0X0X0X0X0X0X0X0X0X0XX 564 | 0110X110X100X110X110X110X110X110X11X 565 | 00X0X0XXX0X000X0X0X0X0X0X0X0X0X0X0XX 566 | 01011XX0X1010XX1XXX1XXX1XXX1XXX1XXXX 567 | 00X0X0X0X0XXX000X0X0X0X0X0X0X0X0X0XX 568 | 0110X110X110X100X110X110X110X110X11X 569 | 00X0X0X0X0XXX0X000X0X0X0X0X0X0X0X0XX 570 | 01011XX1XXX0X1010XX1XXX1XXX1XXX1XXXX 571 | 00X0X0X0X0X0X0XXX000X0X0X0X0X0X0X0XX 572 | 0110X110X110X110X100X110X110X110X11X 573 | 00X0X0X0X0X0X0XXX0X000X0X0X0X0X0X0XX 574 | 01011XX1XXX1XXX0X1010XX1XXX1XXX1XXXX 575 | 00X0X0X0X0X0X0X0X0XXX000X0X0X0X0X0XX 576 | 0110X110X110X110X110X100X110X110X11X 577 | 00X0X0X0X0X0X0X0X0XXX0X000X0X0X0X0XX 578 | 01011XX1XXX1XXX1XXX0X1010XX1XXX1XXXX 579 | 00X0X0X0X0X0X0X0X0X0X0XXX000X0X0X0XX 580 | 0110X110X110X110X110X110X100X110X11X 581 | 00X0X0X0X0X0X0X0X0X0X0XXX0X000X0X0XX 582 | 01011XX1XXX1XXX1XXX1XXX0X1010XX1XXXX 583 | 00X0X0X0X0X0X0X0X0X0X0X0X0XXX000X0XX 584 | 0110X110X110X110X110X110X110X100X11X 585 | 00X0X0X0X0X0X0X0X0X0X0X0X0XXX0X000XX 586 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1010XXX 587 | 00X0X0X0X0X0X0X0X0X0X0X0X0X0X0XXX00X 588 | 0110X110X110X110X110X110X110X110X10X 589 | 00X0X0X0X0X0X0X0X0X0X0X0X0X0X0XXX0X0 590 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X100 591 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 592 | 01X1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 593 | 11010X11XX11XX11XX11XX11XX11XX11XX1X 594 | 01000110X110X110X110X110X110X110X11X 595 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 596 | 1XX0X1X1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 597 | 1X11X1010X11XX11XX11XX11XX11XX11XX1X 598 | 0110X1000110X110X110X110X110X110X11X 599 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 600 | 1XX1XXX0X1X1XXX1XXX1XXX1XXX1XXX1XXXX 601 | 1X11XX11X1010X11XX11XX11XX11XX11XX1X 602 | 0110X110X1000110X110X110X110X110X11X 603 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 604 | 1XX1XXX1XXX0X1X1XXX1XXX1XXX1XXX1XXXX 605 | 1X11XX11XX11X1010X11XX11XX11XX11XX1X 606 | 0110X110X110X1000110X110X110X110X11X 607 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 608 | 1XX1XXX1XXX1XXX0X1X1XXX1XXX1XXX1XXXX 609 | 1X11XX11XX11XX11X1010X11XX11XX11XX1X 610 | 0110X110X110X110X1000110X110X110X11X 611 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 612 | 1XX1XXX1XXX1XXX1XXX0X1X1XXX1XXX1XXXX 613 | 1X11XX11XX11XX11XX11X1010X11XX11XX1X 614 | 0110X110X110X110X110X1000110X110X11X 615 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 616 | 1XX1XXX1XXX1XXX1XXX1XXX0X1X1XXX1XXXX 617 | 1X11XX11XX11XX11XX11XX11X1010X11XX1X 618 | 0110X110X110X110X110X110X1000110X11X 619 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 620 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX0X1X1XXXX 621 | 1X11XX11XX11XX11XX11XX11XX11X1010X1X 622 | 0110X110X110X110X110X110X110X100011X 623 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 624 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX0X1XX 625 | 1X11XX11XX11XX11XX11XX11XX11XX11X100 626 | 0110X110X110X110X110X110X110X110X100 627 | 11010101X101X101X101X101X101X101X10X 628 | 01000100X100X100X100X100X100X100X10X 629 | 110101010101010101010XX1XXX1XXX1XXXX 630 | 011111X1X1X1X1X1X1X1XXX1XXX1XXX1XXXX 631 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 632 | 01XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 633 | 01000110X110X110X110X110X110X110X11X 634 | 11010X11XX11XX11XX11XX11XX11XX11XX1X 635 | 0110X1000110X110X110X110X110X110X11X 636 | 1X11X1010X11XX11XX11XX11XX11XX11XX1X 637 | 0110X110X1000110X110X110X110X110X11X 638 | 1X11XX11X1010X11XX11XX11XX11XX11XX1X 639 | 0110X110X110X1000110X110X110X110X11X 640 | 1X11XX11XX11X1010X11XX11XX11XX11XX1X 641 | 0110X110X110X110X1000110X110X110X11X 642 | 1X11XX11XX11XX11X1010X11XX11XX11XX1X 643 | 0110X110X110X110X110X1000110X110X11X 644 | 1X11XX11XX11XX11XX11X1010X11XX11XX1X 645 | 0110X110X110X110X110X110X1000110X11X 646 | 1X11XX11XX11XX11XX11XX11X1010X11XX1X 647 | 0110X110X110X110X110X110X110X100011X 648 | 1X11XX11XX11XX11XX11XX11XX11X1010X1X 649 | 0110X110X110X110X110X110X110X110X100 650 | 1X11XX11XX11XX11XX11XX11XX11XX11X100 651 | 110001101110111011101110111011101111 652 | 110101010XX1XXX1XXX1XXX1XXX1XXX1XXXX 653 | 011111X0X110111011101110111011101111 654 | 1X1111111011101110111X111X111X111X11 655 | 0110111111X0011011101110111011101110 656 | 1X1110111111101110111X111X111X111X11 657 | 01101110111111X001101110111011101110 658 | 1X1110111011111110111X111X111X111X11 659 | 011011101110111111X00110111011101110 660 | 1X1110111011101111111X111X111X111X11 661 | 0110111011101110111111X0011011101110 662 | 1X111011101110111011111110111X111X11 663 | 01101110111011101110111111X001101110 664 | 1X111011101110111011101111111X111X11 665 | 011011101110111011101110111111X00110 666 | 1X1110111011101110111011101111111X11 667 | none found 668 | 101110111011101110111011101110111111 669 | 0100X110X110X110X110X110X110X110X11X 670 | 1101XXX1XXX1XXX1XXX1XXX1XXX1XXX0X11X 671 | 01010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 672 | 11X10XX1XXX1XXX1XXX1XXX1XXX1XXX0X111 673 | 0110X100X110X110X110X110X110X110X11X 674 | 1XX1X101XXX1XXX1XXX1XXX1XXX1XXX0X11X 675 | 010011010XX1XXX1XXX1XXX1XXX1XXX1XXXX 676 | 1XX1X1X10XX1XXX1XXX1XXX1XXX1XXX0X111 677 | 0110X110X100X110X110X110X110X110X11X 678 | 1XX1XXX1X101XXX1XXX1XXX1XXX1XXX0X11X 679 | 01011XX0X1010XX1XXX1XXX1XXX1XXX1XXXX 680 | 1XX1XXX1X1X10XX1XXX1XXX1XXX1XXX0X111 681 | 0110X110X110X100X110X110X110X110X11X 682 | 1XX1XXX1XXX1X101XXX1XXX1XXX1XXX0X11X 683 | 01011XX1XXX0X1010XX1XXX1XXX1XXX1XXXX 684 | 1XX1XXX1XXX1X1X10XX1XXX1XXX1XXX0X111 685 | 0110X110X110X110X100X110X110X110X11X 686 | 1XX1XXX1XXX1XXX1X101XXX1XXX1XXX0X11X 687 | 01011XX1XXX1XXX0X1010XX1XXX1XXX1XXXX 688 | 1XX1XXX1XXX1XXX1X1X10XX1XXX1XXX0X111 689 | 0110X110X110X110X110X100X110X110X11X 690 | 1XX1XXX1XXX1XXX1XXX1X101XXX1XXX0X11X 691 | 01011XX1XXX1XXX1XXX0X1010XX1XXX1XXXX 692 | 1XX1XXX1XXX1XXX1XXX1X1X10XX1XXX0X111 693 | 0110X110X110X110X110X110X100X110X11X 694 | 1XX1XXX1XXX1XXX1XXX1XXX1X101XXX0X11X 695 | 01011XX1XXX1XXX1XXX1XXX0X1010XX1XXXX 696 | 1XX1XXX1XXX1XXX1XXX1XXX1X1X10XX0X111 697 | 0110X110X110X110X110X110X110X100X11X 698 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1X100X11X 699 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1010XXX 700 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1X1X00111 701 | 0110X110X110X110X110X110X110X110X10X 702 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX0X111X10X 703 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X100 704 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX0X11111X0 705 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 706 | 0100X110X110X110X110X110X110X110X11X 707 | 11110X111X111X111X111X111X111X111X11 708 | 01010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 709 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 710 | 0110X100X110X110X110X110X110X110X11X 711 | 1X1111110X111X111X111X111X111X111X11 712 | 010011010XX1XXX1XXX1XXX1XXX1XXX1XXXX 713 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 714 | 0110X110X100X110X110X110X110X110X11X 715 | 1X111X1111110X111X111X111X111X111X11 716 | 01011XX0X1010XX1XXX1XXX1XXX1XXX1XXXX 717 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 718 | 0110X110X110X100X110X110X110X110X11X 719 | 1X111X111X1111110X111X111X111X111X11 720 | 01011XX1XXX0X1010XX1XXX1XXX1XXX1XXXX 721 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 722 | 0110X110X110X110X100X110X110X110X11X 723 | 1X111X111X111X1111110X111X111X111X11 724 | 01011XX1XXX1XXX0X1010XX1XXX1XXX1XXXX 725 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 726 | 0110X110X110X110X110X100X110X110X11X 727 | 1X111X111X111X111X1111110X111X111X11 728 | 01011XX1XXX1XXX1XXX0X1010XX1XXX1XXXX 729 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 730 | 0110X110X110X110X110X110X100X110X11X 731 | 1X111X111X111X111X111X1111110X111X11 732 | 01011XX1XXX1XXX1XXX1XXX0X1010XX1XXXX 733 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 734 | 0110X110X110X110X110X110X110X100X11X 735 | 1X111X111X111X111X111X111X1111110X11 736 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1010XXX 737 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 738 | 0110X110X110X110X110X110X110X110X10X 739 | 1X111X111X111X111X111X111X111X111110 740 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X100 741 | 111101110111011101110111011101110110 742 | 01010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 743 | 111101110111011101110X11XX11XX11XX1X 744 | 01001110X110X110X11XXX1XXX1XXX1XXX1X 745 | 1X11XX11XX11XX11XX11XX11XX11XX11XX1X 746 | 010XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 747 | 01010XX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 748 | 11110X111X111X111X111X111X111X111X11 749 | 010011010XX1XXX1XXX1XXX1XXX1XXX1XXXX 750 | 1X1111110X111X111X111X111X111X111X11 751 | 01011XX0X1010XX1XXX1XXX1XXX1XXX1XXXX 752 | 1X111X1111110X111X111X111X111X111X11 753 | 01011XX1XXX0X1010XX1XXX1XXX1XXX1XXXX 754 | 1X111X111X1111110X111X111X111X111X11 755 | 01011XX1XXX1XXX0X1010XX1XXX1XXX1XXXX 756 | 1X111X111X111X1111110X111X111X111X11 757 | 01011XX1XXX1XXX1XXX0X1010XX1XXX1XXXX 758 | 1X111X111X111X111X1111110X111X111X11 759 | 01011XX1XXX1XXX1XXX1XXX0X1010XX1XXXX 760 | 1X111X111X111X111X111X1111110X111X11 761 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1010XXX 762 | 1X111X111X111X111X111X111X1111110X11 763 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X100 764 | 1X111X111X111X111X111X111X111X111110 765 | 01110XX1XXX1XXX1XXX1XXX1XXX1XXX0X101 766 | 111101110X11XX11XX11XX11XX11XX11XX1X 767 | 01001111XXX1XXX1XXX1XXX1XXX1XXX1XXXX 768 | 1X1111111011101110111X111X111X111X11 769 | 01011XX0X111XXX1XXX1XXX1XXX1XXX1XXXX 770 | 1X1110111111101110111X111X111X111X11 771 | 01011XX1XXX0X111XXX1XXX1XXX1XXX1XXXX 772 | 1X1110111011111110111X111X111X111X11 773 | 01011XX1XXX1XXX0X111XXX1XXX1XXX1XXXX 774 | 1X1110111011101111111X111X111X111X11 775 | 01011XX1XXX1XXX1XXX0X111XXX1XXX1XXXX 776 | 1X111011101110111011111110111X111X11 777 | 01011XX1XXX1XXX1XXX1XXX0X111XXX1XXXX 778 | 1X111011101110111011101111111X111X11 779 | 01011XX1XXX1XXX1XXX1XXX1XXX0X111XXXX 780 | 1X1110111011101110111011101111111X11 781 | none found 782 | 101110111011101110111011101110111111 783 | 111111111111111111111X111X111X111X11 784 | 0100010011001100110X1XXX1XXX1XXX1XX1 785 | 1X111X111X111X111X111X111X111X111X11 786 | 010X0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 787 | 01001110X110X110X110X110X110X110X100 788 | 111111111X111X111X111X111X111X111X11 789 | 010001011XX1XXX1XXXXXXXXXXXXXXXXXXXX 790 | 1X1111111011101110111X111X111X111X11 791 | 01010XX0X1011XX1XXXXXXXXXXXXXXXXXXXX 792 | 1X1110111111101110111X111X111X111X11 793 | 01010XX1XXX0X1011XXXXXXXXXXXXXXXXXXX 794 | 1X1110111011111110111X111X111X111X11 795 | 01010XX1XXX1XXX0X10X1XXXXXXXXXXXXXXX 796 | 1X1110111011101111111X111X111X111X11 797 | 01010XX1XXX1XXX1XXX0X1011XXXXXXXXXXX 798 | 1X111011101110111011111110111X111X11 799 | 01010XX1XXX1XXX1XXX1XXX0X10X1XXXXXXX 800 | 1X111011101110111011101111111X111X11 801 | 01010XX1XXX1XXX1XXX1XXX1XXX0X10X1XXX 802 | 1X1110111011101110111011101111111X11 803 | none found 804 | 101110111011101110111011101110111111 805 | 00X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0XX 806 | 101111111011101110111011101110111011 807 | 01X1XXX1XXX1XXX1XXXXXXXXXXXXXXXXXXXX 808 | 1X1111111011101110111X111X111X111X11 809 | 01111XX1XXX0X11011101110111011101111 810 | 1X111111101111111X111X111X111X111X11 811 | 01111XX0X110111011101110111011101111 812 | 1X11111111111X111X111X111X111X111X11 813 | 00X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0XX 814 | 101110111111101110111011101110111011 815 | 011011111XX0X1100110X110X110X110X11X 816 | 1X111011111111111X111X111X111X111X11 817 | 011011111XX1XXX0X110111001101110X11X 818 | 1X11101111111011101111111X111X111X11 819 | 011011111XX1XXX0X11011111XX0X110011X 820 | 1X111011111110111X111X11101111111X11 821 | 01X1XXX1XXX1XXX1XXXXXXXXXXXXXXXXXXXX 822 | 1X11101111111X1110111X111X111X111X11 823 | 01111XX1XXX0X11011101110111011101111 824 | 1X11101111111X1111111X111X111X111X11 825 | 00X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0XX 826 | 101110111011111110111011101110111011 827 | 01X1XXX1XXX1XXX1XXXXXXXXXXXXXXXXXXXX 828 | 1X111011101111111X111X111X111X111X11 829 | 011011111XX1XXX0X110111001101110X11X 830 | 1X11101110111111101111111X111X111X11 831 | 0110111011111XX1XXX0X11011100110X11X 832 | 1X1110111011111110111X1111111X111X11 833 | 011011111XX1XXX0X11011111XX0X110011X 834 | none found 835 | 00X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0XX 836 | 101110111011101111111011101110111011 837 | 011011111XX1XXX1XXX0X11001101110X11X 838 | 1X11101110111011111111111X111X111X11 839 | 0110111011111XX1XXX0X11011100110X11X 840 | 1X1110111011101111111X1111111X111X11 841 | 01X1XXX1XXX1XXX1XXXXXXXXXXXXXXXXXXXX 842 | 1X1110111011101111111X111X111X111X11 843 | 00X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0XX 844 | 101110111011101110111111101110111011 845 | 01X1XXX1XXX1XXX1XXX1XXX1XXXXXXXXXXXX 846 | 1X111011101110111011111110111X111X11 847 | 00X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0XX 848 | 101110111011101110111011111110111011 849 | 01X1XXX1XXX1XXX1XXX1XXX1XXXXXXXXXXXX 850 | 1X111011101110111011101111111X111X11 851 | 011011111XX1XXX0X11011111XX0X110011X 852 | 1X111011101110111X111011111111111X11 853 | 00X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0X0XX 854 | 101110111011101110111011101111111011 855 | 01X1XXX1XXX1XXXXXXX1XXX1XXX1XXXXXXXX 856 | 1X111011101110111X111011101111111X11 857 | 1X1110111011101110111X111X111X111X11 858 | 011011111XX0X11001101110X110X110X11X 859 | 1X11101111111X111X111X111X111X111X11 860 | 011011111XX0X1100110X110X110X110X11X 861 | 1X111011101111111X111X111X111X111X11 862 | 011011111XX1XXX0X110111001101110X11X 863 | 1X11101111111X111X111X111X111X111X11 864 | 011011111XX1XXX0X110111001100110X11X 865 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/c432.medfault: -------------------------------------------------------------------------------- 1 | 357_0 2 | 1 3 | 418 4 | 0 5 | 308 6 | 0 7 | 79 8 | 0 9 | 203_7 10 | 1 11 | 190 12 | 1 13 | 168 14 | 0 15 | 256 16 | 1 17 | 154_0 18 | 1 19 | 53_0 20 | 0 21 | 50 22 | 1 23 | 213_8 24 | 1 25 | 417 26 | 1 27 | 386_5 28 | 0 29 | 27 30 | 1 31 | 376 32 | 0 33 | 357_1 34 | 1 35 | 319_4 36 | 1 37 | 370 38 | 1 39 | 69_0 40 | 1 41 | 393_3 42 | 0 43 | 341 44 | 0 45 | 380 46 | 1 47 | 243 48 | 1 49 | 89_1 50 | 1 51 | 236 52 | 1 53 | 150 54 | 0 55 | 319_6 56 | 0 57 | 40 58 | 0 59 | 411_0 60 | 1 61 | 360_1 62 | 0 63 | 292 64 | 0 65 | 53_1 66 | 1 67 | 43_0 68 | 0 69 | 115_1 70 | 1 71 | 8_1 72 | 1 73 | 131 74 | 1 75 | 76_1 76 | 0 77 | 180_0 78 | 0 79 | 360_8 80 | 1 81 | 147 82 | 0 83 | 213_8 84 | 1 85 | 319_7 86 | 1 87 | 360_0 88 | 0 89 | 89 90 | 0 91 | 40 92 | 1 93 | 288 94 | 0 95 | 63_1 96 | 0 97 | 105_0 98 | 1 99 | 415 100 | 0 101 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/c432.medrefout: -------------------------------------------------------------------------------- 1 | 0100010011001100110X1XXX1XXX1XXX1XX1 2 | 1X111011101110111011111110111X111X11 3 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X100 4 | 01011XX1XXX1XXX1XXX0X1011XX1XXX1XXXX 5 | 1X11XX11XX11XX11XX11XX11XX11X1010X1X 6 | 01011XX1XXX1XXX0X1011XX1XXX1XXX1XXXX 7 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 8 | 0110111011101110111111X0011011101110 9 | 01X1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 10 | 01011XX1XXX0X1011XX1XXX1XXX1XXX1XXXX 11 | 1XX1XXX1XXX1XXX0X1X1XXX1XXX1XXX1XXXX 12 | 101110111011101110111011101110111111 13 | 01X1XXX1XXX1XXX1XXXXXXXXXXXXXXXXXXXX 14 | 01111XX1XXX0X11011101110111011101111 15 | 010011010XX1XXX1XXX1XXX1XXX1XXX1XXXX 16 | 1X111011101110111011111110111X111X11 17 | 010X0XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 18 | 1X1110111011101111111X111X111X111X11 19 | 1X111X111X111X111X111X111X111X111X11 20 | 00X0X0X0X0X0X0X0X0XXX00000X0X0X0X0XX 21 | 0110111011111XX1XXX0X11011100110X11X 22 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1010XXX 23 | 0100010X0XXXXXXXXXXXXXXXXXXXXXXXXXXX 24 | 1XX1XXX1XXX1XXX1XXX1XXX1X1010XX0X11X 25 | 01101110111011101110111011101110011X 26 | 1XX1XXX1XXX1XXX1X1010XX1XXX1XXX0X11X 27 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX0X1XX 28 | 01011XX1XXX1XXX1XXX1XXX0X111XXX1XXXX 29 | 01011XX0X1011XX1XXX1XXX1XXX1XXX1XXXX 30 | 101110111011101110111011101111111011 31 | 010001011XX1XXX1XXXXXXXXXXXXXXXXXXXX 32 | 110111011101110111011101110111011101 33 | 01010XX1XXX0X1010XXXXXXXXXXXXXXXXXXX 34 | 0110X110X110X1000110X110X110X110X11X 35 | 01001110X110X110X110X110X110X110X100 36 | 0100010X0XXXXXXXXXXXXXXXXXXXXXXXXXXX 37 | 0110X110X110X1000110X110X110X110X11X 38 | 01101110111011101110111111X001101110 39 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 40 | 101110111011101110111011101110111111 41 | 00X0X0X0X0X0X0X0X0X0X0X0X0XXX00000XX 42 | 101110111011101110111011101110111111 43 | 1X1110111011101110111011101111111X11 44 | 01001110X110X110X110X110X110X110X100 45 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1X1X1XXXX 46 | 01011XX0X1010XX1XXX1XXX1XXX1XXX1XXXX 47 | 110111011101110111011101110111011101 48 | 0110111011101110111111X0011011101110 49 | 01011XX1XXX1XXX1XXX1XXX1XXX0X1010XXX 50 | 0100010X0XXXXXXXXXXXXXXXXXXXXXXXXXXX 51 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/c432.smallfault: -------------------------------------------------------------------------------- 1 | 357_0 2 | 1 3 | 418 4 | 0 5 | 308 6 | 0 7 | 79 8 | 0 9 | 203_7 10 | 1 11 | 190 12 | 1 13 | 168 14 | 0 15 | 256 16 | 1 17 | 154_0 18 | 1 19 | 53_0 20 | 0 21 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/c432.smallrefout: -------------------------------------------------------------------------------- 1 | 0100010011001100110X1XXX1XXX1XXX1XX1 2 | 1X111011101110111011111110111X111X11 3 | 01011XX1XXX1XXX1XXX1XXX1XXX1XXX0X100 4 | 01011XX1XXX1XXX1XXX0X1011XX1XXX1XXXX 5 | 1X11XX11XX11XX11XX11XX11XX11X1010X1X 6 | 01011XX1XXX1XXX0X1011XX1XXX1XXX1XXXX 7 | 1XX1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 8 | 0110111011101110111111X0011011101110 9 | 01X1XXX1XXX1XXX1XXX1XXX1XXX1XXX1XXXX 10 | 01011XX1XXX0X1011XX1XXX1XXX1XXX1XXXX 11 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/ex1.bench: -------------------------------------------------------------------------------- 1 | INPUT(A) 2 | INPUT(B) 3 | INPUT(C) 4 | INPUT(D) 5 | OUTPUT(L) 6 | e = AND(A, B) 7 | f = OR(C, e) 8 | g = NOT(f) 9 | h = AND(f, A) 10 | k = OR(D, g) 11 | L = NAND(k, h) 12 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/ex1.fault: -------------------------------------------------------------------------------- 1 | A 2 | 0 3 | A 4 | 1 5 | B 6 | 0 7 | B 8 | 1 9 | C 10 | 0 11 | C 12 | 1 13 | D 14 | 0 15 | D 16 | 1 17 | e 18 | 0 19 | e 20 | 1 21 | f 22 | 0 23 | f 24 | 1 25 | g 26 | 0 27 | g 28 | 1 29 | h 30 | 0 31 | h 32 | 1 33 | k 34 | 0 35 | k 36 | 1 37 | L 38 | 0 39 | L 40 | 1 41 | A_0 42 | 0 43 | A_0 44 | 1 45 | A_1 46 | 0 47 | A_1 48 | 1 49 | f_0 50 | 0 51 | f_0 52 | 1 53 | f_1 54 | 0 55 | f_1 56 | 1 57 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/ex1.refout: -------------------------------------------------------------------------------- 1 | 1101 2 | 0101 3 | 1101 4 | 1001 5 | 1011 6 | 1001 7 | 1X11 8 | 1X10 9 | 1101 10 | 1001 11 | 1X11 12 | 1001 13 | none found 14 | 1X10 15 | 1X11 16 | 0X0X 17 | 1X11 18 | 1X10 19 | XX10 20 | 1X11 21 | 1101 22 | none found 23 | 1X11 24 | 0X11 25 | 1X10 26 | none found 27 | 1X11 28 | 100X 29 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/ex2.bench: -------------------------------------------------------------------------------- 1 | INPUT(A) 2 | INPUT(B) 3 | INPUT(C) 4 | OUTPUT(X) 5 | OUTPUT(Y) 6 | OUTPUT(Z) 7 | 8 | d = AND(A, B) 9 | m = XNOR(d, B) 10 | q = NOT(m) 11 | r = XNOR(d, m) 12 | s = NOT(r) 13 | X = NAND(d, r) 14 | Y = OR(s, q) 15 | v = XNOR(s, B) 16 | Z = NAND(v, m, C) 17 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/ex2.fault: -------------------------------------------------------------------------------- 1 | A 2 | 0 3 | A 4 | 1 5 | B 6 | 0 7 | B 8 | 1 9 | C 10 | 0 11 | C 12 | 1 13 | d 14 | 0 15 | d 16 | 1 17 | m 18 | 0 19 | m 20 | 1 21 | q 22 | 0 23 | q 24 | 1 25 | r 26 | 0 27 | r 28 | 1 29 | s 30 | 0 31 | s 32 | 1 33 | X 34 | 0 35 | X 36 | 1 37 | Y 38 | 0 39 | Y 40 | 1 41 | v 42 | 0 43 | v 44 | 1 45 | Z 46 | 0 47 | Z 48 | 1 49 | B_0 50 | 0 51 | B_0 52 | 1 53 | B_1 54 | 0 55 | B_1 56 | 1 57 | B_2 58 | 0 59 | B_2 60 | 1 61 | d_0 62 | 0 63 | d_0 64 | 1 65 | d_1 66 | 0 67 | d_1 68 | 1 69 | d_2 70 | 0 71 | d_2 72 | 1 73 | m_0 74 | 0 75 | m_0 76 | 1 77 | m_1 78 | 0 79 | m_1 80 | 1 81 | m_2 82 | 0 83 | m_2 84 | 1 85 | r_0 86 | 0 87 | r_0 88 | 1 89 | r_1 90 | 0 91 | r_1 92 | 1 93 | s_0 94 | 0 95 | s_0 96 | 1 97 | s_1 98 | 0 99 | s_1 100 | 1 101 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/ex2.refout: -------------------------------------------------------------------------------- 1 | 11X 2 | 01X 3 | 11X 4 | 10X 5 | none found 6 | none found 7 | 11X 8 | 01X 9 | 11X 10 | 011 11 | 01X 12 | 11X 13 | 11X 14 | 10X 15 | 10X 16 | 11X 17 | 0XX 18 | 11X 19 | 10X 20 | 11X 21 | none found 22 | 111 23 | 11X 24 | none found 25 | 11X 26 | none found 27 | 011 28 | none found 29 | 111 30 | X01 31 | 11X 32 | 011 33 | 11X 34 | 00X 35 | 11X 36 | 01X 37 | 11X 38 | 01X 39 | 00X 40 | none found 41 | none found 42 | none found 43 | 11X 44 | 10X 45 | 11X 46 | none found 47 | 10X 48 | 11X 49 | 101 50 | 111 51 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/target.bench: -------------------------------------------------------------------------------- 1 | input(a) 2 | input(b) 3 | output(e) 4 | c = or(a, b) 5 | d = not(b) 6 | e = and(c, c, d) 7 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/target.fault: -------------------------------------------------------------------------------- 1 | a 2 | 0 3 | a 4 | 1 5 | b 6 | 0 7 | b 8 | 1 9 | c 10 | 0 11 | c 12 | 1 13 | d 14 | 0 15 | d 16 | 1 17 | e 18 | 0 19 | e 20 | 1 21 | b_0 22 | 0 23 | b_0 24 | 1 25 | b_1 26 | 0 27 | b_1 28 | 1 29 | c_0 30 | 0 31 | c_0 32 | 1 33 | c_1 34 | 0 35 | c_1 36 | 1 37 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/target.refout: -------------------------------------------------------------------------------- 1 | 10 2 | 00 3 | 11 4 | 10 5 | 10 6 | 00 7 | 10 8 | X1 9 | 10 10 | 00 11 | none found 12 | 00 13 | X1 14 | 10 15 | 10 16 | none found 17 | 10 18 | none found 19 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/target2.bench: -------------------------------------------------------------------------------- 1 | INPUT(A) 2 | INPUT(B) 3 | OUTPUT(c) 4 | e = XOR(A, B) 5 | f = NOT(B) 6 | c = XNOR(e,f) 7 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/target2.fault: -------------------------------------------------------------------------------- 1 | A 2 | 0 3 | A 4 | 1 5 | B 6 | 0 7 | B 8 | 1 9 | e 10 | 0 11 | e 12 | 1 13 | f 14 | 0 15 | f 16 | 1 17 | c 18 | 0 19 | c 20 | 1 21 | B_0 22 | 0 23 | B_0 24 | 1 25 | B_1 26 | 0 27 | B_1 28 | 1 29 | -------------------------------------------------------------------------------- /Gate and Circuit class/test/target2.refout: -------------------------------------------------------------------------------- 1 | 10 2 | 00 3 | none found 4 | none found 5 | 10 6 | 00 7 | 00 8 | 01 9 | 10 10 | 01 11 | 01 12 | 00 13 | 01 14 | 00 15 | -------------------------------------------------------------------------------- /PODEM implementation report.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanketkkeni/PODEM-Algorithm-implementation/02e58179b8746ced6a4f4efa4df2d7a699349a33/PODEM implementation report.pdf -------------------------------------------------------------------------------- /PODEM questionnaire.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sanketkkeni/PODEM-Algorithm-implementation/02e58179b8746ced6a4f4efa4df2d7a699349a33/PODEM questionnaire.pdf -------------------------------------------------------------------------------- /PODEM.cc: -------------------------------------------------------------------------------- 1 | // ESE-549 Project 3 Reference Solution 2 | // Peter Milder 3 | 4 | /** @file */ 5 | 6 | 7 | // For you to do: 8 | // Part 1: 9 | // - Write the getObjective() function 10 | // - Write the updateDFrontier() function 11 | // - Write the backtrace() function 12 | // - Write the podemRecursion() function 13 | // Then your basic PODEM implementation should be finished. 14 | // Test this code carefully. 15 | // Note you can also turn on a "checkTest" mode that will use your 16 | // simulator to run the test after you generated it and check that it 17 | // correctly detects the faults. 18 | // 19 | // Part 2: 20 | // - Write the eventDrivenSim() function. 21 | // - Change the simulation calls in your podemRecursion() function 22 | // from using the old simFullCircuit() function to the new 23 | // event-driven simulator. 24 | // Then, your PODEM implementation should run considerably faster 25 | // (probably 8 to 10x faster for large circuits). 26 | // Test everything and then evaluate the speedup. 27 | // A quick way to figure out how long it takes to run something in 28 | // Linux is: 29 | // time ./atpg ... type other params... 30 | 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | #include 37 | #include 38 | #include "parse_bench.tab.h" 39 | #include "ClassCircuit.h" 40 | #include "ClassGate.h" 41 | #include 42 | #include 43 | #include 44 | 45 | using namespace std; 46 | 47 | /** @brief Just for the parser. Don't touch. */ 48 | extern "C" int yyparse(); 49 | 50 | /** Input file for parser. Don't touch. */ 51 | extern FILE *yyin; 52 | 53 | /** Our circuit. We declare this external so the parser can use it more easily. */ 54 | extern Circuit* myCircuit; 55 | 56 | //-------------------------- 57 | // Helper functions 58 | void printUsage(); 59 | vector constructInputLine(string line); 60 | bool checkTest(Circuit* myCircuit); 61 | string printPIValue(char v); 62 | //-------------------------- 63 | 64 | //---------------------------- 65 | // Functions for logic simulation 66 | void simFullCircuit(Circuit* myCircuit); 67 | void simGateRecursive(Gate* g); 68 | void eventDrivenSim(Circuit* myCircuit, queue q); 69 | char simGate(Gate* g); 70 | char evalGate(vector in, int c, int i); 71 | char EvalXORGate(vector in, int inv); 72 | int LogicNot(int logicVal); 73 | void setValueCheckFault(Gate* g, char gateValue); 74 | //----------------------------- 75 | 76 | //---------------------------- 77 | // Functions for PODEM: 78 | bool podemRecursion(Circuit* myCircuit); 79 | bool getObjective(Gate* &g, char &v, Circuit* myCircuit); 80 | void updateDFrontier(Circuit* myCircuit); 81 | void backtrace(Gate* &pi, char &piVal, Gate* objGate, char objVal, Circuit* myCircuit); 82 | 83 | //-------------------------- 84 | 85 | 86 | /////////////////////////////////////////////////////////// 87 | // Global variables 88 | // These are made global to make your life slightly easier. 89 | 90 | /** Global variable: a vector of Gate pointers for storing the D-Frontier. */ 91 | vector dFrontier; 92 | 93 | /** Global variable: holds a pointer to the gate with stuck-at fault on its output location. */ 94 | Gate* faultLocation; 95 | 96 | /** Global variable: holds the logic value you will need to activate the stuck-at fault. */ 97 | char faultActivationVal; 98 | 99 | /////////////////////////////////////////////////////////// 100 | 101 | 102 | 103 | /** @brief The main function. 104 | * 105 | * You do not need to change anything in the main function, 106 | * although you should understand what is happening 107 | * here. 108 | */ 109 | int main(int argc, char* argv[]) { 110 | 111 | // Check the command line input and usage 112 | if (argc != 4) { 113 | printUsage(); 114 | return 1; 115 | } 116 | 117 | // Parse the bench file and initialize the circuit. (Using C style for our parser.) 118 | FILE *benchFile = fopen(argv[1], "r"); 119 | if (benchFile == NULL) { 120 | cout << "ERROR: Cannot read file " << argv[1] << " for input" << endl; 121 | return 1; 122 | } 123 | yyin=benchFile; 124 | yyparse(); 125 | fclose(benchFile); 126 | 127 | myCircuit->setupCircuit(); 128 | 129 | cout << endl; 130 | 131 | 132 | 133 | // Setup the output text file 134 | ofstream outputStream; 135 | outputStream.open(argv[2]); 136 | if (!outputStream.is_open()) { 137 | cout << "ERROR: Cannot open file " << argv[2] << " for output" << endl; 138 | return 1; 139 | } 140 | 141 | // Open the fault file. 142 | ifstream faultStream; 143 | string faultLocStr; 144 | faultStream.open(argv[3]); 145 | if (!faultStream.is_open()) { 146 | cout << "ERROR: Cannot open fault file " << argv[3] << " for input" << endl; 147 | return 1; 148 | } 149 | 150 | 151 | // For each line in our fault file... 152 | while(getline(faultStream, faultLocStr)) { 153 | 154 | // Clear the old fault 155 | myCircuit->clearFaults(); 156 | 157 | string faultTypeStr; 158 | 159 | if (!(getline(faultStream, faultTypeStr))) { 160 | break; 161 | } 162 | 163 | char faultType = atoi(faultTypeStr.c_str()); 164 | 165 | // set up the fault we are trying to detect 166 | faultLocation = myCircuit->findGateByName(faultLocStr); 167 | faultLocation->set_faultType(faultType); 168 | faultActivationVal = (faultType == FAULT_SA0) ? LOGIC_ONE : LOGIC_ZERO; 169 | 170 | // set all gate values to X 171 | for (int i=0; i < myCircuit->getNumberGates(); i++) { 172 | myCircuit->getGate(i)->setValue(LOGIC_X); 173 | } 174 | 175 | // initialize the D frontier. 176 | dFrontier.clear(); 177 | 178 | // call PODEM recursion function 179 | bool res = podemRecursion(myCircuit); 180 | 181 | // If we succeed, print the test we found to the output file. 182 | if (res == true) { 183 | vector piGates = myCircuit->getPIGates(); 184 | for (int i=0; i < piGates.size(); i++) 185 | outputStream << printPIValue(piGates[i]->getValue()); 186 | outputStream << endl; 187 | } 188 | 189 | // If we failed to find a test, print a message to the output file 190 | else { 191 | outputStream << "none found" << endl; 192 | } 193 | 194 | // Lastly, you can use this to test that your PODEM-generated test 195 | // correctly detects the already-set fault. 196 | // Of course, this assumes that your simulation code is correct. 197 | 198 | // Don't use this code when you are evaluating the runtime of your 199 | // ATPG system because it will add extra time. 200 | if (res == true) { 201 | if (!checkTest(myCircuit)) { 202 | cout << "ERROR: PODEM returned true, but generated test does not detect fault on PO." << endl; 203 | myCircuit->printAllGates(); 204 | assert(false); 205 | } 206 | } 207 | 208 | // Just printing to screen to let you monitor progress 209 | cout << "Fault = " << faultLocation->get_outputName() << " / " << (int)(faultType) << ";"; 210 | if (res == true) 211 | cout << " test found" << endl; 212 | else 213 | cout << " no test found" << endl; 214 | 215 | } 216 | 217 | faultStream.close(); 218 | 219 | // close the output and fault streams 220 | outputStream.close(); 221 | 222 | 223 | return 0; 224 | } 225 | 226 | 227 | ///////////////////////////////////////////////////////////////////// 228 | // Functions in this section are helper functions. 229 | // You should not need to change these, except if you want 230 | // to enable the checkTest function (which will use your simulator 231 | // to attempt to check the test vector computed by PODEM.) 232 | 233 | 234 | /** @brief Print usage information (if user provides incorrect input). 235 | * 236 | * You don't need to touch this. 237 | */ 238 | void printUsage() { 239 | cout << "Usage: ./atpg [bench_file] [output_loc] [fault_file]" << endl << endl; 240 | cout << " bench_file: the target circuit in .bench format" << endl; 241 | cout << " output_loc: location for output file" << endl; 242 | cout << " fault_file: faults to be considered" << endl; 243 | cout << endl; 244 | cout << " The system will generate a test pattern for each fault listed" << endl; 245 | cout << " in fault_file and store the result in output_loc." << endl; 246 | cout << endl; 247 | } 248 | 249 | 250 | // You don't need to touch this. 251 | /** @brief Used to parse in the values from the input file. 252 | * 253 | * You don't need to touch this. 254 | */ 255 | vector constructInputLine(string line) { 256 | 257 | vector inputVals; 258 | 259 | for (int i=0; i poGates = myCircuit->getPOGates(); 303 | for (int i=0; igetValue(); 305 | if ((v == LOGIC_D) || (v == LOGIC_DBAR)) { 306 | return true; 307 | } 308 | } 309 | 310 | // If we didn't find D or D' on any PO, then our test was not successful. 311 | return false; 312 | 313 | } 314 | 315 | 316 | 317 | /** @brief Prints a PI value. 318 | * 319 | * This is just a helper function used when storing the final test you computed. 320 | * You don't need to run or modify this. 321 | */ 322 | string printPIValue(char v) { 323 | switch(v) { 324 | case LOGIC_ZERO: return "0"; 325 | case LOGIC_ONE: return "1"; 326 | case LOGIC_UNSET: return "U"; 327 | case LOGIC_X: return "X"; 328 | case LOGIC_D: return "1"; 329 | case LOGIC_DBAR: return "0"; 330 | } 331 | return ""; 332 | } 333 | 334 | // end of helper functions 335 | ////////////////////////////////////////////////////////////////////// 336 | 337 | ////////////////////////////////////////////////////////////////////// 338 | // Start of functions for circuit simulation. 339 | 340 | 341 | 342 | /** @brief Runs full circuit simulation 343 | * 344 | * Full-circuit simulation: set all non-PI gates to LOGIC_UNSET 345 | * and call the recursive simulate function on all PO gates. 346 | * Don't change this function unless you want to use your Project 2 code. 347 | */ 348 | void simFullCircuit(Circuit* myCircuit) { 349 | for (int i=0; igetNumberGates(); i++) { 350 | Gate* g = myCircuit->getGate(i); 351 | if (g->get_gateType() != GATE_PI) 352 | g->setValue(LOGIC_UNSET); 353 | } 354 | vector circuitPOs = myCircuit->getPOGates(); 355 | for (int i=0; i < circuitPOs.size(); i++) { 356 | simGateRecursive(circuitPOs[i]); 357 | } 358 | } 359 | 360 | 361 | 362 | // Recursive function to find and set the value on Gate* g. 363 | // This function calls simGate and setValueCheckFault. 364 | // Don't change this function. 365 | /** @brief Recursive function to find and set the value on Gate* g. 366 | * \param g The gate to simulate. 367 | * This function prepares Gate* g to to be simulated by recursing 368 | * on its inputs (if needed). 369 | * 370 | * Then it calls \a simGate(g) to calculate the new value. 371 | * 372 | * Lastly, it will set the Gate's output value based on 373 | * the calculated value. 374 | * 375 | * \note Do not change this function. 376 | */ 377 | void simGateRecursive(Gate* g) { 378 | 379 | // If this gate has an already-set value, you are done. 380 | if (g->getValue() != LOGIC_UNSET) 381 | return; 382 | 383 | // Recursively call this function on this gate's predecessors to 384 | // ensure that their values are known. 385 | vector pred = g->get_gateInputs(); 386 | for (int i=0; i 404 | * indicating the remaining gates that need to be evaluated. 405 | */ 406 | void eventDrivenSim(Circuit* myCircuit, queue q) { 407 | 408 | // Basic idea: 409 | // - Keep a queue (input q) of gates whose output values may potentially change 410 | // - while there are still gates in the queue: 411 | // - Pop a gate from this queue. Store its currently-set output value. 412 | // - Based on the gate's inputs, calculate its new output value. Note that you don't 413 | // need to do this from scratch, you can use the simGate() function below. 414 | // - Check to see if the new gate output value differs from the old one. If it does 415 | // add its fanout gates on the queue 416 | 417 | } 418 | 419 | 420 | 421 | /** @brief Simulate the value of the given Gate. 422 | * 423 | * This is a gate simulation function -- it will simulate the gate g 424 | * with its current input values and return the output value. 425 | * This function does not deal with the fault. (That comes later.) 426 | * \note You do not need to change this function. 427 | * 428 | */ 429 | char simGate(Gate* g) { 430 | // For convenience, create a vector of the values of this 431 | // gate's inputs. 432 | vector pred = g->get_gateInputs(); 433 | vector inputVals; 434 | for (int i=0; igetValue()); 436 | } 437 | 438 | char gateType = g->get_gateType(); 439 | char gateValue; 440 | // Now, set the value of this gate based on its logical function and its input values 441 | switch(gateType) { 442 | case GATE_NAND: { gateValue = evalGate(inputVals, 0, 1); break; } 443 | case GATE_NOR: { gateValue = evalGate(inputVals, 1, 1); break; } 444 | case GATE_AND: { gateValue = evalGate(inputVals, 0, 0); break; } 445 | case GATE_OR: { gateValue = evalGate(inputVals, 1, 0); break; } 446 | case GATE_BUFF: { gateValue = inputVals[0]; break; } 447 | case GATE_NOT: { gateValue = LogicNot(inputVals[0]); break; } 448 | case GATE_XOR: { gateValue = EvalXORGate(inputVals, 0); break; } 449 | case GATE_XNOR: { gateValue = EvalXORGate(inputVals, 1); break; } 450 | case GATE_FANOUT: {gateValue = inputVals[0]; break; } 451 | default: { cout << "ERROR: Do not know how to evaluate gate type " << gateType << endl; assert(false);} 452 | } 453 | 454 | return gateValue; 455 | } 456 | 457 | 458 | /** @brief Evaluate a NAND, NOR, AND, or OR gate. 459 | * \param in The logic value's of this gate's inputs. 460 | * \param c The controlling value of this gate type (e.g. c==0 for an AND or NAND gate) 461 | * \param i The inverting value for this gate (e.g. i==0 for AND and i==1 for NAND) 462 | * \returns The logical value produced by this gate (not including a possible fault on this gate). 463 | * \note You do not need to change this function. 464 | */ 465 | char evalGate(vector in, int c, int i) { 466 | 467 | // Are any of the inputs of this gate the controlling value? 468 | bool anyC = find(in.begin(), in.end(), c) != in.end(); 469 | 470 | // Are any of the inputs of this gate unknown? 471 | bool anyUnknown = (find(in.begin(), in.end(), LOGIC_X) != in.end()); 472 | 473 | int anyD = find(in.begin(), in.end(), LOGIC_D) != in.end(); 474 | int anyDBar = find(in.begin(), in.end(), LOGIC_DBAR) != in.end(); 475 | 476 | 477 | // if any input is c or we have both D and D', then return c^i 478 | if ((anyC) || (anyD && anyDBar)) 479 | return (i) ? LogicNot(c) : c; 480 | 481 | // else if any input is unknown, return unknown 482 | else if (anyUnknown) 483 | return LOGIC_X; 484 | 485 | // else if any input is D, return D^i 486 | else if (anyD) 487 | return (i) ? LOGIC_DBAR : LOGIC_D; 488 | 489 | // else if any input is D', return D'^i 490 | else if (anyDBar) 491 | return (i) ? LOGIC_D : LOGIC_DBAR; 492 | 493 | // else return ~(c^i) 494 | else 495 | return LogicNot((i) ? LogicNot(c) : c); 496 | } 497 | 498 | /** @brief Evaluate an XOR or XNOR gate. 499 | * \param in The logic value's of this gate's inputs. 500 | * \param inv The inverting value for this gate (e.g. i==0 for XOR and i==1 for XNOR) 501 | * \returns The logical value produced by this gate (not including a possible fault on this gate). 502 | * \note You do not need to change this function. 503 | */ 504 | char EvalXORGate(vector in, int inv) { 505 | 506 | // if any unknowns, return unknown 507 | bool anyUnknown = (find(in.begin(), in.end(), LOGIC_X) != in.end()); 508 | if (anyUnknown) 509 | return LOGIC_X; 510 | 511 | // Otherwise, let's count the numbers of ones and zeros for faulty and fault-free circuits. 512 | // This is not required for your project, but this will with with XOR and XNOR with > 2 inputs. 513 | int onesFaultFree = 0; 514 | int onesFaulty = 0; 515 | 516 | for (int i=0; iget_faultType() == FAULT_SA0) && (gateValue == LOGIC_ONE)) 566 | g->setValue(LOGIC_D); 567 | else if ((g->get_faultType() == FAULT_SA0) && (gateValue == LOGIC_DBAR)) 568 | g->setValue(LOGIC_ZERO); 569 | else if ((g->get_faultType() == FAULT_SA1) && (gateValue == LOGIC_ZERO)) 570 | g->setValue(LOGIC_DBAR); 571 | else if ((g->get_faultType() == FAULT_SA1) && (gateValue == LOGIC_D)) 572 | g->setValue(LOGIC_ONE); 573 | else 574 | g->setValue(gateValue); 575 | } 576 | 577 | // End of functions for circuit simulation 578 | //////////////////////////////////////////////////////////// 579 | 580 | 581 | ///////////////////////////////////////////////////////// 582 | // Begin functions for PODEM. 583 | 584 | // TODO 585 | /** @brief PODEM recursion. 586 | * 587 | * \note For Part 1, you must write this, following the pseudocode in class and in the code's comments. 588 | */ 589 | bool podemRecursion(Circuit* myCircuit) { 590 | 591 | // If D or D' is at an output, then return true 592 | char val; 593 | 594 | vector opGates = myCircuit->getPOGates(); 595 | for (int i=0; igetValue(); 597 | if ((val == LOGIC_D) || (val == LOGIC_DBAR)) 598 | return true; 599 | } 600 | 601 | Gate* g; 602 | char v; 603 | 604 | // Call the getObjective function. Store the result in g and v. 605 | // If getObjective fails, return false 606 | 607 | bool obj = getObjective(g, v, myCircuit); 608 | /////////// 609 | if (obj == false ) return false; 610 | 611 | Gate* pi; 612 | char piVal; 613 | 614 | // Call the backtrace function. Store the result in pi and piVal. 615 | 616 | backtrace(pi, piVal, g, v, myCircuit); 617 | 618 | // Set the value of pi to piVal. Use your setValueCheckFault function (see above) 619 | // to make sure if there is a fault on the PI gate, it correctly gets set. 620 | 621 | setValueCheckFault(pi, piVal); 622 | 623 | // Now, determine the implications of the input you set by simulating 624 | // the circuit by calling simFullCircuit(myCircuit); 625 | 626 | simFullCircuit(myCircuit); 627 | 628 | 629 | if (podemRecursion(myCircuit)) return true; 630 | // If the recursive call fails, set the opposite PI value, simulate, it and recurse. 631 | // If this recursive call succeeds, return true. 632 | 633 | char notpiVal; 634 | notpiVal= LogicNot(piVal); 635 | 636 | setValueCheckFault(pi, notpiVal); 637 | 638 | simFullCircuit(myCircuit); 639 | if (podemRecursion(myCircuit)) return true; 640 | 641 | // If we get to here, neither pi=v nor pi = v' worked. So, set pi to value X and 642 | // return false. 643 | 644 | setValueCheckFault(pi, LOGIC_X); 645 | 646 | return false; 647 | 648 | } 649 | 650 | // Find the objective for myCircuit. The objective is stored in g, v. 651 | // 652 | // TODO Write this function, based on the pseudocode from 653 | // class or your textbook. 654 | /** @brief PODEM objective function. 655 | * \param g Use this pointer to store the objective Gate your function picks. 656 | * \param v Use this char to store the objective value your function picks. 657 | * \returns True if the function is able to determine an objective, and false if it fails. 658 | * \note For Part 2, you must write this, following the pseudocode in class and the code's comments. 659 | */ 660 | 661 | bool getObjective(Gate* &g, char &v, Circuit* myCircuit) { 662 | 663 | // First you will need to check if the fault is activated yet. 664 | // Note that in the setup above we set up a global variable 665 | // Gate* faultLocation which represents the gate with the stuck-at 666 | // fault on its output. Use that when you check if the fault is 667 | // excited. 668 | 669 | 670 | // Another note: if the fault is not excited but the fault 671 | // location value is not X, then we have failed to activate 672 | // the fault. In this case getObjective should fail and Return false. 673 | 674 | if (faultLocation->getValue()== LOGIC_X) {g= faultLocation; v=faultActivationVal; 675 | return true;} 676 | 677 | if (faultLocation->getValue()== LOGIC_ONE || faultLocation->getValue()== LOGIC_ZERO) 678 | {return false;} 679 | //setValueCheckFault(faultLocation, faultLocation->getValue()); 680 | 681 | // If the fault is already activated, then you will need to 682 | // use the D-frontier to find an objective. 683 | // Before you use the D-frontier you should update it by running: 684 | 685 | updateDFrontier(myCircuit); 686 | 687 | // This function should update the global D-frontier variable 688 | // vector dFrontier; 689 | 690 | // If the D frontier is empty after update, then getObjective fails 691 | // and should return false. 692 | 693 | if (dFrontier.empty()) return false; 694 | 695 | 696 | // getObjective needs to choose a gate from the D-Frontier. 697 | // For part 1, pick dFrontier[0] if you want to match my reference outputs. 698 | Gate* d; 699 | d = dFrontier[0]; 700 | 701 | // Later, a possible optimization is to use the 702 | // SCOAP observability metric or other smart methods to choose this carefully. 703 | 704 | 705 | // Lastly, set the values of g and v based on the 706 | // gate you chose from the D-Frontier. 707 | 708 | 709 | vector dinputs = d->get_gateInputs(); 710 | 711 | for (int i=0; igetValue()== LOGIC_X) 714 | { 715 | g = dinputs[i]; break; 716 | } 717 | } 718 | 719 | if (d->get_gateType()==GATE_AND || d->get_gateType()==GATE_NAND) v=LOGIC_ONE; 720 | else if (d->get_gateType()==GATE_OR || d->get_gateType()==GATE_NOR) v=LOGIC_ZERO; 721 | else if (d->get_gateType()==GATE_XOR || d->get_gateType()==GATE_XNOR) v=LOGIC_ZERO; 722 | else v=LOGIC_X; 723 | 724 | 725 | return true; 726 | 727 | } 728 | 729 | 730 | // A very simple method to update the D frontier. 731 | // TODO: Write this code based on the pseudocode below. 732 | /** @brief A simple method to compute the set of gates on the D frontier. 733 | * 734 | * \note For Part 1, you must write this. The simplest form follows the pseudocode included in the comments. 735 | */ 736 | 737 | void updateDFrontier(Circuit* myCircuit) { 738 | // Procedure: 739 | // - clear the dFrontier vector (stored as the global variable dFrontier -- see the top of the file) 740 | 741 | dFrontier.clear(); 742 | 743 | // - loop over all gates in the circuit; for each gate, check if it should be on D-frontier; if it is, 744 | // add it to the dFrontier vector. 745 | 746 | Gate* G; 747 | int numberofgates = myCircuit->getNumberGates(); 748 | 749 | for (int i=0; i< numberofgates; i++) 750 | { 751 | G = myCircuit->getGate(i); 752 | if (G->getValue() != LOGIC_X) continue; 753 | else 754 | { 755 | vector Ginputs = G->get_gateInputs(); 756 | for (int j=0; jgetValue()== LOGIC_D || Ginputs[j]->getValue() == LOGIC_DBAR) 759 | { 760 | dFrontier.push_back(G); break; 761 | } 762 | 763 | } 764 | 765 | } 766 | } 767 | 768 | } 769 | 770 | 771 | // Backtrace: given objective objGate and objVal, then figure out which input (pi) to set 772 | // and which value (piVal) to set it to. 773 | // TODO: write this 774 | 775 | /** @brief PODEM backtrace function 776 | * \param pi Output: A Gate pointer to the primary input your backtrace function found. 777 | * \param piVal Output: The value you want to set that primary input to 778 | * \param objGate Input: The objective Gate (computed by getObjective) 779 | * \param objVal Input: the objective value (computed by getObjective) 780 | * \note Write this function based on the psuedocode from class. 781 | */ 782 | void backtrace(Gate* &pi, char &piVal, Gate* objGate, char objVal, Circuit* myCircuit) { 783 | 784 | pi = objGate;int k1;int cnt=0; 785 | int num_inversions; 786 | char gatetype = pi->get_gateType(); 787 | 788 | if (gatetype == GATE_NOR || gatetype == GATE_NOT || gatetype == GATE_NAND || gatetype == GATE_XNOR) 789 | num_inversions=1; 790 | else num_inversions=0; 791 | 792 | 793 | while (pi->get_gateType()!=GATE_PI) 794 | { 795 | vector gateinputs = pi->get_gateInputs();// 796 | 797 | for (k1=0; k1getValue()== LOGIC_X) {pi=gateinputs[k1]; break;} 800 | 801 | } 802 | 803 | gatetype = pi->get_gateType(); 804 | 805 | if (gatetype == GATE_NOR || gatetype == GATE_NOT || gatetype == GATE_NAND || gatetype == GATE_XNOR) 806 | {num_inversions++; } 807 | } 808 | 809 | if (num_inversions%2==1) piVal= LogicNot(objVal); 810 | else piVal = objVal; 811 | 812 | } 813 | 814 | 815 | //////////////////////////////////////////////////////////////////////////// 816 | // Place any new functions you add here, between these two bars. 817 | 818 | 819 | 820 | //////////////////////////////////////////////////////////////////////////// 821 | 822 | 823 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PODEM-Algorithm-implementation 2 | An ATPG tool using PODEM algorithm in C++ that generates a test to detect any given list of Single-Stuck-at Faults 3 | --------------------------------------------------------------------------------