00001 // Torc - Copyright 2011 University of Southern California. All Rights Reserved. 00002 // $HeadURL: https://torc-isi.svn.sourceforge.net/svnroot/torc-isi/branches/staging/0.9/src/torc/placer/PlacerHeuristicBase.hpp $ 00003 // $Id: PlacerHeuristicBase.hpp 10 2011-10-12 18:40:16Z nsteiner $ 00004 00005 // This program is free software: you can redistribute it and/or modify it under the terms of the 00006 // GNU General Public License as published by the Free Software Foundation, either version 3 of the 00007 // License, or (at your option) any later version. 00008 // 00009 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; 00010 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See 00011 // the GNU General Public License for more details. 00012 // 00013 // You should have received a copy of the GNU General Public License along with this program. If 00014 // not, see <http://www.gnu.org/licenses/>. 00015 00016 /// \file 00017 /// \brief Header for the Placer class. 00018 00019 #ifndef TORC_PLACER_PLACERHEURISTICBASE_HPP 00020 #define TORC_PLACER_PLACERHEURISTICBASE_HPP 00021 00022 #include "torc/physical/Design.hpp" 00023 #include "torc/placer/DeviceWrapper.hpp" 00024 #include <boost/timer.hpp> 00025 00026 namespace torc { 00027 namespace placer { 00028 00029 /// \brief Simulated annealing algorithm class. 00030 class PlacerHeuristicBase { 00031 protected: 00032 //types 00033 typedef architecture::DDB DDB; 00034 typedef boost::uint32_t uint32; 00035 typedef torc::physical::DesignSharedPtr DesignSharedPtr; 00036 00037 DeviceWrapper& mDevice; 00038 DesignSharedPtr mDesign; 00039 00040 uint32 mMovesPerTemperature; 00041 uint32 mInitialTemperature; 00042 //COOLING SCHEDULE 00043 //MOVE SELECTION PROBABILTY FOR TYPES 00044 00045 public: 00046 // the heuristic may be the site mapping structure... 00047 // heuristic should contain most of the numeric constants here 00048 // probably functions for cooling schedule and such as well 00049 // in fact, the heuristic may wrap the placement entirely... as we do in routing 00050 PlacerHeuristicBase(DeviceWrapper& inDevice, DesignSharedPtr inDesign) 00051 : mDevice(inDevice), mDesign(inDesign), 00052 mMovesPerTemperature(1000), mInitialTemperature(10000) { 00053 00054 // crawl the design to extract RPMS and create corresponding site types. 00055 /*InstanceSharedPtrVector::iterator p = mDesign->instancesBegin(); 00056 InstanceSharedPtrVector::iterator e = mDesign->instancesEnd(); 00057 for ( ; p != e; p++) { 00058 InstanceSharedPtr instance = *p; 00059 uint32 typeIndex = mDevice.mTypeMapping.getTypeIndex(instance->getType()); 00060 instance->setAnnotation(ePlacerInstanceTypeIndex, typeIndex); 00061 00062 mAllInstances.push_back(instance); 00063 mAllInstancesByType[typeIndex].push_back(instance); 00064 }*/ 00065 00066 00067 00068 } 00069 00070 ~PlacerHeuristicBase() {} 00071 00072 uint32 getMovesPerTemperature() { return mMovesPerTemperature; } 00073 uint32 getInitialTemperature() { return mInitialTemperature; } 00074 uint32 updateTemperature() { return 0; } 00075 00076 void updateCostFull() {} 00077 void updateCostRemovePair() {} // remove a pair of instance from cost 00078 void updateCostAddPair() {} // add a pair of instances from cost 00079 00080 }; // class PlacerHeuristicBase 00081 } // namespace placer 00082 } // namespace torc 00083 00084 #endif // TORC_PLACER_PLACERHEURISTICBASE_HPP