• 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. Amplitude sweep in VERILOG-A environment to generate multiple...

Stats

  • Locked Locked
  • Replies 0
  • Subscribers 64
  • Views 13293
  • 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

Amplitude sweep in VERILOG-A environment to generate multiple Output files through the Verilog-A code

Jaikrishnan
Jaikrishnan over 5 years ago

I am doing a simulation in Cadence for a Delta-Sigma ADC with blocks like op-amp and Quantizer modeled in Verilog-A environment. The quantizer is a single-bit quantizer and hence modelled just as a comparator that works on a clock with V(out) = +1 when the V(in) > 0 and V(out) = -1 when the V(in) < 0. In the quantizer block, I have a code piece that does a file export in .dat format (@filecheck (path of the destination to store the file)). This is performed because I will load this file generated into Matlab and verify the performance metrics like SNR and IBN through the code run in Matlab. 

Now I want to sweep that amplitude lets say for 100 levels between a minimum and maximum. With this, I would like to generate 100 file outputs on each iteration such that I can load that in Matlab using an iteration of 100 levels.

How can I modify the Verilog-A code so as to generate each file at each amplitude iteration without just replacing the existing file each time?

Below is the current code:

module Quantizer(in,clk,out),

input in,clk,

output clk,

voltage in,clk,out;
parameter real tr = 1n, tf= 1n, tdel = 1n;
integer file_check = 0;
real vin, out_var;
analog
begin
if(analysis("tran"))
begin
file_check = $fopen("path to store the file")
@cross(V(clk)-0.5,+1)
begin
vin = V(in);
if(vin>0)
out_var = 1;
else begin
out_var = -1;
end
$fstrobe(file_check,"%g",out_var)
end 
end
@(finalstep) begin
$fclose(file_check);
end
V(out)<+transition(out_var,tdel,tr,tf)
end
endmodule
Can some one help me to midy the same code according to my need?
  • 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