From c78869d4678eea4332fda6fa9fe3d17e4f8ea9b2 Mon Sep 17 00:00:00 2001 From: Sachin Gupta Date: Mon, 14 Nov 2016 00:24:45 -0600 Subject: Add sleep only for simics for FIFO operations Change-Id: I193bb015bf269da512921278db8b9ea03efc0e50 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32569 Tested-by: Jenkins Server Reviewed-by: Shakeeb A. Pasha B K Reviewed-by: RAJA DAS Tested-by: FSP CI Jenkins Reviewed-by: AMIT J. TENDOLKAR --- src/sbefw/sbeFifoMsgUtils.C | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'src/sbefw') diff --git a/src/sbefw/sbeFifoMsgUtils.C b/src/sbefw/sbeFifoMsgUtils.C index 26515077..26085022 100644 --- a/src/sbefw/sbeFifoMsgUtils.C +++ b/src/sbefw/sbeFifoMsgUtils.C @@ -162,7 +162,13 @@ uint32_t sbeUpFifoDeq_mult (uint32_t &io_len, // We can reach here because FIFO was empty. We can not trust // empty flag because empty flag tells the status of FIFO after // operation not at the time of operation - pk_sleep(PK_MILLISECONDS(FIFO_WAIT_SLEEP_TIME)); + if( SBE::isSimicsRunning() ) + { + // sleep if simics is running. Otherwise simics becomes + // 99 % busy and fsp does not get a chance to do operation + // over FIFO. + pk_sleep(PK_MILLISECONDS(FIFO_WAIT_SLEEP_TIME)); + } continue; } @@ -221,7 +227,13 @@ uint32_t sbeDownFifoEnq_mult (uint32_t &io_len, if (l_status.downfifo_status.fifo_full) { // Downstream FIFO is full - pk_sleep(PK_MILLISECONDS(FIFO_WAIT_SLEEP_TIME)); + if( SBE::isSimicsRunning() ) + { + // sleep if simics is running. Otherwise simics becomes + // 99 % busy and fsp does not get a chance to do operation + // over FIFO. + pk_sleep(PK_MILLISECONDS(FIFO_WAIT_SLEEP_TIME)); + } continue; } @@ -282,7 +294,13 @@ uint32_t sbeDownFifoSignalEot (void) // Check if downstream FIFO is full if (l_status.downfifo_status.fifo_full) { - pk_sleep(PK_MILLISECONDS(FIFO_WAIT_SLEEP_TIME)); + if( SBE::isSimicsRunning() ) + { + // sleep if simics is running. Otherwise simics becomes + // 99 % busy and fsp does not get a chance to do operation + // over FIFO. + pk_sleep(PK_MILLISECONDS(FIFO_WAIT_SLEEP_TIME)); + } continue; } l_rc = putscom_abs(SBE_DOWNSTREAM_FIFO_SIGNAL_EOT, DOWNSTREAM_EOT_DATA); -- cgit v1.2.1