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

Subversion Repositories w11

[/] [w11/] [tags/] [w11a_V0.7/] [tools/] [tcl/] [rbtest/] [test_attn.tcl] - Blame information for rev 33

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 30 wfjm
# $Id: test_attn.tcl 661 2015-04-03 18:28:41Z mueller $
2 10 wfjm
#
3 30 wfjm
# Copyright 2011-2015 by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
4 10 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 30 wfjm
# 2015-04-03   661   2.1    drop estatdef (stat err check default now)
17 27 wfjm
# 2014-11-09   603   2.0    use rlink v4 address layout and iface
18 10 wfjm
# 2011-03-27   374   1.0    Initial version
19
# 2011-03-20   372   0.1    First Draft
20
#
21
 
22
package provide rbtest 1.0
23
 
24
package require rutiltpp
25
package require rutil
26
package require rlink
27
 
28
namespace eval rbtest {
29
  #
30
  # Test with stat connectivity of the cntl register.
31
  #
32
  proc test_attn {{attnmsk 0x0}} {
33
    # quit if nothing to do...
34
    if {$attnmsk == 0} {return 0}
35
    #
36
    set apats {}
37
    for {set i 0} {$i < 16} {incr i} {
38 21 wfjm
      set apat [expr {1 << $i}]
39
      if {[expr {$apat & $attnmsk}]} {lappend apats $apat}
40 10 wfjm
    }
41
    #
42
    set errcnt 0
43
    rlc errcnt -clear
44
    #
45
    rlc log "rbtest::test_attn - init: clear regs and attn flags"
46
    rlc exec -init te.cntl [regbld rbtest::INIT cntl data fifo]
47
    rlc exec -attn
48
 
49
    #
50
    #-------------------------------------------------------------------------
51
    rlc log "  test 1: verify connection of attn bits"
52
    foreach apat $apats {
53 30 wfjm
      rlc exec \
54 10 wfjm
        -wreg te.attn $apat \
55 27 wfjm
        -rreg te.cntl -estat [regbld rlink::STAT attn] \
56 10 wfjm
        -attn         -edata $apat \
57 27 wfjm
        -rreg te.cntl -estat 0x0
58 10 wfjm
    }
59
 
60
    #
61
    #-------------------------------------------------------------------------
62
    rlc log "  test 2: verify that attn flags accumulate"
63
    foreach apat $apats {
64 30 wfjm
      rlc exec -wreg te.attn $apat
65 10 wfjm
    }
66 30 wfjm
    rlc exec -attn -edata $attnmsk
67 10 wfjm
 
68
    #
69
    #-------------------------------------------------------------------------
70 27 wfjm
    #rlc log "  test 3: verify that <attn> comma is send"
71
    #set apat [lindex $apats 0]
72
    #rlc exec -init 0xff [regbld rlink::INIT anena] -estat $esdval $esdmsk 
73
    #rlc exec -wreg te.attn $apat -estat $esdval $esdmsk
74
    #rlc wtlam 1.
75
    #rlc exec -attn -edata $apat -estat $esdval $esdmsk
76 10 wfjm
 
77
    #
78
    #-------------------------------------------------------------------------
79
    rlc log "rbtest::test_attn - cleanup: clear regs and attn flags"
80
    rlc exec -init te.cntl [regbld rbtest::INIT cntl data fifo]
81
    rlc exec -attn
82
    #
83
    incr errcnt [rlc errcnt -clear]
84
    return $errcnt
85
  }
86
}

powered by: WebSVN 2.1.0

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