Bug Report

Posted 5 months ago by Orimitsu Serizawa

Post a topic
Answered
Orimitsu Serizawa
Orimitsu Serizawa

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 Error

endclass

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 Error

endmodule

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 Error

endpackage

Each complete test bench file is attached.


I hope these issues are resolved in the future release of DSim.

0 Votes

D

David Jones posted 5 months ago Admin 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.

1 Votes


2 Comments

Sorted by
Orimitsu Serizawa

Orimitsu Serizawa posted 5 months ago

Hi David,


It looks you are right. Thanks.


0 Votes

D

David Jones posted 5 months ago Admin 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.

1 Votes

Login to post a comment