From 4b2c048529a64a79cbce403e070c5a7c138ba117 Mon Sep 17 00:00:00 2001 From: Sachin Gupta Date: Wed, 19 Oct 2016 16:33:08 -0500 Subject: Temporary Fix for timer Also include fix for changing the behavior on simics CMVC-Prereq: 1009109 Change-Id: Ib191e2c30ac508d2506ea1ed48dd76cc59da62f2 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/31519 Tested-by: Jenkins Server Reviewed-by: AMIT J. TENDOLKAR Reviewed-by: RAJA DAS Tested-by: AMIT J. TENDOLKAR --- src/hwpf/src/plat/plat_utils.C | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/hwpf/src') diff --git a/src/hwpf/src/plat/plat_utils.C b/src/hwpf/src/plat/plat_utils.C index 94adc7d6..4b5a60ea 100644 --- a/src/hwpf/src/plat/plat_utils.C +++ b/src/hwpf/src/plat/plat_utils.C @@ -34,6 +34,7 @@ #include #include #include +#include namespace fapi2 { @@ -72,7 +73,22 @@ namespace fapi2 // The "accurate" version is the next line. // target_time = pk_timebase_get() + PK_INTERVAL_SCALE(PK_NANOSECONDS(i_nanoSeconds)); - target_time = pk_timebase_get() + PK_INTERVAL_SCALE(PK_NANOSECONDS_SBE(i_nanoSeconds)); + uint64_t cycles = 0; + if( SBE::isSimicsRunning() ) + { + cycles = PK_INTERVAL_SCALE( + PK_NANOSECONDS_SBE(i_nanoSeconds)); + } + else + { + // TODO via RTC 163216 + // Fix for the timer ( using in cycle mode ) + // Check what should be the right approach for time calculatin. + cycles = PK_INTERVAL_SCALE( + PK_NANOSECONDS_SBE(i_nanoSeconds)) * 64; + } + target_time = pk_timebase_get() + cycles; + do { current_time = pk_timebase_get(); -- cgit v1.2.1