torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Generic.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 /// \file
17 /// \brief Main torc::generic namespace header.
18 
19 /// \namespace torc::generic
20 /// \brief Namespace for the Torc generic netlist, including EDIF and BLIF importers and exporters.
21 
22 #ifndef TORC_GENERIC_HPP
23 #define TORC_GENERIC_HPP
24 
25 #include "torc/generic/Apply.hpp"
26 #include "torc/generic/Bundle.hpp"
28 #include "torc/generic/Cell.hpp"
30 #include "torc/generic/Cloning.hpp"
37 #include "torc/generic/Design.hpp"
42 #include "torc/generic/Event.hpp"
43 #include "torc/generic/Extern.hpp"
53 #include "torc/generic/Library.hpp"
59 #include "torc/generic/Net.hpp"
73 #include "torc/generic/Port.hpp"
86 #include "torc/generic/Pruning.hpp"
88 #include "torc/generic/Root.hpp"
89 #include "torc/generic/Scalar.hpp"
99 #include "torc/generic/Status.hpp"
101 #include "torc/generic/SymTab.hpp"
103 #include "torc/generic/Timing.hpp"
104 #include "torc/generic/Unit.hpp"
106 #include "torc/generic/Value.hpp"
107 #include "torc/generic/Vector.hpp"
115 #include "torc/generic/View.hpp"
120 #include "torc/generic/Written.hpp"
121 #include "torc/generic/Error.hpp"
122 #include "torc/generic/Log.hpp"
123 #include "torc/generic/Message.hpp"
138 // #including this would require that sources be compiled with -Wno-overloaded-virtual.
139 //#include "torc/generic/verilog/VerilogImporterVisitor.hpp"
143 
144 namespace torc {
145 namespace generic {
146 
147  // temporary patch for FCCM paper compatibility
148  class EdifImporter : public EdifParser {
149  protected:
152  public:
153  EdifImporter(ObjectFactorySharedPtr& inObjectFactoryPtr)
154  : mObjectFactoryPtr(inObjectFactoryPtr), mRootPtr(inObjectFactoryPtr->newRootPtr("new")) {}
155  virtual ~EdifImporter(void) throw () {}
156  void operator() (std::ostream& inStream, std::string& inName) {
157  mRootPtr->setName(inName);
158  LinkerSharedPtr linkerPtr(new Linker(mRootPtr));
159  ParserOptions options;
160  parse(inName, mRootPtr, linkerPtr, mObjectFactoryPtr, options);
161  }
163  };
164 
165  // temporary patch for FCCM paper compatibility
166  class EdifExporter {
167  protected:
168  std::ostream& mStream;
169  public:
170  EdifExporter(std::ostream& inStream) : mStream(inStream) {}
171  void operator() (RootSharedPtr& inRootPtr) {
172  Decompiler decompiler(inRootPtr, mStream);
173  decompiler();
174  }
175  };
176 
177 } // namespace generic
178 } // namespace torc
179 
180 #endif // TORC_GENERIC_HPP
void operator()(std::ostream &inStream, std::string &inName)
Definition: Generic.hpp:156
The Top level parser for parsing EDIF files.
Definition: EdifParser.hpp:41
std::ostream & mStream
Definition: Generic.hpp:168
Header for the VerilogImporter class.
boost::shared_ptr< Linker > LinkerSharedPtr
Header for the VerilogExporter class.
boost::shared_ptr< ObjectFactory > ObjectFactorySharedPtr
std::string string
EdifExporter(std::ostream &inStream)
Definition: Generic.hpp:170
void operator()(RootSharedPtr &inRootPtr)
Definition: Generic.hpp:171
Contains functions for flattening a design.
virtual ~EdifImporter(void)
Definition: Generic.hpp:155
Represents a repository of unresolved usage references.
Definition: Linker.hpp:51
Contains definition for CompositionType.
Interface for Cloneable.
EdifImporter(ObjectFactorySharedPtr &inObjectFactoryPtr)
Definition: Generic.hpp:153
RootSharedPtr getRootPtr(void)
Definition: Generic.hpp:162
Header for the VerilogExporterVisitor class.
Header for the VerilogNames class.
boost::shared_ptr< Root > RootSharedPtr
void parse(const std::string &inFileName, const RootSharedPtr &outRoot, const LinkerSharedPtr &outLinker, const ObjectFactorySharedPtr &inFactory, const ParserOptions &inOptions)
Definition: EdifParser.cpp:40
ObjectFactorySharedPtr mObjectFactoryPtr
Definition: Generic.hpp:150