From 725cf8b2e64c9cf5586e7ddc7b15a4143c88a7a0 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Sun, 10 Feb 2013 11:53:07 +0000 Subject: [PATCH] * ./mauka: - New: In MaukaEngine::Construct(), do not try to initialize the slice height from a model with an empty AbutmentBox. Instead, signal an error (the model is likely to be missing, it has been initialized from the COMPONENT). - Change: In MaukaEngine::Construct(), clearer error message when there is duplicated instances. Show the full occurrence path of each conflicting instance. --- mauka/src/BBPlacer.cpp | 2 +- mauka/src/MaukaEngine.cpp | 31 ++++++++++++++++++++++--------- mauka/src/mauka/MaukaEngine.h | 2 +- 3 files changed, 24 insertions(+), 11 deletions(-) diff --git a/mauka/src/BBPlacer.cpp b/mauka/src/BBPlacer.cpp index 3dafbfa6..9b244cf4 100644 --- a/mauka/src/BBPlacer.cpp +++ b/mauka/src/BBPlacer.cpp @@ -265,7 +265,7 @@ void BBPlacer::Save() instanceOccurrence.getPath().getTransformation().invert().applyOn(instanceTransformation); instance->setTransformation(instanceTransformation); instance->setPlacementStatus(Instance::PlacementStatus::PLACED); - //setPlacementStatusRecursivelyToPlaced(instance); + //setPlacementStatusRecursivelyToPlaced(instance); } } diff --git a/mauka/src/MaukaEngine.cpp b/mauka/src/MaukaEngine.cpp index abbfd283..8cb513cf 100644 --- a/mauka/src/MaukaEngine.cpp +++ b/mauka/src/MaukaEngine.cpp @@ -184,9 +184,9 @@ void MaukaEngine::Construct() // ************************** { typedef map InstanceOccurrenceMap; - typedef set InstanceSet; + typedef map OccurrencesLUT; typedef map NetMap; - InstanceSet instanceSet; + OccurrencesLUT occurencesLUT; NetMap netMap; unsigned instanceId = 0; unsigned netId = 0; @@ -222,6 +222,14 @@ void MaukaEngine::Construct() { //cerr << "unplaced " << (*ioccurrence) << (*ioccurrence).getBoundingBox() << endl; Cell* model = instance->getMasterCell(); + if (model->getAbutmentBox().isEmpty()) { + throw Error("Unplaced terminal instance <%s> of <%s> with an empty model abutment box.\n" + "(hint: the vst model may be missing)" + ,getString(instance->getName()).c_str() + ,getString(model->getName()).c_str() + ); + } + DbU::Unit insWidth = model->getAbutmentBox().getWidth(); DbU::Unit insHeight = model->getAbutmentBox().getHeight(); if (standardCellHeight == 0) { @@ -239,16 +247,21 @@ void MaukaEngine::Construct() _instanceOccurrencesVector.push_back(*ioccurrence); //VerifyPathCellBox(*ioccurrence); _instanceWidths.push_back(insWidth); - InstanceSet::iterator isit = instanceSet.find(instance); - if (isit != instanceSet.end()) + OccurrencesLUT::iterator duplicate = occurencesLUT.find(instance); + if (duplicate != occurencesLUT.end()) { - cerr << "Unplaced Instance : " << *isit << endl; - cerr << "Unplaced Occurrence : " << (*ioccurrence) << endl; - cerr << (*isit)->getPlacementStatus() << endl; - throw Error("Each unplaced instance must have one occurrence only"); + //cerr << "Unplaced Instance : " << *duplicate << endl; + //cerr << "Unplaced Occurrence : " << (*ioccurrence) << endl; + //cerr << (*duplicate)->getPlacementStatus() << endl; + throw Error("Each unplaced instance must have one occurrence only.\n" + "Model <%s> is intanciated as:\n. %s\n. %s\n(at least)." + ,getString(instance->getMasterCell()->getName()).c_str() + ,(*ioccurrence).getCompactString().c_str() + ,((*duplicate).second).getCompactString().c_str() + ); } _instanceOccurrencesMap[*ioccurrence] = instanceId++; - instanceSet.insert(instance); + occurencesLUT.insert(make_pair(instance,*ioccurrence)); _instanceNets.push_back(UVector()); } } diff --git a/mauka/src/mauka/MaukaEngine.h b/mauka/src/mauka/MaukaEngine.h index 4e1ece7c..268b919f 100644 --- a/mauka/src/mauka/MaukaEngine.h +++ b/mauka/src/mauka/MaukaEngine.h @@ -2,7 +2,7 @@ // -*- C++ -*- // // This file is part of the Coriolis Software. -// Copyright (c) UPMC/LIP6 2006-2012, All Rights Reserved +// Copyright (c) UPMC/LIP6 2006-2013, All Rights Reserved // // x-----------------------------------------------------------------x // | C O R I O L I S |