Jump to content


Floating-point design problem


  • You cannot reply to this topic
2 replies to this topic

#1 mmw119

    Member

  • Members
  • PipPip
  • 7 posts

Posted 19 February 2009 - 09:21 PM

Hi,

This is a piece of code in my Impulse C project :

CODE
co_uint8 imgPix[IMG_WIDTH * IMG_HEIGHT + 2];
double pca   =  0.0;
double BaseMatrix[IMG_WIDTH * IMG_HEIGHT][PCA_NUM] = {...};
for (n=0; n<IMG_WIDTH * IMG_HEIGHT; n++)
{        
//#pragma CO PIPELINE        
    pca  += imgPix[n] * BaseMatrix[n][m];
}

During my hardware simulation(the simulation tool is ModelSim 6.1),I found that if "#pragma CO PIPELINE" is not used , the value of "pca" is totally correct, but if "#pragma CO PIPELINE" is used, the value of "pca" is just wrong!
I doubt that if it is because the different type of "imgPix" and "BaseMatrix", since "imgPix" is co_uint8 type and "BaseMatrix" is double type.
Thank you!
mmw119

#2 RalphBodenner

    Advanced Member

  • Admin
  • PipPipPip
  • 348 posts

Posted 21 February 2009 - 12:56 AM

Thanks for reporting this problem. We need a bit more information in order to be able to recommend a fix. When are you measuring the value of pca? After the loop has exited? Which version of CoDeveloper are you using?

If possible, please send your source and project (.icProj and ModelSim) files to support@impulsec.com so we can diagnose the problem more easily. If you need to remove proprietary code, please do, but include enough that we can reproduce the issue.

Regards,
Ralph
Ralph Bodenner
Impulse Accelerated Technologies, Inc.

#3 mmw119

    Member

  • Members
  • PipPip
  • 7 posts

Posted 21 February 2009 - 07:11 PM

QUOTE (RalphBodenner @ Feb 21 2009, 12:56 AM) <{POST_SNAPBACK}>
Thanks for reporting this problem. We need a bit more information in order to be able to recommend a fix. When are you measuring the value of pca? After the loop has exited? Which version of CoDeveloper are you using?

If possible, please send your source and project (.icProj and ModelSim) files to support@impulsec.com so we can diagnose the problem more easily. If you need to remove proprietary code, please do, but include enough that we can reproduce the issue.

Regards,
Ralph

I have send the project files to support@impulsec.com,PLZ have a check. Thanks for you help!

Best Regards,

mmw119





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users