Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members

Nodes.h

Go to the documentation of this file.
00001 /**************************************************************************
00002 ***    
00003 *** Copyright (c) 1995-2000 Regents of the University of California,
00004 ***               Andrew E. Caldwell, Andrew B. Kahng and Igor L. Markov
00005 *** Copyright (c) 2000-2004 Regents of the University of Michigan,
00006 ***               Saurabh N. Adya, Jarrod A. Roy and Igor L. Markov
00007 ***
00008 ***  Contact author(s): abk@cs.ucsd.edu, imarkov@umich.edu
00009 ***  Original Affiliation:   UCLA, Computer Science Department,
00010 ***                          Los Angeles, CA 90095-1596 USA
00011 ***
00012 ***  Permission is hereby granted, free of charge, to any person obtaining 
00013 ***  a copy of this software and associated documentation files (the
00014 ***  "Software"), to deal in the Software without restriction, including
00015 ***  without limitation 
00016 ***  the rights to use, copy, modify, merge, publish, distribute, sublicense, 
00017 ***  and/or sell copies of the Software, and to permit persons to whom the 
00018 ***  Software is furnished to do so, subject to the following conditions:
00019 ***
00020 ***  The above copyright notice and this permission notice shall be included
00021 ***  in all copies or substantial portions of the Software.
00022 ***
00023 *** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
00024 *** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
00025 *** OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
00026 *** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
00027 *** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
00028 *** OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
00029 *** THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00030 ***
00031 ***
00032 ***************************************************************************/
00033 
00034 
00035 #ifndef NODES_H
00036 #define NODES_H
00037 
00038 #include <vector>
00039 #include <algorithm>
00040 #include <math.h>
00041 #include <stdlib.h>
00042 #include "Node.h"
00043 
00044 namespace parquetfp
00045 {
00046    class Nets;
00047    using namespace std;
00048    typedef std::vector<Node>::iterator itNode;
00049 
00050    class Nodes
00051    {
00052    private:
00053       vector<Node> _nodes;
00054       vector<Node> _terminals;
00055   
00056    public:
00057       Nodes(char* baseName);
00058       Nodes(void)
00059          {}
00060 
00061       unsigned getNumNodes(void);
00062 
00063       void parseNodes(char* fnameBl);
00064       void parsePl(char* fnamePl);
00065 
00066       Node& getNode(unsigned index)
00067          { return _nodes[index]; }
00068 
00069       Node& getTerm(unsigned index)
00070          { return _terminals[index]; }
00071 
00072       void putNewNode(Node& node)
00073          { _nodes.push_back(node); }
00074 
00075       void putNewTerm(Node& term)
00076          { _terminals.push_back(term); }
00077 
00078       void clearNodes(void)
00079          { _nodes.resize(0); }
00080 
00081       void clearTerm(void)
00082          { _terminals.resize(0); }
00083 
00084       void clean(void)
00085          {
00086             _nodes.clear();
00087             _terminals.clear();
00088          }
00089 
00090       itNode nodesBegin(void)
00091          { return _nodes.begin(); }
00092 
00093       itNode nodesEnd(void)
00094          { return _nodes.end(); }
00095 
00096 
00097       unsigned getNumTerminals(void)
00098          { return _terminals.size(); }
00099   
00100       Node& getTerminal(unsigned index)
00101          { return _terminals[index]; }
00102 
00103       itNode terminalsBegin(void)
00104          { return _terminals.begin(); }
00105       itNode terminalsEnd(void)
00106          { return _terminals.end(); }
00107   
00108       vector<double> getNodeWidths();
00109       vector<double> getNodeHeights();
00110       vector<double> getXLocs();
00111       vector<double> getYLocs();
00112       double getNodeWidth(unsigned index);
00113       double getNodeHeight(unsigned index);
00114       double getNodesArea();
00115       double getMinHeight();
00116       double getMinWidth();
00117 
00118       void putNodeWidth(unsigned index, double width);
00119       void putNodeHeight(unsigned index, double height);
00120 
00121       void changeOrient(unsigned index, ORIENT newOrient, Nets& nets);
00122       void updatePinsInfo(Nets& nets);
00123  
00124       void updatePlacement(int index, bool type, double xloc, double yloc);
00125       void updateOrient(int index, bool type, ORIENT newOrient);
00126       void updateHW(int index, bool type, double width, double height);
00127 
00128       //initialize info for fast pin offset access.
00129       //if reset is true then all pin-offsets are assumed to be non-trivial
00130       //useful for fast HPWL calc.
00131       void initNodesFastPOAccess(Nets& nets, bool reset=false);
00132 
00133       void savePl(char* baseFileName);
00134       void saveNodes(char* baseFileName);
00135 
00136       //following functions save in Capo format
00137       void saveCapoNodes(char* baseFileName);
00138       void saveCapoPl(char* baseFileName);
00139       void saveCapoScl(char* baseFileName, double reqdAR, double reqdWS);
00140    };
00141 }
00142 //using namespace parquetfp;
00143 
00144 #endif

Generated on Mon Apr 25 01:09:24 2005 for Parquete by doxygen 1.3.2