diff options
author | Sachin Gupta <sgupta2m@in.ibm.com> | 2016-10-19 16:33:08 -0500 |
---|---|---|
committer | AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com> | 2016-10-26 03:34:06 -0400 |
commit | 4b2c048529a64a79cbce403e070c5a7c138ba117 (patch) | |
tree | ff8a61422049aabc9e60d50fcc908e48992e11d8 /src/hwpf/src | |
parent | edefd286237fbc62a50095585a3b4c60134cc599 (diff) | |
download | talos-sbe-4b2c048529a64a79cbce403e070c5a7c138ba117.tar.gz talos-sbe-4b2c048529a64a79cbce403e070c5a7c138ba117.zip |
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 <pfd-jenkins+hostboot@us.ibm.com>
Reviewed-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Reviewed-by: RAJA DAS <rajadas2@in.ibm.com>
Tested-by: AMIT J. TENDOLKAR <amit.tendolkar@in.ibm.com>
Diffstat (limited to 'src/hwpf/src')
-rw-r--r-- | src/hwpf/src/plat/plat_utils.C | 18 |
1 files changed, 17 insertions, 1 deletions
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 <return_code.H> #include <plat_trace.H> #include <target.H> +#include <sbeutil.H> 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(); |