You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

25 lines
578 B

  1. proc iswithin { ADDRESS BASE LEN } {
  2. return [expr ((($ADDRESS - $BASE) > 0) && (($ADDRESS - $BASE + $LEN) > 0))]
  3. }
  4. proc memorytype { ADDRESS } {
  5. for { set chip 0 } { $chip < $N_CHIP } { incr chip } {
  6. if { iswithin $ADDRESS $FLASH($chip,BASE) $FLASH($chip,LEN) } {
  7. return "flash"
  8. }
  9. }
  10. for { set chip 0 } { $chip < $N_RAM } { incr chip } {
  11. if { iswithin $ADDRESS $RAM($chip,BASE) $RAM($chip,LEN) } {
  12. return "ram"
  13. }
  14. }
  15. }
  16. # default to 32bit reads.
  17. proc isreadable { ADDRESS } {
  18. return isreadable32 $ADDRESS
  19. }
  20. proc isreadable32 { ADDRESS } {