From 4250c5bec76118c547ff89c0c67bb652341ac34a Mon Sep 17 00:00:00 2001 From: gatecat Date: Mon, 10 Jan 2022 18:43:59 +0000 Subject: [PATCH] def: Fix export of pins Signed-off-by: gatecat --- crlcore/src/ccore/lefdef/DefExport.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/crlcore/src/ccore/lefdef/DefExport.cpp b/crlcore/src/ccore/lefdef/DefExport.cpp index a17ae7c0..79d03ecd 100644 --- a/crlcore/src/ccore/lefdef/DefExport.cpp +++ b/crlcore/src/ccore/lefdef/DefExport.cpp @@ -601,10 +601,18 @@ namespace { if ( status != 0 ) return driver->checkStatus(status); for ( RoutingPad* rp : net->getRoutingPads() ) { - status = defwNetConnection ( extractInstanceName(rp).c_str() - , getString(static_cast(rp->getPlugOccurrence().getEntity())->getMasterNet()->getName()).c_str() - , 0 - ); + Plug *plug = dynamic_cast(rp->getPlugOccurrence().getEntity()); + if (plug) { + status = defwNetConnection ( extractInstanceName(rp).c_str() + , getString(plug->getMasterNet()->getName()).c_str() + , 0 + ); + } else { + Pin *pin = dynamic_cast(rp->getPlugOccurrence().getEntity()); + if (!pin) + throw Error("RP PlugOccurrence neither a plug nor a pin!"); + // TODO: do we need to write something ? + } if ( status != 0 ) return driver->checkStatus(status); }