xref: /netbsd-src/external/gpl3/binutils.old/dist/cpu/or1k.cpu (revision e992f068c547fd6e84b3f104dc2340adcc955732)
116dce513Schristos; OpenRISC 1000 architecture.  -*- Scheme -*-
2012573ebSchristos; Copyright 2000-2019 Free Software Foundation, Inc.
316dce513Schristos; Contributed for OR32 by Johan Rydberg, jrydberg@opencores.org
416dce513Schristos; Modified by Julius Baxter, juliusbaxter@gmail.com
516dce513Schristos; Modified by Peter Gavin, pgavin@gmail.com
6012573ebSchristos; Modified by Andrey Bacherov, avbacherov@opencores.org
716dce513Schristos;
816dce513Schristos; This program is free software; you can redistribute it and/or modify
916dce513Schristos; it under the terms of the GNU General Public License as published by
1016dce513Schristos; the Free Software Foundation; either version 3 of the License, or
1116dce513Schristos; (at your option) any later version.
1216dce513Schristos;
1316dce513Schristos; This program is distributed in the hope that it will be useful,
1416dce513Schristos; but WITHOUT ANY WARRANTY; without even the implied warranty of
1516dce513Schristos; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1616dce513Schristos; GNU General Public License for more details.
1716dce513Schristos;
1816dce513Schristos; You should have received a copy of the GNU General Public License
1916dce513Schristos; along with this program; if not, see <http://www.gnu.org/licenses/>
2016dce513Schristos
2116dce513Schristos(include "simplify.inc")
2216dce513Schristos
2316dce513Schristos; The OpenRISC family is a set of RISC microprocessor architectures with an
2416dce513Schristos; emphasis on scalability and is targetted at embedded use.
2516dce513Schristos; The CPU RTL development is a collaborative open source effort.
2616dce513Schristos; http://opencores.org/or1k
2716dce513Schristos; http://openrisc.net
2816dce513Schristos
2916dce513Schristos(define-arch
3016dce513Schristos  (name or1k)
3116dce513Schristos  (comment "OpenRISC 1000")
3216dce513Schristos  (default-alignment aligned)
3316dce513Schristos  (insn-lsb0? #t)
34*e992f068Schristos  (machs or32 or32nd)
3516dce513Schristos  (isas openrisc)
3616dce513Schristos)
3716dce513Schristos
3816dce513Schristos; Instruction set parameters.
3916dce513Schristos(define-isa
4016dce513Schristos  ; Name of the ISA.
4116dce513Schristos  (name openrisc)
4216dce513Schristos  ; Base insturction length.  The insns are always 32 bits wide.
4316dce513Schristos  (base-insn-bitsize 32)
4416dce513Schristos  )
4516dce513Schristos
4616dce513Schristos(define-pmacro OR32-MACHS       or32,or32nd)
47*e992f068Schristos(define-pmacro ORBIS-MACHS      or32,or32nd)
48*e992f068Schristos(define-pmacro ORFPX32-MACHS    or32,or32nd)
49012573ebSchristos(define-pmacro ORFPX64A32-MACHS or32,or32nd) ; float64 for 32-bit machs
5016dce513Schristos
5116dce513Schristos(define-attr
5216dce513Schristos  (for model)
5316dce513Schristos  (type boolean)
5416dce513Schristos  (name NO-DELAY-SLOT)
5516dce513Schristos  (comment "does not have delay slots")
5616dce513Schristos  )
5716dce513Schristos
5816dce513Schristos(if (keep-mach? (or32 or32nd))
5916dce513Schristos    (begin
6016dce513Schristos      (define-cpu
6116dce513Schristos        (name or1k32bf)
6216dce513Schristos        (comment "OpenRISC 1000 32-bit CPU family")
6316dce513Schristos        (insn-endian big)
6416dce513Schristos        (data-endian big)
6516dce513Schristos        (word-bitsize 32)
6616dce513Schristos        (file-transform "")
6716dce513Schristos        )
6816dce513Schristos
6916dce513Schristos      (define-mach
7016dce513Schristos        (name or32)
7116dce513Schristos        (comment "Generic OpenRISC 1000 32-bit CPU")
7216dce513Schristos        (cpu or1k32bf)
7316dce513Schristos        (bfd-name "or1k")
7416dce513Schristos        )
7516dce513Schristos
7616dce513Schristos      (define-mach
7716dce513Schristos        (name or32nd)
78012573ebSchristos        (comment "Generic OpenRISC 1000 32-bit CPU with no branch delay slot")
7916dce513Schristos        (cpu or1k32bf)
8016dce513Schristos        (bfd-name "or1knd")
8116dce513Schristos        )
8216dce513Schristos
8316dce513Schristos      ; OpenRISC 1200 - 32-bit or1k CPU implementation
8416dce513Schristos      (define-model
8516dce513Schristos        (name or1200) (comment "OpenRISC 1200 model")
8616dce513Schristos        (attrs)
8716dce513Schristos        (mach or32)
8816dce513Schristos        (unit u-exec "Execution Unit" () 1 1 () () () ())
8916dce513Schristos        )
9016dce513Schristos
9116dce513Schristos      ; OpenRISC 1200 - 32-bit or1k CPU implementation
9216dce513Schristos      (define-model
93012573ebSchristos        (name or1200nd) (comment "OpenRISC 1200 model with no branch delay slot")
9416dce513Schristos        (attrs NO-DELAY-SLOT)
9516dce513Schristos        (mach or32nd)
9616dce513Schristos        (unit u-exec "Execution Unit" () 1 1 () () () ())
9716dce513Schristos        )
9816dce513Schristos      )
9916dce513Schristos    )
10016dce513Schristos
10116dce513Schristos(include "or1kcommon.cpu")
10216dce513Schristos(include "or1korbis.cpu")
10316dce513Schristos(include "or1korfpx.cpu")
104