heisba Posted January 30, 2014 Report Share Posted January 30, 2014 Hi again! Maybe this is too obvious, but I've been wonderin for a while now and never found the answer (and dared to ask for it ). Is it possible to directly pass whatever comes from an tdf_in port to a tdf_out port? Not only that, is it possible to do it in a sc_module instead of a sca_module? For a better explanation I'll leave a piece of code. Let's say I have: #include <systemc-ams> class some_module : public sc_core::sc_module { public: sca_tdf::sca_in<int> in; sca_tdf::sca_out<int> out; some_module(sc_core::sc_module_name nm); }; Until now I was adding an object, let's call it "tdf_some": #include <systemc-ams> class tdf_some_module : public sca_tdf::sca_module { public: sca_tdf::sca_in<int> in; sca_tdf::sca_out<int> out; tdf_some_module(sc_core::sc_module_name nm) {} void processing() { out.write( in.read() ); } }; Then, in the previous class I would change to: #include <systemc-ams> class some_module : public sc_core::sc_module { public: sca_tdf::sca_in<int> in; sca_tdf::sca_out<int> out; // Add new TDF module tdf_some *ts; some_module(sc_core::sc_module_name nm) { // Instantiate and bind ports ts = new tdf_some("ts"); ts->in(in); ts->out(out); } }; Looks like a very simple question (and I hope so), but I still haven't been able to solve it. Any ideas? Thanks Quote Link to comment Share on other sites More sharing options...
maehne Posted January 31, 2014 Report Share Posted January 31, 2014 Besides a typo in the last code snippet (tdf_some -> tdf_some_module), your code is correct. You can directly bind a TDF port to another TDF port of the same kind. In addition, a TDF input port can be directly bound to a TDF output port. These port to port bindings constitute a kind of indirection to enable you to cross the design hierarchy levels. However, in the end, there has to be always exactly one TDF signal bound inside the chain of port-to-port and port-to-signal bindings from any TDF output port to the TDF input ports. The port binding rules are well described in the Section 2.3.3 of the SystemC AMS User's Guide. For reference, the exact port binding rules are defined in clause 4.1.2 of the SystemC AMS 2.0 LRM. Quote Link to comment Share on other sites More sharing options...
dakupoto Posted February 1, 2014 Report Share Posted February 1, 2014 Hi again! Maybe this is too obvious, but I've been wonderin for a while now and never found the answer (and dared to ask for it ). Is it possible to directly pass whatever comes from an tdf_in port to a tdf_out port? Not only that, is it possible to do it in a sc_module instead of a sca_module? For a better explanation I'll leave a piece of code. Let's say I have: #include <systemc-ams> class some_module : public sc_core::sc_module { public: sca_tdf::sca_in<int> in; sca_tdf::sca_out<int> out; some_module(sc_core::sc_module_name nm); }; Until now I was adding an object, let's call it "tdf_some": #include <systemc-ams> class tdf_some_module : public sca_tdf::sca_module { public: sca_tdf::sca_in<int> in; sca_tdf::sca_out<int> out; tdf_some_module(sc_core::sc_module_name nm) {} void processing() { out.write( in.read() ); } }; Then, in the previous class I would change to: #include <systemc-ams> class some_module : public sc_core::sc_module { public: sca_tdf::sca_in<int> in; sca_tdf::sca_out<int> out; // Add new TDF module tdf_some *ts; some_module(sc_core::sc_module_name nm) { // Instantiate and bind ports ts = new tdf_some("ts"); ts->in(in); ts->out(out); } }; Looks like a very simple question (and I hope so), but I still haven't been able to solve it. Any ideas? Thanks Hello Sir, In response to your first query, yes absolutely. For example, one might have: out.write(in.read()); /* in is the in port, and out is the out port of the SAME TYPE */ In response to the second query, SystemC-AMS provides special converter ports for the following: 1. Pure SystemC to pure SystemC-AMS TDF and vice-versa 2. SystemC-AMS TDF to SystemC-AMS ELN, or LSF Please note that the TDF infrastructure in SystemC-AMS is special, and while one may use a sc_module for ELN or LSF, it is strictly forbidden for TDF. 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.