torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
torc::ArchitectureBrowser Class Reference

Utility class for exploring database contents. More...

#include <ArchitectureBrowser.hpp>

+ Collaboration diagram for torc::ArchitectureBrowser:

Public Member Functions

 ArchitectureBrowser (DDB &inDB)
 Constructor. More...
 
 ~ArchitectureBrowser ()
 Destructor. More...
 
void browse ()
 Function to begin an interactive browsing session. More...
 
void functionPrompt (const char *inPrompt, BrowserFunction f)
 Secondary menu loop to remain in a particular function. More...
 
void deviceSummary ()
 A brief summary of device information. More...
 
void getTileList ()
 List all tiles. More...
 
void getFilteredTileList (const string &inString)
 Filtered list of all tiles. More...
 
void getSiteList ()
 List of all sites. More...
 
void getFilteredSiteList (const string &inString)
 Filtered list of all sites. More...
 
void getSiteDetail (const string &inString)
 brief Site detail function. More...
 
void displaySitesOfType (const string &inString)
 brief Sites of a particular type function. More...
 
void getTilewireDetail (const string &inString)
 Tilewire detail function. More...
 
void displaySegmentSources (const string &inString)
 Display source Tilewires of a segment. More...
 
void displaySegmentSinks (const string &inString)
 Display sink Tilewires of a segment. More...
 
void displayFullSegment (const string &inString)
 Display segment connectivity. More...
 
void displayFullSegmentFANCY (const string &inString)
 Display segment connectivity. More...
 
void getWireListForTileType (const string &inString)
 List all wires for a given tile type. More...
 
void enumerateSiteTypes ()
 
Tilewire stringToTilewire (const string &inString)
 Convert user input to a Tilewire. More...
 
void printFullMenu ()
 Print the full menu of browser functions. More...
 
void setupFunctionMap ()
 Prepare function map to lookup what the user asks for. More...
 

Protected Types

enum  EFunctionMap {
  eNotDefined, eQuit, eBit, eClear,
  eDetail, eFind, eGoto, eSinks,
  eInstances, eRoute, eSources, eWires,
  eTypes, eEquations, eeXtent, eMap,
  eSites, eSitePins, eSegment, eSiteTypes,
  eDeviceSummary, eTiles, eSiteDetail, eSitesOfType
}
 Enumeration of menu selection options. More...
 
typedef std::string string
 Imported type name. More...
 
typedef architecture::DDB DDB
 Imported type name. More...
 
typedef architecture::PrimitiveDef PrimitiveDef
 Imported type name. More...
 
typedef architecture::Segments Segments
 Imported type name. More...
 
typedef architecture::Sites Sites
 Imported type name. More...
 
typedef architecture::Tiles Tiles
 Imported type name. More...
 
typedef architecture::ArcUsage ArcUsage
 Imported type name. More...
 
typedef architecture::WireUsage WireUsage
 Imported type name. More...
 
typedef architecture::Tilewire Tilewire
 Imported type name. More...
 
typedef
architecture::TilewireVector 
TilewireVector
 Imported type name. More...
 
typedef architecture::WireInfo WireInfo
 Imported type name. More...
 
typedef
architecture::xilinx::TileIndex 
TileIndex
 Imported type name. More...
 
typedef
architecture::xilinx::TileCount 
TileCount
 Imported type name. More...
 
typedef
architecture::xilinx::WireIndex 
WireIndex
 Imported type name. More...
 
typedef
architecture::xilinx::TileTypeIndex 
TileTypeIndex
 Imported type name. More...
 
typedef
architecture::xilinx::SiteIndex 
SiteIndex
 Imported type name. More...
 
typedef void(ArchitectureBrowser::* BrowserFunction )(const std::string &x)
 Type for member function pointers. More...
 

Protected Attributes

DDBmDB
 Database Reference. More...
 
const SegmentsmSegments
 Segments reference from the database. More...
 
const SitesmSites
 Site data reference from the database. More...
 
const TilesmTiles
 Tile data reference from the database. More...
 
ArcUsagemArcUsage
 Pip usage information from the database. More...
 
WireUsagemWireUsage
 Wire usage information from the database. More...
 
std::map< string, EFunctionMapmFunctionMap
 Mapping from function to index. More...
 

Static Protected Attributes

static boost::regex sTilewireRegEx
 Regular expression for Tilewire form. More...
 
static boost::regex sIndexRegEx
 Regular expression for nonnegative integers. More...
 
static boost::regex sNameRegEx
 Regular expression for a name. More...
 

Detailed Description

Utility class for exploring database contents.

Definition at line 37 of file ArchitectureBrowser.hpp.

Member Typedef Documentation

Imported type name.

Definition at line 53 of file ArchitectureBrowser.hpp.

typedef void(ArchitectureBrowser::* torc::ArchitectureBrowser::BrowserFunction)(const std::string &x)
protected

Type for member function pointers.

Definition at line 73 of file ArchitectureBrowser.hpp.

Imported type name.

Definition at line 43 of file ArchitectureBrowser.hpp.

Imported type name.

Definition at line 45 of file ArchitectureBrowser.hpp.

Imported type name.

Definition at line 47 of file ArchitectureBrowser.hpp.

Imported type name.

Definition at line 71 of file ArchitectureBrowser.hpp.

Imported type name.

Definition at line 49 of file ArchitectureBrowser.hpp.

typedef std::string torc::ArchitectureBrowser::string
protected

Imported type name.

Definition at line 41 of file ArchitectureBrowser.hpp.

Imported type name.

Definition at line 65 of file ArchitectureBrowser.hpp.

Imported type name.

Definition at line 63 of file ArchitectureBrowser.hpp.

Imported type name.

Definition at line 51 of file ArchitectureBrowser.hpp.

Imported type name.

Definition at line 69 of file ArchitectureBrowser.hpp.

Imported type name.

Definition at line 57 of file ArchitectureBrowser.hpp.

Imported type name.

Definition at line 59 of file ArchitectureBrowser.hpp.

Imported type name.

Definition at line 67 of file ArchitectureBrowser.hpp.

Imported type name.

Definition at line 61 of file ArchitectureBrowser.hpp.

Imported type name.

Definition at line 55 of file ArchitectureBrowser.hpp.

Member Enumeration Documentation

Enumeration of menu selection options.

Enumerator
eNotDefined 
eQuit 
eBit 
eClear 
eDetail 
eFind 
eGoto 
eSinks 
eInstances 
eRoute 
eSources 
eWires 
eTypes 
eEquations 
eeXtent 
eMap 
eSites 
eSitePins 
eSegment 
eSiteTypes 
eDeviceSummary 
eTiles 
eSiteDetail 
eSitesOfType 

Definition at line 96 of file ArchitectureBrowser.hpp.

96  {
100  };

Constructor & Destructor Documentation

torc::ArchitectureBrowser::ArchitectureBrowser ( DDB inDB)
inline

Constructor.

Definition at line 109 of file ArchitectureBrowser.hpp.

109  : mDB(inDB), mSegments(inDB.getSegments()),
110  mSites(inDB.getSites()), mTiles(inDB.getTiles()),
111  mArcUsage(inDB.getArcUsage()), mWireUsage(inDB.getWireUsage()) {
113  }
const Sites & mSites
Site data reference from the database.
ArcUsage & mArcUsage
Pip usage information from the database.
DDB & mDB
Database Reference.
void setupFunctionMap()
Prepare function map to lookup what the user asks for.
const Segments & mSegments
Segments reference from the database.
WireUsage & mWireUsage
Wire usage information from the database.
const Tiles & mTiles
Tile data reference from the database.

+ Here is the call graph for this function:

torc::ArchitectureBrowser::~ArchitectureBrowser ( )
inline

Destructor.

Definition at line 115 of file ArchitectureBrowser.hpp.

115 {}

Member Function Documentation

void torc::ArchitectureBrowser::browse ( )
inline

Function to begin an interactive browsing session.

Definition at line 118 of file ArchitectureBrowser.hpp.

118  {
119  using std::cout;
120  using std::cin;
121  using std::endl;
122 
132 
133  string function;
134  string userinput;
135  Tilewire tw;
136  while (true) {
137  printFullMenu();
138  cin >> function;
139  switch (mFunctionMap[function]) {
140  case eQuit:
141  cout << "Bye!" << endl << endl;
142  return;
143  break;
144  case eDeviceSummary:
145  cout << "Device Summary." << endl;
146  deviceSummary();
147  break;
148  case eTiles:
149  //cout << "Tile List." << endl;
150  functionPrompt("Enter regexp filter (\".*\" to match all tiles), q to quit",
151  getFilteredTileListRef);
152  break;
153  case eWires:
154  functionPrompt("Enter tile type index, tile type name or tile name, q to quit",
155  getWireListForTileTypeRef);
156  break;
157  case eDetail:
158  functionPrompt("Enter wire@tile, q to quit", getTilewireDetailRef);
159  break;
160  case eSegment:
161  functionPrompt("Enter wire@tile, q to quit", displayFullSegmentRef);
162  break;
163  case eSources:
164  functionPrompt("Enter wire@tile, q to quit", displaySegmentSourcesRef);
165  break;
166  case eSinks:
167  functionPrompt("Enter wire@tile, q to quit", displaySegmentSinksRef);
168  break;
169  case eSites:
170  //cout << "Site List." << endl;
171  functionPrompt("Enter regexp filter (\".*\" to match all sites), q to quit",
172  getFilteredSiteListRef);
173  break;
174  case eSiteDetail:
175  functionPrompt("Enter site name or index, q to quit", getSiteDetailRef);
176  break;
177  case eSiteTypes:
178  cout << "List site types: " << endl;
180  break;
181  case eSitesOfType:
182  functionPrompt("Enter site type name, q to quit", displaySitesOfTypeRef);
183  break;
184 
185 
186 
187  case eBit:
188  cout << "Bit - Nothing here yet." << endl;
189  break;
190  case eClear:
191  cout << "Clear - Nothing here yet." << endl;
192  break;
193  case eFind:
194  cout << "Enter tile index: ";
195  cin >> userinput;
196  //findIndexInformation(userinput);
197  break;
198  case eGoto:
199  cout << "Enter wire@tile: " << endl;
200  cin >> userinput;
201  //enumerateTileWireSinks(userinput);
202  break;
203  case eInstances:
204  cout << "Enter tile type: ";
205  cin >> userinput;
206  //enumerateTileInstances(userinput);
207  break;
208  case eRoute:
209  cout << "Route - Not yet supported" << endl;
210  //cout << "Route - Supports routing to a single sink." << endl;
211  //routeToSingleSink();
212  break;
213  case eTypes:
214  cout << "Available tile types:" << endl;
215  //enumerateTileTypes();
216  break;
217  case eEquations:
218  cout << "Equations - Nothing here yet." << endl;
219  break;
220  case eeXtent:
221  cout << "Enter wire@tile: ";
222  cin >> userinput;
223  //enumerateTilewireReach(userinput);
224  break;
225  case eMap:
226  cout << "Displaying tilemap:" << endl;
227  //displayTilemap();
228  break;
229  case eSitePins:
230  cout << "Enter site: ";
231  cin >> userinput;
232  //enumerateSitePins(userinput);
233  break;
234  default:
235  cout << "Invalid Function: " << function << endl;
236  }
237  }
238  }
architecture::Tilewire Tilewire
Imported type name.
void getFilteredSiteList(const string &inString)
Filtered list of all sites.
void getFilteredTileList(const string &inString)
Filtered list of all tiles.
void getWireListForTileType(const string &inString)
List all wires for a given tile type.
void displaySitesOfType(const string &inString)
brief Sites of a particular type function.
void displaySegmentSources(const string &inString)
Display source Tilewires of a segment.
void displaySegmentSinks(const string &inString)
Display sink Tilewires of a segment.
void getSiteDetail(const string &inString)
brief Site detail function.
void(ArchitectureBrowser::* BrowserFunction)(const std::string &x)
Type for member function pointers.
void functionPrompt(const char *inPrompt, BrowserFunction f)
Secondary menu loop to remain in a particular function.
void displayFullSegment(const string &inString)
Display segment connectivity.
void printFullMenu()
Print the full menu of browser functions.
std::map< string, EFunctionMap > mFunctionMap
Mapping from function to index.
void deviceSummary()
A brief summary of device information.
void getTilewireDetail(const string &inString)
Tilewire detail function.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::ArchitectureBrowser::deviceSummary ( )
inline

A brief summary of device information.

Definition at line 258 of file ArchitectureBrowser.hpp.

258  {
259  using std::cout;
260  using std::endl;
261  cout << "Name: " << mDB.getDeviceName() << endl;
262  cout << "Family: " << mDB.getFamilyName() << endl;
263  cout << "Speed grades:";
264  for (unsigned int i =0; i < mDB.getSpeedGrades().size(); i++) {
265  cout << " " << mDB.getSpeedGrades()[i];
266  }
267  cout << endl;
268 
269  cout << "Total tiles: " << mTiles.getTileCount() << endl;
270  cout << "Family tile type count: " << mTiles.getTileTypeCount() << endl;
271  cout << "Tilemap dimensions: " << mTiles.getRowCount() << " "
272  << mTiles.getColCount() << endl;
273  cout << "Wire use: " << mWireUsage.getWireUsageCount() << endl;
274  cout << "Arc use: " << mArcUsage.getArcUsageCount() << endl;
275  }
const string & getDeviceName(void) const
Returns the device name.
Definition: DDB.hpp:132
TileTypeCount getTileTypeCount(void) const
Returns the tile type count for this device.
Definition: Tiles.hpp:151
TileRow getRowCount(void) const
Returns the row count for this device.
Definition: Tiles.hpp:153
const string & getFamilyName(void) const
Returns the family name.
Definition: DDB.hpp:134
uint32_t getArcUsageCount(void) const
Returns the number of arcs in use.
Definition: ArcUsage.hpp:228
TileCount getTileCount(void) const
Returns the tile count for this device.
Definition: Tiles.hpp:149
ArcUsage & mArcUsage
Pip usage information from the database.
const StringVector & getSpeedGrades(void) const
Returns a constant reference to a vector of speed grades.
Definition: DDB.hpp:140
uint32_t getWireUsageCount(void) const
Returns the number of wires in use.
Definition: WireUsage.hpp:151
DDB & mDB
Database Reference.
TileCol getColCount(void) const
Returns the column count for this device.
Definition: Tiles.hpp:155
WireUsage & mWireUsage
Wire usage information from the database.
const Tiles & mTiles
Tile data reference from the database.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::ArchitectureBrowser::displayFullSegment ( const string inString)
inline

Display segment connectivity.

Definition at line 556 of file ArchitectureBrowser.hpp.

556  {
557  using std::cout;
558  using std::endl;
559 
560  std::map<string, std::vector<string> > sourcemap;
561  std::map<string, std::vector<string> > sinkmap;
562  std::vector<string> segmentstrings;
563 
564  Tilewire tw = stringToTilewire(inString);
565  if (tw == Tilewire::sInvalid) {
566  cout << inString << " is not a valid Tilewire" << std::endl;
567  return;
568  }
569  architecture::TilewireVector segmentwires;
571  mDB.expandSegment(tw, segmentwires);
572  for (uint32_t i = 0; i < segmentwires.size(); i++) {
573  architecture::ExtendedWireInfo ewi(mDB, segmentwires[i]);
574  std::stringstream segwire;
575  segwire << ewi;
576  string segwirestring = segwire.str();
577  segmentstrings.push_back(segwirestring);
578 
579  sinkmap[segwirestring] = std::vector<string>();
580  sourcemap[segwirestring] = std::vector<string>();
581 
582  arcwires.clear();
583  mDB.expandTilewireSinks(segmentwires[i], arcwires);
584  for (uint32_t j = 0; j < arcwires.size(); j++) {
585  architecture::ExtendedWireInfo ewi2(mDB, arcwires[j]);
586  std::stringstream arcwire;
587  arcwire << ewi2;
588 
589  sinkmap[segwirestring].push_back(arcwire.str());
590  }
591  arcwires.clear();
592  mDB.expandTilewireSources(segmentwires[i], arcwires);
593  for (uint32_t j = 0; j < arcwires.size(); j++) {
594  architecture::ExtendedWireInfo ewi2(mDB, arcwires[j]);
595  std::stringstream arcwire;
596  arcwire << ewi2;
597 
598  sourcemap[segwirestring].push_back(arcwire.str());
599  }
600  }
601  cout << "Displaying segment containing: " << inString << endl;
602  /*for (uint32_t i = 0; i < segmentstrings.size(); i++) {
603  //cout << "\t\t" << segmentstrings[i] << endl;
604  for (uint32_t j = 0; j < sourcemap[segmentstrings[i]].size(); j++) {
605  cout << "|<--\t" << sourcemap[segmentstrings[i]][j] << endl;
606  }
607  cout << "|\t\t" << segmentstrings[i] << endl;
608  for (uint32_t j = 0; j < sinkmap[segmentstrings[i]].size(); j++) {
609  cout << "|-->\t\t\t" << sinkmap[segmentstrings[i]][j] << endl;
610  }
611  }*/
612  for (uint32_t i = 0; i < segmentstrings.size(); i++) {
613  cout << "|" << endl << "| " << segmentstrings[i] << endl;
614 
615  for (uint32_t j = 0; j < sourcemap[segmentstrings[i]].size(); j++) {
616  cout << "| <--- " << sourcemap[segmentstrings[i]][j] << endl;
617  }
618  for (uint32_t j = 0; j < sinkmap[segmentstrings[i]].size(); j++) {
619  cout << "| ---> " << sinkmap[segmentstrings[i]][j] << endl;
620  }
621  }
622 
623  }
std::vector< Tilewire > TilewireVector
Vector of Tilewire objects.
Definition: Tilewire.hpp:101
architecture::Tilewire Tilewire
Imported type name.
void expandTilewireSinks(const Tilewire &inTilewire, TilewireVector &outSinks, bool inUseTied=true, bool inUseRegular=true, bool inUseIrregular=true, bool inUseRoutethrough=true)
Expands the given tilewire's arc sinks.
Definition: DDB.cpp:214
DDB & mDB
Database Reference.
void expandTilewireSources(const Tilewire &inTilewire, TilewireVector &outSources, bool inUseTied=true, bool inUseRegular=true, bool inUseIrregular=true, bool inUseRoutethrough=true)
Expands the given tilewire's arc sources.
Definition: DDB.cpp:264
Tilewire stringToTilewire(const string &inString)
Convert user input to a Tilewire.
static const Tilewire sInvalid
Definition: Tilewire.hpp:93
void expandSegment(const Tilewire &inTilewire, TilewireVector &outTilewires, EExpandDirection inExpandDirection=eExpandDirectionNone)
Expands the given tilewire's segment.
Definition: DDB.cpp:154

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::ArchitectureBrowser::displayFullSegmentFANCY ( const string inString)
inline

Display segment connectivity.

Definition at line 625 of file ArchitectureBrowser.hpp.

625  {
626  using std::cout;
627  using std::endl;
628 
629  std::map<string, std::vector<string> > sourcemap;
630  std::map<string, std::vector<string> > sinkmap;
631  std::vector<string> segmentstrings;
632 
633  Tilewire tw = stringToTilewire(inString);
634  architecture::TilewireVector segmentwires;
636  mDB.expandSegment(tw, segmentwires);
637  for (uint32_t i = 0; i < segmentwires.size(); i++) {
638  architecture::ExtendedWireInfo ewi(mDB, segmentwires[i]);
639  std::stringstream segwire;
640 
641  segwire << ewi;
642  string segwirestring = segwire.str();
643  segmentstrings.push_back(segwirestring);
644 
645  sinkmap[segwirestring] = std::vector<string>();
646  sourcemap[segwirestring] = std::vector<string>();
647 
648  arcwires.clear();
649  mDB.expandTilewireSinks(segmentwires[i], arcwires);
650  for (uint32_t j = 0; j < arcwires.size(); j++) {
651  architecture::ExtendedWireInfo ewi2(mDB, arcwires[j]);
652  std::stringstream arcwire;
653 
654  arcwire << ewi2;
655 
656  sinkmap[segwirestring].push_back(arcwire.str());
657  }
658  arcwires.clear();
659  mDB.expandTilewireSources(segmentwires[i], arcwires);
660  for (uint32_t j = 0; j < arcwires.size(); j++) {
661  architecture::ExtendedWireInfo ewi2(mDB, arcwires[j]);
662  std::stringstream arcwire;
663 
664  arcwire << ewi2;
665 
666  sourcemap[segwirestring].push_back(arcwire.str());
667  }
668  }
669 
670  uint32_t sourcewidth = 0;
671  uint32_t segwidth = 0;
672  uint32_t sinkwidth = 0;
673 
674  std::map<string, std::vector<string> >::iterator e;
675  std::map<string, std::vector<string> >::iterator p;
676 
677  e = sourcemap.end();
678  for (p = sourcemap.begin(); p != e; p++) {
679  // get length of longest string
680  for (uint32_t j = 0; j < p->second.size(); j++) {
681  if (p->second[j].size() > sourcewidth) sourcewidth = p->second[j].size();
682  }
683  }
684  e = sinkmap.end();
685  for (p = sinkmap.begin(); p != e; p++) {
686  // get length of longest string
687  for (uint32_t j = 0; j < p->second.size(); j++) {
688  if (p->second[j].size() > sinkwidth) sinkwidth = p->second[j].size();
689  }
690  }
691  for (uint32_t i = 0; i < segmentstrings.size(); i++) {
692  if (segmentstrings[i].size() > segwidth) segwidth = segmentstrings[i].size();
693  }
694  sourcewidth += 2;
695  segwidth += 2;
696  sinkwidth += 2;
697 
698  for (uint32_t i = 0; i < segmentstrings.size(); i++) {
699  std::map<string, std::vector<string> >::iterator p;
700  p = sourcemap.find(segmentstrings[i]);
701  if (p != sourcemap.end() && p->second.size() > 0) {
702  for (uint32_t j = 0; j < p->second.size() - 1; j++) {
703  cout << " " << p->second[j];
704  for (uint32_t k = p->second[j].size(); k < sourcewidth; k++) cout << " ";
705  cout << "|" << endl;
706  }
707  cout << " " << p->second[p->second.size() - 1];
708  for (uint32_t k = p->second[p->second.size() - 1].size();
709  k < sourcewidth; k++) cout << " ";
710  cout << "+ ";
711  } else {
712  for (uint32_t k = 0; k < sourcewidth + 3; k++) cout << " ";
713  }
714 
715  cout << segmentstrings[i];
716  for (uint32_t k = segmentstrings[i].size(); k < segwidth; k++) cout << " ";
717  p = sinkmap.find(segmentstrings[i]);
718  if (p != sinkmap.end()) {
719  if (p->second.size() > 0) cout << " + " << p->second[0] << endl;
720  else cout << endl;
721  for (uint32_t j = 1; j < p->second.size(); j++) {
722  for (uint32_t k = 0; k < sourcewidth + segwidth + 4; k++) cout << " ";
723  cout << "| " << p->second[j] << endl;
724  }
725  }
726  }
727 
728  }
std::vector< Tilewire > TilewireVector
Vector of Tilewire objects.
Definition: Tilewire.hpp:101
architecture::Tilewire Tilewire
Imported type name.
void expandTilewireSinks(const Tilewire &inTilewire, TilewireVector &outSinks, bool inUseTied=true, bool inUseRegular=true, bool inUseIrregular=true, bool inUseRoutethrough=true)
Expands the given tilewire's arc sinks.
Definition: DDB.cpp:214
DDB & mDB
Database Reference.
void expandTilewireSources(const Tilewire &inTilewire, TilewireVector &outSources, bool inUseTied=true, bool inUseRegular=true, bool inUseIrregular=true, bool inUseRoutethrough=true)
Expands the given tilewire's arc sources.
Definition: DDB.cpp:264
Tilewire stringToTilewire(const string &inString)
Convert user input to a Tilewire.
void expandSegment(const Tilewire &inTilewire, TilewireVector &outTilewires, EExpandDirection inExpandDirection=eExpandDirectionNone)
Expands the given tilewire's segment.
Definition: DDB.cpp:154

+ Here is the call graph for this function:

void torc::ArchitectureBrowser::displaySegmentSinks ( const string inString)
inline

Display sink Tilewires of a segment.

Definition at line 519 of file ArchitectureBrowser.hpp.

519  {
520  using std::cout;
521  using std::endl;
522 
523  Tilewire tw = stringToTilewire(inString);
524  if (tw == Tilewire::sInvalid) {
525  cout << inString << " is not a valid Tilewire" << endl;
526  return;
527  }
528  architecture::TilewireVector segmentWires;
530  cout << "Sinks for segment containing: " << inString << endl;
531  mDB.expandSegment(tw, segmentWires);
532  for (uint32_t i = 0; i < segmentWires.size(); i++) {
533  architecture::ExtendedWireInfo ewi(mDB, segmentWires[i]);
534  cout << "|\t" << ewi << endl;
535  sinkWires.clear();
536  mDB.expandTilewireSinks(segmentWires[i], sinkWires, false, true, false, false);
537  for (uint32_t j = 0; j < sinkWires.size(); j++) {
538  architecture::ExtendedWireInfo ewi2(mDB, sinkWires[j]);
539  cout << "|-->\t\t" << ewi2 << endl;
540  }
541  sinkWires.clear();
542  mDB.expandTilewireSinks(segmentWires[i], sinkWires, false, false, true, false);
543  for (uint32_t j = 0; j < sinkWires.size(); j++) {
544  architecture::ExtendedWireInfo ewi2(mDB, sinkWires[j]);
545  cout << "|-->\t\t" << ewi2 << " - IRREGULAR" << endl;
546  }
547  sinkWires.clear();
548  mDB.expandTilewireSinks(segmentWires[i], sinkWires, false, false, false, true);
549  for (uint32_t j = 0; j < sinkWires.size(); j++) {
550  architecture::ExtendedWireInfo ewi2(mDB, sinkWires[j]);
551  cout << "|-->\t\t" << ewi2 << " - ROUTETHROUGH" << endl;
552  }
553  }
554  }
std::vector< Tilewire > TilewireVector
Vector of Tilewire objects.
Definition: Tilewire.hpp:101
architecture::Tilewire Tilewire
Imported type name.
void expandTilewireSinks(const Tilewire &inTilewire, TilewireVector &outSinks, bool inUseTied=true, bool inUseRegular=true, bool inUseIrregular=true, bool inUseRoutethrough=true)
Expands the given tilewire's arc sinks.
Definition: DDB.cpp:214
DDB & mDB
Database Reference.
Tilewire stringToTilewire(const string &inString)
Convert user input to a Tilewire.
static const Tilewire sInvalid
Definition: Tilewire.hpp:93
void expandSegment(const Tilewire &inTilewire, TilewireVector &outTilewires, EExpandDirection inExpandDirection=eExpandDirectionNone)
Expands the given tilewire's segment.
Definition: DDB.cpp:154

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::ArchitectureBrowser::displaySegmentSources ( const string inString)
inline

Display source Tilewires of a segment.

Definition at line 482 of file ArchitectureBrowser.hpp.

482  {
483  using std::cout;
484  using std::endl;
485 
486  Tilewire tw = stringToTilewire(inString);
487  if (tw == Tilewire::sInvalid) {
488  cout << inString << " is not a valid Tilewire" << endl;
489  return;
490  }
491  architecture::TilewireVector segmentWires;
492  architecture::TilewireVector sourceWires;
493  cout << "Sources for segment containing: " << inString << endl;
494  mDB.expandSegment(tw, segmentWires);
495  for (uint32_t i = 0; i < segmentWires.size(); i++) {
496  architecture::ExtendedWireInfo ewi(mDB, segmentWires[i]);
497  cout << "|\t" << ewi << endl;
498  sourceWires.clear();
499  mDB.expandTilewireSources(segmentWires[i], sourceWires, false, true, false, false);
500  for (uint32_t j = 0; j < sourceWires.size(); j++) {
501  architecture::ExtendedWireInfo ewi2(mDB, sourceWires[j]);
502  cout << "|<--\t\t" << ewi2 << endl;
503  }
504  sourceWires.clear();
505  mDB.expandTilewireSources(segmentWires[i], sourceWires, false, false, true, false);
506  for (uint32_t j = 0; j < sourceWires.size(); j++) {
507  architecture::ExtendedWireInfo ewi2(mDB, sourceWires[j]);
508  cout << "|<--\t\t" << ewi2 << " - IRREGULAR" << endl;
509  }
510  sourceWires.clear();
511  mDB.expandTilewireSources(segmentWires[i], sourceWires, false, false, false, true);
512  for (uint32_t j = 0; j < sourceWires.size(); j++) {
513  architecture::ExtendedWireInfo ewi2(mDB, sourceWires[j]);
514  cout << "|<--\t\t" << ewi2 << " - ROUTETHROUGH" << endl;
515  }
516  }
517  }
std::vector< Tilewire > TilewireVector
Vector of Tilewire objects.
Definition: Tilewire.hpp:101
architecture::Tilewire Tilewire
Imported type name.
DDB & mDB
Database Reference.
void expandTilewireSources(const Tilewire &inTilewire, TilewireVector &outSources, bool inUseTied=true, bool inUseRegular=true, bool inUseIrregular=true, bool inUseRoutethrough=true)
Expands the given tilewire's arc sources.
Definition: DDB.cpp:264
Tilewire stringToTilewire(const string &inString)
Convert user input to a Tilewire.
static const Tilewire sInvalid
Definition: Tilewire.hpp:93
void expandSegment(const Tilewire &inTilewire, TilewireVector &outTilewires, EExpandDirection inExpandDirection=eExpandDirectionNone)
Expands the given tilewire's segment.
Definition: DDB.cpp:154

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::ArchitectureBrowser::displaySitesOfType ( const string inString)
inline

brief Sites of a particular type function.

Definition at line 413 of file ArchitectureBrowser.hpp.

413  {
414  using std::cout;
415  using std::endl;
416  std::ios_base::fmtflags saveflags = cout.flags();
417 
418  for (SiteIndex i(0); i < mSites.getSiteCount(); i++) {
419  const architecture::Site& site = mSites.getSite(i);
420  const PrimitiveDef* siteTypePtr = site.getPrimitiveDefPtr();
421  if (siteTypePtr->getName() == inString)
422  cout << std::setw(7) << i << " " << site.getName() << endl;
423  }
424 
425  cout.flags(saveflags);
426  }
const Sites & mSites
Site data reference from the database.
SiteCount getSiteCount(void) const
Returns the site count for this device.
Definition: Sites.hpp:121
architecture::xilinx::SiteIndex SiteIndex
Imported type name.
architecture::PrimitiveDef PrimitiveDef
Imported type name.
const Site & getSite(SiteIndex inSiteIndex) const
Returns the site for the specified index.
Definition: Sites.hpp:129
const string & getName(void) const
Returns the name of the primitive.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::ArchitectureBrowser::enumerateSiteTypes ( )
inline

Definition at line 793 of file ArchitectureBrowser.hpp.

793  {
794  using std::cout;
795  using std::endl;
796  cout << "Device Site Types:" << endl;
797 
798  const architecture::Array<const PrimitiveDef>& siteTypes = mSites.getSiteTypes();
799  for (uint32_t i = 0; i < siteTypes.getSize(); i++) {
800  cout << siteTypes[i].getName() << endl;
801  }
802  }
const Sites & mSites
Site data reference from the database.
const Array< const PrimitiveDef > & getSiteTypes(void) const
Returns the site types for this family.
Definition: Sites.hpp:125

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::ArchitectureBrowser::functionPrompt ( const char *  inPrompt,
BrowserFunction  f 
)
inline

Secondary menu loop to remain in a particular function.

Definition at line 240 of file ArchitectureBrowser.hpp.

240  {
241  using std::cout;
242  using std::endl;
243  using std::cin;
244  string userinput;
245  while (true) {
246  cout << endl << inPrompt << "> ";
247  cin >> userinput;
248  switch (mFunctionMap[userinput]) {
249  case eQuit:
250  return;
251  default:
252  (this->*f)(userinput);
253  break;
254  }
255  }
256  }
std::map< string, EFunctionMap > mFunctionMap
Mapping from function to index.

+ Here is the caller graph for this function:

void torc::ArchitectureBrowser::getFilteredSiteList ( const string inString)
inline

Filtered list of all sites.

Definition at line 339 of file ArchitectureBrowser.hpp.

339  {
340  using std::cout;
341  using std::endl;
342  std::ios_base::fmtflags saveflags = cout.flags();
343 
344  // Replace all asterisks in the input string with regex wildcards (".*")
345  std::string userPattern = regex_replace(inString, boost::regex("(?<!\\.)\\*"), ".*");
346 
347  // Build regex
348  boost::regex sSiteNameRegEx(userPattern, boost::regex::perl | boost::regex::icase
349  | boost::regex::no_except);
350  // Check regex syntax
351  if (sSiteNameRegEx.empty()) {
352  cout << "Bad regular expression. Try again." << endl;
353  return;
354  }
355 
356  // Print matching sites
357  boost::smatch smatches;
358  int matchCount = 0;
359  for (SiteIndex i(0); i < mSites.getSiteCount(); i++) {
360  const architecture::Site& site = mSites.getSite(i);
361  if (regex_match(site.getName(), smatches, sSiteNameRegEx)) {
362  matchCount++;
363  cout << std::setw(7) << i << " " << site.getName() << endl;
364  }
365  }
366 
367  // Output # matches
368  cout << endl << matchCount << " match" << (matchCount == 1 ? "." : "es.") << endl;
369 
370  cout.flags(saveflags);
371  }
const Sites & mSites
Site data reference from the database.
SiteCount getSiteCount(void) const
Returns the site count for this device.
Definition: Sites.hpp:121
architecture::xilinx::SiteIndex SiteIndex
Imported type name.
std::string string
const string & getName(void) const
Returns the site name.
Definition: Site.hpp:79
const Site & getSite(SiteIndex inSiteIndex) const
Returns the site for the specified index.
Definition: Sites.hpp:129

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::ArchitectureBrowser::getFilteredTileList ( const string inString)
inline

Filtered list of all tiles.

Definition at line 291 of file ArchitectureBrowser.hpp.

291  {
292  using std::cout;
293  using std::endl;
294  std::ios_base::fmtflags saveflags = cout.flags();
295 
296  // Replace all asterisks in the input string with regex wildcards (".*")
297  std::string userPattern = regex_replace(inString, boost::regex("(?<!\\.)\\*"), ".*");
298 
299  // Build regex
300  boost::regex sTileNameRegEx(userPattern, boost::regex::perl | boost::regex::icase
301  | boost::regex::no_except);
302  // Check regex syntax
303  if (sTileNameRegEx.empty()) {
304  cout << "Bad regular expression. Try again." << endl;
305  return;
306  }
307 
308  // Print matching sites
309  boost::smatch smatches;
310  int matchCount = 0;
311  for (TileIndex i(0); i < mTiles.getTileCount(); i++) {
312  const architecture::TileInfo& ti = mTiles.getTileInfo(i);
313  if (regex_match(std::string(ti.getName()), smatches, sTileNameRegEx)) {
314  matchCount++;
315  cout << std::setw(6) << i << " type " << std::setw(3) << ti.getTypeIndex() << " "
316  << "(" << std::setw(3) << ti.getRow() << "," << std::setw(3) << ti.getCol()
317  << ") " << ti.getName() << endl;
318  }
319  }
320 
321  // Output # matches
322  cout << endl << matchCount << " match" << (matchCount == 1 ? "." : "es.") << endl;
323 
324  cout.flags(saveflags);
325  }
architecture::xilinx::TileIndex TileIndex
Imported type name.
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
Definition: Tiles.hpp:137
TileCount getTileCount(void) const
Returns the tile count for this device.
Definition: Tiles.hpp:149
std::string string
const TileTypeIndex & getTypeIndex(void) const
Returns the tile type index for this tile.
Definition: TileInfo.hpp:92
const Tiles & mTiles
Tile data reference from the database.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::ArchitectureBrowser::getSiteDetail ( const string inString)
inline

brief Site detail function.

Definition at line 373 of file ArchitectureBrowser.hpp.

373  {
374  using std::cout;
375  using std::endl;
376  std::ios_base::fmtflags saveflags = cout.flags();
377  SiteIndex siteIndex(0);
378  std::string siteName;
379  boost::smatch smatches;
380  if (regex_match(inString, smatches, ArchitectureBrowser::sIndexRegEx)) {
381  siteIndex = boost::lexical_cast<SiteIndex>(smatches[1]);
382  if (siteIndex >= mSites.getSiteCount()) {
383  cout << "Site index " << siteIndex << " out of range! "
384  << mSites.getSiteCount() << endl;
385  return;
386  }
387  } else if (regex_match(inString, smatches, ArchitectureBrowser::sNameRegEx)) {
388  siteIndex = mSites.findSiteIndex(inString);
389  if (siteIndex == SiteIndex(-1)) {
390  cout << "Site not found: " << inString << endl;
391  return;
392  }
393  } else {
394  cout << "Input invalid: " << inString << endl;
395  return;
396  }
397  const architecture::Site& site = mSites.getSite(siteIndex);
398  cout << "Site: " << site.getName() << endl;
399  cout << "\tTile: " << mTiles.getTileInfo(site.getTileIndex()).getName()
400  << " (" << site.getTileIndex() << ") " << endl;
401  cout << "\tFlags: " << std::hex << site.getFlags() << endl;
402  cout << std::dec << "\tPinMapPtr" << endl << "\t\t";
403  for (unsigned int i = 0; i < (site.getPinMapPtr())->getSize(); i++) {
404  cout << " " << (*site.getPinMapPtr())[i];
405  }
406  cout << endl;
407  const PrimitiveDef& primDef = *site.getPrimitiveDefPtr();
408  cout << "\tPrimitive Definition: " << primDef.getName() << endl;
409  cout.flags(saveflags);
410 
411  }
const Sites & mSites
Site data reference from the database.
SiteCount getSiteCount(void) const
Returns the site count for this device.
Definition: Sites.hpp:121
architecture::xilinx::SiteIndex SiteIndex
Imported type name.
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
Definition: Tiles.hpp:137
std::string string
architecture::PrimitiveDef PrimitiveDef
Imported type name.
const string & getName(void) const
Returns the site name.
Definition: Site.hpp:79
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
static boost::regex sNameRegEx
Regular expression for a name.
static boost::regex sIndexRegEx
Regular expression for nonnegative integers.
const Tiles & mTiles
Tile data reference from the database.
const string & getName(void) const
Returns the name of the primitive.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::ArchitectureBrowser::getSiteList ( )
inline

List of all sites.

Definition at line 327 of file ArchitectureBrowser.hpp.

327  {
328  using std::cout;
329  using std::endl;
330  std::ios_base::fmtflags saveflags = cout.flags();
331 
332  for (SiteIndex i(0); i < mSites.getSiteCount(); i++) {
333  const architecture::Site& site = mSites.getSite(i);
334  cout << std::setw(7) << i << " " << site.getName() << endl;
335  }
336  cout.flags(saveflags);
337  }
const Sites & mSites
Site data reference from the database.
SiteCount getSiteCount(void) const
Returns the site count for this device.
Definition: Sites.hpp:121
architecture::xilinx::SiteIndex SiteIndex
Imported type name.
const string & getName(void) const
Returns the site name.
Definition: Site.hpp:79
const Site & getSite(SiteIndex inSiteIndex) const
Returns the site for the specified index.
Definition: Sites.hpp:129

+ Here is the call graph for this function:

void torc::ArchitectureBrowser::getTileList ( )
inline

List all tiles.

Definition at line 277 of file ArchitectureBrowser.hpp.

277  {
278  using std::cout;
279  using std::endl;
280  std::ios_base::fmtflags saveflags = cout.flags();
281 
282  for (TileIndex i(0); i < mTiles.getTileCount(); i++) {
283  const architecture::TileInfo& ti = mTiles.getTileInfo(i);
284  cout << std::setw(6) << i << " type " << std::setw(3) << ti.getTypeIndex() << " "
285  << "(" << std::setw(3) << ti.getRow() << "," << std::setw(3) << ti.getCol()
286  << ") " << ti.getName() << endl;
287  }
288  cout.flags(saveflags);
289  }
architecture::xilinx::TileIndex TileIndex
Imported type name.
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
Definition: Tiles.hpp:137
TileCount getTileCount(void) const
Returns the tile count for this device.
Definition: Tiles.hpp:149
const TileTypeIndex & getTypeIndex(void) const
Returns the tile type index for this tile.
Definition: TileInfo.hpp:92
const Tiles & mTiles
Tile data reference from the database.

+ Here is the call graph for this function:

void torc::ArchitectureBrowser::getTilewireDetail ( const string inString)
inline

Tilewire detail function.

Todo:
SegmentReference with internal segment data?

Definition at line 428 of file ArchitectureBrowser.hpp.

428  {
429  using std::cout;
430  using std::endl;
431  Tilewire tw = stringToTilewire(inString);
432  if (tw == Tilewire::sInvalid) {
433  cout << "Specified tilewire not found: " << inString << endl;
434  return;
435  }
436  TileTypeIndex tti = mTiles.getTileInfo(tw.getTileIndex()).getTypeIndex();
437  architecture::ExtendedWireInfo ewi(mDB, tw);
438  cout << ewi << endl;
439  const architecture::WireInfo& wireinfo = mTiles.getWireInfo(tti, tw.getWireIndex());
440  cout << "\toffset: " << wireinfo.getArcOffset() << endl;
441  cout << "\tattributes: ";
442  cout << (wireinfo.isHidden() ? "HIDDEN " : "");
443  cout << (wireinfo.isInput() ? "INPUT " : "");
444  cout << (wireinfo.isOutput() ? "OUTPUT " : "");
445  cout << (wireinfo.isRemote() ? "REMOTE " : "");
446  cout << (wireinfo.isGlobal() ? "GLOBAL " : "");
447  cout << (wireinfo.isRemoteNodeCapable() ? "REMOTE_NODE_CAPABLE " : "");
448  cout << (wireinfo.isRemoteArcCapable() ? "REMOTE_ARC_CAPABLE " : "") << endl;
449  const architecture::WireArray& sinks = wireinfo.getSinks();
450  cout << "\tsinks: ";
451  for (uint32_t i = 0; i < sinks.getSize(); i++) cout << sinks[i] << " "; cout << endl;
452 
453  const architecture::WireArray& sources = wireinfo.getSources();
454  cout << "\tsources: ";
455  for (uint32_t i = 0; i < sources.getSize(); i++) cout << sources[i] << " "; cout << endl;
456 
457  const architecture::WireArray& isinks = wireinfo.getIrregularSinks();
458  cout << "\tirregular sinks: ";
459  for (uint32_t i = 0; i < isinks.getSize(); i++) cout << isinks[i] << " "; cout << endl;
460 
461  const architecture::WireArray& isources = wireinfo.getIrregularSources();
462  cout << "\tirregular sources: ";
463  for (uint32_t i = 0; i < isources.getSize(); i++) cout << isources[i] << " "; cout << endl;
464 
465  const architecture::WireArray& tsinks = wireinfo.getTiedSinks();
466  cout << "\ttied sinks: ";
467  for (uint32_t i = 0; i < tsinks.getSize(); i++) cout << tsinks[i] << " "; cout << endl;
468 
469  const architecture::WireArray& tsources = wireinfo.getTiedSources();
470  cout << "\ttied sources: ";
471  for (uint32_t i = 0; i < tsources.getSize(); i++) cout << tsources[i] << " "; cout << endl;
472 
473  /// \todo SegmentReference with internal segment data?
474 
475  architecture::TilewireVector segmentwires;
476  mDB.expandSegment(tw, segmentwires);
477  cout << "\t";
478  for (uint32_t i = 0; i < segmentwires.size(); i++) cout << segmentwires[i] << " ";
479  cout << endl;
480  }
std::vector< Tilewire > TilewireVector
Vector of Tilewire objects.
Definition: Tilewire.hpp:101
architecture::Tilewire Tilewire
Imported type name.
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
Definition: Tiles.hpp:137
const Array< const WireInfo > & getWireInfo(TileTypeIndex inTileTypeIndex) const
Returns the WireInfo array for the specified tile type.
Definition: Tiles.hpp:140
DDB & mDB
Database Reference.
architecture::xilinx::TileTypeIndex TileTypeIndex
Imported type name.
Tilewire stringToTilewire(const string &inString)
Convert user input to a Tilewire.
static const Tilewire sInvalid
Definition: Tilewire.hpp:93
void expandSegment(const Tilewire &inTilewire, TilewireVector &outTilewires, EExpandDirection inExpandDirection=eExpandDirectionNone)
Expands the given tilewire's segment.
Definition: DDB.cpp:154
const Tiles & mTiles
Tile data reference from the database.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::ArchitectureBrowser::getWireListForTileType ( const string inString)
inline

List all wires for a given tile type.

Definition at line 730 of file ArchitectureBrowser.hpp.

730  {
731  using std::cout;
732  using std::endl;
733 
734  TileTypeIndex tileType(0);
735  TileIndex tileIndex(0);
736  string tileTypeName;
737  string tileName;
738 
739  boost::smatch smatches;
740  if (regex_match(inString, smatches, ArchitectureBrowser::sIndexRegEx)) {
741  tileType = boost::lexical_cast<TileTypeIndex>(smatches[1]);
742  if (tileType >= mTiles.getTileTypeCount()) {
743  cout << "Type index " << tileType << " out of range! "
744  << mTiles.getTileTypeCount() << endl;
745  return;
746  }
747  tileTypeName = mTiles.getTileTypeName(tileType);
748  } else if (regex_match(inString, smatches, ArchitectureBrowser::sNameRegEx)) {
749  bool flag = false;
750  tileTypeName = smatches[1];
751  for ( ; tileType < mTiles.getTileTypeCount(); tileType++) {
752  if (tileTypeName == mTiles.getTileTypeName(tileType)) {
753  flag = true;
754  break;
755  }
756  }
757  tileName = tileTypeName;
758  for ( ; tileIndex < mTiles.getTileCount(); tileIndex++) {
759  const architecture::TileInfo& tileInfo = mTiles.getTileInfo(tileIndex);
760  if (tileTypeName == tileInfo.getName()) {
761  tileType = tileInfo.getTypeIndex();
762  tileTypeName = mTiles.getTileTypeName(tileType);
763  flag = true;
764  break;
765  }
766  }
767  if (!flag) {
768  cout << inString << " not found." << endl;
769  return;
770  }
771  } else {
772  cout << "Input invalid: " << inString << endl;
773  return;
774  }
775 
776  const architecture::Array<const architecture::WireInfo>& wireInfoArray =
777  mTiles.getWireInfo(tileType);
778 
779  cout << "Wires for tile type: " << tileTypeName << " (" << tileType << ")" << endl;
780  for (uint32_t i = 0; i < wireInfoArray.getSize(); i++) {
781  const WireInfo& wireInfo = wireInfoArray[i];
782  cout << "\t" << i << ": " << wireInfo.getName();
783  cout << (wireInfo.isHidden() ? " (HIDDEN) " : "");
784  cout << (wireInfo.isInput() ? " (INPUT) " : "");
785  cout << (wireInfo.isOutput() ? " (OUTPUT) " : "");
786  cout << (wireInfo.isRemote() ? " (REMOTE) " : "");
787  cout << (wireInfo.isGlobal() ? " (GLOBAL) " : "");
788  cout << (wireInfo.isRemoteNodeCapable() ? " (REMOTE_NODE_CAPABLE) " : "");
789  cout << (wireInfo.isRemoteArcCapable() ? " (REMOTE_ARC_CAPABLE) " : "");
790  cout << endl;
791  }
792  }
architecture::xilinx::TileIndex TileIndex
Imported type name.
TileTypeCount getTileTypeCount(void) const
Returns the tile type count for this device.
Definition: Tiles.hpp:151
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
Definition: Tiles.hpp:137
const Array< const WireInfo > & getWireInfo(TileTypeIndex inTileTypeIndex) const
Returns the WireInfo array for the specified tile type.
Definition: Tiles.hpp:140
TileCount getTileCount(void) const
Returns the tile count for this device.
Definition: Tiles.hpp:149
architecture::WireInfo WireInfo
Imported type name.
const char * getTileTypeName(TileTypeIndex inTileTypeIndex) const
Returns the tile type name for the given tile type index.
Definition: Tiles.hpp:164
const TileTypeIndex & getTypeIndex(void) const
Returns the tile type index for this tile.
Definition: TileInfo.hpp:92
architecture::xilinx::TileTypeIndex TileTypeIndex
Imported type name.
static boost::regex sNameRegEx
Regular expression for a name.
static boost::regex sIndexRegEx
Regular expression for nonnegative integers.
const char * getName(void) const
Returns the name for this wire.
Definition: WireInfo.hpp:109
const Tiles & mTiles
Tile data reference from the database.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void torc::ArchitectureBrowser::printFullMenu ( )

Print the full menu of browser functions.

Definition at line 27 of file ArchitectureBrowser.cpp.

27  {
28  using std::cout;
29  using std::endl;
30  cout << endl;
31  cout << "########## Device Database Browser ##########" << endl;
32  cout << "Select a command:" << endl
33  << "\t0) Device Summary - Display basic information about the device." << endl
34  << "\t1) Tile list - Search a list of all tiles in the device." << endl
35  << "\t2) Wire List - Display a list of all wires in a given tile type." << endl
36  << "\t3) Tilewire Detail - Display detail of a tilewire." << endl
37  << "\t4) Segment Information" << endl
38  << "\t5) Sources - Display segment sources." << endl
39  << "\t6) Sinks - Display segment sinks." << endl
40  << "\t7) Site List - Search a list of all sites in the device." << endl
41  << "\t8) Site Detail - Display detail of a site." << endl
42  << "\t9) Site Types - Display a list of all site types in the device family." << endl
43  << "\t10) Sites of Type - Display a list of all sites of a specified type." << endl
44  << "\tq) Quit" << endl
45  << "> ";
46  }

+ Here is the caller graph for this function:

void torc::ArchitectureBrowser::setupFunctionMap ( )

Prepare function map to lookup what the user asks for.

Definition at line 48 of file ArchitectureBrowser.cpp.

48  {
49  mFunctionMap["q"] = eQuit;
50  mFunctionMap["Q"] = eQuit;
51  mFunctionMap["exit"] = eQuit;
52  mFunctionMap["quit"] = eQuit;
53 
55  mFunctionMap["1"] = eTiles;
56  mFunctionMap["2"] = eWires;
57  mFunctionMap["3"] = eDetail;
58  mFunctionMap["4"] = eSegment;
59  mFunctionMap["5"] = eSources;
60  mFunctionMap["6"] = eSinks;
61  mFunctionMap["7"] = eSites;
63  mFunctionMap["9"] = eSiteTypes;
64  mFunctionMap["10"] = eSitesOfType;
65  mFunctionMap["d"] = eDetail;
66  mFunctionMap["D"] = eDetail;
67  }
std::map< string, EFunctionMap > mFunctionMap
Mapping from function to index.

+ Here is the caller graph for this function:

Tilewire torc::ArchitectureBrowser::stringToTilewire ( const string inString)
inline

Convert user input to a Tilewire.

Definition at line 805 of file ArchitectureBrowser.hpp.

805  {
806  TileIndex tile;
807  WireIndex wire;
808 
809  boost::smatch smatches;
810  boost::smatch smatches2;
811  if (regex_match(inString, smatches, ArchitectureBrowser::sTilewireRegEx)) {
812  // wire@tile form
813  string tilePart = smatches[2];
814  boost::to_upper(tilePart);
815  if (regex_match(tilePart, smatches2, ArchitectureBrowser::sIndexRegEx)) {
816  tile = boost::lexical_cast<TileIndex>(smatches2[1]);
817  } else if (regex_match(tilePart, smatches2, ArchitectureBrowser::sNameRegEx)) {
818  tile = mTiles.findTileIndex(tilePart);
819  } else {
820  return Tilewire::sInvalid;
821  }
822  if (tile >= mTiles.getTileCount()) return Tilewire::sInvalid;
824  string wirePart = smatches[1];
825  boost::to_upper(wirePart);
826  if (regex_match(wirePart, smatches2, ArchitectureBrowser::sIndexRegEx)) {
827  wire = boost::lexical_cast<WireIndex>(smatches2[1]);
828  } else if (regex_match(wirePart, smatches2, ArchitectureBrowser::sNameRegEx)) {
829  wire = mTiles.findWireIndex(tti, wirePart);
830  } else {
831  return Tilewire::sInvalid;
832  }
833  if (wire >= mTiles.getWireInfo(tti).getSize()) return Tilewire::sInvalid;
834  return Tilewire(tile, wire);
835  }
836  else {
837  return Tilewire::sInvalid;
838  }
839  }
architecture::xilinx::TileIndex TileIndex
Imported type name.
architecture::Tilewire Tilewire
Imported type name.
const TileInfo & getTileInfo(TileIndex inTileIndex) const
Returns the TileInfo object for the specified tile.
Definition: Tiles.hpp:137
static boost::regex sTilewireRegEx
Regular expression for Tilewire form.
const Array< const WireInfo > & getWireInfo(TileTypeIndex inTileTypeIndex) const
Returns the WireInfo array for the specified tile type.
Definition: Tiles.hpp:140
TileCount getTileCount(void) const
Returns the tile count for this device.
Definition: Tiles.hpp:149
const TileTypeIndex & getTypeIndex(void) const
Returns the tile type index for this tile.
Definition: TileInfo.hpp:92
architecture::xilinx::TileTypeIndex TileTypeIndex
Imported type name.
TileIndex findTileIndex(const string &inName) const
Returns the tile index for the given tile name.
Definition: Tiles.hpp:170
WireIndex findWireIndex(TileTypeIndex inTileTypeIndex, const string &inName) const
Returns the wire index for the given wire name in the given tile type.
Definition: Tiles.hpp:182
static boost::regex sNameRegEx
Regular expression for a name.
static const Tilewire sInvalid
Definition: Tilewire.hpp:93
static boost::regex sIndexRegEx
Regular expression for nonnegative integers.
architecture::xilinx::WireIndex WireIndex
Imported type name.
const Tiles & mTiles
Tile data reference from the database.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Field Documentation

ArcUsage& torc::ArchitectureBrowser::mArcUsage
protected

Pip usage information from the database.

Definition at line 84 of file ArchitectureBrowser.hpp.

DDB& torc::ArchitectureBrowser::mDB
protected

Database Reference.

Definition at line 76 of file ArchitectureBrowser.hpp.

std::map<string, EFunctionMap> torc::ArchitectureBrowser::mFunctionMap
protected

Mapping from function to index.

Definition at line 103 of file ArchitectureBrowser.hpp.

const Segments& torc::ArchitectureBrowser::mSegments
protected

Segments reference from the database.

Definition at line 78 of file ArchitectureBrowser.hpp.

const Sites& torc::ArchitectureBrowser::mSites
protected

Site data reference from the database.

Definition at line 80 of file ArchitectureBrowser.hpp.

const Tiles& torc::ArchitectureBrowser::mTiles
protected

Tile data reference from the database.

Definition at line 82 of file ArchitectureBrowser.hpp.

WireUsage& torc::ArchitectureBrowser::mWireUsage
protected

Wire usage information from the database.

Definition at line 86 of file ArchitectureBrowser.hpp.

boost::regex torc::ArchitectureBrowser::sIndexRegEx
staticprotected

Regular expression for nonnegative integers.

Definition at line 91 of file ArchitectureBrowser.hpp.

boost::regex torc::ArchitectureBrowser::sNameRegEx
staticprotected

Regular expression for a name.

Definition at line 93 of file ArchitectureBrowser.hpp.

boost::regex torc::ArchitectureBrowser::sTilewireRegEx
staticprotected

Regular expression for Tilewire form.

Definition at line 89 of file ArchitectureBrowser.hpp.


The documentation for this class was generated from the following files: