or1k.cpu 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. ; OpenRISC 1000 architecture. -*- Scheme -*-
  2. ; Copyright 2000-2014 Free Software Foundation, Inc.
  3. ; Contributed for OR32 by Johan Rydberg, jrydberg@opencores.org
  4. ; Modified by Julius Baxter, juliusbaxter@gmail.com
  5. ; Modified by Peter Gavin, pgavin@gmail.com
  6. ;
  7. ; This program is free software; you can redistribute it and/or modify
  8. ; it under the terms of the GNU General Public License as published by
  9. ; the Free Software Foundation; either version 3 of the License, or
  10. ; (at your option) any later version.
  11. ;
  12. ; This program is distributed in the hope that it will be useful,
  13. ; but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. ; GNU General Public License for more details.
  16. ;
  17. ; You should have received a copy of the GNU General Public License
  18. ; along with this program; if not, see <http://www.gnu.org/licenses/>
  19. (include "simplify.inc")
  20. ; The OpenRISC family is a set of RISC microprocessor architectures with an
  21. ; emphasis on scalability and is targetted at embedded use.
  22. ; The CPU RTL development is a collaborative open source effort.
  23. ; http://opencores.org/or1k
  24. ; http://openrisc.net
  25. (define-arch
  26. (name or1k)
  27. (comment "OpenRISC 1000")
  28. (default-alignment aligned)
  29. (insn-lsb0? #t)
  30. (machs or32 or32nd or64 or64nd)
  31. (isas openrisc)
  32. )
  33. ; Instruction set parameters.
  34. (define-isa
  35. ; Name of the ISA.
  36. (name openrisc)
  37. ; Base insturction length. The insns are always 32 bits wide.
  38. (base-insn-bitsize 32)
  39. )
  40. (define-pmacro OR32-MACHS or32,or32nd)
  41. (define-pmacro OR64-MACHS or64,or64nd)
  42. (define-pmacro ORBIS-MACHS or32,or32nd,or64,or64nd)
  43. (define-pmacro ORFPX-MACHS or32,or32nd,or64,or64nd)
  44. (define-pmacro ORFPX32-MACHS or32,or32nd,or64,or64nd)
  45. (define-pmacro ORFPX64-MACHS or64,or64nd)
  46. (define-attr
  47. (for model)
  48. (type boolean)
  49. (name NO-DELAY-SLOT)
  50. (comment "does not have delay slots")
  51. )
  52. (if (keep-mach? (or32 or32nd))
  53. (begin
  54. (define-cpu
  55. (name or1k32bf)
  56. (comment "OpenRISC 1000 32-bit CPU family")
  57. (insn-endian big)
  58. (data-endian big)
  59. (word-bitsize 32)
  60. (file-transform "")
  61. )
  62. (define-mach
  63. (name or32)
  64. (comment "Generic OpenRISC 1000 32-bit CPU")
  65. (cpu or1k32bf)
  66. (bfd-name "or1k")
  67. )
  68. (define-mach
  69. (name or32nd)
  70. (comment "Generic OpenRISC 1000 32-bit CPU")
  71. (cpu or1k32bf)
  72. (bfd-name "or1knd")
  73. )
  74. ; OpenRISC 1200 - 32-bit or1k CPU implementation
  75. (define-model
  76. (name or1200) (comment "OpenRISC 1200 model")
  77. (attrs)
  78. (mach or32)
  79. (unit u-exec "Execution Unit" () 1 1 () () () ())
  80. )
  81. ; OpenRISC 1200 - 32-bit or1k CPU implementation
  82. (define-model
  83. (name or1200nd) (comment "OpenRISC 1200 model")
  84. (attrs NO-DELAY-SLOT)
  85. (mach or32nd)
  86. (unit u-exec "Execution Unit" () 1 1 () () () ())
  87. )
  88. )
  89. )
  90. (if (keep-mach? (or64 or64nd))
  91. (begin
  92. (define-cpu
  93. (name or1k64bf)
  94. (comment "OpenRISC 1000 64-bit CPU family")
  95. (insn-endian big)
  96. (data-endian big)
  97. (word-bitsize 64)
  98. (file-transform "64")
  99. )
  100. (define-mach
  101. (name or64)
  102. (comment "Generic OpenRISC 1000 64-bit CPU")
  103. (cpu or1k64bf)
  104. (bfd-name "or1k64")
  105. )
  106. (define-mach
  107. (name or64nd)
  108. (comment "Generic OpenRISC 1000 ND 64-bit CPU")
  109. (cpu or1k64bf)
  110. (bfd-name "or1k64nd")
  111. )
  112. )
  113. )
  114. (include "or1kcommon.cpu")
  115. (include "or1korbis.cpu")
  116. (include "or1korfpx.cpu")