enchanter Posted May 3, 2018 Report Share Posted May 3, 2018 I am try to compile tlm1/bidir example from uvm-systemc-1.0-beta1 with SystemC 2.3.2 I got error as below and I have no idea what I have done wrong. ~/systemc/include/tlm_core/tlm_1/tlm_req_rsp/tlm_channels/tlm_req_rsp_channels/tlm_put_get_imp.h:87:7: error: inherited virtual base class 'sc_core::sc_interface' has private destructor class tlm_master_imp : ^ I have attached the full compile log comp.log Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted May 3, 2018 Report Share Posted May 3, 2018 You did nothing wrong. This is an issue with Clang/LLVM-based compilers and their specific treatment of virtual private inheritance, see e.g. https://bugs.llvm.org/show_bug.cgi?id=30916. Other compilers accept this code. Greetings from Duisburg, Philipp Quote Link to comment Share on other sites More sharing options...
enchanter Posted May 4, 2018 Author Report Share Posted May 4, 2018 Thanks Philipp. I will try it with gcc. Quote Link to comment Share on other sites More sharing options...
iperryman Posted June 15, 2018 Report Share Posted June 15, 2018 Thanks ... I ran into this problem as well with clang++ Any known issues with mixing SystemC compiled in clang++ and uvm-systemc compiled in g++? Or should I recompile my SystemC install as well? Thanks, Ian Quote Link to comment Share on other sites More sharing options...
sumit_tuwien Posted August 14, 2018 Report Share Posted August 14, 2018 On 5/3/2018 at 10:03 PM, Philipp A Hartmann said: You did nothing wrong. This is an issue with Clang/LLVM-based compilers and their specific treatment of virtual private inheritance, see e.g. https://bugs.llvm.org/show_bug.cgi?id=30916. Other compilers accept this code. Greetings from Duisburg, Philipp Hello Philipp, Would it be possible to bypass the bug by explicitly deleting the destructor [public : ~mclass() = delete;] if the the chosen c++ standard is at or above c++11 ? It started hurting now. Regards, Sumit Quote Link to comment Share on other sites More sharing options...
Philipp A Hartmann Posted August 16, 2018 Report Share Posted August 16, 2018 Hi Sumit, I re-checked the LLVM issue and it now refers to C++ CWG issue #7 (http://www.open-std.org/Jtc1/sc22/wg21/docs/cwg_closed.html#7), which clearly describes our situation here and shows that the current implementation of tlm_req_rsp_channel<...> is invalid C++ in SystemC (even though only Clang rejects it so far). Without changing the inheritance pattern, the only fix would be to add "friend" declarations to all (indirect) virtual base classes of tlm_put_get_impl<...>, including sc_interface. This is not an option, so I think the internal implementation of the tlm_req_rsp_channel<...> needs to be refactored to avoid the private virtual inheritance. I have opened an issue in the SystemC Language WG bug tracker for this. Greetings from Duisburg, Philipp Quote Link to comment Share on other sites More sharing options...
sumit_tuwien Posted August 16, 2018 Report Share Posted August 16, 2018 Thanks Phillip. Regards, Sumit Quote Link to comment Share on other sites More sharing options...
mburton Posted August 30, 2018 Report Share Posted August 30, 2018 In fact the fix is relatively simple, and will hopefully be in the next release (meantime, please find attached a small patch). The real question is why this inheritance structure was like this in the first place. Here's the PR rational: class tlm_put_get_imp <class1, class2> inherits private virtual from tlm_put_if<class1>, and tlm_get_peek_if<class2> tlm_put_if and tlm_get_peek_if are compounded class that are interfaces, which means that they (and their parents) have only pure virtual methods but these must be implemented because they are pure, so are they in tlm_put_get_imp, as publicmethods. So there is no point in the private inheritance. (Special thanks to Luc Michel from GreenSocs who helped sort this out) tlm1.patch maehne 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.