Jump to content

Philipp A Hartmann

Members
  • Content Count

    534
  • Joined

  • Last visited

  • Days Won

    129

Posts posted by Philipp A Hartmann


  1. Hi Ameya,

    I currently don't have access to such new Linux platforms, but I may have a suspicion about a potential root cause.
    Can you please check, if it helps to change the sc_process_b::delete_process function in src/sysc/kernel/sc_process.cpp  as follows:

     // if ( this != sc_get_current_process_b() )
     if ( NULL == sc_get_current_process_b() )

    Thanks and Greetings from Duisburg,
      Philipp


  2. This example still uses the positional binding feature of SystemC, which is deprecated as per IEEE Std. 1666 (see Annex C (h), emphasis mine):

    Quote

    This annex contains a list of deprecated features. A deprecated feature is a feature that was present in version 2.0.1 of the OSCI open source proof-of-concept SystemC implementation but is not part of this standard. Deprecated features may or may not remain in the Accellera Systems Initiative implementation in
    the future. The user is strongly discouraged from using deprecated features because an implementation is not obliged to support such features. An implementation may issue a warning on the first occurrence of each deprecated feature but is not obliged to do so.

    [...]

    h) operator, and operator<< of class sc_module for positional port binding (use operator() instead)

    hth,
      Philipp


  3. 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):

    Quote

    e) The template argument to a hostendian function should be a type representing the internal initiator data word for the endianness conversion. The expression sizeof(DATAWORD) is used to determine the width of the data word in bytes, and the assignment operator of type DATAWORD is used during copying. sizeof(DATAWORD) shall be a power of 2.

    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.


  4. 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 


  5. 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.

     

    10 hours ago, Ivan said:

    Question 1: if I swapped two statements evt1.notify(0, SC_NS) and evt1.notify() here, will the delta notification will be removed? In my opinion only evt1.nofity() will be remembered:

    Yes, see section 5.10.8 of the aforementioned standard.

     

    10 hours ago, Ivan said:

     Question 2: Since I we have wait(10, SC_NS), does that mean that the process p3 will be put in separate list/queue of sleep processes? Let's call it list S, so we would have S = {p1} effectively? 

    Kind of, yes.  This is called "time out", see section 4.2(.1) of the standard.

     

    10 hours ago, Ivan said:

    Question 3: How come that order of thread registration actually affects the order of the process being scheduled?

    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.

    .

     


  6. 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


  7. 1 hour ago, katang said:

    And, not testing if at least the "Hello World" can be built with, as given by the example setup test?

    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).


  8. 20 hours ago, katang said:

    BTW: If that version works with standard 11 only, why is it not preconfigured?

    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. 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. 


  10. Hi all,

    16 hours ago, Eyck said:
    
    x sc_core::sc_get_current_process_b()->get_parent()->name()

    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


  11. 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


  12. 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


  13. 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

×
×
  • Create New...