1 ;; Faraday FA606TE Pipeline Description
2 ;; Copyright (C) 2010-2013 Free Software Foundation, Inc.
3 ;; Written by Mingfeng Wu, based on ARM926EJ-S Pipeline Description.
5 ;; This file is part of GCC.
7 ;; GCC is free software; you can redistribute it and/or modify it under
8 ;; the terms of the GNU General Public License as published by the Free
9 ;; Software Foundation; either version 3, or (at your option) any later
12 ;; GCC is distributed in the hope that it will be useful, but WITHOUT ANY
13 ;; WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 ;; FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GCC; see the file COPYING3. If not see
19 ;; <http://www.gnu.org/licenses/>. */
21 ;; These descriptions are based on the information contained in the
22 ;; FA606TE Core Design Note, Copyright (c) 2010 Faraday Technology Corp.
24 ;; Modeled pipeline characteristics:
25 ;; LD -> any use: latency = 2 (1 cycle penalty).
26 ;; ALU -> any use: latency = 1 (0 cycle penalty).
28 ;; This automaton provides a pipeline description for the Faraday
31 ;; The model given here assumes that the condition for all conditional
32 ;; instructions is "true", i.e., that all of the instructions are
35 (define_automaton "fa606te")
37 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
39 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
41 ;; There is a single pipeline
43 ;; The ALU pipeline has fetch, decode, execute, memory, and
44 ;; write stages. We only need to model the execute, memory and write
49 (define_cpu_unit "fa606te_core" "fa606te")
51 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
53 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
55 ;; ALU instructions require two cycles to execute, and use the ALU
56 ;; pipeline in each of the three stages. The results are available
57 ;; after the execute stage stage has finished.
59 ;; If the destination register is the PC, the pipelines are stalled
60 ;; for several cycles. That case is not modeled here.
63 (define_insn_reservation "606te_alu_op" 1
64 (and (eq_attr "tune" "fa606te")
65 (eq_attr "type" "arlo_imm,arlo_reg,shift,shift_reg,
66 extend,arlo_shift,arlo_shift_reg,\
67 mov_imm,mov_reg,mov_shift,mov_shift_reg,\
68 mvn_imm,mvn_reg,mvn_shift,mvn_shift_reg"))
71 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
72 ;; Multiplication Instructions
73 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
75 (define_insn_reservation "606te_mult1" 2
76 (and (eq_attr "tune" "fa606te")
77 (eq_attr "type" "smlalxy"))
80 (define_insn_reservation "606te_mult2" 3
81 (and (eq_attr "tune" "fa606te")
82 (eq_attr "type" "smlaxy,smulxy,smulwy,smlawy"))
85 (define_insn_reservation "606te_mult3" 4
86 (and (eq_attr "tune" "fa606te")
87 (eq_attr "type" "mul,mla,muls,mlas"))
90 (define_insn_reservation "606te_mult4" 5
91 (and (eq_attr "tune" "fa606te")
92 (eq_attr "type" "umull,umlal,smull,smlal,umulls,umlals,smulls,smlals"))
95 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
96 ;; Load/Store Instructions
97 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
99 ;; The models for load/store instructions do not accurately describe
100 ;; the difference between operations with a base register writeback
101 ;; (such as "ldm!"). These models assume that all memory references
104 (define_insn_reservation "606te_load1_op" 2
105 (and (eq_attr "tune" "fa606te")
106 (eq_attr "type" "load1,load_byte"))
109 (define_insn_reservation "606te_load2_op" 3
110 (and (eq_attr "tune" "fa606te")
111 (eq_attr "type" "load2"))
114 (define_insn_reservation "606te_load3_op" 4
115 (and (eq_attr "tune" "fa606te")
116 (eq_attr "type" "load3"))
119 (define_insn_reservation "606te_load4_op" 5
120 (and (eq_attr "tune" "fa606te")
121 (eq_attr "type" "load4"))
124 (define_insn_reservation "606te_store1_op" 0
125 (and (eq_attr "tune" "fa606te")
126 (eq_attr "type" "store1"))
129 (define_insn_reservation "606te_store2_op" 1
130 (and (eq_attr "tune" "fa606te")
131 (eq_attr "type" "store2"))
134 (define_insn_reservation "606te_store3_op" 2
135 (and (eq_attr "tune" "fa606te")
136 (eq_attr "type" "store3"))
139 (define_insn_reservation "606te_store4_op" 3
140 (and (eq_attr "tune" "fa606te")
141 (eq_attr "type" "store4"))
145 ;;(define_insn_reservation "606te_ldm_op" 9
146 ;; (and (eq_attr "tune" "fa606te")
147 ;; (eq_attr "type" "load2,load3,load4,store2,store3,store4"))
150 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
151 ;; Branch and Call Instructions
152 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
154 ;; Branch instructions are difficult to model accurately. The FA606TE
155 ;; core can predict most branches. If the branch is predicted
156 ;; correctly, and predicted early enough, the branch can be completely
157 ;; eliminated from the instruction stream. Some branches can
158 ;; therefore appear to require zero cycles to execute. We assume that
159 ;; all branches are predicted correctly, and that the latency is
160 ;; therefore the minimum value.
162 (define_insn_reservation "606te_branch_op" 0
163 (and (eq_attr "tune" "fa606te")
164 (eq_attr "type" "branch"))
167 ;; The latency for a call is actually the latency when the result is available.
168 ;; i.e. R0 ready for int return value. For most cases, the return value is set
169 ;; by a mov instruction, which has 1 cycle latency.
170 (define_insn_reservation "606te_call_op" 1
171 (and (eq_attr "tune" "fa606te")
172 (eq_attr "type" "call"))