@@ -4308,4 +4308,52 @@ library(test_r11_ccs) {
43084308 }() ));
43094309}
43104310
4311+ // Regression: hasSequentials must return true for cells that define
4312+ // sequential behavior via a statetable group (no ff/latch).
4313+ // Multi-bit flip-flops (MBFFs) and clock-gated cells commonly use
4314+ // statetable instead of ff/latch groups. Without the statetable_
4315+ // check in hasSequentials(), these cells are misclassified as
4316+ // combinational — breaking power categorization, resizer guards,
4317+ // and dbSta cell-type mapping.
4318+ TEST_F (StaLibertyTest, HasSequentialsStatetableMBFF) {
4319+ const char *content = R"(
4320+ library(test_mbff_statetable) {
4321+ delay_model : table_lookup ;
4322+ time_unit : "1ns" ;
4323+ voltage_unit : "1V" ;
4324+ current_unit : "1mA" ;
4325+ capacitive_load_unit(1, ff) ;
4326+ cell(MBFF2) {
4327+ area : 6.0 ;
4328+ pin(D0) { direction : input ; capacitance : 0.01 ; }
4329+ pin(D1) { direction : input ; capacitance : 0.01 ; }
4330+ pin(CLK) { direction : input ; capacitance : 0.01 ; clock : true ; }
4331+ pin(Q0) { direction : output ; function : "IQ0" ; }
4332+ pin(Q1) { direction : output ; function : "IQ1" ; }
4333+ statetable("D0 D1 CLK", "IQ0 IQ1") {
4334+ table : "- - ~R : - - : N N ,\
4335+ H - R : - - : H N ,\
4336+ L - R : - - : L N ,\
4337+ - H R : - - : N H ,\
4338+ - L R : - - : N L" ;
4339+ }
4340+ }
4341+ }
4342+ )" ;
4343+ LibertyLibrary *lib = writeAndReadLibReturn (sta_, content);
4344+ ASSERT_NE (lib, nullptr );
4345+ LibertyCell *mbff = lib->findLibertyCell (" MBFF2" );
4346+ ASSERT_NE (mbff, nullptr );
4347+
4348+ // The cell has no ff/latch group, so sequentials_ is empty.
4349+ EXPECT_TRUE (mbff->sequentials ().empty ());
4350+ // But it has a statetable, so it IS sequential.
4351+ EXPECT_NE (mbff->statetable (), nullptr );
4352+ // hasSequentials() must return true for statetable-only cells.
4353+ EXPECT_TRUE (mbff->hasSequentials ())
4354+ << " MBFF2 uses statetable (no ff/latch) but hasSequentials() "
4355+ " returned false — statetable cells are misclassified as "
4356+ " combinational" ;
4357+ }
4358+
43114359} // namespace sta
0 commit comments