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

sc_port sc_export binding issue

$
0
0

Hi

 

I am facing an issue with sc_port sc_export binding.

 

My following example compiles fine

class initiator : public sc_module {
    public:
    sc_port<sc_signal_inout_if<bool> > out;
    initiator(sc_module_name name){}
};

class target : public sc_module {
    public:
    sc_port<sc_signal_in_if<bool> > in;
    target(sc_module_name name){}
};

int sc_main(int, char**){
    initiator init("init");
    target targ("targ");
    sc_signal<bool> sig;
    init.out(sig);
    targ.in(sig);
    sc_start();
    return 0;
}

 

But when I move the channel inside the target, and replace sc_port with sc_export, I have following error

 

 

class initiator : public sc_module {
    public:
    sc_port<sc_signal_inout_if<bool> > out;
    initiator(sc_module_name name){}
};

class target : public sc_module {
    public:
    sc_export<sc_signal_in_if<bool> > in;
    sc_signal<bool> sig;
    target(sc_module_name name){in(sig);}
};

int sc_main(int, char**){
    initiator init("init");
    target targ("targ");
    init.out(targ.in);
    sc_start();
    return 0;
}

 

the error is

error: no match for call to ‘(sc_core::sc_port<sc_core::sc_signal_inout_if<bool>, 1, (sc_core::sc_port_policy)0u>) (sc_core::sc_export<sc_core::sc_signal_in_if<bool> >&)’
 

Can you help me in inderstanding this issue ?

 

Thanks

Rahul

 

 


Viewing all articles
Browse latest Browse all 595

Trending Articles