Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 10/18/2020 in all areas

  1. Managed to run SystemC on new Apple M1 silicon, following are the steps 1. modify configure file, add the following code highlighted in red # check CPU architecture case ${target_cpu} in #( x86_64|amd64) : TARGET_ARCH="${TARGET_ARCH}64" CPU_ARCH="x86_64" QT_ARCH="x86_64" ;; #( x*86|i*86) : CPU_ARCH="i386" QT_ARCH="iX86" ;; #( powerpc64) : TARGET_ARCH="${TARGET_ARCH}ppc64" CPU_ARCH="ppc64" QT_ARCH="pthreads" ;; #( powerpc) : TARGET_ARCH="${TARGET_ARCH}ppc" CPU_ARCH="ppc" QT_ARCH="powerpc-apple-macosx" ;; #( arm) : TARGET_ARCH="${TARGET_ARCH}arm" CPU_ARCH="arm64" QT_ARCH="pthreads" ;; #( *) : as_fn_error $? "\"sorry...architecture not supported\"" "$LINENO" 5 ;; 2. install g++ using homebrew brew install gcc 3. setting CXX and point to the homebrew g++-11 in step 2, run configure export CXX=g++-11 ./configure 4. make all 5. make check I would like to encourage others to share their experience of porting systemC to this new mac silicon.
    3 points
  2. Why not use constructor prameters? Another option would be cci_params. Via the broker they can be given a value before they are created. So you can use them in contructor bodies....
    3 points
  3. As @Eyck suggested, constructor parameters should fit best your needs. You can even give them default values if it is sensible. If the number of parameters grows, grouping them in a struct may become handy. Its members can be default-initialised and you can override them with assignments before passing the whole struct to the module constructor. Personally, I like to first check for consistency and legal range for these parameters in the constructor / member function to which I pass this struct, e.g., by using assertions before actually using them for describing any behaviour/internal structure.
    2 points
  4. Thanks @William Lock, for sharing your experience of building SystemC on macOS for the Apple M1 architecture. I opened an issue on the LWG’s internal tracker to update our build scripts so that it will work out of the box in the future.
    2 points
  5. Matthias Jung

    C++20 Co-routines

    For my SystemC-Lecture, I wrote a simple DES simulator to reduce to the minimal mechanisms that are required to understand the DES concept. (https://github.com/myzinsky/des/tree/main/sw). For that I used C++20 co-routines for the 'processes'. Therefore, I was wondering if somebody has considered these co-routines also as co-routines for SystemC, instead of qt, pthreads or fibers?
    2 points
  6. Actually the usual bus protocols allow to send larger number of requests and the interconnect is allowed to answer them 'out of order' (e.g. AMBA AXI or CHI). But you are free to define you onw protocol and its own rules. The LRM states exactly how to do this. One example can be found at https://github.com/Arteris-IP/tlm2-interfaces which defines the extensions and phases for the AXI/ACE and the CHI protocol.
    2 points
  7. Port requires a pointer towards the object containing implementations of methods specified in the interface. Export provides the very pointer that port needs. Port goes from caller towards callee. Export goes from callee towards caller. Pseudo-graphically: // +----------------------------------------------------------------------------------+ // |struct Top : sc_module { | // | | // | initiator.p1.bind( target.x1 ); | // | | // | Initiator initiator{"orgin"}; Target target{"target"}; | // | +------------------------------------+ +--------------------------------------+ | // | |struct Initiator : sc_module { | |struct Target : sc_module { | | // | | | | | | // | | sc_port<IF> p1{"p1"}; | | sc_export<IF> x1{"x1"}; | | // | | caller.p0.bind( p1 ); | | x1.bind( callee.x0 ); | | // | | | | | | // | | Caller caller{"caller"}; | | Callee callee{"callee"}; | | // | | +----------------------------+ | | +------------------------------+ | | // | | |struct Caller : sc_module { | | | |struct Callee : sc_module, IF | | | // | | | | | | | | | | // | | | sc_port<IF> p0{"p0"}; | | | | sc_export<IF> x0{"x0"}; | | | // | | | SC_THREAD(thread1); | | | | Data m_data; | | | // | | | | | | | x0.bind(*this); | | | // | | | | | | | | | | // | | | .------------------. | | | | .----------------------. | | | // | | | | void thread1() | | | | | | void xfer( data& d ) | | | | // | | | | { | | | | | | { | | | | // | | | | p0->xfer( v ); | [p0]->[p1]->[x1]->[x0] | // Save/load d | | | | // | | | | } | | | | | | auto t = d; | | | | // | | | | | | | | | | d = m_data; | | | | // | | | | | | | | | | // Transform t | | | | // | | | | | | | | | | m_data = t; | | | | // | | | | | | | | | | } | | | | // | | | '------------------' | | | | '----------------------' | | | // | | | | | | | | | | // | | |}; | | | | | | | // | | +----------------------------+ | | +------------------------------+ | | // | | | | | | // | |}; | |}; | | // | +------------------------------------+ +--------------------------------------+ | // | | // |}; | // +----------------------------------------------------------------------------------+
    2 points
  8. A better solution is to compile for C++11 (or later) instead, where sem_* APIs are not required.
    1 point
  9. Create a custom protocol and don't use address field if you don't have an address. If you do have an address but it has different requirements, then add a mandatory extension to the payload for your protocol.
    1 point
  10. Hi all, I am running into a very weird exception when I try to build SystemC applications that contain `SC_THREAD` under Visual Studio 2019. I managed to prepare a small reproduction example (see attached file) which looks like: #include <systemc> SC_MODULE(Test) { SC_HAS_PROCESS(Test); explicit Test(sc_core::sc_module_name name) : sc_module(name) { SC_THREAD(busy); } void busy(void) { for(int i = 0; i < 10; i++) { sc_core::wait(1, sc_core::SC_NS); printf("busy\n"); } sc_core::sc_stop(); } }; int sc_main(int, char *[]) { Test ttt("ttt"); sc_core::sc_start(); return EXIT_SUCCESS; } The program is compiled using the attached CMakeLists.txt file. Upon execution, it runs into an exception and when I look in the debugger, the exception comes from: The same program runs without any issues when compiled using GCC 9.2 on CentOS 7. On Windows, I am using Windows 10 with VS 2019 Enterprise. Did anyone else run into similar issues when trying SystemC 2.3.3 with VS 2019? Edit 1: Issue has been resolved. It turns out that you need to pass `/GR` and `/vmg` in the compile flags. Best Regards, Mohamed CMakeLists.txt ctor.cc
    1 point
  11. I deduct from this that somewhere in your design, timing is involved, most probably in the part that triggers/feeds the input threads. If not, your simulation would finish in zero time + x delta cycles, which "at this time stamp" seems to contradict. So, you have to define what "at this time stamp" means. Is it exactly the simulation time at which the first FIFO notifies the arbiter? In that case, David's solution applies. Do you have clocks (e.g. wait statements with time indication) in your design? Maybe your arbiter can only be sure at the end of a clock cycle? Maybe another part of your design must tell the arbiter that "at this time stamp" has finished, and the arbiter can assume that no new transactions will come in?
    1 point
  12. Create: sc_event arbiter_event; All arriving processes push to their respective fifo and immediately post: queue.push(data); arbiter_event.notify(SC_ZERO_TIME); Arbiter waits for the event and processes all fifo’s upon receipt.
    1 point
  13. Hello @Soumyajeet, As per the sources: https://github.com/accellera-official/systemc/blob/604182509559ae42c34e878f508bae7c18abbbd6/INSTALL.md#L602 It mentions that the SC_CPLUSPLUS would be set to the latest value configured at the compiler level/command line flag. I am using C++20 in my SystemC environment without any issues. Hope it helps. Regards, Ameya Vikram Singh
    1 point
  14. If you want to set the initial value of the signal to which the port int_o will be bound during elaboration, you can use the member function initialize() (cf. to clause 6.10.4 of IEEE Std 1666-2011).
    1 point
  15. I took your eample and pasted it at https://www.edaplayground.com/x/EtqQ From there is works without any hassle. You seem to have anything different in your code base than posted here.
    1 point
  16. It is not correct to bind a port to another port directly except in the case of a hierarchical connection. Furthermore, there is no such thing as an input port or an output port in SystemC. Ports are simply sophisticated pointers to channel objects that provide methods for exchanging information. Some methods are directional in nature by g to heir behavior. For instance, sc_signal<int>::write(value) deposits it’s contents into memory managed by the sc_signal<int> channel.
    1 point
  17. Hello @Saikat, Regarding your questions. Since SystemC is written in C++, g++ should be the default. Regarding compiler warning the ones mentioned in your post: Seems a good enough list for now. I would prefer you going through your compiler manual to figure which ones you might need. But, as my personal preference I usually prefer to build my code with various compilers and on various platforms to get the best possible platforms compatible code. It is very easy the write a code which might end up being platform/compiler dependent. Better to stick with standard C++ language compliance to get the most out of your code. Regards, Ameya Vikram Singh
    1 point
  18. I had a look onto your code and it has several flaws: your condion variable not protected against spurious and lost wakeups you use one global condition variable for all threads. This is bad design... your simulation runs out of events. Since the SC kernel does not see any events during the start of your thread(s), it simply shuts down the simulation. So before your thread is alive there is no simulation at all diamond problem with multiple inheritance: ThreadSafeEvent inherits of sc_prim_channel and ThreadSafeEventIf where both inherit of sc_interface. So at least ThreadSafeEventIf needs to ingerit virtual. Instead of dealing with pthreads you should use std::thread and friends. This eases your life quite a lot an makes things easier Based on your example I created a working example at https://www.edaplayground.com/x/Nn9e using C++11. Make sure that in the field 'Compile Options' the option '-pthread' is given as well as c++11 or c++14 is selected
    1 point
  19. SystemC is a single-thread simulator and moreover not thread-safe due to various reasons. The problem you are facing is that you modify datastructures in the SystemC kernel (by calling notify() ) asyncronously since you are running it in another (OS-)thread. This might work in some case but in most cases it will not. To cut a long story short you cannot use sc_event to syncronize os-threads. But there are means to handle this case namely async_request_update(). To see an example you might check out https://stackoverflow.com/questions/49814756/async-request-update-example-in-systemc esp. the implementation of class ThreadSafeEvent. One remark: I strongly suggest to use C++11 and there std::thread since it makes your code more readable and abstracts from the underlying API. E.g. PThread is not a native Windows thread implementation rather belongs to some POSIX layer which might introduce additional issues.
    1 point
  20. Be aware that SystemC kernel is not threadsafe with exception of async_request_update(). So you must code accordingly.
    1 point
  21. maehne

    (max. 20 printed)

    You are welcome @omaima!
    1 point
  22. maehne

    (max. 20 printed)

    The cause for the empty VCD file is probably due that you call at the end the wrong closing function sca_close_tabular_trace_file(tfp_vcd) instead of the correct one sca_close_vcd_trace_file(tfp_vcd). As Martin Barnasconi wrote, VCD files are not well suited for tracing TDF, LSF, and ELN signals, because these signals tend to change at each time step. VCD is best suited for discrete event signals.
    1 point
  23. David is correct, another program having issues with Quickthreads is valgrind. With Quickthreads SystemC threads actually all live in a single pthread. When a SystemC thread yields to another one the stack is changed from one piece of storage to another in a discontinuous manner. The stack for that single pthread that SystemC is living ends up being discontinuous. With pthreads enabled each SystemC thread is in its own pthread and those stacks are continuous.
    1 point
  24. You need to specify the timestep to at least one TDF module or TDF port, using method set_timestep. In a TDF module this method should be called in the callback set_attributes. See section 2.3.1 (Discrete-time modeling) and Example 2.11 in the SystemC-AMS User's Guide.
    1 point
  25. uvm_config_db is simply a facade pattern on top of the uvm_resource_db. As mentioned above, most recommend avoiding direct use of the resource db because the config db adds more consistency to its use.
    1 point
  26. No, you cannot run the SystemC simulator kernel as a Linux kernel module for sevberal reasons: SystemC requires quite some libraries (libc, libqt, ...) that are not available in kernel space You would taint the kernel and open up a security hole large as a gate. You would alos risk the system integrity. SystemC is simply not meant for such things. A proper design would make a distinction between (as little as possibel) code to run in kernel space providing interfaces (devices or shared memory) to interact with and a userspace application which could be the SystemC simulation e.g. running as a daemon. Even linux kernel hackers move everything into this direction... Yes, the simulation is a simple userspace process being constraint by the OS permissions. So it can use all resources a process is allowed. It can open socket connections and ports and whatever it needs. In the past I wrote some interface which allowed the SystemC simulation running on a Linux system to talk to another simulator running on a Windows host using network sockets (it also worked with UNIX domain sockets). And actually we are implementing a SystemC simulation talking to an FPGA on an accelerator card via device files. Unfortunately I'm not aware of freely available examples to do so. But if you have some C/C++ code to deal with the netlink sockets you can just embed this code into the simulator e.g. as part of a sc_module and tie it to the simulation phases (open the socket during start_of_simulation(), closing them during end_of_simulation()).
    1 point
  27. If you can avoid global variables at all cost. They will bite you more than you think. If you need to have static global variables (e.g. for loggers or memory managers) use the Meyers-SIngleton. Those will be initialized upon first use which usually gives you some control over the life cycle. Another example can be found here: https://github.com/Minres/SystemC-Components/blob/master/incl/tlm/tlm_mm.h
    1 point
  28. Yes, it is possible. Since SystemC is basically a C++ class library you can you whatever C/C++ allows for.
    1 point
  29. You'll have to create internal (i.e., private) signals for each member of the bundled class, which you need to connect to sub-blocks. Then, you have to register a SC_METHOD or SC_THREAD, which is sensitive to changes of the bundled input. The method/thread can then assign the correct new values to the internal signals based on the changed bundled input.
    1 point
  30. Not sure if this topic is active. Here is some feedback. 1. Decouple the datatypes library from other core SystemC libraries. In other words it should be a light stand-alone library of its own. 2. Single unified bit vector library for all widths (like ac_int<W>). However having the range function for behavioral modeling (not synthesis) is also very useful. Currently we use the following c++-11 feature: /*----------------------------------------------------------------*/ // This uses a neat template alias trick introduced in C++-11 // to hide the underlying type of either a biguint or _bits_ull // inside a bv. This allows uniform use of bv<W> in the code // while hiding the underlying type // Refer to: Stroustrop's C++11 FAQ /*----------------------------------------------------------------*/ template<bool,int W> struct bv_traits { typedef biguint<W> type; }; template<int W> struct bv_traits<true,W> { typedef _bits_ull<W> type; }; template<int W> using bv = typename bv_traits<W<=64,W>::type; 3. Illegal shifts are a problem. Introduced an artificial layer with static assertion (C++-11) checks to mitigate the problem. Example of static assertion for illegal widths below. There are lots and lots of static and run-rime assertions like this. template <int W> class _bits_ull : public sc_uint_base { public: static const int width = W; enum { valid_ull_width = (W <= 64) }; enum { MAX_WIDTH = 64 // fits into unsigned long long }; // constructors _bits_ull() : sc_uint_base(W) { (void)cmn_static_assert<valid_ull_width>::Invalid_bits_ull_width; } 4. Speed of execution of bit-vectors is critical. I worked with Andy Goodrich to have a faster implementation of sc_biguint<W> and have it locally as a branch to 2.3.0. It does not seem to have made it into the latest standard (v2.3.3). This provides a dramatic improvement in speed. There are other things which can be done to speed it up further. 5. Recently I did some work on concurrency from within the SystemC simulation. Much to my surprise, I find the SystemC datatypes (range functions and the operator[int]) are not thread-safe. This is because of static variables and sc_vpool (sc_temporary) use. Here is an example which on the surface should work fine but has data_races. Note that we can have thread safety issues from either within or outside the SystemC simulation. Races can be found by clang++ thread sanitizer -fsanitize=thread data_race.cc #include <thread> #include <future> #include <systemc> using namespace sc_core; using namespace sc_dt; using namespace std; void thread_func() { sc_uint<32> b32; for (int i = 1; i < 32; i++) { b32[i] = 1; // RACE inside here b32.range(i, i-1) = 2; // RACE inside here } } std::vector<std::future<void>> futures; int main(int argc, char** argv) { const int N_THREADS = 2; for (int i = 0; i < N_THREADS; ++i) { auto f = std::async(std::launch::async, thread_func); futures.push_back(std::move(f)); } return 0; } ================== WARNING: ThreadSanitizer: data race (pid=19816) Read of size 4 at 0x0000016dfc90 by thread T2: #0 sc_core::sc_vpool<sc_dt::sc_uint_bitref>::allocate() /projects/ntsw-arch-public/tools/systemc-22sep2015/systemc-2.3.0/x86_64-gcc8/include/sysc/utils/sc_temporary.h:187:23 (data_race.x+0x4c63d5) #1 sc_dt::sc_uint_base::operator[](int) /projects/ntsw-arch-public/tools/systemc-22sep2015/systemc-2.3.0/x86_64-gcc8/include/sysc/datatypes/int/sc_uint_base.h:1207:55 (data_race.x+0x4c5f48) #2 thread_func() /projects/ntsw-arch/AV/users/runipg/rg_arch40/arch/common/test/data_race/data_race.cc:15:9 (data_race.x+0x4c5c29) #3 void std::_Bind_simple<void (*())()>::_M_invoke<>(std::_Index_tuple<>) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1399:18 (data_race.x+0x4ca7ba) #4 std::_Bind_simple<void (*())()>::operator()() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1389:16 (data_race.x+0x4ca685) #5 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::_Bind_simple<void (*())()>, void>::operator()() const /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1348:6 (data_race.x+0x4ca55a) #6 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::_Bind_simple<void (*())()>, void> >::_M_invoke(std::_Any_data const&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1725:9 (data_race.x+0x4ca3a6) #7 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:2136:14 (data_race.x+0x4c9fc1) #8 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:533:27 (data_race.x+0x4c9308) #9 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:235:14 (data_race.x+0x4c9dc7) #10 std::result_of<void (std::__future_base::_State_baseV2::* const&(std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&))(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>::type std::__invoke<void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:259:14 (data_race.x+0x4c9cf8) #11 _ZNKSt12_Mem_fn_baseIMNSt13__future_base13_State_baseV2EFvPSt8functionIFSt10unique_ptrINS0_12_Result_baseENS4_8_DeleterEEvEEPbELb1EEclIJPS1_S9_SA_EEEDTclsr3stdE8__invokedtdefpT6_M_pmfspclsr3stdE7forwardIT_Efp_EEEDpOSG_ /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:613:11 (data_race.x+0x4c9b6d) #12 void std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> (std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>::_M_invoke<0ul, 1ul, 2ul>(std::_Index_tuple<0ul, 1ul, 2ul>) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1399:18 (data_race.x+0x4c9ace) #13 std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> (std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>::operator()() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1389:16 (data_race.x+0x4c9a45) #14 void std::__once_call_impl<std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> (std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> >() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/mutex:587:7 (data_race.x+0x4c951b) #15 pthread_once /var/tmp/x86_64-rhel6/llvm-6.0.1.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1433 (data_race.x+0x456d92) #16 __gthread_once(int*, void (*)()) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/x86_64-pc-linux-gnu/bits/gthr-default.h:699:12 (data_race.x+0x4c5e0b) #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/mutex:619:17 (data_race.x+0x4c92a5) #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:392:2 (data_race.x+0x4c8ecb) #19 std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1}::operator()() const /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1664:3 (data_race.x+0x4c8d3e) #20 void std::_Bind_simple<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1} ()>::_M_invoke<>(std::_Index_tuple<>) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1399:18 (data_race.x+0x4c8ca5) #21 std::_Bind_simple<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1} ()>::operator()() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1389:16 (data_race.x+0x4c8c65) #22 std::thread::_State_impl<std::_Bind_simple<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1} ()> >::_M_run() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/thread:196:13 (data_race.x+0x4c8b19) #23 execute_native_thread_routine /var/tmp/x86_64-rhel6/gcc-6.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11/../../../../../../gcc-6.1.0/libstdc++-v3/src/c++11/thread.cc:83 (data_race.x+0x54d601) Previous write of size 4 at 0x0000016dfc90 by thread T1: #0 sc_core::sc_vpool<sc_dt::sc_uint_bitref>::allocate() /projects/ntsw-arch-public/tools/systemc-22sep2015/systemc-2.3.0/x86_64-gcc8/include/sysc/utils/sc_temporary.h:188:11 (data_race.x+0x4c63f7) #1 sc_dt::sc_uint_base::operator[](int) /projects/ntsw-arch-public/tools/systemc-22sep2015/systemc-2.3.0/x86_64-gcc8/include/sysc/datatypes/int/sc_uint_base.h:1207:55 (data_race.x+0x4c5f48) #2 thread_func() /projects/ntsw-arch/AV/users/runipg/rg_arch40/arch/common/test/data_race/data_race.cc:15:9 (data_race.x+0x4c5c29) #3 void std::_Bind_simple<void (*())()>::_M_invoke<>(std::_Index_tuple<>) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1399:18 (data_race.x+0x4ca7ba) #4 std::_Bind_simple<void (*())()>::operator()() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1389:16 (data_race.x+0x4ca685) #5 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::_Bind_simple<void (*())()>, void>::operator()() const /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1348:6 (data_race.x+0x4ca55a) #6 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::_Bind_simple<void (*())()>, void> >::_M_invoke(std::_Any_data const&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1725:9 (data_race.x+0x4ca3a6) #7 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:2136:14 (data_race.x+0x4c9fc1) #8 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:533:27 (data_race.x+0x4c9308) #9 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:235:14 (data_race.x+0x4c9dc7) #10 std::result_of<void (std::__future_base::_State_baseV2::* const&(std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&))(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>::type std::__invoke<void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:259:14 (data_race.x+0x4c9cf8) #11 _ZNKSt12_Mem_fn_baseIMNSt13__future_base13_State_baseV2EFvPSt8functionIFSt10unique_ptrINS0_12_Result_baseENS4_8_DeleterEEvEEPbELb1EEclIJPS1_S9_SA_EEEDTclsr3stdE8__invokedtdefpT6_M_pmfspclsr3stdE7forwardIT_Efp_EEEDpOSG_ /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:613:11 (data_race.x+0x4c9b6d) #12 void std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> (std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>::_M_invoke<0ul, 1ul, 2ul>(std::_Index_tuple<0ul, 1ul, 2ul>) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1399:18 (data_race.x+0x4c9ace) #13 std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> (std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>::operator()() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1389:16 (data_race.x+0x4c9a45) #14 void std::__once_call_impl<std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> (std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> >() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/mutex:587:7 (data_race.x+0x4c951b) #15 pthread_once /var/tmp/x86_64-rhel6/llvm-6.0.1.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1433 (data_race.x+0x456d92) #16 __gthread_once(int*, void (*)()) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/x86_64-pc-linux-gnu/bits/gthr-default.h:699:12 (data_race.x+0x4c5e0b) #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/mutex:619:17 (data_race.x+0x4c92a5) #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:392:2 (data_race.x+0x4c8ecb) #19 std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1}::operator()() const /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1664:3 (data_race.x+0x4c8d3e) #20 void std::_Bind_simple<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1} ()>::_M_invoke<>(std::_Index_tuple<>) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1399:18 (data_race.x+0x4c8ca5) #21 std::_Bind_simple<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1} ()>::operator()() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1389:16 (data_race.x+0x4c8c65) #22 std::thread::_State_impl<std::_Bind_simple<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1} ()> >::_M_run() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/thread:196:13 (data_race.x+0x4c8b19) #23 execute_native_thread_routine /var/tmp/x86_64-rhel6/gcc-6.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11/../../../../../../gcc-6.1.0/libstdc++-v3/src/c++11/thread.cc:83 (data_race.x+0x54d601) Location is global 'sc_dt::sc_uint_bitref::m_pool' of size 24 at 0x0000016dfc90 (data_race.x+0x0000016dfc90) Thread T2 (tid=19820, running) created by main thread at: #0 pthread_create /var/tmp/x86_64-rhel6/llvm-6.0.1.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:992 (data_race.x+0x433b36) #1 __gthread_create /var/tmp/x86_64-rhel6/gcc-6.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:662 (data_race.x+0x54d8f4) #2 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /var/tmp/x86_64-rhel6/gcc-6.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11/../../../../../../gcc-6.1.0/libstdc++-v3/src/c++11/thread.cc:163 (data_race.x+0x54d8f4) #3 std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1661:14 (data_race.x+0x4c7b04) #4 void __gnu_cxx::new_allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >::construct<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::_Bind_simple<void (*())()> >(std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>*, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/ext/new_allocator.h:120:23 (data_race.x+0x4c7a46) #5 void std::allocator_traits<std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > >::construct<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::_Bind_simple<void (*())()> >(std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >&, std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>*, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/alloc_traits.h:455:8 (data_race.x+0x4c77cd) #6 std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::_Bind_simple<void (*())()> >(std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr_base.h:520:4 (data_race.x+0x4c74a3) #7 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::_Sp_make_shared_tag, std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>*, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr_base.h:615:18 (data_race.x+0x4c7234) #8 std::__shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::_Sp_make_shared_tag, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr_base.h:1099:14 (data_race.x+0x4c7157) #9 std::shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >::shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::_Sp_make_shared_tag, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr.h:319:4 (data_race.x+0x4c70ed) #10 std::shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > std::allocate_shared<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr.h:619:14 (data_race.x+0x4c703d) #11 std::shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > std::make_shared<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::_Bind_simple<void (*())()> >(std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr.h:635:14 (data_race.x+0x4c6f3b) #12 std::shared_ptr<std::__future_base::_State_baseV2> std::__future_base::_S_make_async_state<std::_Bind_simple<void (*())()> >(std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1702:14 (data_race.x+0x4c6c0b) #13 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(std::launch, void (&)()) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1716:18 (data_race.x+0x4c61ac) #14 main /projects/ntsw-arch/AV/users/runipg/rg_arch40/arch/common/test/data_race/data_race.cc:29:18 (data_race.x+0x4c5cd1) Thread T1 (tid=19819, finished) created by main thread at: #0 pthread_create /var/tmp/x86_64-rhel6/llvm-6.0.1.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:992 (data_race.x+0x433b36) #1 __gthread_create /var/tmp/x86_64-rhel6/gcc-6.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:662 (data_race.x+0x54d8f4) #2 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /var/tmp/x86_64-rhel6/gcc-6.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11/../../../../../../gcc-6.1.0/libstdc++-v3/src/c++11/thread.cc:163 (data_race.x+0x54d8f4) #3 std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1661:14 (data_race.x+0x4c7b04) #4 void __gnu_cxx::new_allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >::construct<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::_Bind_simple<void (*())()> >(std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>*, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/ext/new_allocator.h:120:23 (data_race.x+0x4c7a46) #5 void std::allocator_traits<std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > >::construct<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::_Bind_simple<void (*())()> >(std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >&, std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>*, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/alloc_traits.h:455:8 (data_race.x+0x4c77cd) #6 std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::_Bind_simple<void (*())()> >(std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr_base.h:520:4 (data_race.x+0x4c74a3) #7 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::_Sp_make_shared_tag, std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>*, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr_base.h:615:18 (data_race.x+0x4c7234) #8 std::__shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::_Sp_make_shared_tag, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr_base.h:1099:14 (data_race.x+0x4c7157) #9 std::shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >::shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::_Sp_make_shared_tag, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr.h:319:4 (data_race.x+0x4c70ed) #10 std::shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > std::allocate_shared<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr.h:619:14 (data_race.x+0x4c703d) #11 std::shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > std::make_shared<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::_Bind_simple<void (*())()> >(std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr.h:635:14 (data_race.x+0x4c6f3b) #12 std::shared_ptr<std::__future_base::_State_baseV2> std::__future_base::_S_make_async_state<std::_Bind_simple<void (*())()> >(std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1702:14 (data_race.x+0x4c6c0b) #13 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(std::launch, void (&)()) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1716:18 (data_race.x+0x4c61ac) #14 main /projects/ntsw-arch/AV/users/runipg/rg_arch40/arch/common/test/data_race/data_race.cc:29:18 (data_race.x+0x4c5cd1) SUMMARY: ThreadSanitizer: data race /projects/ntsw-arch-public/tools/systemc-22sep2015/systemc-2.3.0/x86_64-gcc8/include/sysc/utils/sc_temporary.h:187:23 in sc_core::sc_vpool<sc_dt::sc_uint_bitref>::allocate() ================== ================== WARNING: ThreadSanitizer: data race (pid=19816) Read of size 4 at 0x0000016dfc70 by thread T2: #0 sc_core::sc_vpool<sc_dt::sc_uint_subref>::allocate() /projects/ntsw-arch-public/tools/systemc-22sep2015/systemc-2.3.0/x86_64-gcc8/include/sysc/utils/sc_temporary.h:187:23 (data_race.x+0x4c6538) #1 sc_dt::sc_uint_base::range(int, int) /projects/ntsw-arch-public/tools/systemc-22sep2015/systemc-2.3.0/x86_64-gcc8/include/sysc/datatypes/int/sc_uint_base.h:1272:55 (data_race.x+0x4c6001) #2 thread_func() /projects/ntsw-arch/AV/users/runipg/rg_arch40/arch/common/test/data_race/data_race.cc:16:13 (data_race.x+0x4c5c45) #3 void std::_Bind_simple<void (*())()>::_M_invoke<>(std::_Index_tuple<>) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1399:18 (data_race.x+0x4ca7ba) #4 std::_Bind_simple<void (*())()>::operator()() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1389:16 (data_race.x+0x4ca685) #5 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::_Bind_simple<void (*())()>, void>::operator()() const /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1348:6 (data_race.x+0x4ca55a) #6 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::_Bind_simple<void (*())()>, void> >::_M_invoke(std::_Any_data const&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1725:9 (data_race.x+0x4ca3a6) #7 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:2136:14 (data_race.x+0x4c9fc1) #8 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:533:27 (data_race.x+0x4c9308) #9 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:235:14 (data_race.x+0x4c9dc7) #10 std::result_of<void (std::__future_base::_State_baseV2::* const&(std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&))(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>::type std::__invoke<void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:259:14 (data_race.x+0x4c9cf8) #11 _ZNKSt12_Mem_fn_baseIMNSt13__future_base13_State_baseV2EFvPSt8functionIFSt10unique_ptrINS0_12_Result_baseENS4_8_DeleterEEvEEPbELb1EEclIJPS1_S9_SA_EEEDTclsr3stdE8__invokedtdefpT6_M_pmfspclsr3stdE7forwardIT_Efp_EEEDpOSG_ /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:613:11 (data_race.x+0x4c9b6d) #12 void std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> (std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>::_M_invoke<0ul, 1ul, 2ul>(std::_Index_tuple<0ul, 1ul, 2ul>) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1399:18 (data_race.x+0x4c9ace) #13 std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> (std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>::operator()() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1389:16 (data_race.x+0x4c9a45) #14 void std::__once_call_impl<std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> (std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> >() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/mutex:587:7 (data_race.x+0x4c951b) #15 pthread_once /var/tmp/x86_64-rhel6/llvm-6.0.1.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1433 (data_race.x+0x456d92) #16 __gthread_once(int*, void (*)()) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/x86_64-pc-linux-gnu/bits/gthr-default.h:699:12 (data_race.x+0x4c5e0b) #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/mutex:619:17 (data_race.x+0x4c92a5) #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:392:2 (data_race.x+0x4c8ecb) #19 std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1}::operator()() const /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1664:3 (data_race.x+0x4c8d3e) #20 void std::_Bind_simple<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1} ()>::_M_invoke<>(std::_Index_tuple<>) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1399:18 (data_race.x+0x4c8ca5) #21 std::_Bind_simple<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1} ()>::operator()() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1389:16 (data_race.x+0x4c8c65) #22 std::thread::_State_impl<std::_Bind_simple<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1} ()> >::_M_run() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/thread:196:13 (data_race.x+0x4c8b19) #23 execute_native_thread_routine /var/tmp/x86_64-rhel6/gcc-6.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11/../../../../../../gcc-6.1.0/libstdc++-v3/src/c++11/thread.cc:83 (data_race.x+0x54d601) Previous write of size 4 at 0x0000016dfc70 by thread T1: #0 sc_core::sc_vpool<sc_dt::sc_uint_subref>::allocate() /projects/ntsw-arch-public/tools/systemc-22sep2015/systemc-2.3.0/x86_64-gcc8/include/sysc/utils/sc_temporary.h:188:11 (data_race.x+0x4c655a) #1 sc_dt::sc_uint_base::range(int, int) /projects/ntsw-arch-public/tools/systemc-22sep2015/systemc-2.3.0/x86_64-gcc8/include/sysc/datatypes/int/sc_uint_base.h:1272:55 (data_race.x+0x4c6001) #2 thread_func() /projects/ntsw-arch/AV/users/runipg/rg_arch40/arch/common/test/data_race/data_race.cc:16:13 (data_race.x+0x4c5c45) #3 void std::_Bind_simple<void (*())()>::_M_invoke<>(std::_Index_tuple<>) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1399:18 (data_race.x+0x4ca7ba) #4 std::_Bind_simple<void (*())()>::operator()() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1389:16 (data_race.x+0x4ca685) #5 std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::_Bind_simple<void (*())()>, void>::operator()() const /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1348:6 (data_race.x+0x4ca55a) #6 std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::_Bind_simple<void (*())()>, void> >::_M_invoke(std::_Any_data const&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1725:9 (data_race.x+0x4ca3a6) #7 std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:2136:14 (data_race.x+0x4c9fc1) #8 std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:533:27 (data_race.x+0x4c9308) #9 void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:235:14 (data_race.x+0x4c9dc7) #10 std::result_of<void (std::__future_base::_State_baseV2::* const&(std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&))(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>::type std::__invoke<void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::* const&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:259:14 (data_race.x+0x4c9cf8) #11 _ZNKSt12_Mem_fn_baseIMNSt13__future_base13_State_baseV2EFvPSt8functionIFSt10unique_ptrINS0_12_Result_baseENS4_8_DeleterEEvEEPbELb1EEclIJPS1_S9_SA_EEEDTclsr3stdE8__invokedtdefpT6_M_pmfspclsr3stdE7forwardIT_Efp_EEEDpOSG_ /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:613:11 (data_race.x+0x4c9b6d) #12 void std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> (std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>::_M_invoke<0ul, 1ul, 2ul>(std::_Index_tuple<0ul, 1ul, 2ul>) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1399:18 (data_race.x+0x4c9ace) #13 std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> (std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)>::operator()() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1389:16 (data_race.x+0x4c9a45) #14 void std::__once_call_impl<std::_Bind_simple<std::_Mem_fn<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> (std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)> >() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/mutex:587:7 (data_race.x+0x4c951b) #15 pthread_once /var/tmp/x86_64-rhel6/llvm-6.0.1.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:1433 (data_race.x+0x456d92) #16 __gthread_once(int*, void (*)()) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/x86_64-pc-linux-gnu/bits/gthr-default.h:699:12 (data_race.x+0x4c5e0b) #17 void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/mutex:619:17 (data_race.x+0x4c92a5) #18 std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:392:2 (data_race.x+0x4c8ecb) #19 std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1}::operator()() const /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1664:3 (data_race.x+0x4c8d3e) #20 void std::_Bind_simple<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1} ()>::_M_invoke<>(std::_Index_tuple<>) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1399:18 (data_race.x+0x4c8ca5) #21 std::_Bind_simple<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1} ()>::operator()() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/functional:1389:16 (data_race.x+0x4c8c65) #22 std::thread::_State_impl<std::_Bind_simple<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&)::{lambda()#1} ()> >::_M_run() /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/thread:196:13 (data_race.x+0x4c8b19) #23 execute_native_thread_routine /var/tmp/x86_64-rhel6/gcc-6.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11/../../../../../../gcc-6.1.0/libstdc++-v3/src/c++11/thread.cc:83 (data_race.x+0x54d601) Location is global 'sc_dt::sc_uint_subref::m_pool' of size 24 at 0x0000016dfc70 (data_race.x+0x0000016dfc70) Thread T2 (tid=19820, running) created by main thread at: #0 pthread_create /var/tmp/x86_64-rhel6/llvm-6.0.1.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:992 (data_race.x+0x433b36) #1 __gthread_create /var/tmp/x86_64-rhel6/gcc-6.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:662 (data_race.x+0x54d8f4) #2 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /var/tmp/x86_64-rhel6/gcc-6.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11/../../../../../../gcc-6.1.0/libstdc++-v3/src/c++11/thread.cc:163 (data_race.x+0x54d8f4) #3 std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1661:14 (data_race.x+0x4c7b04) #4 void __gnu_cxx::new_allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >::construct<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::_Bind_simple<void (*())()> >(std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>*, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/ext/new_allocator.h:120:23 (data_race.x+0x4c7a46) #5 void std::allocator_traits<std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > >::construct<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::_Bind_simple<void (*())()> >(std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >&, std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>*, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/alloc_traits.h:455:8 (data_race.x+0x4c77cd) #6 std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::_Bind_simple<void (*())()> >(std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr_base.h:520:4 (data_race.x+0x4c74a3) #7 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::_Sp_make_shared_tag, std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>*, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr_base.h:615:18 (data_race.x+0x4c7234) #8 std::__shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::_Sp_make_shared_tag, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr_base.h:1099:14 (data_race.x+0x4c7157) #9 std::shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >::shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::_Sp_make_shared_tag, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr.h:319:4 (data_race.x+0x4c70ed) #10 std::shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > std::allocate_shared<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr.h:619:14 (data_race.x+0x4c703d) #11 std::shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > std::make_shared<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::_Bind_simple<void (*())()> >(std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr.h:635:14 (data_race.x+0x4c6f3b) #12 std::shared_ptr<std::__future_base::_State_baseV2> std::__future_base::_S_make_async_state<std::_Bind_simple<void (*())()> >(std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1702:14 (data_race.x+0x4c6c0b) #13 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(std::launch, void (&)()) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1716:18 (data_race.x+0x4c61ac) #14 main /projects/ntsw-arch/AV/users/runipg/rg_arch40/arch/common/test/data_race/data_race.cc:29:18 (data_race.x+0x4c5cd1) Thread T1 (tid=19819, finished) created by main thread at: #0 pthread_create /var/tmp/x86_64-rhel6/llvm-6.0.1.src/projects/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc:992 (data_race.x+0x433b36) #1 __gthread_create /var/tmp/x86_64-rhel6/gcc-6.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/include/x86_64-pc-linux-gnu/bits/gthr-default.h:662 (data_race.x+0x54d8f4) #2 std::thread::_M_start_thread(std::unique_ptr<std::thread::_State, std::default_delete<std::thread::_State> >, void (*)()) /var/tmp/x86_64-rhel6/gcc-6.1.0/objdir/x86_64-pc-linux-gnu/libstdc++-v3/src/c++11/../../../../../../gcc-6.1.0/libstdc++-v3/src/c++11/thread.cc:163 (data_race.x+0x54d8f4) #3 std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>::_Async_state_impl(std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1661:14 (data_race.x+0x4c7b04) #4 void __gnu_cxx::new_allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >::construct<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::_Bind_simple<void (*())()> >(std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>*, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/ext/new_allocator.h:120:23 (data_race.x+0x4c7a46) #5 void std::allocator_traits<std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > >::construct<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::_Bind_simple<void (*())()> >(std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >&, std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>*, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/alloc_traits.h:455:8 (data_race.x+0x4c77cd) #6 std::_Sp_counted_ptr_inplace<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, (__gnu_cxx::_Lock_policy)2>::_Sp_counted_ptr_inplace<std::_Bind_simple<void (*())()> >(std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr_base.h:520:4 (data_race.x+0x4c74a3) #7 std::__shared_count<(__gnu_cxx::_Lock_policy)2>::__shared_count<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::_Sp_make_shared_tag, std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>*, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr_base.h:615:18 (data_race.x+0x4c7234) #8 std::__shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, (__gnu_cxx::_Lock_policy)2>::__shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::_Sp_make_shared_tag, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr_base.h:1099:14 (data_race.x+0x4c7157) #9 std::shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >::shared_ptr<std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::_Sp_make_shared_tag, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr.h:319:4 (data_race.x+0x4c70ed) #10 std::shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > std::allocate_shared<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> >, std::_Bind_simple<void (*())()> >(std::allocator<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > const&, std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr.h:619:14 (data_race.x+0x4c703d) #11 std::shared_ptr<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void> > std::make_shared<std::__future_base::_Async_state_impl<std::_Bind_simple<void (*())()>, void>, std::_Bind_simple<void (*())()> >(std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/bits/shared_ptr.h:635:14 (data_race.x+0x4c6f3b) #12 std::shared_ptr<std::__future_base::_State_baseV2> std::__future_base::_S_make_async_state<std::_Bind_simple<void (*())()> >(std::_Bind_simple<void (*())()>&&) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1702:14 (data_race.x+0x4c6c0b) #13 std::future<std::result_of<std::decay<void (&)()>::type ()>::type> std::async<void (&)()>(std::launch, void (&)()) /tools/oss/packages/x86_64-rhel6/gcc/6.1.0/lib/gcc/x86_64-pc-linux-gnu/6.1.0/../../../../include/c++/6.1.0/future:1716:18 (data_race.x+0x4c61ac) #14 main /projects/ntsw-arch/AV/users/runipg/rg_arch40/arch/common/test/data_race/data_race.cc:29:18 (data_race.x+0x4c5cd1) SUMMARY: ThreadSanitizer: data race /projects/ntsw-arch-public/tools/systemc-22sep2015/systemc-2.3.0/x86_64-gcc8/include/sysc/utils/sc_temporary.h:187:23 in sc_core::sc_vpool<sc_dt::sc_uint_subref>::allocate() ================== ThreadSanitizer: reported 2 warnings 6. A common pattern is to use a fixed width slice of a bit-vector (both set and get). This should be optimized to take advantage of compile time templated left and right (L,R) parameters. For example: template< int W > class biguint { public: ... template<int L, int R, int W2> void set_fslc (const biguint<W2> &b); template<int L, int R> biguint<L - R + 1> fslc () const; } There are other interesting problems to solve as well but don't want to make this post too long.
    1 point
  31. Code itself looks fine. I ran the above on EDAplayground without problem. I also ran on MacOS 10.15.7 (Catalina) with Apple clang++ 12.0 (LLVM ) Here is a link to where I ran it: https://edaplayground.com/x/V25h SystemC 2.3.3-Accellera --- Sep 21 2020 10:55:34g++ 7.5Using C++ standard 201402Ubuntu 18.04 You might consider upgrading g++ (4.8 is pretty old). I use g++ 9.3 normally.
    1 point
  32. SystemC is a discrete event driven simulator using an approach similar to Verilog, SystemVerilog and VHDL.The coding approach assumes cooperative multitasking. This is very time efficient and more importantly simplifies the modeling aspect if you really understand it, and makes it easier to interoperate with other simulators. Immediate notification is a unique feature of SystemC that works for some models, but not all. The reasoning behind it is simple efficiency. Delayed notification (i.e., SC_ZERO_TIME) is the safest approach if you are not certain that other processes are designed to work with immediate notification. Both potentially (likely) result in additional delta cycles. I have an old presentation (with code) that graphically single steps the simulator to make its behavior easier to understand under https://github.com/dcblack/SystemC-Engine/.
    1 point
  33. @plafrattTLM2 is built to allow any protocols you like. The "base protocol" was deemed sufficient for most needs; however, TLM2 was designed specifically to allow alternatives. Furthermore, the standard provides mechanisms to keep the cost of adapters/bridges between protocols simulation efficient. [Plug - ignore if you like] The Doulos course on TLM 2.0 <https://www.doulos.com/training/systemc-tlm-20/systemc-modeling-using-tlm-20-online/> investigates the base protocol and then builds up to a module describing custom protocols.
    1 point
  34. Paul Floyd

    A few Valgrind issues

    Here is a full analysis of the first problem, and a proposed patch. Here's what I saw running the executable under Valgrind via the GDB server (this is required to execute the mo(nitor) command). 257 result_p->digit = (sc_digit*)sc_core::sc_temp_heap.allocate( 258 sizeof(sc_digit)*result_p->ndigits ); 259 #if defined(_MSC_VER) 260 // workaround spurious initialisation issue on MS Visual C++ 261 memset( result_p->digit, 0, sizeof(sc_digit)*result_p->ndigits ); 262 #else 263 result_p->digit[result_p->ndigits-1] = 0; 264 #endif >265 right_non_zero = m_right_p->concat_get_data( result_p->digit, 0 ); The above is copied from gdb. result_p->nbits is 95, result_p->ndigits is 4 and result_p->digit contains all zeroes (gdb) x /4x result_p->digit 0x5825bb0: 0x00000000 0x00000000 0x00000000 0x00000000 However, the 1st 3 words are uninitialized, only the 4th word is initialized, as seen on line 263 (gdb) mo xb 0x5825bb0 16 ff ff ff ff ff ff ff ff 0x5825BB0: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 ff ff ff ff 00 00 00 00 0x5825BB8: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 Inside concat_get_data we execute >337 dst_p[dst_i] = dst_p[dst_i] & ~mask; Where dst_i is 0, mask is 0x3fffffff, dst_p[dst_i] is all uninitialized After this assignment, the lower 30 bits are initialized but the top 2 bits are still uninitialized: (gdb) p &dst_p[dst_i] $27 = (sc_dt::sc_digit *) 0x5825bb0 (gdb) mo xb 0x5825bb0 4 00 00 00 c0 0x5825BB0: 0x00 0x00 0x00 0x00 However, I don't think that the problem is here. The next call 266 left_non_zero = m_left_p->concat_get_data(result_p->digit, m_len_r); is where I reckon those two bits ought to be written to, but aren't. Watch this space. Update: In the second call to concat_get_data, the first word of dst_p doesn't get written (since dst_i is 1 rather than 0). So in summary, the 1st call to concat_get_data doesn't initialize all of word 0 of dst_p but then the 2nd call assumes that it was all initialized. For comparison, the concatenation with 29 bits behaves in a similar fashion to 30 bits for the 1st call, bit the second call has dst_i set to 0 so word 0 does get fully initialized. In the case of 31 bits, a different path is taken in in the first call to concat_get_data (sc_unsigned.cpp around line 352) which writes 2 whole words rather than just part of 1 word. I suggest as a fix changing this block // ALL DATA TO BE MOVED IS IN A SINGLE WORD: if ( dst_i == end_i ) { mask = ~(~0U << real_bits) << left_shift; dst_p[dst_i] = dst_p[dst_i] & ~mask; } to be // ALL DATA TO BE MOVED IS IN A SINGLE WORD: if ( dst_i == end_i ) { if ( left_shift == 0 ) { dst_p[dst_i] = 0; } else { mask = ~(~0U << real_bits) << left_shift; dst_p[dst_i] = dst_p[dst_i] & ~mask; } } (and the same thing for signed) It is not easy to test this thoroughly. The problem is with the circular buffer, which reuses memory. The re-used memory never becomes uninitialized, so to check that I made this change +#include "/usr/home/paulf/tools/valgrind/include/valgrind/memcheck.h" + template<class T> T* sc_vpool<T>::allocate() { T* result_p; // Entry to return. result_p = &m_pool_p[m_pool_i]; + + VALGRIND_MAKE_MEM_UNDEFINED(result_p, sizeof(T)); + m_pool_i = (m_pool_i + 1) & m_wrap; return result_p; } I've attached a patch that seems to solve the issue. Lastly, this can also probably be changed #if defined(_MSC_VER) // workaround spurious initialisation issue on MS Visual C++ memset( result_p->digit, 0, sizeof(sc_digit)*result_p->ndigits ); #else result_p->digit[result_p->ndigits-1] = 0; #endif The comment is al least half wrong - it is a genuine workaround. With the attached patch the memset should not be necessary. concat_init.patch
    1 point
  35. Have a goal. Do you want to learn the design side or verification? Either way, create some small design, then a testbench to check its operation. There are a lot of great resources out there. Sometimes you can get a simulator license by taking a course. Or use the EDA Playground. Stu Sutherland has an excellent book on design with SystemVerilog. Highly recommended! Personally, I learned a lot by writing many small examples. You can do a lot in a dozen lines. I have a directory filled with little modules, most under 20 lines. If you keep it small, you can stay focused. Once you have mastered the concept, apply it to your design and testbench. Cheers, Chris Spear Mentor Graphics
    1 point
  36. Paul Floyd

    A few Valgrind issues

    More details on the other two issues systemc/misc/user_guide/chpt4.4 ==165605== Invalid write of size 8 ==165605== at 0x49FACA6: sc_core::sc_object::orphan_child_objects() (sc_object.cpp:336) ==165605== by 0x49F5D46: sc_core::sc_module::~sc_module() (sc_module.cpp:273) ==165605== by 0x406CC3: stage1_2::~stage1_2() (stage1_2.h:43) ==165605== by 0x406B95: pipeline::~pipeline() (pipeline.h:43) ==165605== by 0x406C38: pipeline::~pipeline() (pipeline.h:43) ==165605== by 0x49F5343: sc_core::sc_module_dynalloc_list::~sc_module_dynalloc_list() (sc_module.cpp:94) ==165605== by 0x4EA4236: __run_exit_handlers (in /usr/lib64/libc-2.32.so) ==165605== by 0x4EA43DF: exit (in /usr/lib64/libc-2.32.so) ==165605== by 0x4E8C1E8: (below main) (in /usr/lib64/libc-2.32.so) ==165605== Address 0x5377510 is 96 bytes inside a block of size 448 free'd ==165605== at 0x483AEDD: operator delete(void*) (vg_replace_malloc.c:584) ==165605== by 0x4071A6: stage1::~stage1() (stage1.h:43) ==165605== by 0x49F5343: sc_core::sc_module_dynalloc_list::~sc_module_dynalloc_list() (sc_module.cpp:94) ==165605== by 0x4EA4236: __run_exit_handlers (in /usr/lib64/libc-2.32.so) ==165605== by 0x4EA43DF: exit (in /usr/lib64/libc-2.32.so) ==165605== by 0x4E8C1E8: (below main) (in /usr/lib64/libc-2.32.so) ==165605== Block was alloc'd at ==165605== at 0x4839E7D: operator new(unsigned long) (vg_replace_malloc.c:342) ==165605== by 0x406EAC: f_stage1(char const*, sc_core::sc_clock&, sc_core::sc_signal<double, (sc_core::sc_writer_policy)0> const&, sc_core::sc_signal<double, (sc_core::sc_writer_policy)0> const&, sc_core::sc_signal<double, (sc_core::sc_writer_policy)0>&, sc_core::sc_signal<double, (sc_core::sc_writer_policy)0>&) (stage1.cpp:66) ==165605== by 0x406951: stage1_2::stage1_2(sc_core::sc_module_name, sc_core::sc_clock&, sc_core::sc_signal<double, (sc_core::sc_writer_policy)0> const&, sc_core::sc_signal<double, (sc_core::sc_writer_policy)0> const&, sc_core::sc_signal<double, (sc_core::sc_writer_policy)0>&, sc_core::sc_signal<double, (sc_core::sc_writer_policy)0>&) (stage1_2.h:56) ==165605== by 0x406AA1: pipeline::pipeline(sc_core::sc_module_name, sc_core::sc_clock&, sc_core::sc_signal<double, (sc_core::sc_writer_policy)0> const&, sc_core::sc_signal<double, (sc_core::sc_writer_policy)0> const&, sc_core::sc_signal<double, (sc_core::sc_writer_policy)0>&) (pipeline.h:56) ==165605== by 0x4067FB: f_pipeline(char const*, sc_core::sc_clock&, sc_core::sc_signal<double, (sc_core::sc_writer_policy)0> const&, sc_core::sc_signal<double, (sc_core::sc_writer_policy)0> const&, sc_core::sc_signal<double, (sc_core::sc_writer_policy)0>&) (pipeline.cpp:55) ==165605== by 0x4048D9: sc_main (main.cpp:58) ==165605== by 0x49F1E8C: sc_elab_and_sim (sc_main_main.cpp:89) ==165605== by 0x49F1CCE: main (sc_main.cpp:36) memcheck is saying that in this code [sc_object.cpp void sc_object::orphan_child_events()] for( ; it != end; ++it ) { (*it)->m_parent = NULL; simcontext()->add_child_object(*it); } the child object has already been deleted, so it is writing to deleted memory. I assume that stage1 should be destroyed after stage1_2. Should pipeline::stage1_2 be a pointer allocated with SC_NEW so that the destruction gets done in the right order? If so it's an issue with the testcase so not a very serious problem. And the last problem tlm/bus_dmi ==166842== Thread 5: ==166842== Conditional jump or move depends on uninitialised value(s) ==166842== at 0x4278D8: tlm_utils::simple_target_socket_b<ExplicitATTarget, 32u, tlm::tlm_base_protocol_types, (sc_core::sc_port_policy)0>::bw_process::nb_transport_bw(tlm::tlm_generic_payload&, tlm::tlm_phase&, sc_core::sc_time&) (simple_target_socket.h:157) ==166842== by 0x415358: ExplicitATTarget::beginResponse() (ExplicitATTarget.h:133) ==166842== by 0x4A0B504: sc_core::sc_process_b::semantics() (sc_process.h:685) ==166842== by 0x4A11C21: sc_core::sc_thread_cor_fn(void*) (sc_thread_process.cpp:117) ==166842== by 0x49EABB0: sc_core::sc_cor_pthread::invoke_module_method(void*) (sc_cor_pthread.cpp:127) ==166842== by 0x4E493F8: start_thread (in /usr/lib64/libpthread-2.32.so) ==166842== by 0x4F65902: clone (in /usr/lib64/libc-2.32.so) ==166842== Uninitialised value was created by a stack allocation ==166842== at 0x40A8EB: sc_main (bus_dmi.cpp:37) ==166842== ==166842== Thread 1: ==166842== Conditional jump or move depends on uninitialised value(s) ==166842== at 0x429158: tlm_utils::simple_target_socket_b<SimpleATTarget2, 32u, tlm::tlm_base_protocol_types, (sc_core::sc_port_policy)0>::bw_process::nb_transport_bw(tlm::tlm_generic_payload&, tlm::tlm_phase&, sc_core::sc_time&) (simple_target_socket.h:157) ==166842== by 0x413A65: SimpleATTarget2::beginResponse() (SimpleATTarget2.h:145) ==166842== by 0x4A0B504: sc_core::sc_process_b::semantics() (sc_process.h:685) ==166842== by 0x4A0B788: sc_core::sc_method_process::run_process() (sc_method_process.h:305) ==166842== by 0x4A0CFA3: sc_core::sc_simcontext::crunch(bool) (sc_simcontext.cpp:486) ==166842== by 0x4A08D19: sc_core::sc_simcontext::simulate(sc_core::sc_time const&) (sc_simcontext.cpp:887) ==166842== by 0x4A0AB61: sc_core::sc_start(sc_core::sc_time const&, sc_core::sc_starvation_policy) (sc_simcontext.cpp:1718) ==166842== by 0x4A0AC8C: sc_core::sc_start() (sc_simcontext.cpp:1752) ==166842== by 0x40AEBF: sc_main (bus_dmi.cpp:76) ==166842== by 0x49F1E8C: sc_elab_and_sim (sc_main_main.cpp:89) ==166842== by 0x49F1CCE: main (sc_main.cpp:36) ==166842== Uninitialised value was created by a stack allocation ==166842== at 0x40A8EB: sc_main (bus_dmi.cpp:37) ==166842== This is a very straightforward missing initialization, fixed with the following change diff --git a/src/tlm_utils/simple_target_socket.h b/src/tlm_utils/simple_target_ socket.h index 7e4c3a19..c3bd240f 100644 --- a/src/tlm_utils/simple_target_socket.h +++ b/src/tlm_utils/simple_target_socket.h @@ -68,6 +68,7 @@ public: : base_type(n) , m_fw_process(this) , m_bw_process(this) + , m_current_transaction(NULL) { bind(m_fw_process); }
    1 point
  37. Paul Floyd

    A few Valgrind issues

    So, for the 1st item that I've looked at the most, I reproduced this on Fedora 33 amd64 with the default GCC [gcc (GCC) 10.2.1 20201125 (Red Hat 10.2.1-9)]. The SystemC library is the latest from github and regressions systemc-regressions-2.3.3 from Accellera. Valgrind is the latest release, 3.16.1. I also reproduced the same issue on FreeBSD 12.2 with the default clang (10 I believe). That was with my own build of Valgrind, a bit more recent than 3.16.1 but no significant differences on amd64. The 2nd and 3rd items I also saw on FreeBSD and I'm rerunning the full set of tests on Fedora at the moment. Will update tomorrow.
    1 point
  38. Hello @Beginner_KOR, You can follow a similar discussion here: Hope this helps. Regards, Ameya Vikram Singh
    1 point
  39. Hello @Issraa, Can you share the directory listing(ls -al) for the mentioned path below: ls -al /home/israa/systemc-2.3.3/ # or more appropriately ls -al $SYSTEMC_HOME Regards, Ameya Vikram Singh
    1 point
  40. In the constructor list you would provide a creator function. This is a functor(a function pointer, a std::function object, a Functor classinstance, a lambda function, ...) which accepts a char const* and a size_type and returns a constructed object. In your case it would look like (C++11): class example: public sc_core::sc_module { public: sc_core::sc_vector<sc_core::sc_fifo<unsigned>> fifos; example(sc_core::sc_module_name nm, unsigned outputs) : sc_core::sc_module(nm) , fifos("fifos", outputs, [](char const* name, unsigned i)->sc_core::sc_fifo<unsigned> { return new sc_core::sc_fifo<unsigned>(5000); } { // some construction code } }
    1 point
  41. SystemC FIFO's represent hardware and as such may only be created during construction of a model. After elaboration closes, you are not allowed to add more fifos. None of your code examples above are complete, so it is fairly hard to give you a complete answer. Perhaps you could put your design on https://edaplayground.com and share a link with us. For details on phases of SystemC (e.g. elaboration) see IEEE-1666-2011.pdf, which you can obtain through Accellera.org.
    1 point
  42. Eyck

    tlm to pin converter

    Well, sc_fifo is not TLM. For your example the basic question is: what is the protocol on fifo_out? Should it be clock-based? Valid-Ready signaling? So your queastion and example is too generic and broad. If you are looking for an example to translate from TLM2.0 to pin level of an Amba AHB protocol you may have a look here: https://git.minres.com/SystemC/SystemC-Components/src/branch/master/incl/tlm/ahb/bfm and https://git.minres.com/SystemC/SystemC-Components/src/branch/master/src/tlm_ahb_bfm_initiator.cpp as well as https://git.minres.com/SystemC/SystemC-Components/src/branch/master/src/tlm_ahb_bfm_target.cpp. They implement TLM2.0 to pin and pin to TLM2.0
    1 point
  43. Hi Folks, Are there good open source libraries out there to model (AT/FT style) SoC components (memories, buses, simple nocs, dma engines, registers which can be decoded off of APB) ? Upon some searching I came across - 1. scml/scml2 - https://gitlab.larc-nthu.net/rgly/scml/-/tree/6cb6356704245b9c17f816ba957f1a0971d76a67 (does not offer bus components) 2. System C components - https://github.com/Minres/SystemC-Components (offers bus components - but the buses do not seem to have non block transfer interface) 3. VCML - https://github.com/janweinstock/vcml (offers bus components - but the buses do not seem to have non block transfer interface) Any recommendations ? I am particularly interested in bus models (ring architecture, simple noc and bus with protocols like OCP, APB) and registers which are addressed over APB bus. Thanks.
    1 point
  44. sc_spawn creates same kind of processes as sC_METHOD, SC_THREAD, etc, but is not limited to the elaboration phase. Please either read the official documentation for IEEE-1666 (available as pdf free via Accellera) or get a good book on SystemC or take a class.
    1 point
  45. If you use SC_THREAD that means that you are using sc_event under the hood. Because every SC_THREAD in SystemC has event that activates the process. You can for example spawn a SC_THREAD process to do delayed assignment like this: #include <systemc.h> struct spawned_assignment_demo : sc_module { SC_CTOR(spawned_assignment_demo) { SC_THREAD(test_thread); } sc_signal<int, SC_MANY_WRITERS> out{"out", 0}; void print_out_value() { cout << " out value = " << out.read() << " at " << sc_time_stamp() << "\n"; } void test_thread() { print_out_value(); sc_spawn([&]() { wait(10, SC_NS); out = 42; }); wait(5, SC_NS); print_out_value(); sc_spawn([&]() { wait(10, SC_NS); out = 124; }); wait(6, SC_NS); print_out_value(); wait(6, SC_NS); print_out_value(); } }; int sc_main (int argc, char**argv) { spawned_assignment_demo demo{"demo"}; sc_start(); sc_stop(); } Output will be as expected: out value = 0 at 0 s out value = 0 at 5 ns out value = 42 at 11 ns out value = 124 at 17 ns But when you call wait(10,SC_NS) you create timed event notification. You can use debugger to step into wait() to see what happens there.
    1 point
  46. tymonx

    Unit testing with gtest

    You must create all necessary SystemC signals, SystemC modules and make connection between them before you run any test in gtest. This require to create own gtest_main.cc implementation. Naturally in SystemC you must put everything in sc_main() function. For this, I would use registry design pattern. First create registry class (registry + factory + singleton). This class will be responsible for storing registered constructors using dynamic allocation with new and smart pointer in lambda expression (see factory::add class). Create all objects using factory::create() method before running all tests. Then you can get object using factory::get() method in you test execution. factory.hpp #ifndef FACTORY_HPP #define FACTORY_HPP #include <map> #include <string> #include <memory> #include <functional> class factory { public: static factory& get_instance(); template<typename T, typename ...Args> class add { public: add(Args&&... args); add(const std::string& name, Args&&... args); }; template<typename T> static T* get(const std::string& name = ""); void create(); void destroy(); private: using destructor = std::function<void(void*)>; using object = std::unique_ptr<void, destructor>; using constructor = std::function<object(void)>; factory(); factory(const factory& other) = delete; factory& operator=(const factory& other) = delete; void add_object(const std::string& name, constructor create); void* get_object(const std::string& name); std::map<std::string, constructor> m_constructors; std::map<std::string, object> m_objects; }; template<typename T, typename ...Args> factory::add<T, Args...>::add(Args&&... args) { add("", args...); } template<typename T, typename ...Args> factory::add<T, Args...>::add(const std::string& name, Args&&... args) { factory::get_instance().add_object(name, [args...] () -> object { return object{ new T(std::forward<Args>(args)...), [] (void* obj) { delete static_cast<T*>(obj); } }; } ); } template<typename T> auto factory::get(const std::string& name) -> T* { return static_cast<T*>(factory::get_instance().get_object(name)); } #endif /* FACTORY_HPP */ factory.cpp #include "factory.hpp" #include <stdexcept> auto factory::get_instance() -> factory& { static factory instance{}; return instance; } factory::factory() : m_constructors{}, m_objects{} { } void factory::create() { for (const auto& item : m_constructors) { m_objects[item.first] = item.second(); } } void factory::destroy() { m_objects.clear(); } void factory::add_object(const std::string& name, constructor create) { auto it = m_constructors.find(name); if (it == m_constructors.cend()) { m_constructors[name] = create; } else { throw std::runtime_error("factory::add(): " + name + " object already exist in factory"); } } auto factory::get_object(const std::string& name) -> void* { auto it = m_objects.find(name); if (it == m_objects.cend()) { throw std::runtime_error("factory::get(): " + name + " object doesn't exist in factory"); } return it->second.get(); } Create your own version of gtest_main.cc implementation. Call factory::create() method to create all SystemC signals and SystemC modules before running any tests RUN_ALL_TESTS(). Because factory class is a singleton design pattern, call factory::destroy() method after finishing all tests to destroy all created SystemC objects. main.cpp #include "factory.hpp" #include <systemc> #include <gtest/gtest.h> int sc_main(int argc, char* argv[]) { factory::get_instance().create(); testing::InitGoogleTest(&argc, argv); int status = RUN_ALL_TESTS(); factory::get_instance().destroy(); return status; } Then define dut class in your test than will create SystemC signals and SystemC modules. In constructor do connection between created SystemC signals and modules. Register defined dut class to registry object using global constructor like this factory::add<dut> g. After than you can get your dut object using simple factory::get<dut>() method. test.cpp #include "my_module.h" #include "factory.hpp" #include <gtest/gtest.h> #include <systemc> class dut { public: sc_core::sc_clock aclk{"aclk"}; sc_core::sc_signal<bool> areset_n{"areset_n"}; sc_core::sc_signal<bool> in{"in"}; sc_core::sc_signal<bool> out{"out"}; dut() { m_dut.aclk(aclk); m_dut.areset_n(areset_n); m_dut.in(in); m_dut.out(out); } private: my_module m_dut{"my_module"}; }; static factory::add<dut> g; TEST(my_module, simple) { auto test = factory::get<dut>(); test->areset_n = 0; test->in = 0; sc_start(3, SC_NS); test->areset_n = 1; test->in = 1; sc_start(3, SC_NS); EXPECT_TRUE(test->out.read()); } For more inspiration, you can check my logic library for SystemC verification: https://github.com/tymonx/logic
    1 point
  47. Hello @katang, Here is a modified source for Bit_Adder.h which emulates the delay between component/modules: #ifndef BIT_ADDER_H_ #define BIT_ADDER_H_ #include <systemc> #include <queue> template<typename T = bool> SC_MODULE(BIT_ADDER) { public: sc_core::sc_in<T> a, b, cin; sc_core::sc_out<T> sum, cout; SC_CTOR(BIT_ADDER): a("a") , b("b") , ci("cin") , sum("sum") , cout("cout") , delay(sc_core::sc_time(2, sc_core::SC_NS)) , eqSum("eqSum") , eqCarry("eqCarry") { SC_METHOD(do_add); sensitive << a << b << cin; dont_initialize(); SC_METHOD(drive_sum); sensitive << eqSum; dont_initialize(); SC_METHOD(drive_carry); sensitive << eqCarry; dont_initialize(); } void do_add(void) { T valA = a.read(); T valB = b.read(); T valCi = cin.read(); T tmpCo = (valA & valB) | (valB & valCi) | (valA & valCi); T tmpSum = valA ^ valB ^ valCi; coq.push(tmpCo); sumq.push(tmpSum); eqSum.notify(delay); eqCarry.notify(delay); } void drive_sum(void) { T valSum = sumq.front(); sum.write(valSum); sumq.pop(); } void drive_carry(void) { T valCarry = coq.front(); cout.write(valCarry); coq.pop(); } private: sc_core::sc_time delay; sc_core::sc_event_queue eqSum; sc_core::sc_event_queue eqCarry; std::queue<T> sumq; std::queue<T> coq; }; // BIT_ADDER #endif // BIT_ADDER_H_ This should be drop-in replacement for your module. One thing you will have to change is the declaration where it would change something from: BIT_ADDER bitAdder to: BIT_ADDER<sc_logic> bitAdder Let us know if you need further clarification on how the module behavior is modeled. Regards, Ameya Vikram Singh
    1 point
  48. I could finally make it using TLM docmentation (the IEEE 1666 standard might be useful). I had to implement a TLM transaction extension to fit the particular needs of some transactions between the pipeline and the file register. Useful examples for TLM transaction extensions are provided in a document from the university of Munich. Finally, the Doulos examples are also interesting (but less interesting than the last one). Hope this helped! J-B
    1 point
  49. Rahul, after fixing the missing '$' at the beginning of your vcd dump, I got the following error on GTKwave: GTKWave Analyzer v3.3.49 (w)1999-2013 BSI Near byte 206, $VAR parse error encountered with 'SystemC.Enable' Near byte 252, $VAR parse error encountered with 'SystemC.output' No symbols in VCD file..nothing to do! As you can see, there is an error in your VCD file (at least according to GTKwave): You use spaces in your signal names. Replace those with '_' or something similar, and your VCD viewer should be happy. hth, Philipp
    1 point
  50. Hi Amit, I didn't say "Concept of multiple interfaces in sc_export is a benefit of sc_export over sc_port". I said "You have to parameterize the export by the interface. So if you have two interfaces, and you want them to be exported by a single export, you'd have to create a derived class." You can do that with sc_port as well (i.e. use a single derived class interface that is derived from another set of interface classes) - see the code for sc_inout, for instance, regards Alan
    1 point
×
×
  • Create New...