Geoffrey_Coram wrote on Jan 28th, 2016, 6:13am:The difference in your models appears to be that one reads the data outside the cross event, and the other reads it inside. Does the first model read the data on every timepoint? I don't see what would keep it from doing so, but you have left out much of the model code (eg, the $fopen call and initialization of k).
Are you sure the clocks are the same? Are you sure your cross event has +1 for the direction argument for both models?
You could put in a $strobe to report the time for each crossing and see if the second model reports additional crossings.
Hello Geoffrey,
Thank you for your comments. The problem is solved, and the problem is the file was read every other line, and the frequency is double.
By the way, could you please suggest how to define a variable parameter in Verilog A?
Currently, I define a variable parameter in Verilog A, and after I create the symbol, I try to change the value of the defined parameter in the symbol, it seems the value is not changed at all. I have to edit the Verilog A script every time to change its value. It is a bit boring and not convenient for a large number sweep.
The variable parameter is defined as below,
parameter tr=1n, tf=1n, dy=0;
After creating the symbol, I do see them in the "CDF Parameter of View" in the schematic view. Shall I add more command to complete the definition?
Thank you.