OpenCores
URL https://opencores.org/ocsvn/w11/w11/trunk

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.74/] [tools/] [tcl/] [tst_rlink/] [perf.tcl] - Blame information for rev 38

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 28 wfjm
# $Id: perf.tcl 622 2014-12-28 20:45:26Z mueller $
2 11 wfjm
#
3 27 wfjm
# Copyright 2011-2014 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4 11 wfjm
#
5
# This program is free software; you may redistribute and/or modify it under
6
# the terms of the GNU General Public License as published by the Free
7
# Software Foundation, either version 2, or at your option any later version.
8
#
9
# This program is distributed in the hope that it will be useful, but
10
# WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
11
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12
# for complete details.
13
#
14
#  Revision History:
15
# Date         Rev Version  Comment
16 27 wfjm
# 2014-11-23   606   2.0    use new rlink v4 iface
17 11 wfjm
# 2011-04-17   376   1.0    Initial version
18
#
19
 
20
package provide tst_rlink 1.0
21
 
22
namespace eval tst_rlink {
23
  #
24
  # perf_wtlam: determine wtlam latency using timer.0
25
  # 
26
  proc perf_wtlam {{tmax 1000}} {
27
    if {$tmax < 1} { error "-E: perf_wtlam: tmax argument must be >= 1" }
28
 
29
    set rval "delay  latency"
30
 
31 27 wfjm
    rlink::anena 1;             # enable attn notify
32 11 wfjm
 
33
    for {set dly 250} {$dly <= 10000} {incr dly 250} {
34
      rlc exec \
35
        -wreg timer.0 0 \
36
        -wreg timer.1 0
37
      rlc exec -attn
38
 
39 28 wfjm
      set tbeg [clock milliseconds]
40 11 wfjm
      rlc exec -wreg timer.0 $dly
41
      for {set i 1} {1} {incr i} {
42
        rlc wtlam 1.
43
        rlc exec \
44
          -attn \
45
          -wreg timer.0 $dly
46 28 wfjm
        set trun [expr {[clock milliseconds] - $tbeg}]
47 11 wfjm
        if {$trun > $tmax} { break }
48
      }
49 21 wfjm
      set ms [expr {double($trun) / double($i)}]
50 11 wfjm
      append rval [format "\n%5d   %6.2f" $dly $ms]
51
    }
52
 
53 27 wfjm
    rlink::anena 0;             # disable attn notify
54 11 wfjm
 
55
    return $rval
56
  }
57
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.