• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Mixed-Signal Design
  3. need help with SV resolution function

Stats

  • Locked Locked
  • Replies 0
  • Subscribers 64
  • Views 13019
  • Members are here 0
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

need help with SV resolution function

golanp
golanp over 10 years ago

Hi

new here ...
I need help with resolution function.
Only tried to implement the example given in the IEEE SV 2012 spec section 6.6.7

I wrote the following small code:

// user-defined data type T
 typedef struct {
    real field1 ;
    bit field2  ;
 } T ;
 
 // user-defined resolution function Tsum
 function automatic T Tsum (input T driver[]);
    Tsum.field1 = 0.0 ;
    foreach (driver[i])
<span style="font-weight:bold">       Tsum.field1 += driver[i].field1;
</span> endfunction
 
 
 
 module drv (output T drv_out) ;
 
 endmodule
 
 
 module top ();
    nettype T wT                     ; // an unresolved nettype wT whose data type is T
    nettype T wTsum with Tsum ; // 
 
    wT            no_rf   ;
 //   wire_with_rf  with_rf ;
 
    drv drv1 (
        .drv_out(no_rf)
        );
 
   // drv drv2 (
   //     .drv_out(no_rf)
   //     );
 
/*
    drv drv3 (
        .drv_out(with_rf)
        );
 
    drv drv4 (
        .drv_out(with_rf)
        );
*/
 
 
 
// user-defined data type T
 typedef struct {
    real field1 ;
    bit field2  ;
 } T ;
 
 // user-defined resolution function Tsum
 function automatic T Tsum (input T driver[]);
    Tsum.field1 = 0.0 ;
    foreach (driver[i])
       Tsum.field1 += driver[i].field1;
 endfunction
 
 
 
 module drv (output T drv_out) ;
 
    wire stam;
 
 
 endmodule

and I get the following ERROR:

> which ncverilog
/nfs/iil/eda/tools/cadence/incisive/14.10.013/linux_2.6.16_x86-64/tools/bin/ncverilog
[176]icsl2618:/<6>Mixed_signals/SV/DFE_TB> ncverilog resolution_function_try.sv -sv -sysv +access+rwc +gui
ncverilog: 14.10-s013: (c) Copyright 1995-2014 Cadence Design Systems, Inc.
ncverilog: *N,SNPREC: The existing contents of the environment SPECMAN_PRE_COMMANDS will only be passed on to the simulation phase (conf gen -default_generator=IntelliGen;#ifndef CDN_UVC_USING_INTELLIGEN {define CDN_UVC_USING_INTELLIGEN;}).
file: resolution_function_try.sv
nettype T wTsum with Tsum ; // 
|
ncvlog: *E,SVRFINV (resolution_function_try.sv,23|28): function or class method does not conform to resolution function requirements.
Tsum.field1 += driver[i].field1;
|
ncvlog: *E,SVRFST (resolution_function_try.sv,11|17): static variable not allowed in resolution function.
Tsum.field1 += driver[i].field1;
|
ncvlog: *E,SVRFST (resolution_function_try.sv,11|37): static variable not allowed in resolution function.
module worklib.top:sv
errors: 3, warnings: 0
ncverilog: *E,VLGERR: An error occurred during parsing. Review the log file for errors with the code *E and fix those identified problems to proceed. Exiting with code (status 1).

Can someone help ?

1

COMMENT

HIDE ▲

BTW

line 11: Tsum.field1 += driver[i].field1

line 23: nettype T wTsum with Tsum ;

I am using cadence ncverilog
cadence/incisive/14.10.013/linux_2.6.16_x86-64/tools/bin/ncverilog

  • Cancel

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2025 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information