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 ??