Jump to content
Ronex

Retrieve a pointer to an interface of a port

Recommended Posts

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->basename()) == 0) {

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

                    sc_vector<sc_in<bool> > *v = dynamic_cast<sc_vector<sc_in<bool> > * > (children);
                    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 ??

 

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...