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/architecture/XdlImporter.hpp $ 00003 // $Id: XdlImporter.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 XdlImporter class. 00018 00019 #ifndef TORC_ARCHITECTURE_XDLIMPORTER_HPP 00020 #define TORC_ARCHITECTURE_XDLIMPORTER_HPP 00021 00022 #include "torc/physical/XdlImporter.hpp" 00023 #include "torc/architecture/DDB.hpp" 00024 #include "torc/architecture/InstancePin.hpp" 00025 #include <iostream> 00026 #include "torc/architecture/OutputStreamHelpers.hpp" 00027 #include "torc/architecture/DDBStreamHelper.hpp" 00028 00029 namespace torc { 00030 namespace architecture { 00031 00032 /// \brief Architecture aware importer from XDL format into a physical design. 00033 class XdlImporter : public torc::physical::XdlImporter { 00034 protected: 00035 // typedefs 00036 /// \brief Type of the superclass. 00037 typedef torc::physical::XdlImporter super; 00038 // members 00039 /// \brief The device database pointer. 00040 DDB* mDDBPtr; 00041 // functions 00042 /// \brief Initialize the device database. 00043 virtual void initializeDatabase(void); 00044 /// \brief Bind the given instance pin to its database Tilewire if applicable. 00045 virtual void bind(torc::physical::InstancePinSharedPtr& inInstancePin); 00046 /// \brief Bind the given pip to the database arc and wire usage if applicable. 00047 virtual void bind(torc::physical::Pip& inPip, EPipType inPipType); 00048 public: 00049 // constructors 00050 /// \brief Basic constructor. 00051 XdlImporter(void) : super(), mDDBPtr(0) {} 00052 /// \brief Destructor. 00053 ~XdlImporter(void) { 00054 if(mDDBPtr) { delete mDDBPtr; mDDBPtr = 0; } 00055 } 00056 // accessors 00057 /// \brief Returns the pointer for the device database. 00058 DDB* getDDBPtr(void) { return mDDBPtr; } 00059 // functions 00060 /// \brief Releases ownership of the device database. The caller is now responsible for 00061 /// deleting it. 00062 DDB* releaseDDBPtr(void) { DDB* ddbPtr = mDDBPtr; mDDBPtr = 0; return ddbPtr; } 00063 }; 00064 00065 } // namespace architecture 00066 } // namespace torc 00067 00068 #endif // TORC_ARCHITECTURE_XDLIMPORTER_HPP