modelsim SE 10.0C SystemC bug about initializing sc_signal

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
 
I assume you are using the same compiler version as that sometimes can
also cause issues. If you are not using gcc 4.3.3/4.2.1 (recommended
versions for Linux/win32) then I would try that first.

If it still fails then try the latest Modelsim SE 10.1c release (gcc
4.5.0/4.2.1) and if that also fails then package up a small testcase
with your code and raise a Service Request.

You could also try the 2.2 reference simulator just to add some weight
to your SR.

Good luck,
Hans
www.ht-lab.com


On 09/10/2012 14:10, homeless wrote:
I am very disappointed that I get different results from the same
initializing code in SC_CTOR from 6.6 and 10.0 versions of ModelsimSE. In
ModelsimSE6.6 I can initialize the sc_signal vector (array) as it has to be
but in ModelsimSE10.0c all the chProcPos elements are "posLeft" which is
zero, since the compiler starts with zero to my "position" enumaration
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
 
Yes, I am using the same compiler (gcc 4.2.1) for both versions. I don'
have Modelsim SE 10.1c so I cannot try that. As for the other issue,
believe gcc 4.5.0 is for 64 bit Modelsim SE 10.1c. It says in th
installation manual file that we should use gcc 4.2.1 for 10.1c 32 bi
version.
I guess I will continue with Modelsim SE 6.6 release.

PS: Modelsim SE 6.6c does not work (initalize the sc_signal vector
either.

Thank you for your reply, Hans.


I assume you are using the same compiler version as that sometimes can
also cause issues. If you are not using gcc 4.3.3/4.2.1 (recommended
versions for Linux/win32) then I would try that first.

If it still fails then try the latest Modelsim SE 10.1c release (gcc
4.5.0/4.2.1) and if that also fails then package up a small testcase
with your code and raise a Service Request.

You could also try the 2.2 reference simulator just to add some weight
to your SR.

Good luck,
Hans
www.ht-lab.com
---------------------------------------
Posted through http://www.FPGARelated.com
 

Welcome to EDABoard.com

Sponsor

Back
Top