sc_time.cc (13151:5ce517287782) | sc_time.cc (13177:7b750aeab360) |
---|---|
1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * 27 * Authors: Gabe Black 28 */ 29 | 1/* 2 * Copyright 2018 Google, Inc. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions are 6 * met: redistributions of source code must retain the above copyright 7 * notice, this list of conditions and the following disclaimer; 8 * redistributions in binary form must reproduce the above copyright --- 13 unchanged lines hidden (view full) --- 22 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 * 27 * Authors: Gabe Black 28 */ 29 |
30#include <sstream> |
|
30#include <vector> 31 32#include "base/logging.hh" 33#include "base/types.hh" 34#include "python/pybind11/pybind.hh" 35#include "systemc/core/python.hh" 36#include "systemc/ext/core/sc_main.hh" 37#include "systemc/ext/core/sc_time.hh" --- 168 unchanged lines hidden (view full) --- 206 //XXX Assuming the time resolution is 1ps. 207 double scale = TimeUnitScale[SC_PS] / TimeUnitScale[SC_SEC]; 208 return d * scale; 209} 210 211const std::string 212sc_time::to_string() const 213{ | 31#include <vector> 32 33#include "base/logging.hh" 34#include "base/types.hh" 35#include "python/pybind11/pybind.hh" 36#include "systemc/core/python.hh" 37#include "systemc/ext/core/sc_main.hh" 38#include "systemc/ext/core/sc_time.hh" --- 168 unchanged lines hidden (view full) --- 207 //XXX Assuming the time resolution is 1ps. 208 double scale = TimeUnitScale[SC_PS] / TimeUnitScale[SC_SEC]; 209 return d * scale; 210} 211 212const std::string 213sc_time::to_string() const 214{ |
214 warn("%s not implemented.\n", __PRETTY_FUNCTION__); 215 return ""; | 215 std::ostringstream ss; 216 print(ss); 217 return ss.str(); |
216} 217 218bool 219sc_time::operator == (const sc_time &t) const 220{ 221 return val == t.val; 222} 223 --- 282 unchanged lines hidden --- | 218} 219 220bool 221sc_time::operator == (const sc_time &t) const 222{ 223 return val == t.val; 224} 225 --- 282 unchanged lines hidden --- |