Jump to content

Seeking Feedback on Datatypes


Lynn Garibaldi

Recommended Posts

The SystemC Synthesis Working Group is very active and is currently addressing several issues, including:

  1. Defining more clearly what elaboration behavior is supported for synthesis. More specifically, the dynamic module instantiation, binding, and naming, (e.g., using loops during elaboration).
  2. Considering what array/vector container to support.
  3. Looking at the use of C++ 11 attributes for synthesis directives.
  4. Analyzing the inclusion of AC datatypes as a numerical library.

Our goal over the next 12 months is to see some convergence on a second version of the SystemC Synthesis standard with the issues resolved and based on more updated versions of the C++ standard such as C++ 11, 14, and possibly 17. At SystemC Evolution Day last October there were some datatype proposals presented (download using links below), and we’d like to get more feedback from the community on them. Suggestions and input are welcome in this forum. We look forward to hearing from you.

SystemC Datatypes Proposal

Algorithmic Datatypes Proposal

Link to comment
Share on other sites

  • 2 weeks later...

Some thoughts on these topics:

On 9/11/2018 at 12:19 PM, Lynn Garibaldi said:

1. Defining more clearly what elaboration behavior is supported for synthesis. More specifically, the dynamic module instantiation, binding, and naming, (e.g., using loops during elaboration).

During elaboration any C++ should be supported, including standard library. Language/library restrictions should only be imposed on process bodies (SC_THREADs and SC_METHODs). Otherwise SystemC synthesis would not be competitive vs languages focused on structure generation. Some design teams are already switching from SystemC to Chisel due to limitations in SystemC tools.

Quote

2. Considering what array/vector container to support.

std::array can be supported, but adds little value compared to C-style arrays.

sc_vector should be supported. But unfortunately it only supports sc_object types. So I can't for example create sc_vector<sc_int<32>> to model RAM with elaboration-time defined size.

std::vector allows expansion during simulation, that won't be synthesizable.

I think it would be a good idea to extend sc_vector with non-sc_object types support. Also more flexible API can be added, like emplace_back(...) for elaboration-time programming.

Quote

3. Looking at the use of C++ 11 attributes for synthesis directives.

Attributes can't be used with template-based compile-time programming and elaboration-time programming. Macros will be the only way to program with attributes. That is bad.

Instead, why not to to standardize a set of functions to pass synthesis directives?

Quote

4. Analyzing the inclusion of AC datatypes as a numerical library.

As usual, there is a compromise between simulation performance and flexibility of usage. I looked through proposals, and I think it would be nice to have both AC datatypes and improvement to existing bigint SystemC datatypes.

From flexibility perspective, sc_unsigned and sc_signed are ideal, because they can be used both with template-based meta-programming and  elaboration-time programming. So we have the same structural programming flexibility as in Chisel or MyHDL.

AC datatypes are less flexible, but more efficient. 

Link to comment
Share on other sites

  • 1 month later...

Hi,

I was previously involved with the Synthesis working group and supported efforts to facilitate a version of the SystemC data types that could be used for both simulation and synthesis.

I found the AC datatypes to be very useful for both and in my last project where I worked on HLS synthesis, we decided to continue to use the AC datatypes for simulation even though we decided to drop synthesis efforts.  The current SystemC types are difficult to use for simulation because of the lack of compile time sizing information and the very slow simulation times. The templated types allowed higher level templated functions to be written with predetermined and known sizes which were very important for system simulations. When complex arithmetic is needed these types become even more useful and also allow a framework where higher level simulation code can easily switch between floating point types and fixed point that is not possible with the current SystemC types.

Link to comment
Share on other sites

On 9/19/2018 at 3:23 PM, Roman Popov said:

std::array can be supported, but adds little value compared to C-style arrays.

Actually, it adds a lot of value. std::array can be passed by reference in a function call and the function can then determine the proper size of the array. This is much better than passing pointers, the C standard.

You can also copy an array, which should be synthesizable, which reduces coding and greatly improves readability.

It should be possible to implement some #include <algorithm>s on std::array too.

Also, you can have bounds checking for additional safety; although, that aspect is probably not synthesizable.

Additionally, constexpr should be quite helpful for the synthesis aspect.

Link to comment
Share on other sites

17 hours ago, Tony Kirke said:

Hi,

I was previously involved with the Synthesis working group and supported efforts to facilitate a version of the SystemC data types that could be used for both simulation and synthesis.

I found the AC datatypes to be very useful for both and in my last project where I worked on HLS synthesis, we decided to continue to use the AC datatypes for simulation even though we decided to drop synthesis efforts.  The current SystemC types are difficult to use for simulation because of the lack of compile time sizing information and the very slow simulation times. The templated types allowed higher level templated functions to be written with predetermined and known sizes which were very important for system simulations. When complex arithmetic is needed these types become even more useful and also allow a framework where higher level simulation code can easily switch between floating point types and fixed point that is not possible with the current SystemC types.

Same experience on our side. We are using AC types for CNN inference engine modeling.

The problem with sc_dt:: types is not only performance, but semantics also. For example sc_int and sc_uint types are limited to 64 bits in width. Probably it makes sense for software modeling, but for HLS this is not useful at all. And then you got this weird things happening with wrap-around on 64 bits:

sc_int<64> a, b;
sc_bigint<128> m;
m = a * b; // result is computed with 64 bits wraparound and then casted to 128 bits

 

16 hours ago, David Black said:

How are the AC types licensed?

Are there any copyrights or patents to be concerned with?

It's Apache license, https://github.com/hlslibs/ac_types/blob/master/LICENSE. The same as SystemC.  And it was proposed for synthesis on SystemC evolution day in 2017 http://www.accellera.org/images/activities/working-groups/S3._Datatypes.1.pdf .  So probably the only required thing is tool support from vendors other then Mentor.

Link to comment
Share on other sites

Quote

4. Analyzing the inclusion of AC datatypes as a numerical library.

Some feedback on AC datatypes:

We have found AC datatypes to be an invaluable tool for large DSP ASIC designs. My experience is mostly on the simulation front where speed, bit- (but not necessarily cycle-) accuracy, and seamless integration with standard C++ code is important. AC datatypes provide all the relevant digital system design features (clipping/rounding/bit-slicing), as well as support for complex data types, with very little overhead. The ability to customize/expand AC datatype functionality via private headers (for simulation only) is another great benefit that minimizes the need for instrumentation code around HLS code during system simulations.

Link to comment
Share on other sites

  • 2 years later...

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...