or1k.cpu 3.0 KB

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