I am trying to find the equation to calculate the total length of a signal. So the code should find the moment the signal starts to rise, plateau, and fall duration. After that, the duration of these times should be added. And at the end, I should get 150ns as a result. I tried to implement something like the below but it did not work suggestion are welcome :)
export real rise_time = cross(sig=V(BL), dir='rise', n=1, thresh=0.0)export real fall_time = cross(sig=V(BL), dir='fall', n=1, thresh=0.0)export real pulse_length = fall_time - rise_time
Two issues:
Here's a suggested MDL file which worked for me:
alias measurement tran_pulse { run tran export real rise_time = cross(sig=V(BL), dir='rise, n=1, thresh=0.01) export real fall_time = cross(sig=V(BL), dir='fall, n=1, thresh=0.01) export real pulse_length = fall_time - rise_time } run tran_pulse
Andrew
Worked perfectly. Thank you so much.