From 6280635c3868da25ef9db0af56555c3928ab2984 Mon Sep 17 00:00:00 2001 From: James Cherry Date: Tue, 10 Mar 2026 12:58:53 -0700 Subject: [PATCH] liberty statetable ref test_cell ports resolves #276 Signed-off-by: James Cherry --- liberty/LibertyReader.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/liberty/LibertyReader.cc b/liberty/LibertyReader.cc index 9f8a696e..2ef3e2c5 100644 --- a/liberty/LibertyReader.cc +++ b/liberty/LibertyReader.cc @@ -986,6 +986,8 @@ LibertyReader::readCell(LibertyCell *cell, // Make ff/latch output ports. makeSequentials(cell, cell_group); + // Test cell ports may be referenced by a statetable. + readTestCell(cell, cell_group); readCellAttributes(cell, cell_group); @@ -1000,8 +1002,6 @@ LibertyReader::readCell(LibertyCell *cell, readInternalPowerGroups(cell, ports, port_group); } - readTestCell(cell, cell_group); - cell->finish(infer_latches_, report_, debug_); } @@ -2966,6 +2966,9 @@ LibertyReader::readStatetable(LibertyCell *cell, LibertyPortSeq input_port_ptrs; for (const std::string &input : input_ports) { LibertyPort *port = cell->findLibertyPort(input.c_str()); + if (port == nullptr + && cell->testCell()) + port = cell->testCell()->findLibertyPort(input.c_str()); if (port) input_port_ptrs.push_back(port); else