haase Posted February 3, 2020 Report Share Posted February 3, 2020 Hello, i have the following piece of code not compiling: #include <systemc.h> int sc_main(int argc, char* argv[]){ sc_signal<bool> my_signal_bool; sc_reset* my_reset; my_reset = my_signal_bool.is_reset(); return 0; } I get this error: In file included from /usr/local/systemc-2.3.3/include/sysc/communication/sc_buffer.h:34:0, from /usr/local/systemc-2.3.3/include/systemc:79, from /usr/local/systemc-2.3.3/include/systemc.h:219, from ../src/playground.cpp:12: /usr/local/systemc-2.3.3/include/sysc/communication/sc_signal.h: In function ‘int sc_main(int, char**)’: /usr/local/systemc-2.3.3/include/sysc/communication/sc_signal.h:472:23: error: ‘sc_core::sc_reset* sc_core::sc_signal<bool, POL>::is_reset() const [with sc_core::sc_writer_policy POL = (sc_core::sc_writer_policy)0u]’ is private virtual sc_reset* is_reset() const; ^ ../src/playground.cpp:95:37: error: within this context my_reset = my_signal_bool.is_reset(); ^ make: *** [src/playground.o] Error 1 src/subdir.mk:18: recipe for target 'src/playground.o' failed "make all" terminated with exit code 2. Build might be incomplete. I have installed SystemC 2.3.3 and using Eclipse CDT under Ubunut 16.04. How i can resolve this error? Best regards, Julian Quote Link to comment Share on other sites More sharing options...
ralph.goergen Posted February 4, 2020 Report Share Posted February 4, 2020 Hi. The is_reset method is private. So, you cannot call it on an object. But why are you using is_reset() method? What do you want to achieve? This is not part of the standard API, i.e. it might be dangerous to use. Greetings Ralph haase 1 Quote Link to comment Share on other sites More sharing options...
haase Posted February 5, 2020 Author Report Share Posted February 5, 2020 Hi Ralph, thanks for your reply. Quote The is_reset method is private. So, you cannot call it on an object. I also recognized that this function is private, so i did the workaround making this function public. This fast solution is for the moment ok, but not as long term option. I know that is not a good solution, but it is a qick dirty fix. Quote But why are you using is_reset() method? What do you want to achieve? I have an old SystemC Library(ReChannelv2 from 2007) where this call is used and i want to use this library(the library is not compiling yet). For now i have not the resources to refactor the old library to the newer C++(11 or 14) and SystemC(2.3.3) standard. Also it is an external library, so it is hard to get in and understand how the implementation is done in detail. In theory, i only want to use it 😉 This library is i would say something which wrapped extra stuff around the systemc classes to model reconfiguration during runtime. Quote This is not part of the standard API, i.e. it might be dangerous to use. If i check the SystemC version 2.2, there was this function public, so it was allowed to use this function. Why is this dangerous now? What changed between these two version? Best regards, Julian Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted February 16, 2020 Report Share Posted February 16, 2020 On 2/5/2020 at 9:46 AM, haase said: If i check the SystemC version 2.2, there was this function public, so it was allowed to use this function. The only normative reference for SystemC is defined by the IEEE Std. 1666-2011, see http://ieeexplore.ieee.org/document/6134619/. The is_reset() was never part any version of the standard, so one could never rely on its presence. You would to check, why the ReChannel library tries to call this function and then find another way to implement this functionality. /Philipp 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.