19 #ifndef TORC_UTILS_MARKEXTRACTER_HPP
20 #define TORC_UTILS_MARKEXTRACTER_HPP
26 #include <boost/regex.hpp>
108 mStream <<
"NEAT" << std::endl;
115 std::cout <<
"### " <<
mPattern <<
" ###" << std::endl;
118 for (p =
mDesign->modulesBegin(); p!=
mDesign->modulesEnd(); p++) {
119 std::cout <<
"MODULES ARE NOT CURRENTLY SUPPORTED!" << std::endl;
133 std::map<InstanceSharedPtr, bool> instanceMap;
134 std::map<NetSharedPtr, bool> netMap;
136 boost::smatch smatches;
138 for (inst_i = circuit->instancesBegin(); inst_i != circuit->instancesEnd(); inst_i++) {
139 bool test = regex_match((*inst_i)->getName(), smatches,
mRegex);
140 std::multimap<std::string, physical::Config>::const_iterator p;
141 for (p = (*inst_i)->configBegin(); p != (*inst_i)->configEnd(); p++) {
142 test = test || regex_match((*p).first, smatches,
mRegex);
143 test = test || regex_match((*p).second.getName(), smatches,
mRegex);
144 test = test || regex_match((*p).second.getValue(), smatches,
mRegex);
147 instanceMap[*inst_i] = test;
149 for (net_i = circuit->netsBegin(); net_i != circuit->netsEnd(); net_i++) {
150 bool test = regex_match((*net_i)->getName(), smatches,
mRegex);
152 netMap[*net_i] = test;
155 for (pin_i = (*net_i)->sourcesBegin(); pin_i != (*net_i)->sourcesEnd(); pin_i++) {
156 std::cout <<
"NET INST source: " << ((*pin_i)->getInstancePtr().lock())->getName()
157 <<
" -- " <<
true << std::endl;
158 instanceMap[(*pin_i)->getInstancePtr().lock()] =
true;
160 for (pin_i = (*net_i)->sinksBegin(); pin_i != (*net_i)->sinksEnd(); pin_i++) {
161 std::cout <<
"NET INST sink: " << ((*pin_i)->getInstancePtr().lock())->getName()
162 <<
" -- " <<
true << std::endl;
163 instanceMap[(*pin_i)->getInstancePtr().lock()] =
true;
167 std::map<InstanceSharedPtr, bool>::iterator imap_i;
168 std::map<NetSharedPtr, bool>::iterator nmap_i;
169 std::cout <<
"Copying marked instances and nets..." << std::endl;
170 for (imap_i = instanceMap.begin(); imap_i != instanceMap.end(); imap_i++) {
173 if (imap_i->second) {
178 for (nmap_i = netMap.begin(); nmap_i != netMap.end(); nmap_i++) {
181 if (nmap_i->second) {
192 std::map<InstanceSharedPtr, bool> instanceMap;
193 std::map<NetSharedPtr, bool> netMap;
195 boost::smatch smatches;
197 for (inst_i = circuit->instancesBegin(); inst_i != circuit->instancesEnd(); inst_i++) {
198 instanceMap[*inst_i] =
false;
200 for (net_i = circuit->netsBegin(); net_i != circuit->netsEnd(); net_i++) {
202 for (
PipIterator pip_i = (*net_i)->pipsBegin(); pip_i != (*net_i)->pipsEnd(); pip_i++) {
203 test = test || regex_match(pip_i->getTileName(), smatches,
mRegex);
204 test = test || regex_match(pip_i->getSourceWireName(), smatches,
mRegex);
205 test = test || regex_match(pip_i->getSinkWireName(), smatches,
mRegex);
209 netMap[*net_i] = test;
212 for (pin_i = (*net_i)->sourcesBegin(); pin_i != (*net_i)->sourcesEnd(); pin_i++) {
213 std::cout <<
"NET INST source: " << ((*pin_i)->getInstancePtr().lock())->getName()
214 <<
" -- " <<
true << std::endl;
215 instanceMap[(*pin_i)->getInstancePtr().lock()] =
true;
217 for (pin_i = (*net_i)->sinksBegin(); pin_i != (*net_i)->sinksEnd(); pin_i++) {
218 std::cout <<
"NET INST sink: " << ((*pin_i)->getInstancePtr().lock())->getName()
219 <<
" -- " <<
true << std::endl;
220 instanceMap[(*pin_i)->getInstancePtr().lock()] =
true;
224 std::map<InstanceSharedPtr, bool>::iterator imap_i;
225 std::map<NetSharedPtr, bool>::iterator nmap_i;
226 std::cout <<
"Copying marked instances and nets..." << std::endl;
227 for (imap_i = instanceMap.begin(); imap_i != instanceMap.end(); imap_i++) {
230 if (imap_i->second) {
235 for (nmap_i = netMap.begin(); nmap_i != netMap.end(); nmap_i++) {
238 if (nmap_i->second) {
250 #endif // TORC_UTILS_MARKEXTRACTER_HPP
PortSharedPtrVector::const_iterator PortSharedPtrConstIterator
Constant iterator to Port shared pointers.
PipVector::const_iterator PipConstIterator
Constant iterator to Pip objects.
InstancePinSharedPtrVector::iterator InstancePinSharedPtrIterator
Non-constant iterator to InstancePin shared pointer objects.
InstanceSharedPtrVector::const_iterator InstanceSharedPtrConstIterator
Constant iterator to Instance shared pointers.
ModuleSharedPtrVector::const_iterator ModuleSharedPtrConstIterator
Constant iterator for Module shared pointers.
const_iterator const_iterator
Constant iterator to {setting,Config} pairs.
boost::shared_ptr< Module > ModuleSharedPtr
Shared pointer encapsulation of a Module.
Main torc::physical namespace header.
Header for torc::physical output stream helpers.
boost::shared_ptr< Net > NetSharedPtr
Shared pointer encapsulation of a Net.
boost::shared_ptr< Circuit > CircuitSharedPtr
Shared pointer encapsulation of a Circuit.
boost::shared_ptr< Instance > InstanceSharedPtr
Shared pointer encapsulation of an Instance.
boost::shared_ptr< Design > DesignSharedPtr
Shared pointer encapsulation of a Design.
InstancePinSharedPtrVector::const_iterator InstancePinSharedPtrConstIterator
Constant iterator to InstancePin shared pointer objects.
NetSharedPtrVector::iterator NetSharedPtrIterator
Non-constant iterator to Net shared pointers.
Physical design programmable interconnect point.
static DesignSharedPtr newDesignPtr(const string &inName, const string &inDevice, const string &inPackage, const string &inSpeedGrade, const string &inXdlVersion)
Create and return a new Design shared pointer.
ModuleSharedPtrVector::iterator ModuleSharedPtrIterator
Non-constant iterator for Module shared pointers.
boost::weak_ptr< Instance > InstanceWeakPtr
Weak pointer encapsulation of an Instance.
NetSharedPtrVector::const_iterator NetSharedPtrConstIterator
Constant iterator to Net shared pointers.
PipVector::iterator PipIterator
Non-constant iterator to Pip objects.
InstanceSharedPtrVector::iterator InstanceSharedPtrIterator
Non-constant iterator to Instance shared pointers.
std::vector< Pip > PipVector
Vector of pips.