I need to perform signal sampling in tran analysis at each falling edge of another waveform (not strictly a clock). The problem is those falling edges come at irregular times. It should be something along the lines of "strobe" as it is in the tran analysis menu options, only there it requires a uniform sampling period. I can't figure out how to do it. Any suggestions are very much appreciated.
You could create a Verilog-A or Verilog-AMS module that uses an @cross statement to monitor the crossing of a threshold - this would be the signal whose falling edge you want to trigger the "strobe" from. Something like the following:
module controlOnFalling( in );
@(cross(V(in), -1) begin
dummyStore = V(in);
I have not tried the above code, so beware, it may have syntax or functional problems!
The cross event can be further controlled by supplying a time tolerance and an expression tolerance, here's a section from the documentation:
cross (expr1 [ , direction [ , time_tol [ , expr_tol ] ] ] )
+1 | 0 | -1
time_tol is a constant expression with a positive value, which is the largest
time interval that you consider negligible. The default value is 1.0s, which is large
enough that the tolerance is almost always satisfied.
The simulator will control the timestep and make calculations around the crossing event (in this case when the input signal falls to 0) and this would in effect give you a strobe or a timepoint at around the time that you are interested in. If you wish to actually track the other signal that you are interested in, that could be an additional input to the module.
I hope this helps you, or at least gets you started.