modelsim SE 10.0C SystemC bug about initializing sc_signal

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 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[i][k] = posLeftUp; else if (k == NODES_IN_COL - 1) chProcPos[i][k] = posRightUp; else chProcPos[i][k] = posUp; else if (i == NODES_IN_ROW - 1) if (k == 0) chProcPos[i][k] = posLeftDown; else if (k == NODES_IN_COL - 1) chProcPos[i][k] = posRightDown; else chProcPos[i][k] = posDown; else if (k == 0) chProcPos[i][k] = posLeft; else if (k == NODES_IN_COL - 1) chProcPos[i][k] = posRight; else chProcPos[i][k] = posInner; } /*...*/ }

--------------------------------------- Posted through

formatting link

Reply to
homeless
Loading thread data ...

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

formatting link

Reply to
HT-Lab

Yes, I am using the same compiler (gcc 4.2.1) for both versions. I don't have Modelsim SE 10.1c so I cannot try that. As for the other issue, I believe gcc 4.5.0 is for 64 bit Modelsim SE 10.1c. It says in the installation manual file that we should use gcc 4.2.1 for 10.1c 32 bit 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.

--------------------------------------- Posted through

formatting link

Reply to
homeless

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.