or1k.cfg 1.8 KB

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