rahuljn Posted April 6, 2016 Report Share Posted April 6, 2016 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 Quote Link to comment Share on other sites More sharing options...
Roman Popov Posted April 6, 2016 Report Share Posted April 6, 2016 I think you just have a typo here: int sc_main(int, char**) { initiator init("init"); target targ("targ"); init.out(targ.in); --> Should be init.out(targ.sig); sc_start(); return 0;} Quote Link to comment Share on other sites More sharing options...
rahuljn Posted April 6, 2016 Author Report Share Posted April 6, 2016 Hi Roman I want to do port to export binding at top so I wrote init.out(targ.in); Thanks Quote Link to comment Share on other sites More sharing options...
Roman Popov Posted April 6, 2016 Report Share Posted April 6, 2016 Hi Roman I want to do port to export binding at top so I wrote init.out(targ.in); Thanks Than you have a typo in another place: class target : public sc_module { public: sc_export<sc_signal_in_if<bool> > in; ---- > Change to sc_export<sc_signal_inout_if<bool> > in; sc_signal<bool> sig; target(sc_module_name name){in(sig);} }; The problem is that you try to bind port and export with different interfaces OMark 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.