krishnadas_b Posted January 16, 2017 Report Share Posted January 16, 2017 #include "systemc.h" #include "systemc-ams.h" SC_MODULE (chkdouble) { sca_tdf::sca_signal <double> tdf_ana_out; double x1, x2; void check () { if (tdf_ana_out > (x2-x1)/2 ) { // <<<<<<<<<<<<<<<<<< the error is as follows //chkdouble.cpp: In member function 'void chkdouble::check()': //chkdouble.cpp:9: error: no match for 'operator>' in '((chkdouble*)this)-> cout << "hello" ; } } SC_CTOR (chkdouble) : tdf_ana_out ("tdf_ana_out") { x1 = 0; x2 = 8; tdf_ana_out = 5.2; SC_THREAD (check); } }; int sc_main(int argc, char* argv[]) { sc_set_time_resolution (1, SC_NS); sc_signal <bool> adc_clock; chkdouble chkdouble_1 ("chkdouble_1"); sc_start (100, SC_MS); return(0); } Please let me know what is the issue here? Quote Link to comment Share on other sites More sharing options...
karsten Posted January 16, 2017 Report Share Posted January 16, 2017 you cannot read a value from a TDF signal. Access to TDF signals is only possible via TDF ports in the context of aTDF module inside the context of a processing method (see LRM or User guide). It's why the schedule (underlying equation system) is setup during elaboration and during simulation the TDF time is not inline with the SystemC time - a read access to a TDF signal out of context cannot know which value from the buffer has to be read - only the connected and thus scheduled TDF module has this information. maehne 1 Quote Link to comment Share on other sites More sharing options...
krishnadas_b Posted January 18, 2017 Author Report Share Posted January 18, 2017 Thanks for the clarification. Yes i need to go through the LRM to check for right usage. 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.