torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ArchitectureBrowser.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 ArchitectureBrowser class.
18 
20 
21 namespace torc {
22  boost::regex ArchitectureBrowser::sTilewireRegEx("\\s*(\\S+)@(\\S+)\\s*");
23  boost::regex ArchitectureBrowser::sIndexRegEx("(\\d+)");
24  boost::regex ArchitectureBrowser::sNameRegEx("(\\S+)");
25 
26 
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  }
47 
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  }
68 
69 } // namespace torc
static boost::regex sTilewireRegEx
Regular expression for Tilewire form.
ArchitectureBrowser class for exploring database contents.
void setupFunctionMap()
Prepare function map to lookup what the user asks for.
static boost::regex sNameRegEx
Regular expression for a name.
static boost::regex sIndexRegEx
Regular expression for nonnegative integers.
void printFullMenu()
Print the full menu of browser functions.
std::map< string, EFunctionMap > mFunctionMap
Mapping from function to index.