/***************************************************************************** Licensed to Accellera Systems Initiative Inc. (Accellera) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Accellera licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. *****************************************************************************/ /***************************************************************************** event_triggered.cpp -- test sc_event::triggered Original Author: Philipp A. Hartmann, Intel Corporation - 2017-08-06 *****************************************************************************/ /***************************************************************************** MODIFICATION LOG - modifiers, enter your name, affiliation, date and changes you are making here. Name, Affiliation, Date: Description of Modification: *****************************************************************************/ #define SC_INCLUDE_DYNAMIC_PROCESSES #include #include #ifdef BENCHMARK static const sc_dt::uint64 num_events = 128; static const sc_dt::uint64 num_triggers = 4; static const sc_dt::uint64 num_iterations = 10000000; # define CHECK(expr) ((void)0) #else static const sc_dt::uint64 num_events = 16; static const sc_dt::uint64 num_triggers = 4; static const sc_dt::uint64 num_iterations = 4; # define CHECK(expr) sc_assert(expr) #endif #ifndef UINT64_C #if defined(_WIN32) && !defined(__MINGW32__) # define UINT64_C(v) v ## ui64 #else # define UINT64_C(v) v ## ULL #endif #endif // UINT64_C using namespace sc_core; SC_MODULE( module ) { sc_vector events; sc_event event_return; SC_CTOR( module ) : events("ev", num_events) , m_rng_state() { SC_THREAD(driver); SC_THREAD(consumer_dynamic); SC_THREAD(consumer_static); // odd events only for(unsigned i = 1; i> 48 ); } sc_dt::uint64 m_rng_state; }; int sc_main( int, char*[] ) { module m("m"); sc_start(); sc_stop(); return 0; }