torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Virtex2PrimitiveStructure.cpp
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 Source for the Virtex2PrimitiveStructure class.
18 
20 #include <iostream>
21 
22 namespace torc {
23 namespace packer {
24 
25  using namespace torc::architecture;
26  /// \brief The type name of slice primitives
27  const std::string cSliceTypeName = "SLICE";
28  /// \brief The name of the BYINVOUTUSED slice element
29  const std::string cByInvOutUsedElementName = "BYINVOUTUSED";
30 
32  // look up the SLICE BYINVOUTUSED element
33  if(mPrimitiveDefPtr->getName() == cSliceTypeName) {
34  // look for the BYINVOUTUSED element
35  const PrimitiveElementArray& elements = mPrimitiveDefPtr->getElements();
38  while(ep < ee) {
39  const PrimitiveElement& element = *ep++;
40  if(element.getName() != cByInvOutUsedElementName) continue;
41  // look for the one and only input pin, and add it to the inverted inputs set
42  const PrimitiveElementPinArray& elementPins = element.getPins();
45  while(pp < pe) { if(pp->isInput()) mInvertedInputs.insert(&*pp); pp++; }
46  }
47  }
48 
49 // oops: I need to structure things differently, because the base class has already invoked this
50 // // proceed with the base class functionality
51 // PrimitiveStructure::initialize();
52  }
53 
54 } // namespace architecture
55 } // namespace torc
const std::string cByInvOutUsedElementName
The name of the BYINVOUTUSED slice element.
const const PrimitiveElement * const_iterator
Constant T iterator type.
Definition: Array.hpp:83
T * end(void)
Returns the non-constant end iterator.
Definition: Array.hpp:97
std::string string
const string & getName(void) const
Returns the name of the element.
PrimitiveElementPinArray & getPins(void)
Returns a non-constant array of element pins. This function should only be used by the Sites class d...
Header for the Virtex2PrimitiveStructure class.
Encapsulation of a primitive site element. Primitive elements are subcomponents of logic primitive s...
const std::string cSliceTypeName
The type name of slice primitives.
T * begin(void)
Returns the non-constant begin iterator.
Definition: Array.hpp:95
virtual void initialize(void)
Initialize this object based on the PrimitiveDef information.