systemc: Implement the sc_time_tuple class.

This class is non-standard and is an implementation detail in
Accellera's implementation, but is referred to directly by the tests.
It does the same thing as the time printing function, so rather than
having duplicate code the printing function now uses the sc_time_tuple
class even though it was doing fine on its own already.

Change-Id: I69594ed0651f212ded6d979d60523bb3b0a789b1
Reviewed-on: https://gem5-review.googlesource.com/c/13189
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
This commit is contained in:
Gabe Black
2018-09-26 22:53:01 -07:00
parent 1fe271c71a
commit 07cad60bb0
2 changed files with 42 additions and 56 deletions

View File

@@ -113,7 +113,7 @@ sc_time sc_get_default_time_unit();
class sc_time_tuple
{
public:
sc_time_tuple() : _value(), _unit(SC_SEC), _offset(1) {}
sc_time_tuple() : _value(), _unit(SC_SEC), _set(false) {}
sc_time_tuple(const sc_time &);
bool has_value() const;
@@ -131,7 +131,7 @@ class sc_time_tuple
private:
sc_dt::uint64 _value;
sc_time_unit _unit;
unsigned _offset;
bool _set;
};
} // namespace sc_core