• 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. Reading from a file in Verilog-A

Stats

  • Locked Locked
  • Replies 4
  • Subscribers 125
  • Views 16697
  • 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

Reading from a file in Verilog-A

Manev
Manev over 5 years ago

 Dear All,

To simulate the performance of an analog IC  design (using spectre) , I want to "pass" a specific, predefined, sequence of binary data. For this purpose, I have created a "memory" using VerilogA, which outputs bits at each clock cycle. The example bellow is only for 1 bit. The idea is to load the data sequence from a separate file.

// VerilogA for RTL, memory, veriloga

`include "constants.vams"
`include "disciplines.vams"


module memory(clk, out);

input clk;
output out;
electrical out, clk;

parameter real vtrans = 0.45, high =0.9, td = 2p, tr=2p, tf = 2p;


integer fileHandle;
integer decimal_output;
integer captured_data;
integer x;

analog begin

@ (initial_step)
fileHandle = $fopen("~/bit0");
@ (final_step)
$fclose(fileHandle);
@ (cross (V(clk) - vtrans,+1)) begin
decimal_output = $fscanf(fileHandle,"%d", captured_data);
x = ( captured_data > vtrans);
end

V(out) <+ transition( high*x,td, tr, tf );


end

endmodule

The issue is that, after building, I get the following error in the "Parser Error/Warnings" window:

memory.va (/...../memory.va)

ERR741 [30:27]: Digital or unknown system function '$fscanf' found in analog
block.
</...../memory.va> : Failed with errors (1).

Do you have any toughs on this?

Virtuoso version IC6.1.7-64b.500.23

  • Cancel
Parents
  • Saloni Chhabra
    Saloni Chhabra over 5 years ago

    Hi,

    I tried compiling your code at my end, and it does without any issues. Can you check what Spectre/MMSIM version are you using?

    Regards,

    Saloni

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Manev
    Manev over 5 years ago in reply to Saloni Chhabra

    Hello Saloni,

    For some reason, spectre -W cannot be recognized as a command, but I found the version in the spectre.out log file after running a simulation:

    Spectre (R) Circuit Simulator
    Version 17.1.0.515.isr12 64bit

    Regards,

    Veselin

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Reply
  • Manev
    Manev over 5 years ago in reply to Saloni Chhabra

    Hello Saloni,

    For some reason, spectre -W cannot be recognized as a command, but I found the version in the spectre.out log file after running a simulation:

    Spectre (R) Circuit Simulator
    Version 17.1.0.515.isr12 64bit

    Regards,

    Veselin

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
Children
  • Saloni Chhabra
    Saloni Chhabra over 5 years ago in reply to Manev

    I cannot really see where is the problem could be. Can you run your verilogA code compilation on the command-line? It's explained on the link below:

    https://support.cadence.com/wps/mypoc/cos?uri=deeplinkmin:ViewSolution;solutionNumber=1815796

     Please contact customer support so someone can check your setup.. it's odd that spectre -W doesn't work.

    • Cancel
    • Vote Up 0 Vote Down
    • Cancel
  • Andrew Beckett
    Andrew Beckett over 5 years ago in reply to Saloni Chhabra

    The error message is not a spectre error. My guess is that you have some other simulator integration which is intercepting the VerilogA compilation and it's that simulator that doesn't support the model. From a little guess (I can't see who you work for), I suspect this might be Mica (I've seen issues with that breaking the Verilog-A checking in Virtuoso). Maybe you can try by running without that integration in your environment? You might need to speak to the support within your organisation.

    Regards,

    Andrew.

    • Cancel
    • Vote Up 0 Vote Down
    • 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