1 |
709 |
jeremybenn |
;; Faraday FA626TE Pipeline Description
|
2 |
|
|
;; Copyright (C) 2010 Free Software Foundation, Inc.
|
3 |
|
|
;; Written by I-Jui Sung, based on ARM926EJ-S Pipeline Description.
|
4 |
|
|
;;
|
5 |
|
|
;; This file is part of GCC.
|
6 |
|
|
;;
|
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
|
10 |
|
|
;; version.
|
11 |
|
|
;;
|
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
|
15 |
|
|
;; for more details.
|
16 |
|
|
;;
|
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 |
|
|
;; . */
|
20 |
|
|
|
21 |
|
|
;; These descriptions are based on the information contained in the
|
22 |
|
|
;; FA626TE Core Design Note, Copyright (c) 2010 Faraday Technology Corp.
|
23 |
|
|
|
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).
|
33 |
|
|
|
34 |
|
|
;; This automaton provides a pipeline description for the Faraday
|
35 |
|
|
;; FA626TE core.
|
36 |
|
|
;;
|
37 |
|
|
;; The model given here assumes that the condition for all conditional
|
38 |
|
|
;; instructions is "true", i.e., that all of the instructions are
|
39 |
|
|
;; actually executed.
|
40 |
|
|
|
41 |
|
|
(define_automaton "fa626te")
|
42 |
|
|
|
43 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
44 |
|
|
;; Pipelines
|
45 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
46 |
|
|
|
47 |
|
|
;; There is a single pipeline
|
48 |
|
|
;;
|
49 |
|
|
;; The ALU pipeline has fetch, decode, execute, memory, and
|
50 |
|
|
;; write stages. We only need to model the execute, memory and write
|
51 |
|
|
;; stages.
|
52 |
|
|
|
53 |
|
|
;; S E M W
|
54 |
|
|
|
55 |
|
|
(define_cpu_unit "fa626te_core" "fa626te")
|
56 |
|
|
|
57 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
58 |
|
|
;; ALU Instructions
|
59 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
60 |
|
|
|
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.
|
64 |
|
|
;;
|
65 |
|
|
;; If the destination register is the PC, the pipelines are stalled
|
66 |
|
|
;; for several cycles. That case is not modeled here.
|
67 |
|
|
|
68 |
|
|
;; ALU operations
|
69 |
|
|
(define_insn_reservation "626te_alu_op" 1
|
70 |
|
|
(and (eq_attr "tune" "fa626,fa626te")
|
71 |
|
|
(eq_attr "type" "alu"))
|
72 |
|
|
"fa626te_core")
|
73 |
|
|
|
74 |
|
|
(define_insn_reservation "626te_alu_shift_op" 2
|
75 |
|
|
(and (eq_attr "tune" "fa626,fa626te")
|
76 |
|
|
(eq_attr "type" "alu_shift,alu_shift_reg"))
|
77 |
|
|
"fa626te_core")
|
78 |
|
|
|
79 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
80 |
|
|
;; Multiplication Instructions
|
81 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
82 |
|
|
|
83 |
|
|
(define_insn_reservation "626te_mult1" 2
|
84 |
|
|
(and (eq_attr "tune" "fa626,fa626te")
|
85 |
|
|
(eq_attr "insn" "smulwy,smlawy,smulxy,smlaxy"))
|
86 |
|
|
"fa626te_core")
|
87 |
|
|
|
88 |
|
|
(define_insn_reservation "626te_mult2" 2
|
89 |
|
|
(and (eq_attr "tune" "fa626,fa626te")
|
90 |
|
|
(eq_attr "insn" "mul,mla"))
|
91 |
|
|
"fa626te_core")
|
92 |
|
|
|
93 |
|
|
(define_insn_reservation "626te_mult3" 3
|
94 |
|
|
(and (eq_attr "tune" "fa626,fa626te")
|
95 |
|
|
(eq_attr "insn" "muls,mlas,smull,smlal,umull,umlal,smlalxy,smlawx"))
|
96 |
|
|
"fa626te_core*2")
|
97 |
|
|
|
98 |
|
|
(define_insn_reservation "626te_mult4" 4
|
99 |
|
|
(and (eq_attr "tune" "fa626,fa626te")
|
100 |
|
|
(eq_attr "insn" "smulls,smlals,umulls,umlals"))
|
101 |
|
|
"fa626te_core*3")
|
102 |
|
|
|
103 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
104 |
|
|
;; Load/Store Instructions
|
105 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
106 |
|
|
|
107 |
|
|
;; The models for load/store instructions do not accurately describe
|
108 |
|
|
;; the difference between operations with a base register writeback
|
109 |
|
|
;; (such as "ldm!"). These models assume that all memory references
|
110 |
|
|
;; hit in dcache.
|
111 |
|
|
|
112 |
|
|
(define_insn_reservation "626te_load1_op" 3
|
113 |
|
|
(and (eq_attr "tune" "fa626,fa626te")
|
114 |
|
|
(eq_attr "type" "load1,load_byte"))
|
115 |
|
|
"fa626te_core")
|
116 |
|
|
|
117 |
|
|
(define_insn_reservation "626te_load2_op" 4
|
118 |
|
|
(and (eq_attr "tune" "fa626,fa626te")
|
119 |
|
|
(eq_attr "type" "load2,load3"))
|
120 |
|
|
"fa626te_core*2")
|
121 |
|
|
|
122 |
|
|
(define_insn_reservation "626te_load3_op" 5
|
123 |
|
|
(and (eq_attr "tune" "fa626,fa626te")
|
124 |
|
|
(eq_attr "type" "load4"))
|
125 |
|
|
"fa626te_core*3")
|
126 |
|
|
|
127 |
|
|
(define_insn_reservation "626te_store1_op" 0
|
128 |
|
|
(and (eq_attr "tune" "fa626,fa626te")
|
129 |
|
|
(eq_attr "type" "store1"))
|
130 |
|
|
"fa626te_core")
|
131 |
|
|
|
132 |
|
|
(define_insn_reservation "626te_store2_op" 1
|
133 |
|
|
(and (eq_attr "tune" "fa626,fa626te")
|
134 |
|
|
(eq_attr "type" "store2,store3"))
|
135 |
|
|
"fa626te_core*2")
|
136 |
|
|
|
137 |
|
|
(define_insn_reservation "626te_store3_op" 2
|
138 |
|
|
(and (eq_attr "tune" "fa626,fa626te")
|
139 |
|
|
(eq_attr "type" "store4"))
|
140 |
|
|
"fa626te_core*3")
|
141 |
|
|
|
142 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
143 |
|
|
;; Branch and Call Instructions
|
144 |
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
145 |
|
|
|
146 |
|
|
;; Branch instructions are difficult to model accurately. The FA626TE
|
147 |
|
|
;; core can predict most branches. If the branch is predicted
|
148 |
|
|
;; correctly, and predicted early enough, the branch can be completely
|
149 |
|
|
;; eliminated from the instruction stream. Some branches can
|
150 |
|
|
;; therefore appear to require zero cycle to execute. We assume that
|
151 |
|
|
;; all branches are predicted correctly, and that the latency is
|
152 |
|
|
;; therefore the minimum value.
|
153 |
|
|
|
154 |
|
|
(define_insn_reservation "626te_branch_op" 0
|
155 |
|
|
(and (eq_attr "tune" "fa626,fa626te")
|
156 |
|
|
(eq_attr "type" "branch"))
|
157 |
|
|
"fa626te_core")
|
158 |
|
|
|
159 |
|
|
;; The latency for a call is actually the latency when the result is available.
|
160 |
|
|
;; i.e. R0 ready for int return value.
|
161 |
|
|
(define_insn_reservation "626te_call_op" 1
|
162 |
|
|
(and (eq_attr "tune" "fa626,fa626te")
|
163 |
|
|
(eq_attr "type" "call"))
|
164 |
|
|
"fa626te_core")
|
165 |
|
|
|