summaryrefslogtreecommitdiffstats
path: root/src/phys/place/place_base.h
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2007-02-16 08:01:00 -0800
committerAlan Mishchenko <alanmi@berkeley.edu>2007-02-16 08:01:00 -0800
commit607c253cd2712bacce21ca9b98a848f331ea03a9 (patch)
treef1189c20d24fec46f4fef155de11d347144c59f3 /src/phys/place/place_base.h
parent5f3e4c0fe21ba5e24db0c187a616a28afc0dabae (diff)
downloadabc-607c253cd2712bacce21ca9b98a848f331ea03a9.tar.gz
abc-607c253cd2712bacce21ca9b98a848f331ea03a9.tar.bz2
abc-607c253cd2712bacce21ca9b98a848f331ea03a9.zip
Version abc70216
Diffstat (limited to 'src/phys/place/place_base.h')
-rw-r--r--src/phys/place/place_base.h125
1 files changed, 125 insertions, 0 deletions
diff --git a/src/phys/place/place_base.h b/src/phys/place/place_base.h
new file mode 100644
index 00000000..c9f71e43
--- /dev/null
+++ b/src/phys/place/place_base.h
@@ -0,0 +1,125 @@
+/*===================================================================*/
+//
+// place_base.h
+//
+// Aaron P. Hurst, 2003-2007
+// ahurst@eecs.berkeley.edu
+//
+/*===================================================================*/
+
+#if !defined(PLACE_BASE_H_)
+#define PLACE_BASE_H_
+
+// --------------------------------------------------------------------
+// Data structures
+//
+// --------------------------------------------------------------------
+
+// --- a C++ bool-like type
+//typedef char bool;
+#ifndef bool
+#define bool int
+#endif
+
+#define true 1
+#define false 0
+
+
+// --- Rect - rectangle
+
+typedef struct Rect {
+ float x, y;
+ float w, h;
+} Rect;
+
+
+// --- AbstractCell - a definition of a cell type
+
+typedef struct AbstractCell {
+ char *m_label; // string description
+ float m_width, m_height; // dimensions
+ bool m_pad; // a pad (external I/O) cell?
+} AbstractCell;
+
+
+// --- ConcreteCell - a design object
+
+typedef struct ConcreteCell {
+ AbstractCell *m_parent; // cell type
+ char *m_label; // string description
+ int m_id; // a unique ID (see below)
+ bool m_fixed; // position is fixed?
+ float m_x, m_y; // center of cell
+} ConcreteCell;
+
+
+// --- ConcreteNet - a design net
+
+typedef struct ConcreteNet {
+ int m_id; // a unique ID (see below)
+ int m_numTerms; // num. of connected cells
+ ConcreteCell **m_terms; // connected cells
+ float m_weight; // relative weight
+} ConcreteNet;
+
+
+// A note about IDs - the IDs are non-nonegative integers. They need not
+// be contiguous, but this is certainly a good idea, as they are stored
+// in a non-sparse array.
+// Cells and nets have separate ID spaces.
+
+// --------------------------------------------------------------------
+// Global variable prototypes
+//
+// --------------------------------------------------------------------
+
+// NOTE: None of these need to be managed externally.
+
+extern int g_place_numCells; // number of cells
+extern int g_place_numNets; // number of nets
+extern float g_place_rowHeight; // height of placement row
+extern Rect g_place_coreBounds; // border of placeable area
+ // (x,y) = corner
+extern Rect g_place_padBounds; // border of total die area
+ // (x,y) = corner
+
+extern ConcreteCell **g_place_concreteCells; // all concrete cells
+extern ConcreteNet **g_place_concreteNets; // all concrete nets
+
+
+// --------------------------------------------------------------------
+// Function prototypes
+//
+// --------------------------------------------------------------------
+
+void addConcreteNet(ConcreteNet *net);
+void addConcreteCell(ConcreteCell *cell);
+void delConcreteNet(ConcreteNet *net);
+void delConcreteCell(ConcreteCell *cell);
+
+void globalPreplace(float utilization);
+void globalPlace();
+void globalIncremental();
+void globalFixDensity(int numBins, float maxMovement);
+
+float fastUnplace(ConcreteCell *cell); // UNIMPLEMENTED
+float fastPlace(int numCells, ConcreteCell *cells []); // UNIMPLEMENTED
+float fastEstimate(int numCells, ConcreteCell *cells []); // UNIMPLEMENTED
+
+Rect getNetBBox(const ConcreteNet *net);
+float getNetWirelength(const ConcreteNet *net);
+float getTotalWirelength();
+float getCellArea(const ConcreteCell *cell);
+
+
+// comparative qsort-style functions
+int netSortByL(const void *a, const void *b);
+int netSortByR(const void *a, const void *b);
+int netSortByB(const void *a, const void *b);
+int netSortByT(const void *a, const void *b);
+int netSortByID(const void *a, const void *b);
+int cellSortByX(const void *a, const void *b);
+int cellSortByY(const void *a, const void *b);
+int cellSortByID(const void *a, const void *b);
+
+#endif