Prathap
New Member
Offline
Posts: 7
India
|
Hi,
Can we be able to actually modify the disciplines.vams file. I mean just as we have an "electrical" discipline (which contains two natures - voltage and current), can we have an user defined nature and discipline.
To be more specific, i am right now trying to model a PLL. A PLL has a frequency divider circuit. Of course there are models available for that (for instance , there is one Ken Kundert's model available in the Designer's Guide website). But i thought that we could possibly define a nature for frequency and access it thro' some user defined disciplines. For this i added this piece of code in my "disciplines.vams" file.
nature Frequency units = "Hz" access = Fr; `ifdef FREQUENCY_ABSTOL abstol = `FREQUENCY_ABSTOL `else abstol = 1e-12; `endif endnature
/// Conservative discipline
discipline period potential Frequency; enddiscipline
But when i actually executed this discipline in the following program it gave me error. this is the code where i used it.
// VerilogA for PLL_Prathap, Freq_Discipline_Check, veriloga
`include "constants.vams" `include "disciplines.vams"
`include "/h/prathsi/disciplines_modified.vams" -------- Location where the modified discipline file is present
module Freq_Discipline_Check(in, out); input in; output out;
period in; voltage in; period out;
real temp, temp_1;
analog begin
@(cross(V(in)-0.1, 1)) begin temp = Fr(in); temp_1 = 10 * temp; Fr(out) <+ transition(temp_1, 10n, 10n, 10n);
end endmodule
What i have done might be completely incorrect. If so please try to correct/guide me.
Thanks You.
Regards, Prathap.
|