• 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. Custom IC Design
  3. Return a string from user-defined function in VerilogA

Stats

  • Locked Locked
  • Replies 1
  • Subscribers 125
  • Views 15714
  • 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

Return a string from user-defined function in VerilogA

DimitarT
DimitarT over 5 years ago

Hi,

 

I am trying to define a custom function (analog function) that takes a string input and returns a string;

analog function integer foo;

   input strin;

   output strout;

   string strin; 

    string strout;

  begin 

       strout = {strin,strin};

end

endfunction

 

string output_str;

analog begin

 @(initial_step) 

      foo("bar", output_str);

end

 

This yields an error during similar to:

 

ERROR (VACOMP-1008): Cannot compile ahdlcmi module library. Check the log file /…./…/Sim/… … /adexl/results/data/Interactive.33/sharedData/CDS/ahdl/input.ahdlSimDB/24626ad5616da27e0a69c18e90226eba.bias_autotrim.ahdlcmi/Linux-64//..//ahdlcmi.out for details. Contact your Cadence Customer Support representative with the netlist, log files, behavioral model files, and any other information that can help identify the problem.

    ERROR (SFE-91): Cannot run the simulation because an AHDL compilation error occurred. Check the VACOMP error message above and correct the syntax error in the Verilog-A file. Next, rerun the simulation.

Investigating the ahdlcmi.out file, the first encountered error is:

aslDevAssignStringC(2, &stateDataStruct->input_str_144,(char*)stateDataStruct->input_str_152, funcModeParam);

                        ^

In file included from test.c:24:0:

/mnt/ed/ct/lnx/rh/53/64/…/spectre/tools.lnx86/spectre/ahdlcmi/include/ahdlDevLibGlobal.h:2390:32: note: expected 'char *' but argument is of type 'long int *'

 ASL_FUNC_DECL_START extern int aslDevAssignStringC( int, char *, char *, struct ahdlFuncModeParam * );


I guess this is some intermediate compilation message (VerilogA->C), but I couldn’t get further investigating it.

 

Interestingly, removing the strout output parameter from the function and leaving only an input string works just fine.

 

What could be a possible solution to this issue?

 

Cheers,

Dimitar

  • Cancel
Parents
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    Hi Dimitar,

    This is a bug. In an older spectre version (when you could still disable the VerilogA compilation), the code does work - it's just the compilation that fails. I filed a change request (CCR 2203954) to get this fixed. If you want to track this yourself, you should contact customer support and request that a duplicate is filed so that it's then associated with you (this is better, as customer-filed issues get higher priority than internally filed issues).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Andrew Beckett
    Andrew Beckett over 5 years ago

    Hi Dimitar,

    This is a bug. In an older spectre version (when you could still disable the VerilogA compilation), the code does work - it's just the compilation that fails. I filed a change request (CCR 2203954) to get this fixed. If you want to track this yourself, you should contact customer support and request that a duplicate is filed so that it's then associated with you (this is better, as customer-filed issues get higher priority than internally filed issues).

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
No Data

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