50 return (((x->h_op==hNode::hdlopsEnum::hBinop) &&
51 (x->h_name==pbstring) || (x->h_name==sensop)) ||
52 ((x->h_op == hNode::hdlopsEnum::hSensvar) &&
53 (x->child_list[0]->h_name.find(localstr) != std::string::npos)) ||
54 (x->h_op==hNode::hdlopsEnum::hForStmt) ||
55 (x->h_op == hNode::hdlopsEnum::hVardeclrn) ||
56 ((x->h_op==hNode::hdlopsEnum::hCStmt) &&
57 (x->child_list.empty())) ||
58 (x->h_op==hNode::hdlopsEnum::hVarAssign) ||
59 ((x->h_op == hNode::hdlopsEnum::hVarref) && (x->h_name ==
"sensitive")) ||
60 (isMorF(x->h_op) && (x->h_name.find(strsccore) !=std::string::npos)) ||
61 ((x->h_op == hNode::hdlopsEnum::hNoop) &&
62 (x->h_name==arrsub)));}), hp->
child_list.end());
106 if ((hlo->
h_op == hNode::hdlopsEnum::hVarAssign) &&
108 (hlo->
child_list[0]-> h_op == hNode::hdlopsEnum::hVarref) &&
109 (hlo->
child_list[1]->h_op == hNode::hdlopsEnum::hLiteral)) {
115 if ((hi->
h_op == hNode::hdlopsEnum::hBinop) &&
117 (hlo->
child_list[0]-> h_op == hNode::hdlopsEnum::hVarref) &&
118 (hlo->
child_list[1]->h_op == hNode::hdlopsEnum::hLiteral)) {
124 for_info.push_back(tmp);
220 assert ((hp_orig->
h_op == hNode::hdlopsEnum::hBinop) && (hp_orig->
h_name == pbstring));
223 if (for_info.empty()) {
227 if (hp_orig->
child_list[0]->getopc() == hNode::hdlopsEnum::hVarref) {
231 hpb =
new hNode(submodport.substr(0, submodport.find(fielddelim)),
232 hNode::hdlopsEnum::hPortbinding);
233 hpb->
child_list.push_back(
new hNode(submodport.substr(submodport.find(fielddelim)+fielddelim.size()),
234 hNode::hdlopsEnum::hVarref));
238 hpb =
new hNode(submodport, hNode::hdlopsEnum::hPortbinding);
241 if (hp_orig->
child_list[1]->getopc() == hNode::hdlopsEnum::hVarref) {
243 hpb->
child_list.push_back(
new hNode(thismodsig, hNode::hdlopsEnum::hVarref));
257 string submodport{
"XXX"}, thismodsig{
"YYY"};
258 string submod{
"SUBMOD"};
261 if ((hsubmodport->
h_op == hNode::hdlopsEnum::hVarref) && (hsubmodport->
child_list.size() > 0)) {
273 hNodep hparent = hsubmodport;
274 std::vector<hNodep> hmodarrix;
276 while ((hportchild !=
nullptr) && (hportchild->
h_name == arrsub)) {
277 hmodarrix.push_back(hportchild->
child_list[1]);
278 if ((hportchild->
child_list[0]->h_op == hNode::hdlopsEnum::hVarref) &&
279 (hportchild->
child_list[0]->child_list.empty())) {
283 hparent = hportchild;
286 for (
hNodep hsubmodixname:hmodarrix) {
288 assert((hsubmodixname->h_op == hNode::hdlopsEnum::hVarref) &&
"Submodule index must be simple loop variable name");
289 string ixname = hsubmodixname->h_name;
290 for (
int i = 0; i < for_info.size(); i++) {
291 if (for_info[i].name == ixname) {
292 submod+=tokendelim+
to_string(for_info[i].curix);
297 if (hsubmodport->
child_list[0]->h_name == arrsub) {
301 else if (hsubmodport->
h_name == arrsub) {
334 hNodep hparent = hsubmodport;
335 std::vector<hNodep> hmodarrix;
337 while ((hportchild !=
nullptr) &&
338 ((hportchild->
h_name == arrsub) ||
339 ((hportchild->
h_op == hNode::hdlopsEnum::hVarref) &&
341 if (hportchild->
h_name == arrsub) {
342 hmodarrix.push_back(hportchild->
child_list[1]);
344 hparent = hportchild;
347 if ((hportchild !=
nullptr) && (hportchild->
h_op == hNode::hdlopsEnum::hVarref)) {
349 submod = hportchild->
h_name;
350 size_t found = submod.find(fielddelim);
351 if ( found != std::string::npos) {
352 hportchild->
h_name = submod.substr(found+fielddelim.size());
353 submod = submod.substr(0, found);
356 for (
hNodep hsubmodixname:hmodarrix) {
358 assert((hsubmodixname->h_op == hNode::hdlopsEnum::hVarref) &&
"Submodule index must be simple loop variable name");
359 string ixname = hsubmodixname->h_name;
360 for (
int i = 0; i < for_info.size(); i++) {
361 if (for_info[i].name == ixname) {
362 submod+=tokendelim+
to_string(for_info[i].curix);
367 hparent = hsubmodport;
369 while ((hportchild !=
nullptr) && (hportchild->
h_name != arrsub)) {
370 hparent = hportchild;
373 if (hportchild !=
nullptr) {
381 hNodep hpb =
new hNode( submod, hNode::hdlopsEnum::hPortbinding);
403 if (isMorF(hp->
h_op)) {
405 if (hpi->
h_op == hNode::hdlopsEnum::hUnop) {
406 std::size_t found = (hpi->
child_list[0]->h_name).find(qualnamedelim);
407 if ( found != std::string::npos) {
409 hNode::hdlopsEnum::hSenslist));
488 else if (isInitSensitem(hp)) {
492 else if ((hp->
h_op == hNode::hdlopsEnum::hForStmt) && (hp->
child_list.size() > 3)) {
494 for (
int forloopix = for_info.back().lo; forloopix < for_info.back().hi; forloopix+=for_info.back().step) {
495 for_info.back().curix = forloopix;
503 else if ((hp->
child_list[i]->h_op == hNode::hdlopsEnum::hForStmt) ||
504 (hp->
child_list[i]->h_op == hNode::hdlopsEnum::hCStmt))
510 else if (hp->
h_op == hNode::hdlopsEnum::hCStmt) {
515 else if (isMethodCall(hp)) {
518 hnewsens.push_back(
new hNode(
"METHOD ???", hNode::hdlopsEnum::hSenslist));
523 int threadsensitem = isThreadSensitem(hp);
524 if (threadsensitem >0 ) {
529 LLVM_DEBUG(llvm::dbgs() <<
"HDLHNode: found thread sens item " <<
"\n");
532 hpsens->
set(hNode::hdlopsEnum::hSensvar, threadsensitem == reset_async?
"ASYNC":
"SYNC");
534 hnewsens.push_back(
new hNode(
"METHOD ???", hNode::hdlopsEnum::hSenslist));