|
TESS-c3x Brief Handbook
sim file and its format
sim file defines the accessible memory scope of c3x processor,
but not including the address scope of various sections that
has already been confirmed by the compiler; for instance,
.text, .data, .bss, .const and so on. Generally it is understood
as the location of undefined data section, used by the program
in code. And it may cause program operating errors for the
visit to the undefined areas, and appear the message similar
to "Illegal memory read at address 0x00000000".
The memory scope is appointed by one or more accessible blocks
of the processor. Each block is composed of a starting address
and a length, between which a comma is in the middle; each
row shows one block. As follows is an example of a sim file,
0x0,0x800000
0xC00000, 0x20000
Here two blocks are defined, that are 0x000000~0x7FFFFF and
0Xc00000~0XC1FFFF.
.mal file and its format
.mal file is used coordinated with testing case, that has
the same file name with testing case. .mal file is used to
define the accessible memory unit address of a testing case;
each address is expressed with hexadecimal, which occupies
one row; and it can include sixty four addresses at most.
As follows is an example of .mal file,
0x00140
0x00148
0x00150
0x00158
0x00160
0x00168
0x00170
Seven addresses are defined in this example, and they can
be visited by $mvalue(0)- $mvalue(6). And $maddr(0)- $maddr(6)
can visit above listed addresses.
compile testing case
To visit the register in testing case, which can be got through
with defined register variables. For an example, to visit
r0 register by means of r_r0 variable. The following script
evaluates to r0 register and exports to the console.
set r_r0 1000
puts stdout $r_r0 1000
As follows are all the register variables.
pc pc
r0 r_r0
r1 r_r1
r2 r_r2
r3 r_r3
r4 r_r4
r5 r_r5
r6 r_r6
r7 r_r7
ar0 r_ar0
ar1 r_ar1
ar2 r_ar2
ar3 r_ar3
ar4 r_ar4
ar5 r_ar5
ar6 r_ar6
ar7 r_ar7
ir0 r_ir0
ir1 r_ir1
dp r_dp
bk r_bk
sp r_sp
st r_st
ie r_ie
if r_if
iof r_iof
rs r_rs
re r_re
rc r_rc
r8 r_r8
r9 r_r9
r10 r_r10
r11 r_r11
ivtp r_ivtp
tvtp r_tvtp
er0 r_er0
er1 r_er1
er2 r_er2
er3 r_er3
er4 r_er4
er5 r_er5
er6 r_er6
er7 r_er7
er8 r_er8
er9 r_er9
er10 r_er10
er11 r_er11
The purpose of testing case is to check and change program
operational state through the operation of register and memory
when the program is operated to the appointed position in
the program operation, so as to achieve the testing purpose.
Testing cases are compiled with TCL script language. And generally
the operation on the appointed position is achieved by one
similar to the following script.
if {$pc==[expr 0x809832]} {set pc [expr 0x8098c4]”}
This script jumps to 0x8098c4 to continue the operation when
the program is operated to 0x809832; and other required scripts
are also can be added in the script, as for amending some
register or memory datus.
compile unit testing case
Unit testing case is used for unit testing, and it is transferred
through the function of CPUconfig Unit Test Configure. As
follows is an example.
if {£”[info exists execute _count] }{#the operational
times of initialized testing case
global execute_count
set execute_count 1
puts "-Begin-----------------------------------------------------------------"
}
if {£”[info exists execute _count] }{#the operational
times of initialized testing case
if {$execute_count<100 }{#the invocational point of initialized
unit, also is the address of call order}
set c_point [expr 0x80980a ]
#the entry point of initial unit£»from here unit entry
parameter is meaningful
set e_point [expr 0x809828]
#the back point of initial unit, that is, the address of the
order next to call order
set r point [expr 0x80980b]
if {$pc==$e_point}{
#After the program runs to the entry point, the program operational
state can be changed by judging the parameter of entry point
and the value of local variable.
Incr execute_count
” #to add own script here. }
if {$pc==$r_point}{
#As the program is running to the back point, pc register
is set as the address of invocational point.
set pc $c_point}
}else{
#As test case is almost over, the program execution can be
stopped by the invocation of interrupt order.
Interrupt
#to delete the definition for temporary variable of the script
unset execute_count
puts "--------End-------------------------------------------------------"
}
Unit test case must reset pc register at the back point of
program, otherwise the program may fall apart; after test
case execution is complete, the program execution can be stopped
by interrupt order.
interface simulation
Interface simulation is also realized through the script.
Suppose the interface address of a peripheral equipment are
0x800(read) and 0x801(write); the front order address for
reading operation is 0xc03210 and the back order for writing
operation is 0xc03128. And the following script completes
reading and writing to the interface.
If {$pc==[expr 0xc03210] }{
#the details written into the interface is saved in tmp_data2
set tmp_data2 $mvalue(1)
”
}
.mal file coordinated with the script is:
0x800 #interface address
0x801
Here interface input and output are saved in two variables;
and the script deals with these two variables according to
the features of peripheral equipment. And practical interface
operation may involve even more and much more complicated
datus, by this input and output datus can be saved through
the file.
|