H
homeless
Guest
I am very disappointed that I get different results from the sam
initializing code in SC_CTOR from 6.6 and 10.0 versions of ModelsimSE. I
ModelsimSE6.6 I can initialize the sc_signal vector (array) as it has to b
but in ModelsimSE10.0c all the chProcPos elements are "posLeft" which i
zero, since the compiler starts with zero to my "position" enumaratio
type. I believe this is a bug in ModelsimSE10.0c.
PS: I also tried initializing with .write() member function.
I have a code like this:
typedef enum position_tag {posLeft, posRight, posUp, posDown, posLeftUp
posRightUp, posLeftDown, posRightDown, posInner} position;
/*****/
sc_signal<position> chProcPos[NODES_IN_ROW][NODES_IN_COL];
SC_CTOR(..)
{
/*...*/
for (int i = 0; i < NODES_IN_ROW; i++)
for (int k = 0; k < NODES_IN_COL; k++) {
if (i == 0)
if (k == 0)
chProcPos[k] = posLeftUp;
else if (k == NODES_IN_COL - 1)
chProcPos[k] = posRightUp;
else
chProcPos[k] = posUp;
else if (i == NODES_IN_ROW - 1)
if (k == 0)
chProcPos[k] = posLeftDown;
else if (k == NODES_IN_COL - 1)
chProcPos[k] = posRightDown;
else
chProcPos[k] = posDown;
else
if (k == 0)
chProcPos[k] = posLeft;
else if (k == NODES_IN_COL - 1)
chProcPos[k] = posRight;
else
chProcPos[k] = posInner;
}
/*...*/
}
---------------------------------------
Posted through http://www.FPGARelated.com
initializing code in SC_CTOR from 6.6 and 10.0 versions of ModelsimSE. I
ModelsimSE6.6 I can initialize the sc_signal vector (array) as it has to b
but in ModelsimSE10.0c all the chProcPos elements are "posLeft" which i
zero, since the compiler starts with zero to my "position" enumaratio
type. I believe this is a bug in ModelsimSE10.0c.
PS: I also tried initializing with .write() member function.
I have a code like this:
typedef enum position_tag {posLeft, posRight, posUp, posDown, posLeftUp
posRightUp, posLeftDown, posRightDown, posInner} position;
/*****/
sc_signal<position> chProcPos[NODES_IN_ROW][NODES_IN_COL];
SC_CTOR(..)
{
/*...*/
for (int i = 0; i < NODES_IN_ROW; i++)
for (int k = 0; k < NODES_IN_COL; k++) {
if (i == 0)
if (k == 0)
chProcPos[k] = posLeftUp;
else if (k == NODES_IN_COL - 1)
chProcPos[k] = posRightUp;
else
chProcPos[k] = posUp;
else if (i == NODES_IN_ROW - 1)
if (k == 0)
chProcPos[k] = posLeftDown;
else if (k == NODES_IN_COL - 1)
chProcPos[k] = posRightDown;
else
chProcPos[k] = posDown;
else
if (k == 0)
chProcPos[k] = posLeft;
else if (k == NODES_IN_COL - 1)
chProcPos[k] = posRight;
else
chProcPos[k] = posInner;
}
/*...*/
}
---------------------------------------
Posted through http://www.FPGARelated.com