jtag: measure_clk debug proc
authorØyvind Harboe <oyvind.harboe@zylin.com>
Mon, 2 Aug 2010 09:15:21 +0000 (11:15 +0200)
committerØyvind Harboe <oyvind.harboe@zylin.com>
Mon, 2 Aug 2010 09:15:21 +0000 (11:15 +0200)
It can be useful to get an approximate measurement of
rtck frequency for debugging purposes.

Signed-off-by: Øyvind Harboe <oyvind.harboe@zylin.com>
src/jtag/startup.tcl

index 496fdc82e7707d035d2244ace05d7a712bfa69cb..fdd307815a98e95bb06929cea99692e7f8ce9a78 100644 (file)
@@ -76,6 +76,15 @@ proc srst_asserted {} {
        puts "Sensed nSRST asserted."
 }
 
+# measure actual JTAG clock
+proc measure_clk {} {
+       set start_time [ms];
+       runtest 10000000; 
+       echo "Running at more than [expr 10000.0 / ([ms]-$start_time)] kHz";
+}
+
+add_help_text measure_clk "Runs a test to measure the JTAG clk. Useful with RCLK / RTCK."
+
 # BEGIN MIGRATION AIDS ...  these adapter operations originally had
 # JTAG-specific names despite the fact that the operations were not
 # specific to JTAG, or otherewise had troublesome/misleading names.