sc_time.cc (13195:de9e5572ac44) | sc_time.cc (13247:4aafce81e7dd) |
---|---|
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 --- 480 unchanged lines hidden (view full) --- 489 if (timeFixed) { 490 SC_REPORT_ERROR("(E515) set default time unit failed", 491 "sc_time object(s) constructed"); 492 } 493 494 // Normalize d to seconds. 495 defaultUnit = d * TimeUnitScale[tu]; 496 specified = true; | 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 --- 480 unchanged lines hidden (view full) --- 489 if (timeFixed) { 490 SC_REPORT_ERROR("(E515) set default time unit failed", 491 "sc_time object(s) constructed"); 492 } 493 494 // Normalize d to seconds. 495 defaultUnit = d * TimeUnitScale[tu]; 496 specified = true; |
497 498 double resolution = SimClock::Float::Hz; 499 if (resolution == 0.0) 500 resolution = TimeUnitScale[SC_PS]; 501 if (defaultUnit < resolution) { 502 SC_REPORT_ERROR("(E515) set default time unit failed", 503 "value smaller than time resolution"); 504 } |
|
497} 498 499sc_time 500sc_get_default_time_unit() 501{ 502 return sc_time(defaultUnit, SC_SEC); 503} 504 --- 41 unchanged lines hidden --- | 505} 506 507sc_time 508sc_get_default_time_unit() 509{ 510 return sc_time(defaultUnit, SC_SEC); 511} 512 --- 41 unchanged lines hidden --- |