here is the simple Cadence ocean script to extract clock periods. The results can be used to calculate the period jitter and cycle-to-cycle jitter in the excel spread sheet (post processing).
;_____________________________________________
simulator( 'spectre )
;Output file name
p = outfile( "_jitter.txt" "w")
openResults( "/PATH_TO_DESIGN/spectre/schematic" )
selectResult( 'tran )
;-----------------------------------
; Setting
;----------------------------------
vcc = 1.8
threshold = 0.9
t0_edge = 1
% set a large number in the for_loop counter so it can extract the entire sim results
for(i 1 200000
t1_edge = t0_edge + i
t2_edge = t1_edge + 1
;----------------
; measurement
;----------------
per_buf3 = ( cross(v("/buf3") threshold t2_edge "rising") - cross(v("buf3") threshold t1_edge "rising"))
per_buf3b = ( cross(v("/buf3b") threshold t2_edge "rising") - cross(v("buf3b") threshold t1_edge "rising"))
;----------------
; Print out
;----------------
fprintf( p "%-14e" per_buf3 )
fprintf( p "%-14e" per_buf3b )
fprintf( p "\n" )
)
close(p)
No comments:
Post a Comment