00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include "torc/utils/ArchitectureBrowser.hpp"
00020
00021 namespace torc {
00022 boost::regex ArchitectureBrowser::sTilewireRegEx("\\s*(\\S+)@(\\S+)\\s*");
00023 boost::regex ArchitectureBrowser::sIndexRegEx("(\\d+)");
00024 boost::regex ArchitectureBrowser::sNameRegEx("(\\S+)");
00025
00026
00027 void ArchitectureBrowser::printFullMenu() {
00028 using std::cout;
00029 using std::endl;
00030 cout << endl;
00031 cout << "########## Device Database Browser ##########" << endl;
00032 cout << "Select a command:" << endl
00033 << "\t0) Device Summary - Display basic information about the device." << endl
00034 << "\t1) Tile list - Search a list of all tiles in the device." << endl
00035 << "\t2) Wire List - Display a list of all wires in a given tile type." << endl
00036 << "\t3) Tilewire Detail - Display detail of a tilewire." << endl
00037 << "\t4) Segment Information" << endl
00038 << "\t5) Sources - Display segment sources." << endl
00039 << "\t6) Sinks - Display segment sinks." << endl
00040 << "\t7) Site List - Search a list of all sites in the device." << endl
00041 << "\t8) Site Detail - Display detail of a site." << endl
00042 << "\t9) Site Types - Display a list of all site types in the device family." << endl
00043 << "\t10) Sites of Type - Display a list of all sites of a specified type." << endl
00044 << "\tq) Quit" << endl
00045 << "> ";
00046 }
00047
00048 void ArchitectureBrowser::setupFunctionMap() {
00049 mFunctionMap["q"] = eQuit;
00050 mFunctionMap["Q"] = eQuit;
00051 mFunctionMap["exit"] = eQuit;
00052 mFunctionMap["quit"] = eQuit;
00053
00054 mFunctionMap["0"] = eDeviceSummary;
00055 mFunctionMap["1"] = eTiles;
00056 mFunctionMap["2"] = eWires;
00057 mFunctionMap["3"] = eDetail;
00058 mFunctionMap["4"] = eSegment;
00059 mFunctionMap["5"] = eSources;
00060 mFunctionMap["6"] = eSinks;
00061 mFunctionMap["7"] = eSites;
00062 mFunctionMap["8"] = eSiteDetail;
00063 mFunctionMap["9"] = eSiteTypes;
00064 mFunctionMap["10"] = eSitesOfType;
00065 mFunctionMap["d"] = eDetail;
00066 mFunctionMap["D"] = eDetail;
00067 }
00068
00069 }