aiger: -xaiger to return $_FF_ flops
authorEddie Hung <eddie@fpgeh.com>
Thu, 16 Apr 2020 21:01:54 +0000 (14:01 -0700)
committerEddie Hung <eddie@fpgeh.com>
Thu, 14 May 2020 17:33:56 +0000 (10:33 -0700)
frontends/aiger/aigerparse.cc

index 16e94c3944291d9976d73faab9ae268c0da2d974..d25587e48e55bc5ce39ab22fbea4523d11582494 100644 (file)
@@ -787,21 +787,8 @@ void AigerReader::post_process()
                log_assert(q->port_input);
                q->port_input = false;
 
-               Cell* ff;
-               int clock_index = mergeability[i];
-               if (clock_index & 1) {
-                       ff = module->addCell(NEW_ID, ID($_DFF_N_));
-                       clock_index--;
-               }
-               else
-                       ff = module->addCell(NEW_ID, ID($_DFF_P_));
-               auto r = mergeability_to_clock.insert(clock_index);
-               if (r.second)
-                       r.first->second = module->addWire(NEW_ID);
-               ff->setPort(ID::C, r.first->second);
-               ff->setPort(ID::D, d);
-               ff->setPort(ID::Q, q);
-               log_assert(GetSize(q) == 1);
+               Cell* ff = module->addFfGate(NEW_ID, d, q);
+               ff->attributes[ID::abc9_mergeability] = mergeability[i];
                q->attributes[ID::init] = initial_state[i];
        }