1 |
31 |
wfjm |
# $Id: test_tm11_regs.tcl 683 2015-05-17 21:54:35Z mueller $
|
2 |
|
|
#
|
3 |
|
|
# Copyright 2015- by Walter F.J. Mueller <W.F.J.Mueller@gsi.de>
|
4 |
|
|
# License disclaimer see LICENSE_gpl_v2.txt in $RETROBASE directory
|
5 |
|
|
#
|
6 |
|
|
# Revision History:
|
7 |
|
|
# Date Rev Version Comment
|
8 |
|
|
# 2015-05-17 683 1.0 Initial version
|
9 |
|
|
#
|
10 |
|
|
# Test register response
|
11 |
|
|
# A: register basics
|
12 |
|
|
|
13 |
|
|
# ----------------------------------------------------------------------------
|
14 |
|
|
rlc log "test_tm11_regs: test register response ------------------------------"
|
15 |
|
|
package require ibd_tm11
|
16 |
|
|
ibd_tm11::setup
|
17 |
|
|
|
18 |
|
|
rlc set statmask $rw11::STAT_DEFMASK
|
19 |
|
|
rlc set statvalue 0
|
20 |
|
|
|
21 |
|
|
# -- Section A ---------------------------------------------------------------
|
22 |
|
|
rlc log " A1: test read ---------------------------------------------"
|
23 |
|
|
rlc log " A1.1: loc read sr,...,rl ---------------------------"
|
24 |
|
|
|
25 |
|
|
$cpu cp -rma tma.sr \
|
26 |
|
|
-rma tma.cr \
|
27 |
|
|
-rma tma.bc \
|
28 |
|
|
-rma tma.ba \
|
29 |
|
|
-rma tma.db \
|
30 |
|
|
-rma tma.rl
|
31 |
|
|
|
32 |
|
|
rlc log " A1.2: rem read sr,...,rl ---------------------------"
|
33 |
|
|
|
34 |
|
|
$cpu cp -ribr tma.sr \
|
35 |
|
|
-ribr tma.cr \
|
36 |
|
|
-ribr tma.bc \
|
37 |
|
|
-ribr tma.ba \
|
38 |
|
|
-ribr tma.db \
|
39 |
|
|
-ribr tma.rl
|
40 |
|
|
|
41 |
|
|
rlc log " A1.3: test that rl+2,+4 gives no ack (loc) ---------"
|
42 |
|
|
|
43 |
|
|
set iaddr2 [expr {[cpu0 imap tma.rl] + 2}]
|
44 |
|
|
set iaddr4 [expr {[cpu0 imap tma.rl] + 4}]
|
45 |
|
|
|
46 |
|
|
$cpu cp -ribr $iaddr2 -estaterr \
|
47 |
|
|
-ribr $iaddr4 -estaterr
|
48 |
|
|
|
49 |
|
|
# -- Section B ---------------------------------------------------------------
|
50 |
|
|
rlc log " B1: test sr setup -------------------------------------------------"
|
51 |
|
|
|
52 |
|
|
rlc log " B1.1: rem write via rl -----------------------------"
|
53 |
|
|
# setup units with eof=!u1 eot=!u0 onl=1 bot=u0 wrl=u1
|
54 |
|
|
set rsr0 [regbld ibd_tm11::RRL {eof 1} {eot 1} {onl 1} {bot 0} {wrl 0} {unit 0}]
|
55 |
|
|
set rsr1 [regbld ibd_tm11::RRL {eof 1} {eot 0} {onl 1} {bot 1} {wrl 0} {unit 1}]
|
56 |
|
|
set rsr2 [regbld ibd_tm11::RRL {eof 0} {eot 1} {onl 1} {bot 0} {wrl 1} {unit 2}]
|
57 |
|
|
set rsr3 [regbld ibd_tm11::RRL {eof 0} {eot 0} {onl 1} {bot 1} {wrl 1} {unit 3}]
|
58 |
|
|
# on readback SR has tur=1
|
59 |
|
|
set sr0 [regbld ibd_tm11::SR {eof 1} {eot 1} {onl 1} {bot 0} {wrl 0} {tur 1}]
|
60 |
|
|
set sr1 [regbld ibd_tm11::SR {eof 1} {eot 0} {onl 1} {bot 1} {wrl 0} {tur 1}]
|
61 |
|
|
set sr2 [regbld ibd_tm11::SR {eof 0} {eot 1} {onl 1} {bot 0} {wrl 1} {tur 1}]
|
62 |
|
|
set sr3 [regbld ibd_tm11::SR {eof 0} {eot 0} {onl 1} {bot 1} {wrl 1} {tur 1}]
|
63 |
|
|
set sr7 [regbld ibd_tm11::SR {tur 1}]
|
64 |
|
|
|
65 |
|
|
$cpu cp -wibr "tma.cr" [ibd_tm11::rcr_wunit 0] \
|
66 |
|
|
-wibr "tma.rl" $rsr0 \
|
67 |
|
|
-wibr "tma.cr" [ibd_tm11::rcr_wunit 1] \
|
68 |
|
|
-wibr "tma.rl" $rsr1 \
|
69 |
|
|
-wibr "tma.cr" [ibd_tm11::rcr_wunit 2] \
|
70 |
|
|
-wibr "tma.rl" $rsr2 \
|
71 |
|
|
-wibr "tma.cr" [ibd_tm11::rcr_wunit 3] \
|
72 |
|
|
-wibr "tma.rl" $rsr3
|
73 |
|
|
|
74 |
|
|
rlc log " B1.2: rem read via rl ------------------------------"
|
75 |
|
|
|
76 |
|
|
$cpu cp -wibr "tma.cr" [ibd_tm11::rcr_wunit 0] \
|
77 |
|
|
-ribr "tma.rl" -edata $rsr0 \
|
78 |
|
|
-wibr "tma.cr" [ibd_tm11::rcr_wunit 1] \
|
79 |
|
|
-ribr "tma.rl" -edata $rsr1 \
|
80 |
|
|
-wibr "tma.cr" [ibd_tm11::rcr_wunit 2] \
|
81 |
|
|
-ribr "tma.rl" -edata $rsr2 \
|
82 |
|
|
-wibr "tma.cr" [ibd_tm11::rcr_wunit 3] \
|
83 |
|
|
-ribr "tma.rl" -edata $rsr3
|
84 |
|
|
|
85 |
|
|
rlc log " B1.3: loc read via sr ------------------------------"
|
86 |
|
|
|
87 |
|
|
$cpu cp -wma "tma.cr" [regbld ibd_tm11::CR {unit 0}]\
|
88 |
|
|
-rma "tma.sr" -edata $sr0 \
|
89 |
|
|
-wma "tma.cr" [regbld ibd_tm11::CR {unit 1}]\
|
90 |
|
|
-rma "tma.sr" -edata $sr1 \
|
91 |
|
|
-wma "tma.cr" [regbld ibd_tm11::CR {unit 2}]\
|
92 |
|
|
-rma "tma.sr" -edata $sr2 \
|
93 |
|
|
-wma "tma.cr" [regbld ibd_tm11::CR {unit 3}]\
|
94 |
|
|
-rma "tma.sr" -edata $sr3
|
95 |
|
|
|
96 |
|
|
rlc log " B1.4: ensure unit 4,..,7 signal offline ------------"
|
97 |
|
|
|
98 |
|
|
$cpu cp -wma "tma.cr" [regbld ibd_tm11::CR {unit 4}]\
|
99 |
|
|
-rma "tma.sr" -edata $sr7 \
|
100 |
|
|
-wma "tma.cr" [regbld ibd_tm11::CR {unit 5}]\
|
101 |
|
|
-rma "tma.sr" -edata $sr7 \
|
102 |
|
|
-wma "tma.cr" [regbld ibd_tm11::CR {unit 6}]\
|
103 |
|
|
-rma "tma.sr" -edata $sr7 \
|
104 |
|
|
-wma "tma.cr" [regbld ibd_tm11::CR {unit 7}]\
|
105 |
|
|
-rma "tma.sr" -edata $sr7
|
106 |
|
|
|
107 |
|
|
rlc log " B1.5: setup unit 0:3 as onl=1 bot=1 ----------------"
|
108 |
|
|
|
109 |
|
|
# use use ONL=1 BOT=1 for all units -> no error flags
|
110 |
|
|
set rsr0 [regbld ibd_tm11::RRL {onl 1} {bot 1} {unit 0}]
|
111 |
|
|
set rsr1 [regbld ibd_tm11::RRL {onl 1} {bot 1} {unit 1}]
|
112 |
|
|
set rsr2 [regbld ibd_tm11::RRL {onl 1} {bot 1} {unit 2}]
|
113 |
|
|
set rsr3 [regbld ibd_tm11::RRL {onl 1} {bot 1} {unit 3}]
|
114 |
|
|
# on readback SR has tur=1
|
115 |
|
|
set sr0 [regbld ibd_tm11::SR {onl 1} {bot 1} {tur 1}]
|
116 |
|
|
set sr1 [regbld ibd_tm11::SR {onl 1} {bot 1} {tur 1}]
|
117 |
|
|
set sr2 [regbld ibd_tm11::SR {onl 1} {bot 1} {tur 1}]
|
118 |
|
|
set sr3 [regbld ibd_tm11::SR {onl 1} {bot 1} {tur 1}]
|
119 |
|
|
$cpu cp -wibr "tma.cr" [ibd_tm11::rcr_wunit 0] \
|
120 |
|
|
-wibr "tma.rl" $rsr0 \
|
121 |
|
|
-wibr "tma.cr" [ibd_tm11::rcr_wunit 1] \
|
122 |
|
|
-wibr "tma.rl" $rsr1 \
|
123 |
|
|
-wibr "tma.cr" [ibd_tm11::rcr_wunit 2] \
|
124 |
|
|
-wibr "tma.rl" $rsr2 \
|
125 |
|
|
-wibr "tma.cr" [ibd_tm11::rcr_wunit 3] \
|
126 |
|
|
-wibr "tma.rl" $rsr3
|
127 |
|
|
|
128 |
|
|
rlc log " B2.1: loc write loc/rem read of cr -----------------"
|
129 |
|
|
# test all cr fields except ie and go (no interrupts and functions yet)
|
130 |
|
|
set crlist [list \
|
131 |
|
|
[regbld ibd_tm11::CR {den 0} {pevn 0} {unit 0} {ea 0} {func 0}] \
|
132 |
|
|
[regbld ibd_tm11::CR {den 3} {pevn 0} {unit 0} {ea 0} {func 0}] \
|
133 |
|
|
[regbld ibd_tm11::CR {den 3} {pevn 1} {unit 0} {ea 0} {func 0}] \
|
134 |
|
|
[regbld ibd_tm11::CR {den 3} {pevn 1} {unit 7} {ea 0} {func 0}] \
|
135 |
|
|
[regbld ibd_tm11::CR {den 3} {pevn 1} {unit 3} {ea 3} {func 0}] \
|
136 |
|
|
[regbld ibd_tm11::CR {den 3} {pevn 1} {unit 3} {ea 3} {func 7}] \
|
137 |
|
|
]
|
138 |
|
|
|
139 |
|
|
foreach cr $crlist {
|
140 |
|
|
# on cr read here always rdy=1
|
141 |
|
|
set crread [expr {$cr | [regbld ibd_tm11::CR {rdy 1}] } ]
|
142 |
|
|
$cpu cp -wma "tma.cr" $cr \
|
143 |
|
|
-rma "tma.cr" -edata $crread \
|
144 |
|
|
-ribr "tma.cr" -edata $crread
|
145 |
|
|
}
|
146 |
|
|
|
147 |
|
|
rlc log " B3.1: loc write loc/rem read for bc,ba -------------"
|
148 |
|
|
# Note: ba ignores bit 0, only word addresses
|
149 |
|
|
$cpu cp -wma "tma.bc" 0x0010 \
|
150 |
|
|
-wma "tma.ba" 0x0020 \
|
151 |
|
|
-rma "tma.bc" -edata 0x0010 \
|
152 |
|
|
-rma "tma.ba" -edata 0x0020 \
|
153 |
|
|
-ribr "tma.bc" -edata 0x0010 \
|
154 |
|
|
-ribr "tma.ba" -edata 0x0020
|
155 |
|
|
$cpu cp -wma "tma.bc" 0x8888 \
|
156 |
|
|
-wma "tma.ba" 0x7777 \
|
157 |
|
|
-rma "tma.bc" -edata 0x8888 \
|
158 |
|
|
-rma "tma.ba" -edata 0x7776 \
|
159 |
|
|
-ribr "tma.bc" -edata 0x8888 \
|
160 |
|
|
-ribr "tma.ba" -edata 0x7776
|
161 |
|
|
|
162 |
|
|
rlc log " B3.2: rem write loc/rem read for bc,ba -------------"
|
163 |
|
|
|
164 |
|
|
$cpu cp -wibr "tma.bc" 0x1234 \
|
165 |
|
|
-wibr "tma.ba" 0x4321 \
|
166 |
|
|
-rma "tma.bc" -edata 0x1234 \
|
167 |
|
|
-rma "tma.ba" -edata 0x4320 \
|
168 |
|
|
-ribr "tma.bc" -edata 0x1234 \
|
169 |
|
|
-ribr "tma.ba" -edata 0x4320
|
170 |
|
|
$cpu cp -wibr "tma.bc" 0x0000 \
|
171 |
|
|
-wibr "tma.ba" 0x0000 \
|
172 |
|
|
-rma "tma.bc" -edata 0x0000 \
|
173 |
|
|
-rma "tma.ba" -edata 0x0000 \
|
174 |
|
|
-ribr "tma.bc" -edata 0x0000 \
|
175 |
|
|
-ribr "tma.ba" -edata 0x0000
|