Bug Report
I found the following bugs.
1. variables/objects declared below their reference point is not properly recognized in a class.
Example)
class my_class; //int a; // O.K function new(); a = 3; //this.a = 3; //O.K endfunction int a; // Compile Errorendclass
The code above is complied normally if 'this' is not omitted.
2. Similarly, if the signal is declared outside the class inside a module, then, its declaration point must be above the class.
Example)
module tb; //int a; // O.K class my_class; function new(); a = 3; endfunction endclass int a; // Compile Errorendmodule
3. In the same way, the signal must be declared above the class inside package.
Example)
package my_pkg; //int a; // O.K class my_class; function new(); a = 3; endfunction endclass int a; // Compile Errorendpackage
Each complete test bench file is attached.
I hope these issues are resolved in the future release of DSim.
Best Answer
-
The LRM states (section 6.21):
A variable declaration shall precede any simple reference (non-hierarchical) to that variable.
It is possible that another vendor accepts your code; however, I cannot find any statement in the LRM that specifically allows this.
0
Answers
-
The LRM states (section 6.21):
A variable declaration shall precede any simple reference (non-hierarchical) to that variable.
It is possible that another vendor accepts your code; however, I cannot find any statement in the LRM that specifically allows this.
0 -
Hi David,
It looks you are right. Thanks.
0