1 |
3 |
uson |
// ********************************************************************
|
2 |
|
|
// Actel Corporation Proprietary and Confidential
|
3 |
|
|
// Copyright 2010 Actel Corporation. All rights reserved.
|
4 |
|
|
//
|
5 |
|
|
// ANY USE OR REDISTRIBUTION IN PART OR IN WHOLE MUST BE HANDLED IN
|
6 |
|
|
// ACCORDANCE WITH THE ACTEL LICENSE AGREEMENT AND MUST BE APPROVED
|
7 |
|
|
// IN ADVANCE IN WRITING.
|
8 |
|
|
//
|
9 |
|
|
// Description: User testbench AHBLite master 0 BFM script for CoreAHBLite
|
10 |
|
|
//
|
11 |
|
|
// Revision Information:
|
12 |
|
|
// Date Description
|
13 |
|
|
// 10Feb10 Production Release Version 3.1
|
14 |
|
|
//
|
15 |
|
|
// SVN Revision Information:
|
16 |
|
|
// SVN $Revision: 21348 $
|
17 |
|
|
// SVN $Date: 2013-10-23 20:30:39 +0530 (Wed, 23 Oct 2013) $
|
18 |
|
|
//
|
19 |
|
|
// Resolved SARs
|
20 |
|
|
// SAR Date Who Description
|
21 |
|
|
//
|
22 |
|
|
// Notes:
|
23 |
|
|
// 1. best viewed with tabstops set to "4"
|
24 |
|
|
// 2. Most of the behavior is driven from the BFM script for the AHBLite master.
|
25 |
|
|
// Consult the Actel AMBA BFM documentation for more information.
|
26 |
|
|
// 3. All procedures, variables, and constants used by the 'main' procedure
|
27 |
|
|
// are declared in the include file "coreahblite_usertb_include.bfm"
|
28 |
|
|
//
|
29 |
|
|
// History: 11/05/08 - TFB created
|
30 |
|
|
//
|
31 |
|
|
// *********************************************************************
|
32 |
|
|
|
33 |
|
|
// include constants, and miscellaneous procedures used in this main file
|
34 |
|
|
include "coreahblite_usertb_include.bfm"
|
35 |
|
|
|
36 |
|
|
procedure main
|
37 |
|
|
int i
|
38 |
|
|
int j
|
39 |
|
|
int k
|
40 |
|
|
int dtmp[4]
|
41 |
|
|
int atmp
|
42 |
|
|
int slot_incr
|
43 |
|
|
|
44 |
|
|
int M0_S0_IN_COMBINED
|
45 |
|
|
int M0_S1_IN_COMBINED
|
46 |
|
|
int M0_S2_IN_COMBINED
|
47 |
|
|
int M0_S3_IN_COMBINED
|
48 |
|
|
int M0_S4_IN_COMBINED
|
49 |
|
|
int M0_S5_IN_COMBINED
|
50 |
|
|
int M0_S6_IN_COMBINED
|
51 |
|
|
int M0_S7_IN_COMBINED
|
52 |
|
|
int M0_S8_IN_COMBINED
|
53 |
|
|
int M0_S9_IN_COMBINED
|
54 |
|
|
int M0_S10_IN_COMBINED
|
55 |
|
|
int M0_S11_IN_COMBINED
|
56 |
|
|
int M0_S12_IN_COMBINED
|
57 |
|
|
int M0_S13_IN_COMBINED
|
58 |
|
|
int M0_S14_IN_COMBINED
|
59 |
|
|
int M0_S15_IN_COMBINED
|
60 |
|
|
|
61 |
|
|
int M0_S0_ACTIVE
|
62 |
|
|
int M0_S1_ACTIVE
|
63 |
|
|
int M0_S2_ACTIVE
|
64 |
|
|
int M0_S3_ACTIVE
|
65 |
|
|
int M0_S4_ACTIVE
|
66 |
|
|
int M0_S5_ACTIVE
|
67 |
|
|
int M0_S6_ACTIVE
|
68 |
|
|
int M0_S7_ACTIVE
|
69 |
|
|
int M0_S8_ACTIVE
|
70 |
|
|
int M0_S9_ACTIVE
|
71 |
|
|
int M0_S10_ACTIVE
|
72 |
|
|
int M0_S11_ACTIVE
|
73 |
|
|
int M0_S12_ACTIVE
|
74 |
|
|
int M0_S13_ACTIVE
|
75 |
|
|
int M0_S14_ACTIVE
|
76 |
|
|
int M0_S15_ACTIVE
|
77 |
|
|
|
78 |
|
|
header "User Testbench for CoreAHBLite: BFM AHBLite Master 0 Test Harness"
|
79 |
|
|
print "(c) Copyright 2010 Actel Corporation. All rights reserved."
|
80 |
|
|
call pr_underscores
|
81 |
|
|
|
82 |
|
|
debug 1 // only text strings printed
|
83 |
|
|
timeout 2000 // timeout in cycles, in case BFM stalls
|
84 |
|
|
wait 1
|
85 |
|
|
|
86 |
|
|
// initialize local variables passed from testbench HDL to the
|
87 |
|
|
// ARGVALUE* BFM parameters
|
88 |
|
|
call init_parameter_vars
|
89 |
|
|
|
90 |
|
|
wait 2
|
91 |
|
|
|
92 |
|
|
# Set slot increment based on MEMSPACE parameter
|
93 |
|
|
if MEMSPACE == 0
|
94 |
|
|
call pr_underscores
|
95 |
|
|
print "Master 0, memory space: 16 64KB slave slots, one huge slave slot, testing beginning at: %0d ns." $TIME
|
96 |
|
|
call pr_underscores
|
97 |
|
|
set slot_incr 0x00010000;
|
98 |
|
|
endif
|
99 |
|
|
if MEMSPACE == 1
|
100 |
|
|
call pr_underscores
|
101 |
|
|
print "Master 0, memory space = 4GB, 16 256MB slave slots, testing beginning at: %0d ns." $TIME
|
102 |
|
|
call pr_underscores
|
103 |
|
|
set slot_incr 0x10000000;
|
104 |
|
|
endif
|
105 |
|
|
if MEMSPACE == 2
|
106 |
|
|
call pr_underscores
|
107 |
|
|
print "Master 0, memory space = 256MB, 16 16MB slave slots, testing beginning at: %0d ns." $TIME
|
108 |
|
|
call pr_underscores
|
109 |
|
|
set slot_incr 0x01000000;
|
110 |
|
|
endif
|
111 |
|
|
if MEMSPACE == 3
|
112 |
|
|
call pr_underscores
|
113 |
|
|
print "Master 0, memory space = 16MB, 16 1MB slave slots, testing beginning at: %0d ns." $TIME
|
114 |
|
|
call pr_underscores
|
115 |
|
|
set slot_incr 0x00100000;
|
116 |
|
|
endif
|
117 |
|
|
if MEMSPACE == 4
|
118 |
|
|
call pr_underscores
|
119 |
|
|
print "Master 0, memory space = 1MB, 16 64KB slave slots, testing beginning at: %0d ns." $TIME
|
120 |
|
|
call pr_underscores
|
121 |
|
|
set slot_incr 0x00010000;
|
122 |
|
|
endif
|
123 |
|
|
if MEMSPACE == 5
|
124 |
|
|
call pr_underscores
|
125 |
|
|
print "Master 0, memory space = 64KB, 16 4KB slave slots, testing beginning at: %0d ns." $TIME
|
126 |
|
|
call pr_underscores
|
127 |
|
|
set slot_incr 0x00001000;
|
128 |
|
|
endif
|
129 |
|
|
if MEMSPACE == 6
|
130 |
|
|
call pr_underscores
|
131 |
|
|
print "Master 0, memory space = 4KB, 16 256B slave slots, testing beginning at: %0d ns." $TIME
|
132 |
|
|
call pr_underscores
|
133 |
|
|
set slot_incr 0x00000100;
|
134 |
|
|
endif
|
135 |
|
|
|
136 |
|
|
//=========================================================================
|
137 |
|
|
# Test byte/halfword/word writes and reads for all enabled slots
|
138 |
|
|
loop i 0 15 1
|
139 |
|
|
if SC[i] == 0
|
140 |
|
|
if M0_AHBSLOTENABLE[i]
|
141 |
|
|
call pr_underscores
|
142 |
|
|
print "Master 0 testing AHBLite slot:%0d at: %0d ns." i $TIME
|
143 |
|
|
call pr_underscores
|
144 |
|
|
// write/read 32-bit word
|
145 |
|
|
set atmp i * slot_incr + 0x0
|
146 |
|
|
set dtmp[0] 0x12345678
|
147 |
|
|
print "Master 0 writes:%08x to AHBLite slave:%0d at: %0d ns." dtmp[0] i $TIME
|
148 |
|
|
write w BASE atmp dtmp[0]
|
149 |
|
|
print "Master 0 verifying (reading):%08x from AHBLite slave:%0d at: %0d ns." dtmp[0] i $TIME
|
150 |
|
|
readcheck w BASE atmp dtmp[0]
|
151 |
|
|
wait 8
|
152 |
|
|
// write/read 16-bit halfwords
|
153 |
|
|
set dtmp[0] 0xdead
|
154 |
|
|
set dtmp[1] 0xbeef
|
155 |
|
|
loop j 0 1 1
|
156 |
|
|
set k j * 2
|
157 |
|
|
set atmp i * slot_incr + k
|
158 |
|
|
print "Master 0 writes:%04x to AHBLite slave:%0d at: %0d ns." dtmp[j] i $TIME
|
159 |
|
|
write h BASE atmp dtmp[j]
|
160 |
|
|
endloop
|
161 |
|
|
loop j 0 1 1
|
162 |
|
|
set k j * 2
|
163 |
|
|
set atmp i * slot_incr + k
|
164 |
|
|
print "Master 0 verifying (reading):%04x from AHBLite slave:%0d at: %0d ns." dtmp[j] i $TIME
|
165 |
|
|
readcheck h BASE atmp dtmp[j]
|
166 |
|
|
endloop
|
167 |
|
|
wait 8
|
168 |
|
|
// write/read 8-bit bytes
|
169 |
|
|
set dtmp[0] 0x9a
|
170 |
|
|
set dtmp[1] 0x56
|
171 |
|
|
set dtmp[2] 0x34
|
172 |
|
|
set dtmp[3] 0x12
|
173 |
|
|
loop j 0 3 1
|
174 |
|
|
set k j * 1
|
175 |
|
|
set atmp i * slot_incr + k
|
176 |
|
|
print "Master 0 writes:%02x to AHBLite slave:%0d at: %0d ns." dtmp[j] i $TIME
|
177 |
|
|
write b BASE atmp dtmp[j]
|
178 |
|
|
endloop
|
179 |
|
|
loop j 0 3 1
|
180 |
|
|
set k j * 1
|
181 |
|
|
set atmp i * slot_incr + k
|
182 |
|
|
print "Master 0 verifying (reading):%02x from AHBLite slave:%0d at: %0d ns." dtmp[j] i $TIME
|
183 |
|
|
readcheck b BASE atmp dtmp[j]
|
184 |
|
|
endloop
|
185 |
|
|
wait 8
|
186 |
|
|
// write/read 32-bit word 0xaaaaaaaa
|
187 |
|
|
set atmp i * slot_incr + 0x0
|
188 |
|
|
set dtmp[0] 0xaaaaaaaa
|
189 |
|
|
print "Master 0 writes:%08x to AHBLite slave:%0d at: %0d ns." dtmp[0] i $TIME
|
190 |
|
|
write w BASE atmp dtmp[0]
|
191 |
|
|
print "Master 0 verifying (reading):%08x from AHBLite slave:%0d at: %0d ns." dtmp[0] i $TIME
|
192 |
|
|
readcheck w BASE atmp dtmp[0]
|
193 |
|
|
wait 8
|
194 |
|
|
// write/read 32-bit word 0x55555555
|
195 |
|
|
set atmp i * slot_incr + 0x0
|
196 |
|
|
set dtmp[0] 0x55555555
|
197 |
|
|
print "Master 0 writes:%08x to AHBLite slave:%0d at: %0d ns." dtmp[0] i $TIME
|
198 |
|
|
write w BASE atmp dtmp[0]
|
199 |
|
|
print "Master 0 verifying (reading):%08x from AHBLite slave:%0d at: %0d ns." dtmp[0] i $TIME
|
200 |
|
|
readcheck w BASE atmp dtmp[0]
|
201 |
|
|
wait 8
|
202 |
|
|
print "Master 0 done testing AHBLite slot:%0d at: %0d ns." i $TIME
|
203 |
|
|
call pr_underscores
|
204 |
|
|
else
|
205 |
|
|
call pr_underscores
|
206 |
|
|
print "Master 0 skipping test of AHBLite slot:%0d at: %0d ns." i $TIME
|
207 |
|
|
call pr_underscores
|
208 |
|
|
endif
|
209 |
|
|
else
|
210 |
|
|
call pr_underscores
|
211 |
|
|
print "Master 0 skipping test of AHBLite slot:%0d at: %0d ns." i $TIME
|
212 |
|
|
call pr_underscores
|
213 |
|
|
endif
|
214 |
|
|
// wait here between loops
|
215 |
|
|
endloop
|
216 |
|
|
//=========================================================================
|
217 |
|
|
|
218 |
|
|
# Wait until other masters have finished
|
219 |
|
|
iowaitbit 24 1
|
220 |
|
|
iowaitbit 25 1
|
221 |
|
|
iowaitbit 26 1
|
222 |
|
|
|
223 |
|
|
# Clear write indication bits for all slaves
|
224 |
|
|
iowrite 0x0001ffff
|
225 |
|
|
iowrite 0x00000000
|
226 |
|
|
# Check that bits are clear
|
227 |
|
|
iomask 0x00000000 0x0001ffff
|
228 |
|
|
|
229 |
|
|
# If MEMSPACE = 0, check access to huge slot
|
230 |
|
|
if MEMSPACE == 0
|
231 |
|
|
if M0_AHBSLOT16ENABLE == 1
|
232 |
|
|
print "Master 0 checking access to huge slot."
|
233 |
|
|
set atmp 0x00000000
|
234 |
|
|
set dtmp 0x11223344
|
235 |
|
|
write w 0x80000000 atmp dtmp
|
236 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
237 |
|
|
readcheck w 0x80000000 atmp dtmp
|
238 |
|
|
# Check that an access to slave 16 has occurred
|
239 |
|
|
iomask 0x00010000 0x0001ffff
|
240 |
|
|
print "Write to slave 16 detected."
|
241 |
|
|
# Clear slave 16 access indication
|
242 |
|
|
iosetbit 16
|
243 |
|
|
ioclrbit 16
|
244 |
|
|
iotstbit 16 0
|
245 |
|
|
endif
|
246 |
|
|
endif
|
247 |
|
|
|
248 |
|
|
set M0_S0_IN_COMBINED M0_AHBSLOT16ENABLE and SC_0
|
249 |
|
|
set M0_S1_IN_COMBINED M0_AHBSLOT16ENABLE and SC_1
|
250 |
|
|
set M0_S2_IN_COMBINED M0_AHBSLOT16ENABLE and SC_2
|
251 |
|
|
set M0_S3_IN_COMBINED M0_AHBSLOT16ENABLE and SC_3
|
252 |
|
|
set M0_S4_IN_COMBINED M0_AHBSLOT16ENABLE and SC_4
|
253 |
|
|
set M0_S5_IN_COMBINED M0_AHBSLOT16ENABLE and SC_5
|
254 |
|
|
set M0_S6_IN_COMBINED M0_AHBSLOT16ENABLE and SC_6
|
255 |
|
|
set M0_S7_IN_COMBINED M0_AHBSLOT16ENABLE and SC_7
|
256 |
|
|
set M0_S8_IN_COMBINED M0_AHBSLOT16ENABLE and SC_8
|
257 |
|
|
set M0_S9_IN_COMBINED M0_AHBSLOT16ENABLE and SC_9
|
258 |
|
|
set M0_S10_IN_COMBINED M0_AHBSLOT16ENABLE and SC_10
|
259 |
|
|
set M0_S11_IN_COMBINED M0_AHBSLOT16ENABLE and SC_11
|
260 |
|
|
set M0_S12_IN_COMBINED M0_AHBSLOT16ENABLE and SC_12
|
261 |
|
|
set M0_S13_IN_COMBINED M0_AHBSLOT16ENABLE and SC_13
|
262 |
|
|
set M0_S14_IN_COMBINED M0_AHBSLOT16ENABLE and SC_14
|
263 |
|
|
set M0_S15_IN_COMBINED M0_AHBSLOT16ENABLE and SC_15
|
264 |
|
|
|
265 |
|
|
set M0_S0_ACTIVE M0_AHBSLOT0ENABLE or M0_S0_IN_COMBINED
|
266 |
|
|
set M0_S1_ACTIVE M0_AHBSLOT1ENABLE or M0_S1_IN_COMBINED
|
267 |
|
|
set M0_S2_ACTIVE M0_AHBSLOT2ENABLE or M0_S2_IN_COMBINED
|
268 |
|
|
set M0_S3_ACTIVE M0_AHBSLOT3ENABLE or M0_S3_IN_COMBINED
|
269 |
|
|
set M0_S4_ACTIVE M0_AHBSLOT4ENABLE or M0_S4_IN_COMBINED
|
270 |
|
|
set M0_S5_ACTIVE M0_AHBSLOT5ENABLE or M0_S5_IN_COMBINED
|
271 |
|
|
set M0_S6_ACTIVE M0_AHBSLOT6ENABLE or M0_S6_IN_COMBINED
|
272 |
|
|
set M0_S7_ACTIVE M0_AHBSLOT7ENABLE or M0_S7_IN_COMBINED
|
273 |
|
|
set M0_S8_ACTIVE M0_AHBSLOT8ENABLE or M0_S8_IN_COMBINED
|
274 |
|
|
set M0_S9_ACTIVE M0_AHBSLOT9ENABLE or M0_S9_IN_COMBINED
|
275 |
|
|
set M0_S10_ACTIVE M0_AHBSLOT10ENABLE or M0_S10_IN_COMBINED
|
276 |
|
|
set M0_S11_ACTIVE M0_AHBSLOT11ENABLE or M0_S11_IN_COMBINED
|
277 |
|
|
set M0_S12_ACTIVE M0_AHBSLOT12ENABLE or M0_S12_IN_COMBINED
|
278 |
|
|
set M0_S13_ACTIVE M0_AHBSLOT13ENABLE or M0_S13_IN_COMBINED
|
279 |
|
|
set M0_S14_ACTIVE M0_AHBSLOT14ENABLE or M0_S14_IN_COMBINED
|
280 |
|
|
set M0_S15_ACTIVE M0_AHBSLOT15ENABLE or M0_S15_IN_COMBINED
|
281 |
|
|
|
282 |
|
|
# If MEMSPACE != 0, check access to combined region
|
283 |
|
|
if MEMSPACE != 0
|
284 |
|
|
# Slot 0
|
285 |
|
|
if M0_S0_ACTIVE
|
286 |
|
|
set atmp 0 * slot_incr
|
287 |
|
|
set dtmp 0xaabbccdd
|
288 |
|
|
write w BASE atmp dtmp
|
289 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
290 |
|
|
readcheck w BASE atmp dtmp
|
291 |
|
|
if SC_0 == 1
|
292 |
|
|
print "Slot 0 assigned to combined region."
|
293 |
|
|
# Check that an access to slave 16 has occurred
|
294 |
|
|
iomask 0x00010000 0x0001ffff
|
295 |
|
|
print "Write to slave 16 detected."
|
296 |
|
|
# Clear slave 16 access indication
|
297 |
|
|
iosetbit 16
|
298 |
|
|
ioclrbit 16
|
299 |
|
|
iotstbit 16 0
|
300 |
|
|
else
|
301 |
|
|
if M0_AHBSLOT0ENABLE == 1
|
302 |
|
|
# Check that an access to slave 0 has occurred
|
303 |
|
|
iomask 0x00000001 0x0001ffff
|
304 |
|
|
print "Write to slave 0 detected."
|
305 |
|
|
# Clear slave 0 access indication
|
306 |
|
|
iosetbit 0
|
307 |
|
|
ioclrbit 0
|
308 |
|
|
iotstbit 0 0
|
309 |
|
|
endif
|
310 |
|
|
endif
|
311 |
|
|
endif
|
312 |
|
|
|
313 |
|
|
# Slot 1
|
314 |
|
|
if M0_S1_ACTIVE
|
315 |
|
|
set atmp 1 * slot_incr
|
316 |
|
|
set dtmp 0xaabbccdd
|
317 |
|
|
write w BASE atmp dtmp
|
318 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
319 |
|
|
readcheck w BASE atmp dtmp
|
320 |
|
|
if SC_1 == 1
|
321 |
|
|
print "Slot 1 assigned to combined region."
|
322 |
|
|
# Check that an access to slave 16 has occurred
|
323 |
|
|
iomask 0x00010000 0x0001ffff
|
324 |
|
|
print "Write to slave 16 detected."
|
325 |
|
|
# Clear slave 16 access indication
|
326 |
|
|
iosetbit 16
|
327 |
|
|
ioclrbit 16
|
328 |
|
|
iotstbit 16 0
|
329 |
|
|
else
|
330 |
|
|
if M0_AHBSLOT1ENABLE == 1
|
331 |
|
|
# Check that an access to slave 1 has occurred
|
332 |
|
|
iomask 0x00000002 0x0001ffff
|
333 |
|
|
print "Write to slave 1 detected."
|
334 |
|
|
# Clear slave 1 access indication
|
335 |
|
|
iosetbit 1
|
336 |
|
|
ioclrbit 1
|
337 |
|
|
iotstbit 1 0
|
338 |
|
|
endif
|
339 |
|
|
endif
|
340 |
|
|
endif
|
341 |
|
|
|
342 |
|
|
# Slot 2
|
343 |
|
|
if M0_S2_ACTIVE
|
344 |
|
|
set atmp 2 * slot_incr
|
345 |
|
|
set dtmp 0xaabbccdd
|
346 |
|
|
write w BASE atmp dtmp
|
347 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
348 |
|
|
readcheck w BASE atmp dtmp
|
349 |
|
|
if SC_2 == 1
|
350 |
|
|
print "Slot 2 assigned to combined region."
|
351 |
|
|
# Check that an access to slave 16 has occurred
|
352 |
|
|
iomask 0x00010000 0x0001ffff
|
353 |
|
|
print "Write to slave 16 detected."
|
354 |
|
|
# Clear slave 16 access indication
|
355 |
|
|
iosetbit 16
|
356 |
|
|
ioclrbit 16
|
357 |
|
|
iotstbit 16 0
|
358 |
|
|
else
|
359 |
|
|
if M0_AHBSLOT2ENABLE == 1
|
360 |
|
|
# Check that an access to slave 2 has occurred
|
361 |
|
|
iomask 0x00000004 0x0001ffff
|
362 |
|
|
print "Write to slave 2 detected."
|
363 |
|
|
# Clear slave 2 access indication
|
364 |
|
|
iosetbit 2
|
365 |
|
|
ioclrbit 2
|
366 |
|
|
iotstbit 2 0
|
367 |
|
|
endif
|
368 |
|
|
endif
|
369 |
|
|
endif
|
370 |
|
|
|
371 |
|
|
# Slot 3
|
372 |
|
|
if M0_S3_ACTIVE
|
373 |
|
|
set atmp 3 * slot_incr
|
374 |
|
|
set dtmp 0xaabbccdd
|
375 |
|
|
write w BASE atmp dtmp
|
376 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
377 |
|
|
readcheck w BASE atmp dtmp
|
378 |
|
|
if SC_3 == 1
|
379 |
|
|
print "Slot 3 assigned to combined region."
|
380 |
|
|
# Check that an access to slave 16 has occurred
|
381 |
|
|
iomask 0x00010000 0x0001ffff
|
382 |
|
|
print "Write to slave 16 detected."
|
383 |
|
|
# Clear slave 16 access indication
|
384 |
|
|
iosetbit 16
|
385 |
|
|
ioclrbit 16
|
386 |
|
|
iotstbit 16 0
|
387 |
|
|
else
|
388 |
|
|
if M0_AHBSLOT3ENABLE == 1
|
389 |
|
|
# Check that an access to slave 3 has occurred
|
390 |
|
|
iomask 0x00000008 0x0001ffff
|
391 |
|
|
print "Write to slave 3 detected."
|
392 |
|
|
# Clear slave 3 access indication
|
393 |
|
|
iosetbit 3
|
394 |
|
|
ioclrbit 3
|
395 |
|
|
iotstbit 3 0
|
396 |
|
|
endif
|
397 |
|
|
endif
|
398 |
|
|
endif
|
399 |
|
|
|
400 |
|
|
# Slot 4
|
401 |
|
|
if M0_S4_ACTIVE
|
402 |
|
|
set atmp 4 * slot_incr
|
403 |
|
|
set dtmp 0xaabbccdd
|
404 |
|
|
write w BASE atmp dtmp
|
405 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
406 |
|
|
readcheck w BASE atmp dtmp
|
407 |
|
|
if SC_4 == 1
|
408 |
|
|
print "Slot 4 assigned to combined region."
|
409 |
|
|
# Check that an access to slave 16 has occurred
|
410 |
|
|
iomask 0x00010000 0x0001ffff
|
411 |
|
|
print "Write to slave 16 detected."
|
412 |
|
|
# Clear slave 16 access indication
|
413 |
|
|
iosetbit 16
|
414 |
|
|
ioclrbit 16
|
415 |
|
|
iotstbit 16 0
|
416 |
|
|
else
|
417 |
|
|
if M0_AHBSLOT4ENABLE == 1
|
418 |
|
|
# Check that an access to slave 4 has occurred
|
419 |
|
|
iomask 0x00000010 0x0001ffff
|
420 |
|
|
print "Write to slave 4 detected."
|
421 |
|
|
# Clear slave 4 access indication
|
422 |
|
|
iosetbit 4
|
423 |
|
|
ioclrbit 4
|
424 |
|
|
iotstbit 4 0
|
425 |
|
|
endif
|
426 |
|
|
endif
|
427 |
|
|
endif
|
428 |
|
|
|
429 |
|
|
# Slot 5
|
430 |
|
|
if M0_S5_ACTIVE
|
431 |
|
|
set atmp 5 * slot_incr
|
432 |
|
|
set dtmp 0xaabbccdd
|
433 |
|
|
write w BASE atmp dtmp
|
434 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
435 |
|
|
readcheck w BASE atmp dtmp
|
436 |
|
|
if SC_5 == 1
|
437 |
|
|
print "Slot 5 assigned to combined region."
|
438 |
|
|
# Check that an access to slave 16 has occurred
|
439 |
|
|
iomask 0x00010000 0x0001ffff
|
440 |
|
|
print "Write to slave 16 detected."
|
441 |
|
|
# Clear slave 16 access indication
|
442 |
|
|
iosetbit 16
|
443 |
|
|
ioclrbit 16
|
444 |
|
|
iotstbit 16 0
|
445 |
|
|
else
|
446 |
|
|
if M0_AHBSLOT5ENABLE == 1
|
447 |
|
|
# Check that an access to slave 5 has occurred
|
448 |
|
|
iomask 0x00000020 0x0001ffff
|
449 |
|
|
print "Write to slave 5 detected."
|
450 |
|
|
# Clear slave 5 access indication
|
451 |
|
|
iosetbit 5
|
452 |
|
|
ioclrbit 5
|
453 |
|
|
iotstbit 5 0
|
454 |
|
|
endif
|
455 |
|
|
endif
|
456 |
|
|
endif
|
457 |
|
|
|
458 |
|
|
# Slot 6
|
459 |
|
|
if M0_S6_ACTIVE
|
460 |
|
|
set atmp 6 * slot_incr
|
461 |
|
|
set dtmp 0xaabbccdd
|
462 |
|
|
write w BASE atmp dtmp
|
463 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
464 |
|
|
readcheck w BASE atmp dtmp
|
465 |
|
|
if SC_6 == 1
|
466 |
|
|
print "Slot 6 assigned to combined region."
|
467 |
|
|
# Check that an access to slave 16 has occurred
|
468 |
|
|
iomask 0x00010000 0x0001ffff
|
469 |
|
|
print "Write to slave 16 detected."
|
470 |
|
|
# Clear slave 16 access indication
|
471 |
|
|
iosetbit 16
|
472 |
|
|
ioclrbit 16
|
473 |
|
|
iotstbit 16 0
|
474 |
|
|
else
|
475 |
|
|
if M0_AHBSLOT6ENABLE == 1
|
476 |
|
|
# Check that an access to slave 6 has occurred
|
477 |
|
|
iomask 0x00000040 0x0001ffff
|
478 |
|
|
print "Write to slave 6 detected."
|
479 |
|
|
# Clear slave 6 access indication
|
480 |
|
|
iosetbit 6
|
481 |
|
|
ioclrbit 6
|
482 |
|
|
iotstbit 6 0
|
483 |
|
|
endif
|
484 |
|
|
endif
|
485 |
|
|
endif
|
486 |
|
|
|
487 |
|
|
# Slot 7
|
488 |
|
|
if M0_S7_ACTIVE
|
489 |
|
|
set atmp 7 * slot_incr
|
490 |
|
|
set dtmp 0xaabbccdd
|
491 |
|
|
write w BASE atmp dtmp
|
492 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
493 |
|
|
readcheck w BASE atmp dtmp
|
494 |
|
|
if SC_7 == 1
|
495 |
|
|
print "Slot 7 assigned to combined region."
|
496 |
|
|
# Check that an access to slave 16 has occurred
|
497 |
|
|
iomask 0x00010000 0x0001ffff
|
498 |
|
|
print "Write to slave 16 detected."
|
499 |
|
|
# Clear slave 16 access indication
|
500 |
|
|
iosetbit 16
|
501 |
|
|
ioclrbit 16
|
502 |
|
|
iotstbit 16 0
|
503 |
|
|
else
|
504 |
|
|
if M0_AHBSLOT7ENABLE == 1
|
505 |
|
|
# Check that an access to slave 7 has occurred
|
506 |
|
|
iomask 0x00000080 0x0001ffff
|
507 |
|
|
print "Write to slave 7 detected."
|
508 |
|
|
# Clear slave 7 access indication
|
509 |
|
|
iosetbit 7
|
510 |
|
|
ioclrbit 7
|
511 |
|
|
iotstbit 7 0
|
512 |
|
|
endif
|
513 |
|
|
endif
|
514 |
|
|
endif
|
515 |
|
|
|
516 |
|
|
# Slot 8
|
517 |
|
|
if M0_S8_ACTIVE
|
518 |
|
|
set atmp 8 * slot_incr
|
519 |
|
|
set dtmp 0xaabbccdd
|
520 |
|
|
write w BASE atmp dtmp
|
521 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
522 |
|
|
readcheck w BASE atmp dtmp
|
523 |
|
|
if SC_8 == 1
|
524 |
|
|
print "Slot 8 assigned to combined region."
|
525 |
|
|
# Check that an access to slave 16 has occurred
|
526 |
|
|
iomask 0x00010000 0x0001ffff
|
527 |
|
|
print "Write to slave 16 detected."
|
528 |
|
|
# Clear slave 16 access indication
|
529 |
|
|
iosetbit 16
|
530 |
|
|
ioclrbit 16
|
531 |
|
|
iotstbit 16 0
|
532 |
|
|
else
|
533 |
|
|
if M0_AHBSLOT8ENABLE == 1
|
534 |
|
|
# Check that an access to slave 8 has occurred
|
535 |
|
|
iomask 0x00000100 0x0001ffff
|
536 |
|
|
print "Write to slave 8 detected."
|
537 |
|
|
# Clear slave 8 access indication
|
538 |
|
|
iosetbit 8
|
539 |
|
|
ioclrbit 8
|
540 |
|
|
iotstbit 8 0
|
541 |
|
|
endif
|
542 |
|
|
endif
|
543 |
|
|
endif
|
544 |
|
|
|
545 |
|
|
# Slot 9
|
546 |
|
|
if M0_S9_ACTIVE
|
547 |
|
|
set atmp 9 * slot_incr
|
548 |
|
|
set dtmp 0xaabbccdd
|
549 |
|
|
write w BASE atmp dtmp
|
550 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
551 |
|
|
readcheck w BASE atmp dtmp
|
552 |
|
|
if SC_9 == 1
|
553 |
|
|
print "Slot 9 assigned to combined region."
|
554 |
|
|
# Check that an access to slave 16 has occurred
|
555 |
|
|
iomask 0x00010000 0x0001ffff
|
556 |
|
|
print "Write to slave 16 detected."
|
557 |
|
|
# Clear slave 16 access indication
|
558 |
|
|
iosetbit 16
|
559 |
|
|
ioclrbit 16
|
560 |
|
|
iotstbit 16 0
|
561 |
|
|
else
|
562 |
|
|
if M0_AHBSLOT9ENABLE == 1
|
563 |
|
|
# Check that an access to slave 9 has occurred
|
564 |
|
|
iomask 0x00000200 0x0001ffff
|
565 |
|
|
print "Write to slave 9 detected."
|
566 |
|
|
# Clear slave 9 access indication
|
567 |
|
|
iosetbit 9
|
568 |
|
|
ioclrbit 9
|
569 |
|
|
iotstbit 9 0
|
570 |
|
|
endif
|
571 |
|
|
endif
|
572 |
|
|
endif
|
573 |
|
|
|
574 |
|
|
# Slot 10
|
575 |
|
|
if M0_S10_ACTIVE
|
576 |
|
|
set atmp 10 * slot_incr
|
577 |
|
|
set dtmp 0xaabbccdd
|
578 |
|
|
write w BASE atmp dtmp
|
579 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
580 |
|
|
readcheck w BASE atmp dtmp
|
581 |
|
|
if SC_10 == 1
|
582 |
|
|
print "Slot 10 assigned to combined region."
|
583 |
|
|
# Check that an access to slave 16 has occurred
|
584 |
|
|
iomask 0x00010000 0x0001ffff
|
585 |
|
|
print "Write to slave 16 detected."
|
586 |
|
|
# Clear slave 16 access indication
|
587 |
|
|
iosetbit 16
|
588 |
|
|
ioclrbit 16
|
589 |
|
|
iotstbit 16 0
|
590 |
|
|
else
|
591 |
|
|
if M0_AHBSLOT10ENABLE == 1
|
592 |
|
|
# Check that an access to slave 10 has occurred
|
593 |
|
|
iomask 0x00000400 0x0001ffff
|
594 |
|
|
print "Write to slave 10 detected."
|
595 |
|
|
# Clear slave 10 access indication
|
596 |
|
|
iosetbit 10
|
597 |
|
|
ioclrbit 10
|
598 |
|
|
iotstbit 10 0
|
599 |
|
|
endif
|
600 |
|
|
endif
|
601 |
|
|
endif
|
602 |
|
|
|
603 |
|
|
# Slot 11
|
604 |
|
|
if M0_S11_ACTIVE
|
605 |
|
|
set atmp 11 * slot_incr
|
606 |
|
|
set dtmp 0xaabbccdd
|
607 |
|
|
write w BASE atmp dtmp
|
608 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
609 |
|
|
readcheck w BASE atmp dtmp
|
610 |
|
|
if SC_11 == 1
|
611 |
|
|
print "Slot 11 assigned to combined region."
|
612 |
|
|
# Check that an access to slave 16 has occurred
|
613 |
|
|
iomask 0x00010000 0x0001ffff
|
614 |
|
|
print "Write to slave 16 detected."
|
615 |
|
|
# Clear slave 16 access indication
|
616 |
|
|
iosetbit 16
|
617 |
|
|
ioclrbit 16
|
618 |
|
|
iotstbit 16 0
|
619 |
|
|
else
|
620 |
|
|
if M0_AHBSLOT11ENABLE == 1
|
621 |
|
|
# Check that an access to slave 11 has occurred
|
622 |
|
|
iomask 0x00000800 0x0001ffff
|
623 |
|
|
print "Write to slave 11 detected."
|
624 |
|
|
# Clear slave 11 access indication
|
625 |
|
|
iosetbit 11
|
626 |
|
|
ioclrbit 11
|
627 |
|
|
iotstbit 11 0
|
628 |
|
|
endif
|
629 |
|
|
endif
|
630 |
|
|
endif
|
631 |
|
|
|
632 |
|
|
# Slot 12
|
633 |
|
|
if M0_S12_ACTIVE
|
634 |
|
|
set atmp 12 * slot_incr
|
635 |
|
|
set dtmp 0xaabbccdd
|
636 |
|
|
write w BASE atmp dtmp
|
637 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
638 |
|
|
readcheck w BASE atmp dtmp
|
639 |
|
|
if SC_12 == 1
|
640 |
|
|
print "Slot 12 assigned to combined region."
|
641 |
|
|
# Check that an access to slave 16 has occurred
|
642 |
|
|
iomask 0x00010000 0x0001ffff
|
643 |
|
|
print "Write to slave 16 detected."
|
644 |
|
|
# Clear slave 16 access indication
|
645 |
|
|
iosetbit 16
|
646 |
|
|
ioclrbit 16
|
647 |
|
|
iotstbit 16 0
|
648 |
|
|
else
|
649 |
|
|
if M0_AHBSLOT12ENABLE == 1
|
650 |
|
|
# Check that an access to slave 12 has occurred
|
651 |
|
|
iomask 0x00001000 0x0001ffff
|
652 |
|
|
print "Write to slave 12 detected."
|
653 |
|
|
# Clear slave 12 access indication
|
654 |
|
|
iosetbit 12
|
655 |
|
|
ioclrbit 12
|
656 |
|
|
iotstbit 12 0
|
657 |
|
|
endif
|
658 |
|
|
endif
|
659 |
|
|
endif
|
660 |
|
|
|
661 |
|
|
# Slot 13
|
662 |
|
|
if M0_S13_ACTIVE
|
663 |
|
|
set atmp 13 * slot_incr
|
664 |
|
|
set dtmp 0xaabbccdd
|
665 |
|
|
write w BASE atmp dtmp
|
666 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
667 |
|
|
readcheck w BASE atmp dtmp
|
668 |
|
|
if SC_13 == 1
|
669 |
|
|
print "Slot 13 assigned to combined region."
|
670 |
|
|
# Check that an access to slave 16 has occurred
|
671 |
|
|
iomask 0x00010000 0x0001ffff
|
672 |
|
|
print "Write to slave 16 detected."
|
673 |
|
|
# Clear slave 16 access indication
|
674 |
|
|
iosetbit 16
|
675 |
|
|
ioclrbit 16
|
676 |
|
|
iotstbit 16 0
|
677 |
|
|
else
|
678 |
|
|
if M0_AHBSLOT13ENABLE == 1
|
679 |
|
|
# Check that an access to slave 13 has occurred
|
680 |
|
|
iomask 0x00002000 0x0001ffff
|
681 |
|
|
print "Write to slave 13 detected."
|
682 |
|
|
# Clear slave 13 access indication
|
683 |
|
|
iosetbit 13
|
684 |
|
|
ioclrbit 13
|
685 |
|
|
iotstbit 13 0
|
686 |
|
|
endif
|
687 |
|
|
endif
|
688 |
|
|
endif
|
689 |
|
|
|
690 |
|
|
# Slot 14
|
691 |
|
|
if M0_S14_ACTIVE
|
692 |
|
|
set atmp 14 * slot_incr
|
693 |
|
|
set dtmp 0xaabbccdd
|
694 |
|
|
write w BASE atmp dtmp
|
695 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
696 |
|
|
readcheck w BASE atmp dtmp
|
697 |
|
|
if SC_14 == 1
|
698 |
|
|
print "Slot 14 assigned to combined region."
|
699 |
|
|
# Check that an access to slave 16 has occurred
|
700 |
|
|
iomask 0x00010000 0x0001ffff
|
701 |
|
|
print "Write to slave 16 detected."
|
702 |
|
|
# Clear slave 16 access indication
|
703 |
|
|
iosetbit 16
|
704 |
|
|
ioclrbit 16
|
705 |
|
|
iotstbit 16 0
|
706 |
|
|
else
|
707 |
|
|
if M0_AHBSLOT14ENABLE == 1
|
708 |
|
|
# Check that an access to slave 14 has occurred
|
709 |
|
|
iomask 0x00004000 0x0001ffff
|
710 |
|
|
print "Write to slave 14 detected."
|
711 |
|
|
# Clear slave 14 access indication
|
712 |
|
|
iosetbit 14
|
713 |
|
|
ioclrbit 14
|
714 |
|
|
iotstbit 14 0
|
715 |
|
|
endif
|
716 |
|
|
endif
|
717 |
|
|
endif
|
718 |
|
|
|
719 |
|
|
# Slot 15
|
720 |
|
|
if M0_S15_ACTIVE
|
721 |
|
|
set atmp 15 * slot_incr
|
722 |
|
|
set dtmp 0xaabbccdd
|
723 |
|
|
write w BASE atmp dtmp
|
724 |
|
|
print "Master 0 writes %08x to address %08x at: %0d ns." dtmp atmp $TIME
|
725 |
|
|
readcheck w BASE atmp dtmp
|
726 |
|
|
if SC_15 == 1
|
727 |
|
|
print "Slot 15 assigned to combined region."
|
728 |
|
|
# Check that an access to slave 16 has occurred
|
729 |
|
|
iomask 0x00010000 0x0001ffff
|
730 |
|
|
print "Write to slave 16 detected."
|
731 |
|
|
# Clear slave 16 access indication
|
732 |
|
|
iosetbit 16
|
733 |
|
|
ioclrbit 16
|
734 |
|
|
iotstbit 16 0
|
735 |
|
|
else
|
736 |
|
|
if M0_AHBSLOT15ENABLE == 1
|
737 |
|
|
# Check that an access to slave 15 has occurred
|
738 |
|
|
iomask 0x00008000 0x0001ffff
|
739 |
|
|
print "Write to slave 15 detected."
|
740 |
|
|
# Clear slave 15 access indication
|
741 |
|
|
iosetbit 15
|
742 |
|
|
ioclrbit 15
|
743 |
|
|
iotstbit 15 0
|
744 |
|
|
endif
|
745 |
|
|
endif
|
746 |
|
|
endif
|
747 |
|
|
endif
|
748 |
|
|
|
749 |
|
|
return
|