torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ArchitectureExample.cpp File Reference

Example program to open a device database and do something with it. More...

#include "torc/Architecture.hpp"
#include "torc/Common.hpp"
#include <iostream>
+ Include dependency graph for ArchitectureExample.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Detailed Description

Example program to open a device database and do something with it.

Definition in file ArchitectureExample.cpp.

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 27 of file ArchitectureExample.cpp.

27  {
28 
29  // construct and initialize the device database
30  (void) argc;
31  DirectoryTree directoryTree(argv[0]);
32  DeviceDesignator designator("xc6vlx75tff484-1");
33  DDB ddb(designator);
34 
35  // look up a site output and convert it to a tilewire
36  const Sites& sites = ddb.getSites();
37  SiteIndex index = sites.findSiteIndex("SLICE_X0Y119");
38  const Site& site = sites.getSite(index);
39  Tilewire pinTilewire = site.getPinTilewire("A");
40  std::cout << ddb << pinTilewire << std::endl;
41 
42  // look up arcs that connect from this tilewire
43  ArcVector sinks;
44  ddb.expandSegmentSinks(pinTilewire, sinks);
45  ArcVector::const_iterator pos = sinks.begin();
46  ArcVector::const_iterator end = sinks.end();
47  while(pos < end)
48  std::cout << "\t" << *pos++ << std::endl;
49 
50  return 0;
51 }
Encapsulation of a device designator and its constituent elements.
Device database, including complete wiring and logic support.
Definition: DDB.hpp:42
const Tilewire getPinTilewire(const std::string &inName) const
Returns the Tilewire associated with the specified pin name.
Definition: Site.hpp:70
std::vector< Arc > ArcVector
Vector of Arc objects.
Definition: Arc.hpp:78
Encapsulation of a device logic site.
Definition: Site.hpp:30
Site type and population data for the family and the device.
Definition: Sites.hpp:45
Encapsulation of a device tile and wire pair.
Definition: Tilewire.hpp:39
const Array< const Site > & getSites(void) const
Returns the sites for this family.
Definition: Sites.hpp:127
Encapsulation of filesystem paths that are used by the library.
SiteIndex findSiteIndex(const string &inName) const
Returns the site index for the given site name.
Definition: Sites.hpp:134
const Site & getSite(SiteIndex inSiteIndex) const
Returns the site for the specified index.
Definition: Sites.hpp:129
Encapsulation of a site index in an unsigned 32-bit integer.

+ Here is the call graph for this function: