1 ;; Faraday FA626TE Pipeline Description
2 ;; Copyright (C) 2010-2013 Free Software Foundation, Inc.
3 ;; Written by I-Jui Sung, 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 ;; FA626TE Core Design Note, Copyright (c) 2010 Faraday Technology Corp.
24 ;; Modeled pipeline characteristics:
25 ;; ALU -> simple address LDR/STR: latency = 2 (available after 2 cycles).
26 ;; ALU -> shifted address LDR/STR: latency = 3.
27 ;; ( extra 1 cycle unavoidable stall).
28 ;; ALU -> other use: latency = 2 (available after 2 cycles).
29 ;; LD -> simple address LDR/STR: latency = 3 (available after 3 cycles).
30 ;; LD -> shifted address LDR/STR: latency = 4
31 ;; ( extra 1 cycle unavoidable stall).
32 ;; LD -> any other use: latency = 3 (available after 3 cycles).
34 ;; This automaton provides a pipeline description for the Faraday
37 ;; The model given here assumes that the condition for all conditional
38 ;; instructions is "true", i.e., that all of the instructions are
41 (define_automaton "fa626te")
43 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
45 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
47 ;; There is a single pipeline
49 ;; The ALU pipeline has fetch, decode, execute, memory, and
50 ;; write stages. We only need to model the execute, memory and write
55 (define_cpu_unit "fa626te_core" "fa626te")
57 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
59 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
61 ;; ALU instructions require two cycles to execute, and use the ALU
62 ;; pipeline in each of the three stages. The results are available
63 ;; after the execute stage stage has finished.
65 ;; If the destination register is the PC, the pipelines are stalled
66 ;; for several cycles. That case is not modeled here.
69 (define_insn_reservation "626te_alu_op" 1
70 (and (eq_attr "tune" "fa626,fa626te")
71 (eq_attr "type" "arlo_imm,arlo_reg,shift,shift_reg,\
72 mov_imm,mov_reg,mvn_imm,mvn_reg"))
75 (define_insn_reservation "626te_alu_shift_op" 2
76 (and (eq_attr "tune" "fa626,fa626te")
77 (eq_attr "type" "extend,arlo_shift,arlo_shift_reg,\
78 mov_shift,mov_shift_reg,\
79 mvn_shift,mvn_shift_reg"))
82 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
83 ;; Multiplication Instructions
84 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
86 (define_insn_reservation "626te_mult1" 2
87 (and (eq_attr "tune" "fa626,fa626te")
88 (eq_attr "type" "smulwy,smlawy,smulxy,smlaxy"))
91 (define_insn_reservation "626te_mult2" 2
92 (and (eq_attr "tune" "fa626,fa626te")
93 (eq_attr "type" "mul,mla"))
96 (define_insn_reservation "626te_mult3" 3
97 (and (eq_attr "tune" "fa626,fa626te")
98 (eq_attr "type" "muls,mlas,smull,smlal,umull,umlal,smlalxy,smlawx"))
101 (define_insn_reservation "626te_mult4" 4
102 (and (eq_attr "tune" "fa626,fa626te")
103 (eq_attr "type" "smulls,smlals,umulls,umlals"))
106 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
107 ;; Load/Store Instructions
108 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
110 ;; The models for load/store instructions do not accurately describe
111 ;; the difference between operations with a base register writeback
112 ;; (such as "ldm!"). These models assume that all memory references
115 (define_insn_reservation "626te_load1_op" 3
116 (and (eq_attr "tune" "fa626,fa626te")
117 (eq_attr "type" "load1,load_byte"))
120 (define_insn_reservation "626te_load2_op" 4
121 (and (eq_attr "tune" "fa626,fa626te")
122 (eq_attr "type" "load2,load3"))
125 (define_insn_reservation "626te_load3_op" 5
126 (and (eq_attr "tune" "fa626,fa626te")
127 (eq_attr "type" "load4"))
130 (define_insn_reservation "626te_store1_op" 0
131 (and (eq_attr "tune" "fa626,fa626te")
132 (eq_attr "type" "store1"))
135 (define_insn_reservation "626te_store2_op" 1
136 (and (eq_attr "tune" "fa626,fa626te")
137 (eq_attr "type" "store2,store3"))
140 (define_insn_reservation "626te_store3_op" 2
141 (and (eq_attr "tune" "fa626,fa626te")
142 (eq_attr "type" "store4"))
145 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
146 ;; Branch and Call Instructions
147 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
149 ;; Branch instructions are difficult to model accurately. The FA626TE
150 ;; core can predict most branches. If the branch is predicted
151 ;; correctly, and predicted early enough, the branch can be completely
152 ;; eliminated from the instruction stream. Some branches can
153 ;; therefore appear to require zero cycle to execute. We assume that
154 ;; all branches are predicted correctly, and that the latency is
155 ;; therefore the minimum value.
157 (define_insn_reservation "626te_branch_op" 0
158 (and (eq_attr "tune" "fa626,fa626te")
159 (eq_attr "type" "branch"))
162 ;; The latency for a call is actually the latency when the result is available.
163 ;; i.e. R0 ready for int return value.
164 (define_insn_reservation "626te_call_op" 1
165 (and (eq_attr "tune" "fa626,fa626te")
166 (eq_attr "type" "call"))