RegisterLogin  
Update Profile
   
You are here: Forum  
Minimize 
SVUG Community Forum
Subject: SystemVerilog NewBie --- Need help with constructor
Prev Next
You are not authorized to post a reply.

Author Messages
EricUser is Offline

Posts:4

10/17/2008 2:27 PM  
I built my first object, and it compiles fine through questa from mentor graphics.

When I am trying to initialize the handle, the compiler does not like the "new" statement.

I am puzzled, I have tried all combinations...

Here is the snippet of code:

*************************************************
`include "CLOCK_GEN_C.sv"

module CLK_GENERATOR(output bit SYS_CLK_O);

   // Object
   CLOCK_GEN_C SYS_CLK;

   SYS_CLK = new(); // Compilation error on this line.

   ...
*************************************************

The compilation error:
QuestaSim vlog 6.4a Compiler 2008.08 Aug 28 2008
** Error: CLK_GENERATOR.sv(32): near "=": syntax error, unexpected '='

I need help!

Thank you,

Eric

VerifconsultUser is Offline

Posts:8

10/18/2008 12:07 PM  
You have put the procedural statement in a declarative region. Put SYS_CLK = new(); inside a initial block and not in a declarative region. It should work.
EricUser is Offline

Posts:4

10/22/2008 1:28 PM  
Thank you for your help!

Eric
You are not authorized to post a reply.
Forums > General Discussion > Main Discussion Area > SystemVerilog NewBie --- Need help with constructor



ActiveForums 3.7
  

 Copyright 2008 by SystemVerilog User Group Contact Us    Privacy Statement