update_risc8.tcl 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. foreach hardware_name [get_hardware_names] {
  2. if { [string match "USB-Blaster*" $hardware_name] } {
  3. set usbblaster_name $hardware_name
  4. }
  5. }
  6. puts "JTAG chain: $usbblaster_name";
  7. foreach device_name [get_device_names -hardware_name $usbblaster_name] {
  8. if { [string match "@1*" $device_name] } {
  9. set test_device $device_name
  10. }
  11. }
  12. puts "Device: $test_device";
  13. begin_memory_edit -hardware_name $hardware_name -device_name $device_name
  14. start_insystem_source_probe -hardware_name $hardware_name -device_name $device_name
  15. write_source_data -instance_index 0 -value 1 -value_in_hex
  16. puts "Flashing ram0...";
  17. set content [exec python ./tools/format_utils.py -w 16 -t uhex -s ./memory/build/risc8.data.o]
  18. #set content [exec cat ./memory/risc8.data.uhex]
  19. write_content_to_memory -instance_index 0 -content $content -content_in_hex -start_address 0 -word_count 4096
  20. puts "Flashing rom0...";
  21. set content [exec python ./tools/format_utils.py -w 8 -S 4 -n 0 -t uhex -s ./memory/build/risc8.text.o]
  22. #set content [exec cat ./memory/risc8.text_0.uhex]
  23. write_content_to_memory -instance_index 1 -content $content -content_in_hex -start_address 0 -word_count 1024
  24. puts "Flashing rom1...";
  25. set content [exec python ./tools/format_utils.py -w 8 -S 4 -n 1 -t uhex -s ./memory/build/risc8.text.o]
  26. #set content [exec cat ./memory/risc8.text_1.uhex]
  27. write_content_to_memory -instance_index 2 -content $content -content_in_hex -start_address 0 -word_count 1024
  28. puts "Flashing rom2...";
  29. set content [exec python ./tools/format_utils.py -w 8 -S 4 -n 2 -t uhex -s ./memory/build/risc8.text.o]
  30. #set content [exec cat ./memory/risc8.text_2.uhex]
  31. write_content_to_memory -instance_index 3 -content $content -content_in_hex -start_address 0 -word_count 1024
  32. puts "Flashing rom3...";
  33. set content [exec python ./tools/format_utils.py -w 8 -S 4 -n 3 -t uhex -s ./memory/build/risc8.text.o]
  34. #set content [exec cat ./memory/risc8.text_3.uhex]
  35. write_content_to_memory -instance_index 4 -content $content -content_in_hex -start_address 0 -word_count 1024
  36. write_source_data -instance_index 0 -value 0 -value_in_hex
  37. end_insystem_source_probe
  38. end_memory_edit
  39. puts "Done!";