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/rbtest
    from Rev 25 to Rev 26
    Reverse comparison

Rev 25 → Rev 26

/test_fifo.tcl
0,0 → 1,179
# $Id: test_fifo.tcl 516 2013-05-05 21:24:52Z mueller $
#
# Copyright 2011-2013 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-03-27 374 1.0 Initial version
# 2011-03-13 369 0.1 First draft
#
 
package provide rbtest 1.0
 
package require rutiltpp
package require rutil
package require rlink
 
namespace eval rbtest {
#
# Basic tests with cntl and fifo registers.
#
proc test_fifo {} {
set esdval 0x00
set esdmsk [regbld rlink::STAT {stat -1}]
#
set errcnt 0
rlc errcnt -clear
#
rlc log "rbtest::test_fifo - init: clear cntl, data, and fifo"
# Note: fifo clear via init is tested later, used here 'speculatively'
rlc exec -init te.cntl [regbld rbtest::INIT fifo data cntl]
#
#-------------------------------------------------------------------------
rlc log " test 1: fifo write/read with wreg/rreg"
# single word
rlc exec -estatdef $esdval $esdmsk \
-wreg te.fifo 0x0000 \
-rreg te.fifo -estat 0x0000
# three words
rlc exec -estatdef $esdval $esdmsk \
-wreg te.fifo 0xdead \
-wreg te.fifo 0xbeaf \
-wreg te.fifo 0x1234 \
-rreg te.fifo -edata 0xdead \
-rreg te.fifo -edata 0xbeaf \
-rreg te.fifo -edata 0x1234
#
#-------------------------------------------------------------------------
rlc log " test 2: fifo write/read with wblk/rblk"
# two words
set blk {0x1111 0x2222}
rlc exec -estatdef $esdval $esdmsk \
-wblk te.fifo $blk \
-rblk te.fifo [llength $blk] -edata $blk
# six words
set blk {0x3333 0x4444 0x5555 0x6666 0x7777 0x8888}
rlc exec -estatdef $esdval $esdmsk \
-wblk te.fifo $blk \
-rblk te.fifo [llength $blk] -edata $blk
#
#-------------------------------------------------------------------------
rlc log " test 3a: fifo read error (write 3, read 4)"
set blk {0xdead 0xbeaf 0x1234}
rlc exec -estatdef $esdval $esdmsk \
-wblk te.fifo $blk \
-rblk te.fifo 4 -edata $blk -estat [regbld rlink::STAT rberr] $esdmsk
#
#
rlc log " test 3b: fifo write error (write 17, read 16)"
set blk {}
for { set i 0 } { $i < 17 } { incr i } {
lappend blk [expr {$i | ( $i << 8 ) }]
}
rlc exec -estatdef $esdval $esdmsk \
-wblk te.fifo $blk -estat [regbld rlink::STAT rberr] $esdmsk \
-rblk te.fifo 16 -edata [lrange $blk 0 15]
#
#-------------------------------------------------------------------------
rlc log " test 4a: verify that init 100 clears fifo ant not cntl&data"
# check fifo empty; write a value; clear fifo via init; check fifo empty
# check that cntl and data not affected
rlc exec -estatdef $esdval $esdmsk \
-wreg te.cntl [regbld rbtest::CNTL {stat 0x7}] \
-wreg te.data 0x1234 \
-rreg te.fifo -estat [regbld rlink::STAT rberr] $esdmsk \
-wreg te.fifo 0x4321 \
-init te.cntl [regbld rbtest::INIT fifo] \
-rreg te.fifo -estat [regbld rlink::STAT rberr] $esdmsk \
-rreg te.cntl -edata [regbld rbtest::CNTL {stat 0x7}] \
-rreg te.data -edata 0x1234
#
#
rlc log " test 4b: verify fifo clear via nofifo flag in cntl"
# write a value; set and clear nofifo flag in cntl; ckeck fifo empty
rlc exec -estatdef $esdval $esdmsk \
-wreg te.fifo 0x4321 \
-wreg te.cntl [regbld rbtest::CNTL nofifo] \
-wreg te.cntl 0x0000 \
-rreg te.fifo -estat [regbld rlink::STAT rberr] $esdmsk
#
#-------------------------------------------------------------------------
rlc log " test 5: verify that nofifo causes a rbnak on fifo access"
# write fifo; set nofifo in cntl; write/read fifo(->rbnak);
# clr nofifo in cntl; read fifo(->rberr)
rlc exec -estatdef $esdval $esdmsk \
-wreg te.fifo 0x12ab \
-wreg te.cntl [regbld rbtest::CNTL nofifo] \
-wreg te.fifo 0x12cd -estat [regbld rlink::STAT rbnak] $esdmsk \
-rreg te.fifo -estat [regbld rlink::STAT rbnak] $esdmsk \
-wreg te.cntl 0x0000 \
-rreg te.fifo -estat [regbld rlink::STAT rberr] $esdmsk
#
#-------------------------------------------------------------------------
rlc log " test 6: test that te.attn returns # of cycles for te.fifo w&r"
foreach nbusy {0x03 0x07 0x0f 0x1f 0x00} {
set valc [regbld rbtest::CNTL [list nbusy $nbusy]]
rlc exec -estatdef $esdval $esdmsk \
-wreg te.cntl $valc \
-wreg te.fifo [expr {$nbusy | ( $nbusy << 8 ) }] \
-rreg te.attn -edata [expr {$nbusy + 1 }] \
-rreg te.fifo -edata [expr {$nbusy | ( $nbusy << 8 ) }] \
-rreg te.attn -edata [expr {$nbusy + 1 }]
}
#
#-------------------------------------------------------------------------
rlc log " test 7: verify escaping (all 256 byte codes transported)"
for {set i 0} {$i < 8} {incr i} {
set blk {}
for {set j 0} {$j < 16} {incr j} {
set bcode [expr {32 * $i + 2 * $j}]
lappend blk [expr {( $bcode << 8 ) | ( $bcode + 1 )}]
}
rlc exec -estatdef $esdval $esdmsk \
-wblk te.fifo $blk \
-rblk te.fifo [llength $blk] -edata $blk
}
#
# -------------------------------------------------------------------------
rlc log " test 8: verify stat command after te.data wblk & rblk"
set blk {0x1234 0x2345}
set rlist [rlc exec -rlist -estatdef $esdval $esdmsk \
-wblk te.fifo $blk \
-stat ]
#puts $rlist
#rlist like: {wblk 99 23 0} {stat 4 39 0 99 65279}
set xreg_ccode [lindex $rlist 0 1]
set stat_ccode [lindex $rlist 1 4]
if {$xreg_ccode != $stat_ccode} {
rlc log " ---- stat ccmd mismatch, d=[pbvi o8 $xreg_ccode]! D=[pbvi o8 $stat_ccode] FAIL"
incr errcnt
}
set rlist [rlc exec -rlist -estatdef $esdval $esdmsk \
-rblk te.fifo [llength $blk] -edata $blk \
-stat -edata 0x2345]
#puts $rlist
#{rblk 97 23 0 {4660 9029}} {stat 12 39 0 97 9029}
set xreg_ccode [lindex $rlist 0 1]
set stat_ccode [lindex $rlist 1 4]
if {$xreg_ccode != $stat_ccode} {
rlc log " ---- stat ccmd mismatch, d=[pbvi o8 $xreg_ccode]! D=[pbvi o8 $stat_ccode] FAIL"
incr errcnt
}
#
#-------------------------------------------------------------------------
rlc log "rbtest::test_fifo - cleanup: clear cntl, data, and fifo"
rlc exec -init te.cntl [regbld rbtest::INIT fifo data cntl]
#
incr errcnt [rlc errcnt -clear]
return $errcnt
}
}
/test_attn.tcl
0,0 → 1,87
# $Id: test_attn.tcl 516 2013-05-05 21:24:52Z mueller $
#
# Copyright 2011-2013 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-03-27 374 1.0 Initial version
# 2011-03-20 372 0.1 First Draft
#
 
package provide rbtest 1.0
 
package require rutiltpp
package require rutil
package require rlink
 
namespace eval rbtest {
#
# Test with stat connectivity of the cntl register.
#
proc test_attn {{attnmsk 0x0}} {
# quit if nothing to do...
if {$attnmsk == 0} {return 0}
#
set esdval 0x00
set esdmsk [regbld rlink::STAT {stat -1} attn]
#
set apats {}
for {set i 0} {$i < 16} {incr i} {
set apat [expr {1 << $i}]
if {[expr {$apat & $attnmsk}]} {lappend apats $apat}
}
#
set errcnt 0
rlc errcnt -clear
#
rlc log "rbtest::test_attn - init: clear regs and attn flags"
rlc exec -init te.cntl [regbld rbtest::INIT cntl data fifo]
rlc exec -attn
 
#
#-------------------------------------------------------------------------
rlc log " test 1: verify connection of attn bits"
foreach apat $apats {
rlc exec -estatdef $esdval $esdmsk \
-wreg te.attn $apat \
-rreg te.attn -estat [regbld rlink::STAT attn] \
-attn -edata $apat \
-rreg te.attn -estat 0x0
}
 
#
#-------------------------------------------------------------------------
rlc log " test 2: verify that attn flags accumulate"
foreach apat $apats {
rlc exec -wreg te.attn $apat -estat $esdval $esdmsk
}
rlc exec -attn -edata $attnmsk -estat $esdval $esdmsk
 
#
#-------------------------------------------------------------------------
rlc log " test 3: verify that <attn> comma is send"
set apat [lindex $apats 0]
rlc exec -init 0xff [regbld rlink::INIT anena] -estat $esdval $esdmsk
rlc exec -wreg te.attn $apat -estat $esdval $esdmsk
rlc wtlam 1.
rlc exec -attn -edata $apat -estat $esdval $esdmsk
 
#
#-------------------------------------------------------------------------
rlc log "rbtest::test_attn - cleanup: clear regs and attn flags"
rlc exec -init te.cntl [regbld rbtest::INIT cntl data fifo]
rlc exec -attn
#
incr errcnt [rlc errcnt -clear]
return $errcnt
}
}
/test_data.tcl
0,0 → 1,162
# $Id: test_data.tcl 516 2013-05-05 21:24:52Z mueller $
#
# Copyright 2011-2013 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-03-27 374 1.0 Initial version
# 2011-03-13 369 0.1 First Draft
#
 
package provide rbtest 1.0
 
package require rutiltpp
package require rutil
package require rlink
 
namespace eval rbtest {
#
# Basic tests with cntl and data registers.
# All tests depend only on rbd_tester logic alone and not on how the
# rbd_tester is embedded in the design (e.g. stat and attn connections)
#
proc test_data {} {
set esdval 0x00
set esdmsk [regbld rlink::STAT {stat -1}]
#
set errcnt 0
rlc errcnt -clear
#
rlc log "rbtest::test_data - init: clear cntl, data, and fifo"
# Note: fifo clear via init is tested later, used here 'speculatively'
rlc exec -init te.cntl [regbld rbtest::INIT fifo data cntl]
#
#-------------------------------------------------------------------------
rlc log " test 1a: cntl, data are write- and read-able"
foreach {addr valw valr} [list te.cntl 0xffff 0xf3ff \
te.cntl 0x0000 0x0000 \
te.data 0xffff 0xffff \
te.data 0x0000 0x0000 ] {
rlc exec -wreg $addr $valw -estat $esdval $esdmsk
rlc exec -rreg $addr -edata $valr -estat $esdval $esdmsk
}
#
#
rlc log " test 1b: as test 1a, now use clists and check cntl/data distinct"
foreach {valc vald} [list 0x0000 0x0000 [regbld rbtest::CNTL nofifo] 0xffff] {
rlc exec -estatdef $esdval $esdmsk \
-wreg te.cntl $valc \
-wreg te.data $vald \
-rreg te.cntl -edata $valc \
-rreg te.data -edata $vald
}
#
#
rlc log " test 1c: as test 1, now cntl.stat field is used"
foreach stat {0x1 0x3 0x7 0x0} {
set valc [regbld rbtest::CNTL [list stat $stat]]
set vald [expr {$stat | ( $stat << 8 ) }]
rlc exec -estatdef $esdval $esdmsk \
-wreg te.cntl $valc \
-wreg te.data $vald \
-rreg te.cntl -edata $valc \
-rreg te.data -edata $vald
}
#
#-------------------------------------------------------------------------
rlc log " test 2: cntl.nbusy is write- and readable (last nbusy=0 again)"
foreach nbusy {0x00f 0x0ff 0x3ff 0x000} {
set valc [regbld rbtest::CNTL [list nbusy $nbusy]]
rlc exec -estatdef $esdval $esdmsk \
-wreg te.cntl $valc \
-rreg te.cntl -edata $valc
}
#
#-------------------------------------------------------------------------
rlc log " test 3: verify that large nbusy causes timeout"
rlc exec -estatdef $esdval $esdmsk \
-wreg te.data 0xdead \
-rreg te.data -edata 0xdead \
-wreg te.cntl [regbld rbtest::CNTL {nbusy 0x3ff}] \
-wreg te.data 0xbeaf -estat [regbld rlink::STAT rbnak] $esdmsk \
-rreg te.data -estat [regbld rlink::STAT rbnak] $esdmsk \
-wreg te.cntl 0x0000 \
-rreg te.data -edata 0xdead -edata 0xdead
#
# -------------------------------------------------------------------------
rlc log " test 4a: verify that init 001 clears cntl and not data"
set valc [regbld rbtest::CNTL nofifo {stat 0x3}]
rlc exec -estatdef $esdval $esdmsk \
-wreg te.cntl $valc \
-wreg te.data 0x1234 \
-init te.cntl [regbld rbtest::INIT cntl] \
-rreg te.cntl -edata 0x0 \
-wreg te.data 0x1234
rlc log " test 4b: verify that init 010 clears data and not cntl"
set valc [regbld rbtest::CNTL {stat 0x7}]
rlc exec -estatdef $esdval $esdmsk \
-wreg te.cntl $valc \
-wreg te.data 0x4321 \
-init te.cntl [regbld rbtest::INIT data] \
-rreg te.cntl -edata $valc \
-wreg te.data 0x0
rlc log " test 4c: verify that init 011 clears data and cntl"
rlc exec -estatdef $esdval $esdmsk \
-wreg te.cntl [regbld rbtest::CNTL nofifo {stat 0x7} {nbusy 2}] \
-wreg te.data 0xabcd \
-init te.cntl [regbld rbtest::INIT data cntl] \
-rreg te.cntl -edata 0x0 \
-wreg te.data 0x0
#
# -------------------------------------------------------------------------
rlc log " test 5: test that te.attn returns # of cycles for te.data w&r"
foreach nbusy {0x03 0x07 0x0f 0x1f 0x00} {
set valc [regbld rbtest::CNTL [list nbusy $nbusy]]
rlc exec -estatdef $esdval $esdmsk \
-wreg te.cntl $valc \
-wreg te.data [expr {$nbusy | ( $nbusy << 8 ) }] \
-rreg te.attn -edata [expr {$nbusy + 1 }] \
-rreg te.data -edata [expr {$nbusy | ( $nbusy << 8 ) }] \
-rreg te.attn -edata [expr {$nbusy + 1 }]
}
#
# -------------------------------------------------------------------------
rlc log " test 6: verify stat command after te.data wreg & rreg"
set rlist [rlc exec -rlist -estatdef $esdval $esdmsk \
-wreg te.data 0x1234 \
-stat ]
#rlist like: {wreg 90 23 0} {stat 4 39 0 90 1}
set xreg_ccode [lindex $rlist 0 1]
set stat_ccode [lindex $rlist 1 4]
if {$xreg_ccode != $stat_ccode} {
rlc log " ---- stat ccmd mismatch, d=[pbvi o8 $xreg_ccode]! D=[pbvi o8 $stat_ccode] FAIL"
incr errcnt
}
set rlist [rlc exec -rlist -estatdef $esdval $esdmsk \
-rreg te.data -edata 0x1234 \
-stat -edata 0x1234]
#rlist like: {rreg 72 23 0 4660} {stat 12 39 0 72 4660}
set xreg_ccode [lindex $rlist 0 1]
set stat_ccode [lindex $rlist 1 4]
if {$xreg_ccode != $stat_ccode} {
rlc log " ---- stat ccmd mismatch, d=[pbvi o8 $xreg_ccode]! D=[pbvi o8 $stat_ccode] FAIL"
incr errcnt
}
#
#-------------------------------------------------------------------------
rlc log "rbtest::test_data - cleanup: clear cntl and data"
rlc exec -init te.cntl [regbld rbtest::INIT data cntl]
#
incr errcnt [rlc errcnt -clear]
return $errcnt
}
}
/test_stat.tcl
0,0 → 1,61
# $Id: test_stat.tcl 516 2013-05-05 21:24:52Z mueller $
#
# Copyright 2011-2013 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-03-27 374 1.0 Initial version
# 2011-03-20 372 0.1 First Draft
#
 
package provide rbtest 1.0
 
package require rutiltpp
package require rutil
package require rlink
 
namespace eval rbtest {
#
# Test with stat connectivity of the cntl register.
#
proc test_stat {{statmsk 0x0}} {
# quit if nothing to do...
if {$statmsk == 0} {return 0}
 
#
set errcnt 0
rlc errcnt -clear
#
rlc log "rbtest::test_stat - init: clear cntl"
rlc exec -init te.cntl [regbld rbtest::INIT cntl]
#
#-------------------------------------------------------------------------
rlc log " test 1: verify connection of cntl stat bits to stat return"
for {set i 0} {$i < 3} {incr i} {
set spat [expr {1 << $i}]
if {[expr {$spat & $statmsk}]} {
set cntl [regbld rbtest::CNTL [list stat $spat]]
rlc exec \
-wreg te.cntl $cntl \
-rreg te.cntl -edata $cntl \
-estat [regbld rlink::STAT [list stat $spat]]
}
}
#
#-------------------------------------------------------------------------
rlc log "rbtest::test_stat - cleanup: clear cntl"
rlc exec -init te.cntl [regbld rbtest::INIT cntl]
#
incr errcnt [rlc errcnt -clear]
return $errcnt
}
}
/util.tcl
0,0 → 1,165
# $Id: util.tcl 516 2013-05-05 21:24:52Z mueller $
#
# Copyright 2011-2013 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-03-27 374 1.0 Initial version
# 2011-03-13 369 0.1 Frist draft
#
 
package provide rbtest 1.0
 
package require rutiltpp
package require rutil
package require rlink
 
namespace eval rbtest {
#
# setup register descriptions for rbd_tester
#
regdsc CNTL {nofifo 15} {stat 14 3} {nbusy 9 10}
regdsc INIT {fifo 2} {data 1} {cntl 0}
#
# setup: amap definitions for rbd_tester
#
proc setup {{base 0x00f0}} {
rlc amap -insert te.cntl [expr {$base + 0x00}]
rlc amap -insert te.data [expr {$base + 0x01}]
rlc amap -insert te.fifo [expr {$base + 0x02}]
rlc amap -insert te.attn [expr {$base + 0x03}]
}
#
# init: reset rbd_tester (clear via init)
#
proc init {} {
rlc exec -init te.cntl [regbld rbtest::INIT fifo data cntl]
}
#
# nbusymax: returns maximal nbusy value not causing timeout
#
proc nbusymax {} {
set esdmsk [regbld rlink::STAT {stat -1} attn]
rlc exec -estatdef 0 $esdmsk \
-rreg te.cntl sav_cntl \
-wreg te.cntl [regbld rbtest::CNTL {nbusy -1}] \
-rreg te.data -estat [regbld rlink::STAT rbnak] $esdmsk \
-rreg te.attn ncyc
rlc exec -estatdef 0 $esdmsk \
-wreg te.cntl $sav_cntl
return [expr {$ncyc - 1}]
}
#
# probe: determine rbd_tester environment (max nbusy, stat and attn wiring)
#
proc probe {} {
set esdval 0x00
set esdmsk [regbld rlink::STAT {stat -1}]
set esdmsknak [regbld rlink::STAT {stat -1} rbnak]
set esdmskatt [regbld rlink::STAT {stat -1} attn]
set rbusy {}
set rstat {}
set rattn {}
#
# probe max nbusy for write and read
#
set wrerr {}
set rderr {}
for {set i 3} { $i < 8 } {incr i} {
set nbusy0 [expr {( 1 << $i )}]
for {set j -1} { $j <= 1 } {incr j} {
set nbusy [expr {$nbusy0 + $j}]
set valc [regbld rbtest::CNTL [list nbusy $nbusy]]
rlc exec \
-wreg te.cntl $valc -estat $esdval $esdmsk\
-wreg te.data 0x0000 statwr -estat $esdval $esdmsknak \
-rreg te.data dummy statrd -estat $esdval $esdmsknak
if {[llength $wrerr] == 0 && [regget rlink::STAT(rbnak) $statwr] != 0} {
lappend wrerr $i $j $nbusy
}
if {[llength $rderr] == 0 && [regget rlink::STAT(rbnak) $statrd] != 0} {
lappend rderr $i $j $nbusy
}
}
}
rlc exec -init te.cntl [regbld rbtest::INIT fifo data cntl]
lappend rbusy $wrerr $rderr
#
# probe stat wiring
#
for {set i 0} { $i < 3 } {incr i} {
set valc [regbld rbtest::CNTL [list stat [expr {1 << $i}]]]
rlc exec -estatdef $esdval $esdmsk \
-wreg te.cntl $valc \
-rreg te.data dummy statrd
lappend rstat [list $i [regget rlink::STAT(stat) $statrd]]
}
rlc exec -init te.cntl [regbld rbtest::INIT fifo data cntl]
#
# probe attn wiring
#
rlc exec -attn
for {set i 0} { $i < 16 } {incr i} {
rlc exec -estatdef $esdval $esdmskatt \
-wreg te.attn [expr {1 << $i}] \
-attn attnpat
lappend rattn [list $i $attnpat]
}
rlc exec -attn
#
return [list $rbusy $rstat $rattn]
}
#
# probe_print: print probe results
#
proc probe_print {{plist {}}} {
set rval {}
 
if {[llength $plist] == 0} {
set plist [probe]
}
 
set rbusy [lindex $plist 0]
set rstat [lindex $plist 1]
set rattn [lindex $plist 2]
#
append rval \
"nbusy: write max [lindex $rbusy 0 2] --> WIDTH=[lindex $rbusy 0 0]"
append rval \
"\nnbusy: read max [lindex $rbusy 1 2] --> WIDTH=[lindex $rbusy 1 0]"
#
for {set i 0} { $i < 3 } {incr i} {
set rcvpat [lindex $rstat $i 1]
set rcvind [print_bitind $rcvpat]
append rval [format "\nstat: te.cntl line %2d --> design %2d %s" \
$i $rcvind [pbvi b3 $rcvpat]]
}
#
for {set i 0} { $i < 16 } {incr i} {
set rcvpat [lindex $rattn $i 1]
set rcvind [print_bitind $rcvpat]
append rval [format "\nattn: te.attn line %2d --> design %2d %s" \
$i $rcvind [pbvi b16 $rcvpat]]
}
return $rval
}
 
#
# print_bitind: helper for probe_print:
#
proc print_bitind {pat} {
for {set i 0} { $i < 16 } {incr i} {
if {[expr {$pat & [expr {1 << $i}] }] } { return $i}
}
return -1
}
}
/test_all.tcl
0,0 → 1,35
# $Id: test_all.tcl 375 2011-04-02 07:56:47Z 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-03-27 374 1.0 Initial version
# 2011-03-13 369 0.1 First draft
#
 
package provide rbtest 1.0
 
namespace eval rbtest {
#
# Driver for all rbtest tests
#
proc test_all {{statmsk 0x0} {attnmsk 0x0}} {
#
set errcnt 0
incr errcnt [rbtest::test_data]
incr errcnt [rbtest::test_fifo]
incr errcnt [rbtest::test_stat $statmsk]
incr errcnt [rbtest::test_attn $attnmsk]
return $errcnt
}
}
/.cvsignore
0,0 → 1,35
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.