Skip to content

Commit f9cce5e

Browse files
authored
Merge pull request #7946 from donn/dft_null_ptr_access
dft: fix null pointer access
2 parents 2c0e0ef + 5ba173a commit f9cce5e

File tree

4 files changed

+6
-1
lines changed

4 files changed

+6
-1
lines changed

src/dft/src/cells/ScanCellFactory.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,8 @@ TypeOfCell IdentifyCell(odb::dbInst* inst, sta::dbSta* sta)
6060
sta::dbNetwork* db_network = sta->getDbNetwork();
6161
sta::LibertyCell* liberty_cell
6262
= GetLibertyCell(inst->getMaster(), db_network);
63-
if (liberty_cell->hasSequentials() && !inst->getMaster()->isBlock()) {
63+
if (liberty_cell != nullptr && liberty_cell->hasSequentials()
64+
&& !inst->getMaster()->isBlock()) {
6465
// we assume that we are only dealing with one bit cells, but in the future
6566
// we could deal with multibit cells too
6667
return TypeOfCell::kOneBitCell;

src/dft/test/max_chain_count_sky130.ok

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[INFO ODB-0227] LEF file: sky130hd/sky130hd.tlef, created 13 layers, 25 vias
22
[INFO ODB-0227] LEF file: sky130hd/sky130_fd_sc_hd_merged.lef, created 437 library cells
3+
[WARNING ORD-2011] LEF master sky130_fd_sc_hd__tapvpwrvgnd_1 has no liberty cell.
34
***************************
45
Report DFT Plan
56
Number of chains: 1

src/dft/test/max_chain_count_sky130.v

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ module max_chain_count(port1,
2525
output output9;
2626
output output10;
2727

28+
// A cell without a lib view to ensure those don't cause a crash
29+
sky130_fd_sc_hd__tapvpwrvgnd_1 tap();
2830

2931
// Rising edge flops
3032
sky130_fd_sc_hd__dfstp_1 ff1_clk1_rising(

src/dft/test/max_chain_count_sky130.vok

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ module max_chain_count (clock,
8484
.SCE(scan_enable_0),
8585
.SET_B(set_b),
8686
.CLK(clock));
87+
sky130_fd_sc_hd__tapvpwrvgnd_1 tap ();
8788
sky130_fd_sc_hd__sdfsbp_1 ff10_clk1_rising (.D(port1),
8889
.Q(output10),
8990
.SCD(output1),

0 commit comments

Comments
 (0)