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> |
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{ |
215 std::ostringstream ss; 216 print(ss); 217 return ss.str(); |
218} 219 220bool 221sc_time::operator == (const sc_time &t) const 222{ 223 return val == t.val; 224} 225 --- 282 unchanged lines hidden --- |