torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
XdlExporter.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 Header for the XdlExport class.
18 
19 #ifndef TORC_PHYSICAL_XDLEXPORTER_HPP
20 #define TORC_PHYSICAL_XDLEXPORTER_HPP
21 
22 #include "torc/physical/Design.hpp"
23 #include <boost/smart_ptr.hpp>
24 #include <iostream>
25 #include <string>
26 
27 namespace torc {
28 namespace physical {
29 
30  /// \brief Physical design exporter for XDL.
31  class XdlExporter {
32  // members
33  /// \brief The output stream.
34  std::ostream& mStream;
35  /// \brief The indent count.
37  /// \brief The indent string.
39  // functions
40  /// \brief Indent the current line.
41  void indent(void) const
42  { int count = mIndentCount; while(count--) mStream << mIndentString; }
43  public:
44  // constructors
45  /// \brief Public constructor.
46  /// \param inStream The output stream.
47  /// \param inIndentString The indent string. The default parameter uses a single tab.
48  XdlExporter(std::ostream& inStream, const std::string& inIndentString = "\t")
49  : mStream(inStream), mIndentCount(0), mIndentString(inIndentString) {}
50  // operators
51  /// \brief Top level design exporter operator.
52  void operator() (const DesignSharedPtr& inDesignPtr);
53  // functions
54  /// \brief Writes the given Circuit.
55  void write(const Circuit& circuit);
56  /// \brief Writes the given Design.
57  void write(const Design& design);
58  /// \brief Writes the given Module.
59  void write(const Module& module);
60  /// \brief Writes the given Port.
61  void write(const Port& port);
62  /// \brief Writes the given Instance.
63  void write(const Instance& instance);
64  /// \brief Writes the given Net.
65  void write(const Net& net);
66  /// \brief Writes the given InstancePin, with an optional trailing comma.
67  void write(const InstancePin& instancePin, EPinDirection pinDirection, bool comma);
68  /// \brief Writes the given pip, with an options trailing comma.
69  void write(const Pip& pip, bool comma);
70  /// \brief Writes the given Routethrough.
71  void write(const Routethrough& routethrough);
72  /// \brief Writes the given ConfigMap.
73  void write(const ConfigMap& configMap);
74  };
75 
76 } // namespace physical
77 } // namespace torc
78 
79 #endif // TORC_PHYSICAL_XDLEXPORTER_HPP
void write(const Circuit &circuit)
Writes the given Circuit.
Definition: XdlExporter.cpp:41
std::ostream & mStream
The output stream.
Definition: XdlExporter.hpp:34
Physical netlist design.
std::string string
Physical design instance.
Header for the Design class.
Physical design net.
void operator()(const DesignSharedPtr &inDesignPtr)
Top level design exporter operator.
Definition: XdlExporter.cpp:25
Physical design instance-pin pair, suitable for specifying a net endpoint.
void indent(void) const
Indent the current line.
Definition: XdlExporter.hpp:41
boost::shared_ptr< Design > DesignSharedPtr
Shared pointer encapsulation of a Design.
int mIndentCount
The indent count.
Definition: XdlExporter.hpp:36
Physical design programmable interconnect point.
Definition: Pip.hpp:34
XdlExporter(std::ostream &inStream, const std::string &inIndentString="\t")
Public constructor.
Definition: XdlExporter.hpp:48
Configuration setting map.
Definition: ConfigMap.hpp:39
Module input or output port.
Circuit composed of instances and nets.
Definition: Circuit.hpp:46
Hierarchical module.
Definition: Module.hpp:33
EPinDirection
Enumeration of instance pin directionality.
Physical design exporter for XDL.
Definition: XdlExporter.hpp:31
std::string mIndentString
The indent string.
Definition: XdlExporter.hpp:38