Title: Test Data Generation for LRU CacheMemory Testing
1Test Data Generation for LRU Cache-Memory Testing
- Evgeny KornikhinMoscow State UniversityInstitute
for System Programming of RAS
2testing by test programs
add r1,r2,r3sub r4, r1, r2lw r5, r1, 0lui r2,
r1, r4
Y/N
assembly program ( test program )
microprocessor
3test program generation
model of microprocessor
coverage oftest situations and dependencies
(r-w, r-r)
add r1,r2,r3 _at_ overflow lw r4, r3, c _at_ hit
test templates
(logical form)
mov r2, 0xFF add r1,r2,r3 lw r4, r3, 0
test programs
(executable form)
4test program generation
model of microprocessor
coverage oftest situations and dependencies
(r-w, r-r)
add r1,r2,r3 _at_ overflow lw r4, r3, c _at_ hit
test templates
(logical form)
mov r2, 0xFF add r1,r2,r3 lw r4, r3, 0
test programs
(executable form)
5test program generation
model of microprocessor
coverage oftest situations and dependencies
(r-w, r-r)
add r1,r2,r3 _at_ overflow lw r4, r3, c _at_ hit
test templates
(logical form)
mov r2, 0xFF add r1,r2,r3 lw r4, r3, 0
test programs
add specific initialization of microprocessor
(registers and cache)
(executable form)
6cache-hit
cache model
tag0'
value0'
tag0''
value0''
set ?0
LOAD val, addr (val memoryaddr)
t'
v'
t''
v''
set ?s
7cache-hit
cache model
tag0'
value0'
tag0''
value0''
set ?0
LOAD val, addr (val memoryaddr)
addr
t t' ort t''
s
t
t t''
tag
set
t'
v'
t''
v''
set ?s
8cache-miss
cache model
tag0'
value0'
tag0''
value0''
set ?0
LOAD val, addr (val memoryaddr)
addr
nextlevel
t ! t' andt ! t''
s
t
tag
set
t'
v'
t''
v''
set ?s
evicted
9problem again
- LOAD x, y _at_ hitSTORE u, z _at_ missLOAD z, y _at_ hit
initial state of cacheand registers ?
10key idea
test template
add ...load sub div
LOAD x, y _at_ hit
constraint
variable
?
?
?
?
y ? a,b,c
?
?
variable
u ? a,b,c
cache model
x z
11fully associative cache
z
x
x
y
z
...
N
y
x,y,z,... - current state
12cache-hit hit(t)
z
t
x
x
y
z
...
N
y
t ?x,y,z...
13cache-miss miss(t)
z
t
x
x
y
z
...
N
y
t ? x,y,z...
new cachex,y,z...?t\?
14cache-miss miss(t)?u
z
t
x
x
y
z
...
N
y
t ? x,y,z...
u?x,y,z...
new cachex,y,z...?t\u
15lru(u)
hit x1
u x2
hit x2
x3, x5 L\u
miss x3-gtx4
hit x5
L
miss t-gtu
counter(u)min
16lru(u)
hit x1
u x1
hit x2
x2, x3, x5 L\u
miss x3-gtx4
hit x5
L
miss t-gtu
there are another cases
17example
a
initialstate
b
y?a,b,g
g
z?a,b,g
LOAD x, y _at_ hit
z0?a,b,g
?z0
STORE u, z _at_ miss
z0b a,b,g\z0g,y
LOAD z, y _at_ hit
y?a,b,g,z\z0
N 3
18example
z?a,b,g
y a
y?a,b,g
z?a,b,g
ya0
z0?a,b,g
z0b a,b,g\z0g,y
b1
g2
z3
y?a,b,g,z\z0
19common cache
x
x
R(x)
y
R(y)
y
z
z
R(z)
20common cache
hit(t)
t ? L
miss(t)?u
u ? Lt ? L new cacheL?t\uR(t) R(u)lru(u)
21lru(u)
hit x1
hit x2
u x2
x3, x5nR(u) (L\u)nR(u)
miss x3?x4
hit x5
miss t?u
22example
x1,x2 ? a1,a2,b1,b2,c1,c2
x3 ? a1,a2,b1,b2,c1,c2
R(x3) R(y3)
x4 ? a1,...,c2,x3\y3
x5 ? a1,...,c2,x3\y3
y3 c2
y3 (a1,...,c2\x1,x2, y3)nR(y3)
y5 x2
y5 (a1...c2,x3\y3,y5, x3,x4)nR(y5)
23solver
(assert (or ( x a) ( x b)( x c)))
x ? a,b,c
y ? a,b,c
(assert (and (/ y a) (/ y b)(/ y c)))
x z
(check)
SMT
- SAT modulo theories (bit-vectors)
- Yices
24contacts
- http//tesla-project.googlecode.com
- http//hardware.ispras.ru
- kornevgen_at_gmail.com