-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathotbn_pq.core
307 lines (286 loc) · 8.64 KB
/
otbn_pq.core
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
CAPI=2:
# Copyright lowRISC contributors.
# Copyright Fraunhofer Institute for Applied and Integrated Security (AISEC).
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
# SPDX-License-Identifier: Apache-2.0
name: "aisec:ip:otbn_pq:0.1"
description: "OpenTitan Big Number Accelerator with PQ Extension(OTBN-PQ)"
filesets:
files_rtl_pq:
depend:
- aisec:ip:otbn_pq_pkg:0.1
files:
- rtl/otbn_adder.sv
- rtl/otbn_subtractor.sv
- rtl/otbn_bitreverse.sv
- rtl/otbn_multiplier.sv
- rtl/otbn_reg_addr_unit.sv
- rtl/otbn_twiddle_update.sv
- rtl/otbn_pq_alu.sv
- rtl/otbn_keccak_lane_unit.sv
- rtl/otbn_keccak_plane_unit.sv
file_type: systemVerilogSource
files_rtl_core:
depend:
- lowrisc:prim:assert
- lowrisc:prim:util
- lowrisc:prim:lfsr
- lowrisc:prim:xoshiro256pp
- lowrisc:prim:cipher_pkg
- lowrisc:prim:mubi
- lowrisc:prim:crc32
- lowrisc:prim:sparse_fsm
- lowrisc:prim:onehot
- lowrisc:prim:blanker
- lowrisc:ip:keymgr_pkg
- lowrisc:ip:edn_pkg
- lowrisc:prim:onehot_check
- aisec:ip:otbn_pq_pkg:0.1
files:
- rtl/otbn_controller.sv
- rtl/otbn_decoder.sv
- rtl/otbn_predecode.sv
- rtl/otbn_instruction_fetch.sv
- rtl/otbn_rf_base.sv
- rtl/otbn_rf_bignum.sv
- rtl/otbn_rf_base_ff.sv
- rtl/otbn_rf_bignum_ff.sv
- rtl/otbn_rf_base_fpga.sv
- rtl/otbn_rf_bignum_fpga.sv
- rtl/otbn_lsu.sv
- rtl/otbn_alu_base.sv
- rtl/otbn_alu_bignum.sv
- rtl/otbn_mac_bignum.sv
- rtl/otbn_loop_controller.sv
- rtl/otbn_stack.sv
- rtl/otbn_rnd.sv
- rtl/otbn_start_stop_control.sv
- rtl/otbn_core.sv
file_type: systemVerilogSource
files_rtl_top:
depend:
- lowrisc:ip:tlul
- lowrisc:prim:all
- lowrisc:prim:assert
- lowrisc:prim:util
- lowrisc:prim:ram_1p_scr
- lowrisc:prim:lc_sync
- lowrisc:ip:edn_pkg
- lowrisc:prim:edn_req
- lowrisc:ip:otp_ctrl_pkg
- aisec:ip:otbn_pq_pkg:0.1
files:
- rtl/otbn_reg_pkg.sv
- rtl/otbn_reg_top.sv
- rtl/otbn_scramble_ctrl.sv
- rtl/otbn.sv
file_type: systemVerilogSource
files_rtl_tb:
files:
- dv/sv/tb_tl_ul_pkg.sv
- dv/sv/testcase0000.sv : {is_include_file : true}
- dv/sv/testcase0001.sv : {is_include_file : true}
- dv/sv/testcase0002.sv : {is_include_file : true}
- dv/sv/testcase0003.sv : {is_include_file : true}
- dv/sv/testcase0004.sv : {is_include_file : true}
- dv/sv/testcase0005.sv : {is_include_file : true}
- dv/sv/testcase0010.sv : {is_include_file : true}
- dv/sv/testcase0011.sv : {is_include_file : true}
- dv/sv/testcase0012.sv : {is_include_file : true}
- dv/sv/testcase0020.sv : {is_include_file : true}
- dv/sv/testcase0021.sv : {is_include_file : true}
- dv/sv/testcase0022.sv : {is_include_file : true}
- dv/sv/testcase0023.sv : {is_include_file : true}
- dv/sv/testcase0024.sv : {is_include_file : true}
- dv/sv/testcase0025.sv : {is_include_file : true}
- dv/sv/testcase0026.sv : {is_include_file : true}
- dv/sv/testcase0027.sv : {is_include_file : true}
- dv/sv/testcase0028.sv : {is_include_file : true}
- dv/sv/testcase0029.sv : {is_include_file : true}
- dv/sv/testcase0030.sv : {is_include_file : true}
- dv/sv/testcase0031.sv : {is_include_file : true}
- dv/sv/testcase0040.sv : {is_include_file : true}
- dv/sv/testcase0041.sv : {is_include_file : true}
- dv/sv/testcase0042.sv : {is_include_file : true}
- dv/sv/testcase0043.sv : {is_include_file : true}
- dv/sv/testcase0100.sv : {is_include_file : true}
- dv/sv/testcase0101.sv : {is_include_file : true}
- dv/sv/testcase0200.sv : {is_include_file : true}
- dv/sv/testcase0201.sv : {is_include_file : true}
- dv/sv/testcase0202.sv : {is_include_file : true}
- dv/sv/testcase0210.sv : {is_include_file : true}
- dv/sv/testcase0211.sv : {is_include_file : true}
- dv/sv/testcase0212.sv : {is_include_file : true}
- dv/sv/testcase1000-dilitium-ii-valid.sv : {is_include_file : true}
- dv/sv/testcase1001-dilitium-ii-invalid.sv : {is_include_file : true}
- dv/sv/testcase1002-dilitium-iii-valid.sv : {is_include_file : true}
- dv/sv/testcase1003-dilitium-iii-invalid.sv : {is_include_file : true}
- dv/sv/testcase1004-dilitium-v-valid.sv : {is_include_file : true}
- dv/sv/testcase1005-dilitium-v-invalid.sv : {is_include_file : true}
- dv/sv/tb_otbn.sv
file_type: systemVerilogSource
files_verilator_waiver:
depend:
# common waivers
- lowrisc:lint:common
- lowrisc:lint:comportable
files:
- lint/otbn.vlt
file_type: vlt
files_ascentlint_waiver:
depend:
# common waivers
- lowrisc:lint:common
- lowrisc:lint:comportable
files:
- lint/otbn.waiver
file_type: waiver
files_constraints:
files:
- syn/constraints.sdc
file_type: sdc
parameters:
SYNTHESIS:
datatype: bool
paramtype: vlogdefine
SYNTHESIS_MEMORY_BLACK_BOXING:
datatype: bool
default: false
paramtype: vlogdefine
RegFile:
datatype: str
paramtype: vlogparam
default: RegFileFF
targets:
default: &default_target
filesets:
- tool_verilator ? (files_verilator_waiver)
- tool_ascentlint ? (files_ascentlint_waiver)
- files_rtl_pq
- files_rtl_core
- files_rtl_top
toplevel: otbn
lint:
<<: *default_target
default_tool: verilator
parameters:
- SYNTHESIS=true
tools:
verilator:
mode: lint-only
verilator_options:
- "-Wall"
lint-core:
filesets:
- files_rtl_pq
- files_rtl_core
toplevel: otbn_core
default_tool: verilator
parameters:
- SYNTHESIS=true
tools:
verilator:
mode: lint-only
verilator_options:
- "-Wall"
sim:
<<: *default_target
default_tool: vivado
filesets_append:
- files_rtl_tb
toplevel: tb_otbn
tools:
vivado:
part: "xc7k160tfbg676-1" # CW310 with K410T
syn:
<<: *default_target
# TODO: set default to DC once
# this option is available
# olofk/edalize#89
default_tool: icarus
parameters:
- SYNTHESIS=true
- SYNTHESIS_MEMORY_BLACK_BOXING=true
- RegFile=RegFileFF
tools:
genus:
script_dir: "../../../hw/ip/otbn/syn"
genus_script: "synth_genus_otbn.tcl"
report_dir: "../../reports"
common_config: ../../../hw/syn/tools/genus/config_genus.tcl
jobs: "all"
vivado:
part: "xc7k160tfbg676-1" # CW310 with K410T
syn_fpga:
<<: *default_target
# TODO: set default to DC once
# this option is available
# olofk/edalize#89
default_tool: icarus
parameters:
- SYNTHESIS=true
- SYNTHESIS_MEMORY_BLACK_BOXING=false
- RegFile=RegFileFPGA
tools:
vivado:
part: "xc7k160tfbg676-1" # CW310 with K410T
syn_pq_alu:
filesets:
- tool_verilator ? (files_verilator_waiver)
- tool_ascentlint ? (files_ascentlint_waiver)
- files_rtl_core
- files_rtl_top
toplevel: otbn_pq_alu
parameters:
- SYNTHESIS=true
tools:
vivado:
part: "xc7k160tfbg676-1" # CW310 with K410T
syn_pq_rau:
filesets:
- tool_verilator ? (files_verilator_waiver)
- tool_ascentlint ? (files_ascentlint_waiver)
- files_rtl_core
- files_rtl_top
toplevel: otbn_reg_addr_unit
parameters:
- SYNTHESIS=true
tools:
vivado:
part: "xc7k160tfbg676-1" # CW310 with K410T
syn_pq_trcu:
filesets:
- tool_verilator ? (files_verilator_waiver)
- tool_ascentlint ? (files_ascentlint_waiver)
- files_rtl_core
- files_rtl_top
toplevel: otbn_twiddle_update
parameters:
- SYNTHESIS=true
tools:
vivado:
part: "xc7k160tfbg676-1" # CW310 with K410T
syn_pq_kpu:
filesets:
- tool_verilator ? (files_verilator_waiver)
- tool_ascentlint ? (files_ascentlint_waiver)
- files_rtl_core
- files_rtl_top
toplevel: otbn_keccak_plane_unit
parameters:
- SYNTHESIS=true
tools:
vivado:
part: "xc7k160tfbg676-1" # CW310 with K410T
syn_pq_klu:
filesets:
- tool_verilator ? (files_verilator_waiver)
- tool_ascentlint ? (files_ascentlint_waiver)
- files_rtl_core
- files_rtl_top
toplevel: otbn_keccak_lane_unit
parameters:
- SYNTHESIS=true
tools:
vivado:
part: "xc7k160tfbg676-1" # CW310 with K410T