Quantcast
Channel: SystemC Language Forum RSS Feed
Viewing all articles
Browse latest Browse all 595

Retrieve a pointer to an interface of a port

$
0
0

I am trying to get an interface binded with a vector of port declared as sc_vector<sc_in<bool> > :

 

std::vector<sc_object*> children = get_child_objects();
sc_signal<bool> *s = NULL;
const char *tmp = "sc_vector";

 

for (unsigned i = 0; i < children.size(); i++) {

        if (strcmp(nm, children[i]->basename()) == 0) {

               if (strcmp(children[i]->kind(), tmp) == 0) {

                    sc_vector<sc_in<bool> > *v = dynamic_cast<sc_vector<sc_in<bool> > * > (children[i]);
                    if (v != 0) {
                         s = dynamic_cast<sc_signal<bool> *> (&v->at(0));
                    }

               }

        }

}

 

In the above code, I got the value of s as NULL. I have binded a port with signal, but still it's unexpected behavior.

 

Am I doing something wrong here ??

 


Viewing all articles
Browse latest Browse all 595

Latest Images

Trending Articles



Latest Images