first implementation
[openocd/simonqian.git] / tcl / readable.tcl
blobbd2dc7f8d81907563c8d35b072c1bc0720329e71
1 proc iswithin { ADDRESS BASE LEN } {
2 return [expr ((($ADDRESS - $BASE) > 0) && (($ADDRESS - $BASE + $LEN) > 0))]
5 proc memorytype { ADDRESS } {
6 for { set chip 0 } { $chip < $N_CHIP } { incr chip } {
7 if { iswithin $ADDRESS $FLASH($chip,BASE) $FLASH($chip,LEN) } {
8 return "flash"
12 for { set chip 0 } { $chip < $N_RAM } { incr chip } {
13 if { iswithin $ADDRESS $RAM($chip,BASE) $RAM($chip,LEN) } {
14 return "ram"
19 # default to 32bit reads.
20 proc isreadable { ADDRESS } {
21 return isreadable32 $ADDRESS
24 proc isreadable32 { ADDRESS } {