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