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