installation again

This commit is contained in:
Christophe Alexandre 2008-02-05 20:22:01 +00:00
parent 716aa724f7
commit aa405b5147
10 changed files with 2352 additions and 2221 deletions

View File

@ -1,9 +1,9 @@
# - Find the Hurricane includes and libraries. # - Find the Hurricane includes and libraries.
# The following variables are set if Hurricane is found. If HURRICANE is not # The following variables are set if Hurricane is found. If HURRICANE is not
# found, Hurricane_FOUND is set to false. # found, HURRICANE_FOUND is set to false.
# HURRICANE_FOUND - True when the Hurricane include directory is found. # HURRICANE_FOUND - True when the Hurricane include directory is found.
# HURRICANE_INCLUDE_DIRS - the path to where the Hurricane include files are. # HURRICANE_INCLUDE_DIR - the path to where the Hurricane include files are.
# HURRICANE_LIBRARY_DIRS - The path to where the Hurricane library files are. # HURRICANE_LIBRARIES - The path to where the Hurricane library files are.
SET(HURRICANE_INCLUDE_PATH_DESCRIPTION "directory containing the Hurricane include files. E.g /usr/local/include/hurricane or /asim/coriolis/include/hurricane") SET(HURRICANE_INCLUDE_PATH_DESCRIPTION "directory containing the Hurricane include files. E.g /usr/local/include/hurricane or /asim/coriolis/include/hurricane")
@ -37,10 +37,23 @@ IF(UNIX)
DOC "The ${HURRICANE_INCLUDE_PATH_DESCRIPTION}" DOC "The ${HURRICANE_INCLUDE_PATH_DESCRIPTION}"
) )
#MESSAGE("HURRICANE_DIR_SEARCH : ${HURRICANE_DIR_SEARCH}") FIND_PATH(HURRICANE_ANALOGIC_INCLUDE_PATH NAMES RdsUnit.h PATHS
#MESSAGE("HURRICANE_LIBRARY_PATH : ${HURRICANE_LIBRARY_PATH}") # Look in other places.
${HURRICANE_DIR_SEARCH}
PATH_SUFFIXES include/hurricane
# Help the user find it if we cannot.
DOC "The ${HURRICANE_INCLUDE_PATH_DESCRIPTION}"
)
FIND_PATH(HURRICANE_GRAPHICAL_INCLUDE_PATH FIND_LIBRARY(HURRICANE_ANALOGIC_LIBRARY_PATH
NAMES analogic
PATHS ${HURRICANE_DIR_SEARCH}
PATH_SUFFIXES lib
# Help the user find it if we cannot.
DOC "The ${HURRICANE_INCLUDE_PATH_DESCRIPTION}"
)
FIND_PATH(HURRICANE_VIEWER_INCLUDE_PATH
NAMES CellViewer.h NAMES CellViewer.h
PATHS ${HURRICANE_DIR_SEARCH} PATHS ${HURRICANE_DIR_SEARCH}
PATH_SUFFIXES include/hurricane PATH_SUFFIXES include/hurricane
@ -48,7 +61,7 @@ IF(UNIX)
DOC "The ${HURRICANE_INCLUDE_PATH_DESCRIPTION}" DOC "The ${HURRICANE_INCLUDE_PATH_DESCRIPTION}"
) )
FIND_LIBRARY(HURRICANE_GRAPHICAL_LIBRARY_PATH FIND_LIBRARY(HURRICANE_VIEWER_LIBRARY_PATH
NAMES hurricaneviewer NAMES hurricaneviewer
PATHS ${HURRICANE_DIR_SEARCH} PATHS ${HURRICANE_DIR_SEARCH}
PATH_SUFFIXES lib PATH_SUFFIXES lib
@ -56,39 +69,77 @@ IF(UNIX)
DOC "The ${HURRICANE_INCLUDE_PATH_DESCRIPTION}" DOC "The ${HURRICANE_INCLUDE_PATH_DESCRIPTION}"
) )
FIND_PATH(HURRICANE_EDITOR_INCLUDE_PATH
NAMES CellEditor.h
PATHS ${HURRICANE_DIR_SEARCH}
PATH_SUFFIXES include/hurricane
# Help the user find it if we cannot.
DOC "The ${HURRICANE_INCLUDE_PATH_DESCRIPTION}"
)
FIND_LIBRARY(HURRICANE_EDITOR_LIBRARY_PATH
NAMES hurricaneeditor
PATHS ${HURRICANE_DIR_SEARCH}
PATH_SUFFIXES lib
# Help the user find it if we cannot.
DOC "The ${HURRICANE_INCLUDE_PATH_DESCRIPTION}"
)
# Assume we didn't find it. # Assume we didn't find it.
SET(HURRICANE_FOUND 0) SET(HURRICANE_FOUND 0)
SET(HURRICANE_GRAPHICAL_FOUND 0) SET(HURRICANE_GRAPHICAL_FOUND 0)
IF(HURRICANE_INCLUDE_PATH) IF(HURRICANE_INCLUDE_PATH)
IF (HURRICANE_LIBRARY_PATH) IF(HURRICANE_LIBRARY_PATH)
IF(HURRICANE_ANALOGIC_INCLUDE_PATH)
IF(HURRICANE_ANALOGIC_LIBRARY_PATH)
SET(HURRICANE_FOUND "YES") SET(HURRICANE_FOUND "YES")
SET(HURRICANE_INCLUDE_DIR ${HURRICANE_INCLUDE_PATH}) SET(HURRICANE_INCLUDE_DIR
SET(HURRICANE_LIBRARIES ${HURRICANE_LIBRARY_PATH} -lanalogic) ${HURRICANE_INCLUDE_PATH}
ENDIF(HURRICANE_LIBRARY_PATH) ${HURRICANE_ANALOGIC_INCLUDE_PATH}
)
SET(HURRICANE_LIBRARIES
${HURRICANE_LIBRARY_PATH}
${HURRICANE_ANALOGIC_LIBRARY_PATH}
)
ENDIF(HURRICANE_ANALOGIC_LIBRARY_PATH)
ENDIF(HURRICANE_ANALOGIC_INCLUDE_PATH)
ENDIF(HURRICANE_LIBRARY_PATH)
ENDIF(HURRICANE_INCLUDE_PATH) ENDIF(HURRICANE_INCLUDE_PATH)
IF(HURRICANE_GRAPHICAL_INCLUDE_PATH) IF(HURRICANE_VIEWER_INCLUDE_PATH)
IF (HURRICANE_GRAPHICAL_LIBRARY_PATH) IF(HURRICANE_VIEWER_LIBRARY_PATH)
SET(HURRICANE_GRAPHICAL_FOUND "YES") IF(HURRICANE_EDITOR_INCLUDE_PATH)
SET(HURRICANE_GRAPHICAL_INCLUDE_DIR ${HURRICANE_GRAPHICAL_INCLUDE_PATH}) IF(HURRICANE_EDITOR_LIBRARY_PATH)
SET(HURRICANE_GRAPHICAL_LIBRARIES ${HURRICANE_GRAPHICAL_LIBRARY_PATH} -lhurricaneeditor) SET(HURRICANE_GRAPHICAL_FOUND "YES")
ENDIF(HURRICANE_GRAPHICAL_LIBRARY_PATH) SET(HURRICANE_GRAPHICAL_INCLUDE_DIR
ENDIF(HURRICANE_GRAPHICAL_INCLUDE_PATH) ${HURRICANE_VIEWER_INCLUDE_PATH}
${HURRICANE_EDITOR_INCLUDE_PATH}
)
SET(HURRICANE_GRAPHICAL_LIBRARIES
${HURRICANE_VIEWER_LIBRARY_PATH}
${HURRICANE_EDITOR_LIBRARY_PATH}
)
ENDIF(HURRICANE_EDITOR_LIBRARY_PATH)
ENDIF(HURRICANE_EDITOR_INCLUDE_PATH)
ENDIF(HURRICANE_VIEWER_LIBRARY_PATH)
ENDIF(HURRICANE_VIEWER_INCLUDE_PATH)
IF(NOT HURRICANE_FOUND) IF(HURRICANE_FOUND)
IF(NOT HURRICANE_FIND_QUIETLY) IF(NOT HURRICANE_FIND_QUIETLY)
MESSAGE(STATUS "HURRICANE was not found. ${HURRICANE_DIR_MESSAGE}") MESSAGE(STATUS "Found HURRICANE : ${HURRICANE_LIBRARIES}")
ELSE(NOT HURRICANE_FIND_QUIETLY)
IF(HURRICANE_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "HURRICANE was not found. ${HURRICANE_DIR_MESSAGE}")
ENDIF(HURRICANE_FIND_REQUIRED)
ENDIF(NOT HURRICANE_FIND_QUIETLY) ENDIF(NOT HURRICANE_FIND_QUIETLY)
ENDIF(NOT HURRICANE_FOUND) ELSE(HURRICANE_FOUND)
IF(HURRICANE_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "HURRICANE was not found. ${HURRICANE_DIR_MESSAGE}")
ENDIF(HURRICANE_FIND_REQUIRED)
ENDIF(HURRICANE_FOUND)
MARK_AS_ADVANCED( MARK_AS_ADVANCED(
HURRICANE_INCLUDE_PATH HURRICANE_INCLUDE_PATH
HURRICANE_LIBRARY_PATH HURRICANE_LIBRARY_PATH
HURRICANE_ANALOGIC_INCLUDE_PATH
HURRICANE_ANALOGIC_LIBRARY_PATH
HURRICANE_GRAPHICAL_INCLUDE_PATH HURRICANE_GRAPHICAL_INCLUDE_PATH
HURRICANE_GRAPHICAL_LIBRARY_PATH HURRICANE_GRAPHICAL_LIBRARY_PATH
) )

View File

@ -60,9 +60,11 @@ CellEditor::~CellEditor() {
//} //}
void CellEditor::zoomIn() { void CellEditor::zoomIn() {
view->scale(1.2, 1.2);
} }
void CellEditor::zoomOut() { void CellEditor::zoomOut() {
view->scale(0.8, 0.8);
} }
void CellEditor::fitToWindow() { void CellEditor::fitToWindow() {

View File

@ -22,14 +22,17 @@ CellGraphicsItem::CellGraphicsItem(Cell* c):
// end_for; // end_for;
//} //}
unsigned zValue = 10;
for_each_slice(slice, cell->GetSlices()) { for_each_slice(slice, cell->GetSlices()) {
for_each_go(go, slice->GetGos()) { for_each_go(go, slice->GetGos()) {
Segment* segment = dynamic_cast<Segment*>(go); Segment* segment = dynamic_cast<Segment*>(go);
if (segment) { if (segment) {
new SegmentGraphicsItem(this, segment); SegmentGraphicsItem* segmentItem = new SegmentGraphicsItem(this, segment);
segmentItem->setZValue(zValue);
} }
end_for; end_for;
} }
zValue += 10;
end_for; end_for;
} }
} }

View File

@ -1,8 +1,10 @@
#include <math.h> #include <math.h>
#include <QBitmap>
#include <QPainter> #include <QPainter>
#include <QStyleOptionGraphicsItem> #include <QStyleOptionGraphicsItem>
#include "CompositeLayer.h"
#include "BasicLayer.h" #include "BasicLayer.h"
using namespace H; using namespace H;
@ -10,11 +12,57 @@ using namespace H;
#include "CellGraphicsItem.h" #include "CellGraphicsItem.h"
#include "SegmentFigure.h" #include "SegmentFigure.h"
namespace {
QBrush getBrush(const string &pattern, int redValue, int greenValue, int blueValue) {
if (pattern == "FFFFFFFFFFFFFFFF") {
return QBrush(QColor(redValue, greenValue, blueValue));
} else {
uchar bits[8];
for (int i = 0; i < 8; i++) {
int high = pattern[i * 2];
if (('0' <= high) && (high <= '9')) {
high = high - '0';
} else {
if (('a' <= high) && (high <= 'f')) {
high = 10 + high - 'a';
} else {
if (('A' <= high) && (high <= 'F')) {
high = 10 + high - 'A';
} else {
high = '0';
}
}
}
int low = pattern[(i * 2) + 1];
if (('0' <= low) && (low <= '9')) {
low = low - '0';
} else {
if (('a' <= low) && (low <= 'f')) {
low = 10 + low - 'a';
} else {
if (('A' <= low) && (low <= 'F')) {
low = 10 + low - 'A';
} else {
low = '0';
}
}
}
bits[i] = (uchar)((high * 16) + low);
}
return QBrush(QColor(redValue, greenValue, blueValue), QBitmap::fromData(QSize(8,8), bits, QImage::Format_Mono));
}
}
}
SegmentGraphicsItem::SegmentGraphicsItem(CellGraphicsItem* master, Segment* s): SegmentGraphicsItem::SegmentGraphicsItem(CellGraphicsItem* master, Segment* s):
QGraphicsItem(master), QGraphicsItem(master),
segment(s) segment(s)
{ {
setFlag(ItemIsMovable); setFlag(ItemIsMovable);
setFlag(ItemIsSelectable);
setFlag(ItemIsFocusable);
} }
QRectF SegmentGraphicsItem::boundingRect() const { QRectF SegmentGraphicsItem::boundingRect() const {
@ -25,23 +73,47 @@ QRectF SegmentGraphicsItem::boundingRect() const {
} }
void SegmentGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { void SegmentGraphicsItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
//if (option->levelOfDetail > 1.0) {
//if (option->levelOfDetail > 1.0) { painter->setClipRect(option->exposedRect);
painter->setClipRect(option->exposedRect); Box box = segment->GetBoundingBox();
BasicLayer* layer = dynamic_cast<BasicLayer*>(segment->GetLayer()); QRectF rect;
if (layer) { boxToRectangle(box, rect);
painter->setBrush(QColor(layer->GetRedValue(), layer->GetGreenValue(), layer->GetBlueValue())); BasicLayer* blayer = dynamic_cast<BasicLayer*>(segment->GetLayer());
} else { if (blayer) {
painter->setBrush(Qt::blue); QColor layerColor(blayer->GetRedValue(),
} blayer->GetGreenValue(),
Box box = segment->GetBoundingBox(); blayer->GetBlueValue());
QRectF rect; QBrush brush(layerColor);
boxToRectangle(box, rect); brush.setStyle(Qt::Dense1Pattern);
painter->drawRect(rect); painter->setBrush(brush);
//} //painter->setBrush(getBrush(blayer->GetFillPattern(),
// blayer->GetRedValue(),
// blayer->GetGreenValue(),
// blayer->GetBlueValue()));
painter->setPen(layerColor);
painter->drawRect(rect);
} else {
CompositeLayer* clayer = dynamic_cast<CompositeLayer*>(segment->GetLayer());
if (clayer) {
for_each_basic_layer(basiclayer, clayer->GetBasicLayers()) {
QColor layerColor(basiclayer->GetRedValue(),
basiclayer->GetGreenValue(),
basiclayer->GetBlueValue());
QBrush brush(layerColor);
brush.setStyle(Qt::Dense1Pattern);
painter->setBrush(brush);
//painter->setBrush(getBrush(basiclayer->GetFillPattern(),
// basiclayer->GetRedValue(),
// basiclayer->GetGreenValue(),
// basiclayer->GetBlueValue()));
painter->setPen(layerColor);
painter->drawRect(rect);
end_for;
}
}
}
} }
void SegmentGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { void SegmentGraphicsItem::mousePressEvent(QGraphicsSceneMouseEvent *event) {
update(); update();
QGraphicsItem::mousePressEvent(event); QGraphicsItem::mousePressEvent(event);

View File

@ -8,10 +8,10 @@
using namespace H; using namespace H;
inline void boxToRectangle(const Box& box, QRectF& rec) { inline void boxToRectangle(const Box& box, QRectF& rec) {
double xmin = GetValue(box.getXMin()); double xmin = GetValue(box.getXMin() * 10.0);
double xmax = GetValue(box.getXMax()); double xmax = GetValue(box.getXMax()) * 10.0;
double ymin = GetValue(box.getYMin()); double ymin = GetValue(box.getYMin()) * 10.0;
double ymax = GetValue(box.getYMax()); double ymax = GetValue(box.getYMax()) * 10.0;
rec.setCoords(xmin, ymin, xmax, ymax); rec.setCoords(xmin, ymin, xmax, ymax);
} }

View File

@ -50,170 +50,170 @@ class Cell : public Entity {
// Types // Types
// ***** // *****
public: typedef Entity Inherit; public: typedef Entity Inherit;
class InstanceMap : public IntrusiveMap<Name, Instance> { class InstanceMap : public IntrusiveMap<Name, Instance> {
// **************************************************** // ****************************************************
public: typedef IntrusiveMap<Name, Instance> Inherit; public: typedef IntrusiveMap<Name, Instance> Inherit;
public: InstanceMap(); public: InstanceMap();
public: virtual Name _GetKey(Instance* instance) const; public: virtual Name _GetKey(Instance* instance) const;
public: virtual unsigned _GetHashValue(Name name) const; public: virtual unsigned _GetHashValue(Name name) const;
public: virtual Instance* _GetNextElement(Instance* instance) const; public: virtual Instance* _GetNextElement(Instance* instance) const;
public: virtual void _SetNextElement(Instance* instance, Instance* nextInstance) const; public: virtual void _SetNextElement(Instance* instance, Instance* nextInstance) const;
}; };
public: class SlaveInstanceSet : public IntrusiveSet<Instance> { public: class SlaveInstanceSet : public IntrusiveSet<Instance> {
// *********************************************************** // ***********************************************************
public: typedef IntrusiveSet<Instance> Inherit; public: typedef IntrusiveSet<Instance> Inherit;
public: SlaveInstanceSet(); public: SlaveInstanceSet();
public: virtual unsigned _GetHashValue(Instance* slaveInstance) const; public: virtual unsigned _GetHashValue(Instance* slaveInstance) const;
public: virtual Instance* _GetNextElement(Instance* slaveInstance) const; public: virtual Instance* _GetNextElement(Instance* slaveInstance) const;
public: virtual void _SetNextElement(Instance* slaveInstance, Instance* nextSlaveInstance) const; public: virtual void _SetNextElement(Instance* slaveInstance, Instance* nextSlaveInstance) const;
}; };
public: class NetMap : public IntrusiveMap<Name, Net> { public: class NetMap : public IntrusiveMap<Name, Net> {
// ************************************************** // **************************************************
public: typedef IntrusiveMap<Name, Net> Inherit; public: typedef IntrusiveMap<Name, Net> Inherit;
public: NetMap(); public: NetMap();
public: virtual Name _GetKey(Net* net) const; public: virtual Name _GetKey(Net* net) const;
public: virtual unsigned _GetHashValue(Name name) const; public: virtual unsigned _GetHashValue(Name name) const;
public: virtual Net* _GetNextElement(Net* net) const; public: virtual Net* _GetNextElement(Net* net) const;
public: virtual void _SetNextElement(Net* net, Net* nextNet) const; public: virtual void _SetNextElement(Net* net, Net* nextNet) const;
}; };
class PinMap : public IntrusiveMap<Name, Pin> { class PinMap : public IntrusiveMap<Name, Pin> {
// ******************************************* // *******************************************
public: typedef IntrusiveMap<Name, Pin> Inherit; public: typedef IntrusiveMap<Name, Pin> Inherit;
public: PinMap(); public: PinMap();
public: virtual Name _GetKey(Pin* pin) const; public: virtual Name _GetKey(Pin* pin) const;
public: virtual unsigned _GetHashValue(Name name) const; public: virtual unsigned _GetHashValue(Name name) const;
public: virtual Pin* _GetNextElement(Pin* pin) const; public: virtual Pin* _GetNextElement(Pin* pin) const;
public: virtual void _SetNextElement(Pin* pin, Pin* nextPin) const; public: virtual void _SetNextElement(Pin* pin, Pin* nextPin) const;
}; };
public: class SliceMap : public IntrusiveMap<const Layer*, Slice> { public: class SliceMap : public IntrusiveMap<const Layer*, Slice> {
// ************************************************************** // **************************************************************
public: typedef IntrusiveMap<const Layer*, Slice> Inherit; public: typedef IntrusiveMap<const Layer*, Slice> Inherit;
public: SliceMap(); public: SliceMap();
public: virtual const Layer* _GetKey(Slice* slice) const; public: virtual const Layer* _GetKey(Slice* slice) const;
public: virtual unsigned _GetHashValue(const Layer* layer) const; public: virtual unsigned _GetHashValue(const Layer* layer) const;
public: virtual Slice* _GetNextElement(Slice* slice) const; public: virtual Slice* _GetNextElement(Slice* slice) const;
public: virtual void _SetNextElement(Slice* slice, Slice* nextSlice) const; public: virtual void _SetNextElement(Slice* slice, Slice* nextSlice) const;
}; };
public: class MarkerSet : public IntrusiveSet<Marker> { public: class MarkerSet : public IntrusiveSet<Marker> {
// ************************************************** // **************************************************
public: typedef IntrusiveSet<Marker> Inherit; public: typedef IntrusiveSet<Marker> Inherit;
public: MarkerSet(); public: MarkerSet();
public: virtual unsigned _GetHashValue(Marker* marker) const; public: virtual unsigned _GetHashValue(Marker* marker) const;
public: virtual Marker* _GetNextElement(Marker* marker) const; public: virtual Marker* _GetNextElement(Marker* marker) const;
public: virtual void _SetNextElement(Marker* marker, Marker* nextMarker) const; public: virtual void _SetNextElement(Marker* marker, Marker* nextMarker) const;
}; };
//public: class ViewSet : public IntrusiveSet<View> { //public: class ViewSet : public IntrusiveSet<View> {
//// ********************************************** //// **********************************************
// public: typedef IntrusiveSet<View> Inherit; // public: typedef IntrusiveSet<View> Inherit;
// //
// public: ViewSet(); // public: ViewSet();
// public: virtual unsigned _GetHashValue(View* view) const; // public: virtual unsigned _GetHashValue(View* view) const;
// public: virtual View* _GetNextElement(View* view) const; // public: virtual View* _GetNextElement(View* view) const;
// public: virtual void _SetNextElement(View* view, View* nextView) const; // public: virtual void _SetNextElement(View* view, View* nextView) const;
//}; //};
// Attributes // Attributes
// ********** // **********
private: Library* _library; private: Library* _library;
private: Name _name; private: Name _name;
private: InstanceMap _instanceMap; private: InstanceMap _instanceMap;
private: QuadTree _quadTree; private: QuadTree _quadTree;
private: SlaveInstanceSet _slaveInstanceSet; private: SlaveInstanceSet _slaveInstanceSet;
private: NetMap _netMap; private: NetMap _netMap;
private: PinMap _pinMap; private: PinMap _pinMap;
private: SliceMap _sliceMap; private: SliceMap _sliceMap;
private: MarkerSet _markerSet; private: MarkerSet _markerSet;
//private: ViewSet _viewSet; //private: ViewSet _viewSet;
private: Box _abutmentBox; private: Box _abutmentBox;
private: Box _boundingBox; private: Box _boundingBox;
private: bool _isTerminal; private: bool _isTerminal;
private: bool _isFlattenLeaf; private: bool _isFlattenLeaf;
private: bool _isPad; private: bool _isPad;
private: Cell* _nextOfLibraryCellMap; private: Cell* _nextOfLibraryCellMap;
private: Cell* _nextOfSymbolCellSet; private: Cell* _nextOfSymbolCellSet;
private: multimap<Entity*,Entity*> _slaveEntityMap; private: multimap<Entity*,Entity*> _slaveEntityMap;
// Constructors // Constructors
// ************ // ************
protected: Cell(Library* library, const Name& name); protected: Cell(Library* library, const Name& name);
// Others // Others
// ****** // ******
protected: virtual void _PostCreate(); protected: virtual void _PostCreate();
protected: virtual void _PreDelete(); protected: virtual void _PreDelete();
public: virtual string _GetTypeName() const {return _TName("Cell");}; public: virtual string _GetTypeName() const {return _TName("Cell");};
public: virtual string _GetString() const; public: virtual string _GetString() const;
public: virtual Record* _GetRecord() const; public: virtual Record* _GetRecord() const;
public: InstanceMap& _GetInstanceMap() {return _instanceMap;}; public: InstanceMap& _GetInstanceMap() {return _instanceMap;};
public: QuadTree* _GetQuadTree() {return &_quadTree;}; public: QuadTree* _GetQuadTree() {return &_quadTree;};
public: SlaveInstanceSet& _GetSlaveInstanceSet() {return _slaveInstanceSet;}; public: SlaveInstanceSet& _GetSlaveInstanceSet() {return _slaveInstanceSet;};
public: NetMap& _GetNetMap() {return _netMap;}; public: NetMap& _GetNetMap() {return _netMap;};
public: PinMap& _GetPinMap() {return _pinMap;}; public: PinMap& _GetPinMap() {return _pinMap;};
public: SliceMap& _GetSliceMap() {return _sliceMap;}; public: SliceMap& _GetSliceMap() {return _sliceMap;};
public: MarkerSet& _GetMarkerSet() {return _markerSet;}; public: MarkerSet& _GetMarkerSet() {return _markerSet;};
//public: ViewSet& _GetViewSet() {return _viewSet;}; //public: ViewSet& _GetViewSet() {return _viewSet;};
public: Cell* _GetNextOfLibraryCellMap() const {return _nextOfLibraryCellMap;}; public: Cell* _GetNextOfLibraryCellMap() const {return _nextOfLibraryCellMap;};
public: Cell* _GetNextOfSymbolCellSet() const {return _nextOfSymbolCellSet;}; public: Cell* _GetNextOfSymbolCellSet() const {return _nextOfSymbolCellSet;};
public: void _SetNextOfLibraryCellMap(Cell* cell) {_nextOfLibraryCellMap = cell;}; public: void _SetNextOfLibraryCellMap(Cell* cell) {_nextOfLibraryCellMap = cell;};
public: void _SetNextOfSymbolCellSet(Cell* cell) {_nextOfSymbolCellSet = cell;}; public: void _SetNextOfSymbolCellSet(Cell* cell) {_nextOfSymbolCellSet = cell;};
public: void _Fit(const Box& box); public: void _Fit(const Box& box);
public: void _Unfit(const Box& box); public: void _Unfit(const Box& box);
public: void _AddSlaveEntity(Entity* entity, Entity* slaveEntity); public: void _AddSlaveEntity(Entity* entity, Entity* slaveEntity);
public: void _RemoveSlaveEntity(Entity* entity, Entity* slaveEntity); public: void _RemoveSlaveEntity(Entity* entity, Entity* slaveEntity);
public: void _GetSlaveEntities(SlaveEntityMap::iterator& begin, SlaveEntityMap::iterator& end); public: void _GetSlaveEntities(SlaveEntityMap::iterator& begin, SlaveEntityMap::iterator& end);
public: void _GetSlaveEntities(Entity* entity, SlaveEntityMap::iterator& begin, SlaveEntityMap::iterator& end); public: void _GetSlaveEntities(Entity* entity, SlaveEntityMap::iterator& begin, SlaveEntityMap::iterator& end);
//public: bool _IsDrawable(View* view) const; //public: bool _IsDrawable(View* view) const;
//public: bool _ContentIsDrawable(View* view) const; //public: bool _ContentIsDrawable(View* view) const;
//public: void _DrawPhantoms(View* view, const Box& updateArea, const Transformation& transformation); //public: void _DrawPhantoms(View* view, const Box& updateArea, const Transformation& transformation);
//public: void _DrawBoundaries(View* view, const Box& updateArea, const Transformation& transformation); //public: void _DrawBoundaries(View* view, const Box& updateArea, const Transformation& transformation);
//public: void _DrawContent(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation); //public: void _DrawContent(View* view, BasicLayer* basicLayer, const Box& updateArea, const Transformation& transformation);
//public: void _DrawRubbers(View* view, const Box& updateArea, const Transformation& transformation); //public: void _DrawRubbers(View* view, const Box& updateArea, const Transformation& transformation);
//public: void _DrawMarkers(View* view, const Box& updateArea, const Transformation& transformation); //public: void _DrawMarkers(View* view, const Box& updateArea, const Transformation& transformation);
//public: void _DrawDisplaySlots(View* view, const Box& area, const Box& updateArea, const Transformation& transformation); //public: void _DrawDisplaySlots(View* view, const Box& area, const Box& updateArea, const Transformation& transformation);
# endif # endif
@ -221,91 +221,91 @@ class Cell : public Entity {
// Constructors // Constructors
// ************ // ************
public: static Cell* Create(Library* library, const Name& name); public: static Cell* Create(Library* library, const Name& name);
// Accessors // Accessors
// ********* // *********
public: virtual Cell* GetCell() const {return (Cell*)this;}; public: virtual Cell* GetCell() const {return (Cell*)this;};
public: virtual Box GetBoundingBox() const; public: virtual Box GetBoundingBox() const;
public: Library* GetLibrary() const {return _library;}; public: Library* GetLibrary() const {return _library;};
public: const Name& GetName() const {return _name;}; public: const Name& GetName() const {return _name;};
public: Instance* GetInstance(const Name& name) const {return _instanceMap.GetElement(name);}; public: Instance* GetInstance(const Name& name) const {return _instanceMap.GetElement(name);};
public: Instances GetInstances() const {return _instanceMap.GetElements();}; public: Instances GetInstances() const {return _instanceMap.GetElements();};
public: Instances GetPlacedInstances() const; public: Instances GetPlacedInstances() const;
public: Instances GetFixedInstances() const; public: Instances GetFixedInstances() const;
public: Instances GetUnplacedInstances() const; public: Instances GetUnplacedInstances() const;
public: Instances GetNotUnplacedInstances() const; public: Instances GetNotUnplacedInstances() const;
public: Instances GetInstancesUnder(const Box& area) const; public: Instances GetInstancesUnder(const Box& area) const;
public: Instances GetPlacedInstancesUnder(const Box& area) const; public: Instances GetPlacedInstancesUnder(const Box& area) const;
public: Instances GetFixedInstancesUnder(const Box& area) const; public: Instances GetFixedInstancesUnder(const Box& area) const;
public: Instances GetUnplacedInstancesUnder(const Box& area) const; public: Instances GetUnplacedInstancesUnder(const Box& area) const;
public: Instances GetNotUnplacedInstancesUnder(const Box& area) const; public: Instances GetNotUnplacedInstancesUnder(const Box& area) const;
public: Instances GetSlaveInstances() const; // {return _slaveInstanceSet.GetElements();}; NOON!! public: Instances GetSlaveInstances() const; // {return _slaveInstanceSet.GetElements();}; NOON!!
public: Instances GetTerminalInstances() const; public: Instances GetTerminalInstances() const;
public: Instances GetTerminalInstancesUnder(const Box& area) const; public: Instances GetTerminalInstancesUnder(const Box& area) const;
public: Instances GetNonTerminalInstances() const; public: Instances GetNonTerminalInstances() const;
public: Instances GetNonTerminalInstancesUnder(const Box& area) const; public: Instances GetNonTerminalInstancesUnder(const Box& area) const;
public: Instances GetLeafInstances() const; public: Instances GetLeafInstances() const;
public: Instances GetLeafInstancesUnder(const Box& area) const; public: Instances GetLeafInstancesUnder(const Box& area) const;
public: Instances GetNonLeafInstances() const; public: Instances GetNonLeafInstances() const;
public: Instances GetNonLeafInstancesUnder(const Box& area) const; public: Instances GetNonLeafInstancesUnder(const Box& area) const;
public: Net* GetNet(const Name& name) const {return _netMap.GetElement(name);}; public: Net* GetNet(const Name& name) const {return _netMap.GetElement(name);};
public: Nets GetNets() const {return _netMap.GetElements();}; public: Nets GetNets() const {return _netMap.GetElements();};
public: Nets GetGlobalNets() const; public: Nets GetGlobalNets() const;
public: Nets GetExternalNets() const; public: Nets GetExternalNets() const;
public: Nets GetInternalNets() const; public: Nets GetInternalNets() const;
public: Nets GetClockNets() const; public: Nets GetClockNets() const;
public: Nets GetSupplyNets() const; public: Nets GetSupplyNets() const;
public: Nets GetPowerNets() const; public: Nets GetPowerNets() const;
public: Nets GetGroundNets() const; public: Nets GetGroundNets() const;
public: Pin* GetPin(const Name& name) const {return _pinMap.GetElement(name);}; public: Pin* GetPin(const Name& name) const {return _pinMap.GetElement(name);};
public: Pins GetPins() const {return _pinMap.GetElements();}; public: Pins GetPins() const {return _pinMap.GetElements();};
public: Slice* GetSlice(const Layer* layer) const {return _sliceMap.GetElement(layer);}; public: Slice* GetSlice(const Layer* layer) const {return _sliceMap.GetElement(layer);};
public: Slices GetSlices(const Layer::Mask& mask = ~0) const; public: Slices GetSlices(const Layer::Mask& mask = ~0) const;
// public: Views GetViews() const {return _viewSet.GetElements();}; // public: Views GetViews() const {return _viewSet.GetElements();};
// public: MainViews GetMainViews() const; // public: MainViews GetMainViews() const;
// public: MainViews GetImpactedMainViews() const; // public: MainViews GetImpactedMainViews() const;
public: Rubbers GetRubbers() const; public: Rubbers GetRubbers() const;
public: Rubbers GetRubbersUnder(const Box& area) const; public: Rubbers GetRubbersUnder(const Box& area) const;
public: Markers GetMarkers() const {return _markerSet.GetElements();}; public: Markers GetMarkers() const {return _markerSet.GetElements();};
public: Markers GetMarkersUnder(const Box& area) const; public: Markers GetMarkersUnder(const Box& area) const;
public: References GetReferences() const; public: References GetReferences() const;
public: Components GetComponents(const Layer::Mask& mask = ~0) const; public: Components GetComponents(const Layer::Mask& mask = ~0) const;
public: Components GetComponentsUnder(const Box& area, const Layer::Mask& mask = ~0) const; public: Components GetComponentsUnder(const Box& area, const Layer::Mask& mask = ~0) const;
public: Occurrences GetOccurrences(unsigned searchDepth = (unsigned)-1) const; public: Occurrences GetOccurrences(unsigned searchDepth = (unsigned)-1) const;
public: Occurrences GetOccurrencesUnder(const Box& area, unsigned searchDepth = (unsigned)-1) const; public: Occurrences GetOccurrencesUnder(const Box& area, unsigned searchDepth = (unsigned)-1) const;
public: Occurrences GetTerminalInstanceOccurrences() const; public: Occurrences GetTerminalInstanceOccurrences() const;
public: Occurrences GetTerminalInstanceOccurrencesUnder(const Box& area) const; public: Occurrences GetTerminalInstanceOccurrencesUnder(const Box& area) const;
public: Occurrences GetLeafInstanceOccurrences() const; public: Occurrences GetLeafInstanceOccurrences() const;
public: Occurrences GetLeafInstanceOccurrencesUnder(const Box& area) const; public: Occurrences GetLeafInstanceOccurrencesUnder(const Box& area) const;
public: Occurrences GetComponentOccurrences(const Layer::Mask& mask = ~0) const; public: Occurrences GetComponentOccurrences(const Layer::Mask& mask = ~0) const;
public: Occurrences GetComponentOccurrencesUnder(const Box& area, const Layer::Mask& mask = ~0) const; public: Occurrences GetComponentOccurrencesUnder(const Box& area, const Layer::Mask& mask = ~0) const;
public: Occurrences GetHyperNetRootNetOccurrences() const; public: Occurrences GetHyperNetRootNetOccurrences() const;
public: Cells GetSubCells() const; public: Cells GetSubCells() const;
public: Pathes GetRecursiveSlavePathes() const; public: Pathes GetRecursiveSlavePathes() const;
public: const Box& GetAbutmentBox() const {return _abutmentBox;}; public: const Box& GetAbutmentBox() const {return _abutmentBox;};
// Predicates // Predicates
// ********** // **********
public: bool IsCalledBy(Cell* cell) const; public: bool IsCalledBy(Cell* cell) const;
public: bool IsTerminal() const {return _isTerminal;}; public: bool IsTerminal() const {return _isTerminal;};
public: bool IsFlattenLeaf() const {return _isFlattenLeaf;}; public: bool IsFlattenLeaf() const {return _isFlattenLeaf;};
public: bool IsLeaf() const; public: bool IsLeaf() const;
public: bool IsPad() const {return _isPad;}; public: bool IsPad() const {return _isPad;};
// Updators // Updators
// ******** // ********
public: void SetName(const Name& name); public: void SetName(const Name& name);
public: void SetAbutmentBox(const Box& abutmentBox); public: void SetAbutmentBox(const Box& abutmentBox);
public: void SetTerminal(bool isTerminal) {_isTerminal = isTerminal;}; public: void SetTerminal(bool isTerminal) {_isTerminal = isTerminal;};
public: void SetFlattenLeaf(bool isFlattenLeaf) {_isFlattenLeaf = isFlattenLeaf;}; public: void SetFlattenLeaf(bool isFlattenLeaf) {_isFlattenLeaf = isFlattenLeaf;};
public: void SetPad(bool isPad) {_isPad = isPad;}; public: void SetPad(bool isPad) {_isPad = isPad;};
public: void FlattenNets(bool buildRings=true); public: void FlattenNets(bool buildRings=true);
public: void Materialize(); public: void Materialize();
public: void Unmaterialize(); public: void Unmaterialize();
}; };

File diff suppressed because it is too large Load Diff

View File

@ -23,30 +23,27 @@ CellViewer::~CellViewer() {
delete layersWidget; delete layersWidget;
} }
//void CellViewer::keyPressEvent(QKeyEvent *event) { static int scrollStep = GetUnit(200);
// switch (event->key()) {
// case Qt::Key_Plus: void CellViewer::keyPressEvent(QKeyEvent *event) {
// zoom(ZoomInFactor); switch (event->key()) {
// break; case Qt::Key_Left:
// case Qt::Key_Minus: cellWidget->scroll(-scrollStep, 0);
// zoom(ZoomOutFactor); break;
// break; case Qt::Key_Right:
// case Qt::Key_Left: cellWidget->scroll(+scrollStep, 0);
// scroll(-ScrollStep, 0); break;
// break; case Qt::Key_Down:
// case Qt::Key_Right: cellWidget->scroll(0, -scrollStep);
// scroll(+ScrollStep, 0); break;
// break; case Qt::Key_Up:
// case Qt::Key_Down: cellWidget->scroll(0, +scrollStep);
// scroll(0, -ScrollStep); break;
// break; default:
// case Qt::Key_Up: QWidget::keyPressEvent(event);
// scroll(0, +ScrollStep); }
// break; }
// default:
// QWidget::keyPressEvent(event);
// }
//}
// //
//void CellViewer::wheelEvent(QWheelEvent *event) { //void CellViewer::wheelEvent(QWheelEvent *event) {
// int numDegrees = event->delta() / 8; // int numDegrees = event->delta() / 8;

View File

@ -31,6 +31,9 @@ class CellViewer : public QMainWindow {
void zoomIn(); void zoomIn();
void zoomOut(); void zoomOut();
void fitToWindow(); void fitToWindow();
protected:
void keyPressEvent(QKeyEvent *event);
}; };
#endif #endif

View File

@ -22,6 +22,7 @@ using namespace H;
#include <QPaintEvent> #include <QPaintEvent>
#include <QPainter> #include <QPainter>
#include <QBitmap>
#include <math.h> #include <math.h>
#include <functional> #include <functional>
@ -34,7 +35,7 @@ QBrush getBrush(const string &pattern, int redValue, int greenValue, int blueVal
if (pattern == "FFFFFFFFFFFFFFFF") { if (pattern == "FFFFFFFFFFFFFFFF") {
return QBrush(QColor(redValue, greenValue, blueValue)); return QBrush(QColor(redValue, greenValue, blueValue));
} else { } else {
char bits[8]; uchar bits[8];
for (int i = 0; i < 8; i++) { for (int i = 0; i < 8; i++) {
int high = pattern[i * 2]; int high = pattern[i * 2];
if (('0' <= high) && (high <= '9')) { if (('0' <= high) && (high <= '9')) {
@ -64,10 +65,10 @@ QBrush getBrush(const string &pattern, int redValue, int greenValue, int blueVal
} }
} }
} }
bits[i] = (char)((high * 16) + low); bits[i] = (uchar)((high * 16) + low);
} }
return QBrush(QColor(redValue, greenValue, blueValue),
QPixmap(bits)); return QBrush(QColor(redValue, greenValue, blueValue), QBitmap::fromData(QSize(8,8), bits, QImage::Format_Mono));
} }
} }
@ -1616,8 +1617,7 @@ CellWidget::scroll(const Unit& dx,
if ((getSize(width()) < labs(dx)) || (getSize(height()) < labs(dy))) { if ((getSize(width()) < labs(dx)) || (getSize(height()) < labs(dy))) {
reframe(getCenter().getTranslated(-dx, -dy)); reframe(getCenter().getTranslated(-dx, -dy));
redraw(); redraw();
} } else {
else {
int sdx = getScreenSize(dx); int sdx = getScreenSize(dx);
int sdy = getScreenSize(dy); int sdy = getScreenSize(dy);
@ -1649,32 +1649,35 @@ CellWidget::scroll(const Unit& dx,
if (0 < sdy) { if (0 < sdy) {
//bitBlt(this, sdx, 0, this, 0, sdy, w - sdx, h - sdy); //bitBlt(this, sdx, 0, this, 0, sdy, w - sdx, h - sdy);
invalidate(QRect(-1, -1, sdx + 1, h + 1)); invalidate(QRect(-1, -1, sdx + 1, h + 1));
_redraw(); //_redraw();
invalidate(QRect(sdx - 1, h - sdy - 1, w + 1, h + 1)); invalidate(QRect(sdx - 1, h - sdy - 1, w + 1, h + 1));
_redraw(); //_redraw();
} update();
else { } else {
//bitBlt(this, sdx, -sdy, this, 0, 0, w - sdx, h + sdy, CopyROP); //bitBlt(this, sdx, -sdy, this, 0, 0, w - sdx, h + sdy, CopyROP);
invalidate(QRect(-1, -1, sdx + 1, h + 1)); invalidate(QRect(-1, -1, sdx + 1, h + 1));
_redraw(); //_redraw();
invalidate(QRect(sdx - 1, -1, w + 1, -sdy + 1)); invalidate(QRect(sdx - 1, -1, w + 1, -sdy + 1));
_redraw(); //_redraw();
update();
} }
} }
else { else {
if (0 < sdy) { if (0 < sdy) {
//bitBlt(this, 0, 0, this, -sdx, sdy, w + sdx, h - sdy, CopyROP); //bitBlt(this, 0, 0, this, -sdx, sdy, w + sdx, h - sdy, CopyROP);
invalidate(QRect(w + sdx - 1, -1, w + 1, h + 1)); invalidate(QRect(w + sdx - 1, -1, w + 1, h + 1));
_redraw(); // _redraw();
invalidate(QRect(-1, h - sdy - 1, w + sdx + 1, h + 1)); invalidate(QRect(-1, h - sdy - 1, w + sdx + 1, h + 1));
_redraw(); //_redraw();
update();
} }
else { else {
//bitBlt(this, 0, -sdy, this, -sdx, 0, w + sdx, h + sdy); //bitBlt(this, 0, -sdy, this, -sdx, 0, w + sdx, h + sdy);
invalidate(QRect(w + sdx - 1, -1, w + 1, h + 1)); invalidate(QRect(w + sdx - 1, -1, w + 1, h + 1));
_redraw(); //_redraw();
invalidate(QRect(-1, -1, w + sdx + 1, -sdy + 1)); invalidate(QRect(-1, -1, w + sdx + 1, -sdy + 1));
_redraw(); //_redraw();
update();
} }
} }