RE: [sv-ec] compilation unit - class static variables

From: Rich, Dave <Dave_Rich_at_.....>
Date: Tue Jul 15 2008 - 07:17:16 PDT
This is exactly why we have packages.

 

pkgC.sv

package C_pkg;

`include "c.svh"

endpackage

 

Then change your `include's to import C_pkg::*;

 

Dave

 

 

________________________________

From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On
Behalf Of Daniel Mlynek
Sent: Tuesday, July 15, 2008 7:04 AM
To: 'SV-EC'
Cc: 'Piotr Winter'; 'Mirek Forczek'
Subject: [sv-ec] compilation unit - class static variables

 

Consider the code:

<c.svh)

class C;

    static int i;

endclass

 

<top.v>

`include "c.svh"

module top;

    initial C::i=123;

endmodule

 

<top1.v>

`include "c.svh"

module top1;

    initial #0 $display(C::i);

endmodule

 

Both file are compiled in separate compilation - so class C is compiled
twice into two separate compilation units. As far as i undertand the
description - we get two separate class C definition with two separate
sets of statics?

 

This way user cannot divide his design to part to compile them
separetely  (ie if he has stucks on some lack of memory problems in
sinngle compilation) because C::i in first compilation and C::i in 2nd
are totally different. There is no way to workaround the problem... Why
IEEE have decided to describe it this way???

 

Am I right?

 

 

 

DANiel


-- 
This message has been scanned for viruses and 
dangerous content by MailScanner <http://www.mailscanner.info/> , and is

believed to be clean. 

-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Tue Jul 15 07:18:53 2008

This archive was generated by hypermail 2.1.8 : Tue Jul 15 2008 - 07:19:09 PDT