• 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. noisefile in a vdc source modeled by Verilog-A

Stats

  • Locked Locked
  • Replies 3
  • Subscribers 125
  • Views 15420
  • 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

noisefile in a vdc source modeled by Verilog-A

Aldo2
Aldo2 over 12 years ago

 Hello,

Is it possible to read a noise file from Verilog-A?

I would like to add a known noise shape to a model of a vdc voltage source modeled by Verilog-A.

(I need to read data from a file and pass them to noise_table)

thank you very much

Best regards

Aldo

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

    Aldo,

    How about this code below. A simple command line testcase would be:

    // noise_from_file.scs

    I1 (n1) noise_from_file filename="noise.dat" //debug=1
    r1 (n1 0) resistor r=1k isnoisy=no

    ahdl_include "noise_from_file.va"

    noise (n1 0) noise start=1 stop=1G dec=10

    With this as the noise.dat:

    1e3,1e-9
    2e3,2e-9
    10e3,1.8e-9
    1e6,2.2e-9

     

    `include "disciplines.vams"
    
    module noise_from_file (op);
    
    output op;
    electrical op;
    integer mcd,count,retval;
    real frq,val;
    parameter string filename="noise.dat";
    parameter maxpoints=100;
    parameter debug=0;
    real noisetab[0:maxpoints-1];
    
    analog begin
    
       @(initial_step) begin
          mcd=$fopen(filename,"r");
          retval=2;
          count=0;
          while(retval==2) begin
    	  retval=$fscanf(mcd,"%f,%f",frq,val);
    	  if (debug) $debug("Data is %d %g %g",retval,frq,val);
    	  noisetab[count]=frq;
    	  count=count+1;
    	  noisetab[count]=val;
    	  count=count+1;
          end
          $fclose(mcd);
        end
    
        V(op) <+ noise_table(noisetab);
    end
    
    endmodule

     

    Regards,

    Andrew.

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

    Aldo,

    How about this code below. A simple command line testcase would be:

    // noise_from_file.scs

    I1 (n1) noise_from_file filename="noise.dat" //debug=1
    r1 (n1 0) resistor r=1k isnoisy=no

    ahdl_include "noise_from_file.va"

    noise (n1 0) noise start=1 stop=1G dec=10

    With this as the noise.dat:

    1e3,1e-9
    2e3,2e-9
    10e3,1.8e-9
    1e6,2.2e-9

     

    `include "disciplines.vams"
    
    module noise_from_file (op);
    
    output op;
    electrical op;
    integer mcd,count,retval;
    real frq,val;
    parameter string filename="noise.dat";
    parameter maxpoints=100;
    parameter debug=0;
    real noisetab[0:maxpoints-1];
    
    analog begin
    
       @(initial_step) begin
          mcd=$fopen(filename,"r");
          retval=2;
          count=0;
          while(retval==2) begin
    	  retval=$fscanf(mcd,"%f,%f",frq,val);
    	  if (debug) $debug("Data is %d %g %g",retval,frq,val);
    	  noisetab[count]=frq;
    	  count=count+1;
    	  noisetab[count]=val;
    	  count=count+1;
          end
          $fclose(mcd);
        end
    
        V(op) <+ noise_table(noisetab);
    end
    
    endmodule

     

    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