diff options
author | Gabe Black <gabeblack@google.com> | 2018-08-22 22:45:29 -0700 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2018-09-26 00:00:11 +0000 |
commit | dd8b71b413fb511477358b65c7668e6e2574257e (patch) | |
tree | ec6cdbe1568686acd47700dfba63f87a248e3b5c /src/systemc/ext/core/sc_module.hh | |
parent | 92d1d2c87366c8e9246ad150ff7a71513da4d773 (diff) | |
download | gem5-dd8b71b413fb511477358b65c7668e6e2574257e.tar.xz |
systemc: Make sc_process_b less hokey, and make WAIT* work.
This change puts sc_process_b into the inheritance hierarchy for the
Process types. It also adds the nonstandard sc_set_location function
and calls it from the nonstandard WAIT* macros.
Change-Id: Ic997dcf74d262774dd7b53504146e372e03af2e0
Reviewed-on: https://gem5-review.googlesource.com/12259
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Diffstat (limited to 'src/systemc/ext/core/sc_module.hh')
-rw-r--r-- | src/systemc/ext/core/sc_module.hh | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/systemc/ext/core/sc_module.hh b/src/systemc/ext/core/sc_module.hh index 7088c4e60..8de57b575 100644 --- a/src/systemc/ext/core/sc_module.hh +++ b/src/systemc/ext/core/sc_module.hh @@ -33,6 +33,7 @@ #include <vector> #include "sc_object.hh" +#include "sc_process_handle.hh" #include "sc_sensitive.hh" #include "sc_time.hh" @@ -337,17 +338,20 @@ sc_module *sc_module_sc_new(sc_module *); #define SC_NEW(x) ::sc_core::sc_module_sc_new(new x); // Nonstandard -// In the Accellera implementation, this macro calls sc_set_location to record -// the current file and line, calls wait, and then calls it again to clear the -// file and line. We'll ignore the sc_set_location calls for now. -#define SC_WAIT() ::sc_core::wait(); +#define SC_WAIT() \ + ::sc_core::sc_set_location(__FILE__, __LINE__); \ + ::sc_core::wait(); \ + ::sc_core::sc_set_location(NULL, 0) // Nonstandard -// Same as above, but passes through an argument. -#define SC_WAITN(n) ::sc_core::wait(n); +#define SC_WAITN(n) \ + ::sc_core::sc_set_location(__FILE__, __LINE__); \ + ::sc_core::wait(n); \ + ::sc_core::sc_set_location(NULL, 0) // Nonstandard -#define SC_WAIT_UNTIL(expr) do { SC_WAIT(); } while (!(expr)) +#define SC_WAIT_UNTIL(expr) \ + do { SC_WAIT(); } while (!(expr)) } // namespace sc_core |