Jump to content

Philipp A Hartmann

Members
  • Content Count

    482
  • Joined

  • Last visited

  • Days Won

    115

Everything posted by Philipp A Hartmann

  1. Philipp A Hartmann

    Support for C++11/14 in SystemC 2.3.2

    In the SystemC 2.3.2 review thread Ameya Vikram Singh (@AmeyaVS) reported the following observation: I'll open a separate topic to discuss the details.
  2. The full data length is independent of the word length. The rules for DATAWORD are defined by the standard as follows (see 14.20.3): From your example below, you seem to be using four byte word, so "unsigned" (or uint32_t) could be a used as a DATAWORD parameter.
  3. Hi Khushi, the best is to look up the definition in the IEEE 1666-2011 standard, section 14.20(.3). The different conversion functions have different constraints associated with them, allowing for more performant implementations for the _word, _aligned, and _single specializations. The _generic one covers arbitrary cases. The DATAWORD template parameter allows for optimizations as well (and endianness is always specific to the notion of a word). Hope that helps, Philipp
  4. Philipp A Hartmann

    SystemC Simulation Semantics and Scheduler Steps

    Hi Ivan, instead of referring to the very old 2.01. LRM, I suggest to check the IEEE Std. 1666-2011 for SystemC, which could can download at no cost (sponsored by Accellera) via https://standards.ieee.org/findstds/standard/1666-2011.html. This document includes the normative answers to all of your questions. Yes, see section 5.10.8 of the aforementioned standard. Kind of, yes. This is called "time out", see section 4.2(.1) of the standard. The order to execution of processes in the runnable queue is entirely implementation-defined. See section 4.2.1.2. Hope that helps, Philipp Disclaimer: I haven't checked all of your post for correctness and focused on the questions instead. .
  5. 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
  6. Philipp A Hartmann

    Build error with 2.3.2

    SystemC 2.3.2 has been tested successfully with C++03, C++11, C++14 (and even C++17) with various compilers. As mentioned in this thread, the selected C++ standard needs to match between the library build and the application build. This is enforced by the linker error you see. If you continue to run into these errors, make sure to build the SystemC library with the matching C++ standard selection compared to your application (see INSTALL or cmake/INSTALL_USING_CMAKE how to do that).
  7. Philipp A Hartmann

    Build error with 2.3.2

    The 'CMAKE_CXX_STANDARD' is specific to cmake. When you use automake/configure, you can configure the build by passing the '-std=c++11' flag directly to the configure call: ../configure ... 'CXXFLAGS=-std=c++11' Hope that helps, Philipp
  8. Philipp A Hartmann

    Build error with 2.3.2

    SystemC 2.3.2 works fine with C++03, you just need to configure the C++ standard consistently between your application and the library build. In the (experimental) SystemC Cmake build setup, the selection always defaults to C++03, regardless of the default of the compiler. In your application build, you might not explicitly set the C++ standard on the command-line, giving you a different default version from your compiler. The behavior of the SystemC CMake setup could be improved here. Greetings from Duisburg, Philipp
  9. Philipp A Hartmann

    make check return fail

    Hi all, you may want to try the attached sc_semaphore.h (requires C++11 to avoid the use of sem_init on MacOS). Hope that helps, Philipp sc_host_semaphore.h
  10. Philipp A Hartmann

    Passing event to SC_CTHREAD macro

    It should be fine to use wait(n) in SC_THREADs (with static sensitivity) as well?
  11. Philipp A Hartmann

    Passing event to SC_CTHREAD macro

    For your particular use case, you can just pass in the clock signal directly: SC_CTHREAD(test_cthread, clkgen); // posedge by default for CTHREADs If you need a negedge triggered process, you can also write the equivalent SC_THREAD instead: SC_THREAD(test_cthread); sensitive << clkgen.negedge_event(); dont_initialize(); Allowing plain events for CTHREAD sensitivity was probably just never needed.
  12. Philipp A Hartmann

    reset method or thread

    There is an example for catching and re-throwing an sc_unwind_exception in IEEE 1666-2011, clause 5.6.6.6. Hope that helps, Philipp
  13. Philipp A Hartmann

    C++ class object bringing into systemC Hierarchy

    Hi all, Both sc_get_current_process_b() and get_parent() are non-standard functions that may or may not be supported by (future) versions of your SystemC implementation. I recommend to only use standard IEEE 1666-2011 APIs instead: x sc_core::sc_get_current_process_handle().get_parent_object()->name() x sc_core::sc_get_current_process_handle().name() Greetings from Duisburg, Philipp
  14. Philipp A Hartmann

    systemc-2.3.2 with C++17

    For example, the missing operator delete was added in C++14 only (quoting from http://en.cppreference.com/w/cpp/memory/new/operator_delete) : void operator delete ( void* ptr, std::size_t sz ); (5) (since C++14) void operator delete[]( void* ptr, std::size_t sz ); (6) (since C++14)
  15. Philipp A Hartmann

    systemc-2.3.2 with C++17

    Yes. Most likely, because your clang-7 installation uses an incompatible C++ standard library. /Philipp
  16. Philipp A Hartmann

    systemc-2.3.2 with C++17

    Hi Sumit, can you please share some details on your remark that "it does not compile with -std=c++17"? For me, the SystemC 2.3.2 library and examples compile and run fine with GCC 6.3 and -std=c++17 (no 6.2 installation at hand here). Your linker errors look like you're missing the (matching) C++ runtime libraries in your linker call. Do you configure clang to use libc++ instead of libstdc++? Can you link any other C++ library built with GCC 6.2 to an application built with Clang 7? I would expect that this issue is not specific to SystemC and I would recommend to stick to a single compiler for all artifacts in your application, including SystemC. Hope that helps, Philipp
  17. You can have a look at examples/tlm/common/include/models in the Accellera proof-of-concept implementation for an example interconnect model. Hope that helps, Philipp
  18. Philipp A Hartmann

    initialization problem with <sc_dt::sc_logic> port

    The purpose of the initialize() function of the signal ports is to set the value of the bound signal at the beginning of the simulation through the given port.
  19. For hierarchical point-to-point binding, just use plain tlm_initiator/target_sockets on the parent module. You can keep using (tagged) convenience sockets at the leaves. Hope that helps, Philipp
  20. Philipp A Hartmann

    initialization problem with <sc_dt::sc_logic> port

    You can call eoc.initialize(...) before the port is bound.
  21. I don't see anything wrong with the code, but I don't have access to this platform. The aarch64 platform support has been contributed newly in SystemC 2.3.2 and has only been tested with GCC 4.5.0 so far. Can you provide more more details about the crash? (e.g. backtrace, build logs for library and application - including all command-line invocations, ...) Do you see any compiler warnings during the library/model build? Does it help to switch to the pthreads-based process implementation (../configure --enable-pthreads ...)? Greetings from Duisburg, Philipp
  22. Philipp A Hartmann

    Generic Payload Extensions

    You cannot bind sockets with different payload classes, as the interfaces are templated over the protocol traits, which include the payload and phase types. So integrating this third-party model would require an adapter in your case. Many use cases can be implemented with (ignorable) extensions, which will avoid this incompatibility and integration burden. As a result, you don't have to write/use a custom adapters, interconnect models, tool integrations, etc. For maximum interoperability with models and tools, you want to follow the (base-protocol) conventions as closely as possible, even for custom protocols. See the different TLM-2.0 compliance categories (IEEE 1666-2011, 9.1). Hope that helps, Philipp
  23. 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
  24. Philipp A Hartmann

    Segfault on sc_process_handle.terminated_event() in sc_event_and_list

    Hi Patrick, right now, there is no official publicly accessible repository of the SystemC proof-of-concept implementation. Both repos you mention above are not owned by Accellera. So applying the patch manually on top of a local source tree is sufficient: cd systemc-2.3.2 patch -p1 < 0001_sc_process_*.patch # usual install steps mkdir -p objdir cd objdir ../configure make make install Thanks, Philipp
×