Jump to content


Floating-point design problem


  • This topic is locked This topic is locked
No replies to this topic

#1 mmw119

    Member

  • Members
  • PipPip
  • 7 posts

Posted 20 February 2009 - 11:28 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.
Did anyone meet this problem? PLZ help me!
Thank you!
mmw119





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users