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

Subversion Repositories w11

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /w11/tags/w11a_V0.61/tools/tcl/tst_rlink
    from Rev 25 to Rev 26
    Reverse comparison

Rev 25 → Rev 26

/perf.tcl
0,0 → 1,56
# $Id: perf.tcl 516 2013-05-05 21:24:52Z mueller $
#
# Copyright 2011- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
#
# This program is free software; you may redistribute and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 2, or at your option any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for complete details.
#
# Revision History:
# Date Rev Version Comment
# 2011-04-17 376 1.0 Initial version
#
 
package provide tst_rlink 1.0
 
namespace eval tst_rlink {
#
# perf_wtlam: determine wtlam latency using timer.0
#
proc perf_wtlam {{tmax 1000}} {
if {$tmax < 1} { error "-E: perf_wtlam: tmax argument must be >= 1" }
 
set rval "delay latency"
 
rlc exec -init 0xff [regbld rlink::INIT anena]
 
for {set dly 250} {$dly <= 10000} {incr dly 250} {
rlc exec \
-wreg timer.0 0 \
-wreg timer.1 0
rlc exec -attn
 
set tbeg [clock clicks -milliseconds]
rlc exec -wreg timer.0 $dly
for {set i 1} {1} {incr i} {
rlc wtlam 1.
rlc exec \
-attn \
-wreg timer.0 $dly
set trun [expr {[clock clicks -milliseconds] - $tbeg}]
if {$trun > $tmax} { break }
}
set ms [expr {double($trun) / double($i)}]
append rval [format "\n%5d %6.2f" $dly $ms]
}
 
rlc exec -init 0xff [regbld rlink::INIT {anena 0}]
 
return $rval
}
}
/util.tcl
0,0 → 1,86
# $Id: util.tcl 516 2013-05-05 21:24:52Z mueller $
#
# Copyright 2011- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
#
# This program is free software; you may redistribute and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 2, or at your option any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for complete details.
#
# Revision History:
# Date Rev Version Comment
# 2011-04-17 376 1.0.1 add proc scan_baud
# 2011-04-02 375 1.0 Initial version
# 2011-03-19 372 0.1 First draft
#
 
package provide tst_rlink 1.0
 
package require rlink
package require rbtest
package require rbmoni
package require rbbram
package require rbs3hio
package require rbemon
 
namespace eval tst_rlink {
#
# setup: amap definitions for tst_rlink
#
proc setup {} {
rlc amap -clear; # clear first to allow re-run
rbmoni::setup [bvi b 11111100]
rbemon::setup [bvi b 11111000]
rbbram::setup [bvi b 11110100]
rbtest::setup [bvi b 11110000]
rlc amap -insert timer.1 [bvi b 11100001]
rlc amap -insert timer.0 [bvi b 11100000]
rbs3hio::setup [bvi b 11000000]
}
 
#
# init: reset tst_rlink design to initial state
#
proc init {} {
rlink::init; # reset rlink
rbtest::init
rbbram::init
rbmoni::init
rbs3hio::init
rbemon::init
rlink::init; # re-reset rlink
}
 
#
# scan_baud: scan through baud rates, show uart clkdiv value
#
proc scan_baud {{bmax 500000}} {
if {! [rlink::isopen]} {error "-E: rlink port not open"}
set rlpath [rlc open]
regexp -- {^term:(.*)\?} $rlpath dummy rldev
if {$rldev eq ""} {error "-E: rlink not connected to a term: device"}
 
set rval " baud hi.dsp clkdiv sysclk"
set blist {9600 19200 38400 57600 115200 230400 460800
500000 921600 1000000 2000000 3000000}
 
foreach baud $blist {
if {$baud > $bmax} { break }
rlc close
rlc open "term:$rldev?baud=${baud};break"
rlc exec -rreg hi.dsp hidsp
set mhz [expr {double($baud*$hidsp) / 1.e6}]
append rval [format "\n%7d 0x%4.4x %6d %6.2f" \
$baud $hidsp [expr {$hidsp + 1}] $mhz]
}
 
rlc close
if {! [regexp -- {;break} $rlpath]} {append rlpath ";break"}
rlc open "${rlpath}"
return $rval
}
}
/test_all.tcl
0,0 → 1,57
# $Id: test_all.tcl 469 2013-01-05 12:29:44Z mueller $
#
# Copyright 2011- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
#
# This program is free software; you may redistribute and/or modify it under
# the terms of the GNU General Public License as published by the Free
# Software Foundation, either version 2, or at your option any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY, without even the implied warranty of MERCHANTABILITY
# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for complete details.
#
# Revision History:
# Date Rev Version Comment
# 2013-01-04 469 1.0.2 move rbemon tests from test_all to test_all_emon
# 2011-04-17 376 1.0.1 add rbemon::test_rbtest_sim (if in sum mode)
# 2011-04-02 375 1.0 Initial version
# 2011-03-26 373 0.1 First draft
#
 
package provide tst_rlink 1.0
 
package require rbtest
package require rbmoni
 
namespace eval tst_rlink {
#
# Driver for all tst_rlink tests
#
proc test_all {} {
#
set errcnt 0
incr errcnt [rbtest::test_all 0x7 0xfffc]
incr errcnt [rbmoni::test_regs]
incr errcnt [rbmoni::test_rbtest]
 
puts "tst_rlink::test_all errcnt = $errcnt --> [rutil::errcnt2txt $errcnt]"
 
return $errcnt
}
#
# Driver for emon based tst_rlink tests
#
proc test_all_emon {} {
#
set errcnt 0
incr errcnt [rbemon::test_regs]
if {[rlink::issim]} {
incr errcnt [rbemon::test_rbtest_sim]
}
 
puts "tst_rlink::test_all_emon errcnt = $errcnt --> [rutil::errcnt2txt $errcnt]"
 
return $errcnt
}
}
/.cvsignore
0,0 → 1,57
pkgIndex.tcl
/.
. Property changes : Added: svn:ignore ## -0,0 +1,34 ## +*.dep_ghdl +*.dep_isim +*.dep_xst +work-obj93.cf +*.vcd +*.ghw +*.sav +*.tmp +*.exe +ise +xflow.his +*.ngc +*.ncd +*.pcf +*.bit +*.msk +isim +isim.log +isim.wdb +fuse.log +*_[sft]sim.vhd +*_tsim.sdf +*_xst.log +*_tra.log +*_twr.log +*_map.log +*_par.log +*_tsi.log +*_pad.log +*_bgn.log +*_svn.log +*_sum.log +*_[dsft]sim.log +pkgIndex.tcl

powered by: WebSVN 2.1.0

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