Ata_sa16
Full Member level 6
- Joined
- Mar 29, 2016
- Messages
- 343
- Helped
- 59
- Reputation
- 118
- Reaction score
- 58
- Trophy points
- 28
- Location
- Milky Way Galaxy, 179° 56′ 39.4″
- Activity points
- 2,221
Hi all,
I am new to VerilogA and I have a code which I dont understand. Could you please explain this to me ?
Thank you.
I dont understand this part
I am new to VerilogA and I have a code which I dont understand. Could you please explain this to me ?
Thank you.
Code:
// Fixed frequency oscillator
//
module osc1 (out);
output out; voltage out; // output signal
parameter real freq=1 from (0:inf); // output frequency
parameter real vl=-1; // high output voltage
parameter real vh=1; // low output voltage
parameter real tt=0.01/freq from (0:inf); // transition time of output
integer n;
real next;
analog begin
@(initial_step) begin
next = 0.5/freq + $abstime;
end
@(timer(next)) begin
n = !n;
next = next + 0.5/freq;
end
V(out) <+ transition(n ? vh : vl, 0, tt);
end
endmodule
I dont understand this part
Code:
analog begin
@(initial_step) begin
next = 0.5/freq + $abstime;
end
@(timer(next)) begin
n = !n;
next = next + 0.5/freq;
end
V(out) <+ transition(n ? vh : vl, 0, tt);
end