or1k.cfg 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. set _ENDIAN big
  2. if { [info exists CHIPNAME] } {
  3. set _CHIPNAME $CHIPNAME
  4. } else {
  5. set _CHIPNAME or1k
  6. }
  7. if { [info exists TAP_TYPE] } {
  8. set _TAP_TYPE $TAP_TYPE
  9. } else {
  10. puts "You need to select a tap type"
  11. shutdown
  12. }
  13. # Configure the target
  14. if { [string compare $_TAP_TYPE "VJTAG"] == 0 } {
  15. if { [info exists FPGATAPID] } {
  16. set _FPGATAPID $FPGATAPID
  17. } else {
  18. puts "You need to set your FPGA JTAG ID"
  19. shutdown
  20. }
  21. jtag newtap $_CHIPNAME cpu -irlen 10 -expected-id $_FPGATAPID
  22. set _TARGETNAME $_CHIPNAME.cpu
  23. target create $_TARGETNAME or1k -endian $_ENDIAN -chain-position $_TARGETNAME
  24. # Select the TAP core we are using
  25. tap_select vjtag
  26. } elseif { [string compare $_TAP_TYPE "XILINX_BSCAN"] == 0 } {
  27. if { [info exists FPGATAPID] } {
  28. set _FPGATAPID $FPGATAPID
  29. } else {
  30. puts "You need to set your FPGA JTAG ID"
  31. shutdown
  32. }
  33. jtag newtap $_CHIPNAME cpu -irlen 6 -expected-id $_FPGATAPID
  34. set _TARGETNAME $_CHIPNAME.cpu
  35. target create $_TARGETNAME or1k -endian $_ENDIAN -chain-position $_TARGETNAME
  36. # Select the TAP core we are using
  37. tap_select xilinx_bscan
  38. } else {
  39. # OpenCores Mohor JTAG TAP ID
  40. set _CPUTAPID 0x14951185
  41. jtag newtap $_CHIPNAME cpu -irlen 4 -expected-id $_CPUTAPID
  42. set _TARGETNAME $_CHIPNAME.cpu
  43. target create $_TARGETNAME or1k -endian $_ENDIAN -chain-position $_TARGETNAME
  44. # Select the TAP core we are using
  45. tap_select mohor
  46. }
  47. # Select the debug unit core we are using. This debug unit as an option.
  48. set ADBG_USE_HISPEED 1
  49. set ENABLE_JSP_SERVER 2
  50. set ENABLE_JSP_MULTI 4
  51. # If ADBG_USE_HISPEED is set (options bit 1), status bits will be skipped
  52. # on burst reads and writes to improve download speeds.
  53. # This option must match the RTL configured option.
  54. du_select adv [expr {$ADBG_USE_HISPEED | $ENABLE_JSP_SERVER | $ENABLE_JSP_MULTI}]