aboutsummaryrefslogtreecommitdiff
path: root/config/core.cfg
blob: 9b2d3d3e1ab87da13c17804f9db4f2d5a9657d0f (plain) (blame)
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
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
# Config file for the Cryptech FPGA framework.

# [default] section. Defines defaults, if not specified on the command line.
#
# board: Name of the default [board] section to build, if the --board
#   option is not given.
#
# project: Name of the default [project] section to build, if the
#   --project option is not given.

[default]
board = alpha
project = hsm

# [board] sections, defining the target device.
#
# bus name: Name of the FPGA communications bus, used by applications to
#   read/write the FPGA core registers.
#
# bus width: Width of the FPGA address bus. (The data bus is always 32 bits.)
#
# extra wires: Defines extra I/O ports in the core_selector module definition.
#   Note this is a blob of text, not interpreted, so formatting and commas
#   will be copied out verbatim.
#
# requires: A list of cores that must be present. This supports a fallback
#   scheme so that, for example, if 'mkmif' is not in the project's list
#   of cores, it will use 'dummy-mkmif' instead. In this case, there is no
#   whitespace around the '/'.

[board alpha]
# Cryptech Alpha board
bus name = fmc
bus width = 24
modexp = modexpng
extra wires =
   output wire         mkm_sclk,
   output wire         mkm_cs_n,
   input  wire         mkm_do,
   output wire         mkm_di,
   input  wire         core_clk,

[board dev-bridge]
# Cryptech dev-bridge board - a Novena daughterboard that talks to the
# Novena's FPGA through the high-speed connector.
bus name = fmc
bus width = 17
modexp = modexps6

[board novena]
# Novena board
bus name = eim
bus width = 17
modexp = modexps6

# [project] sections
# 
# cores: A list of cores to build.

[project bare]
# for quick builds to test the bus
cores = 

[project hash]
# for testing just the SHA cores
cores = sha1 sha256 sha512 sha3

[project trng]
# for testing just the True Random Number Generator
cores = trng

[project rsa]
# RSA signing and verification. This is as much as will fit on the
# Novena's Spartan-6 FPGA.
cores = sha256 aes trng modexp mkmif

[project hsm]
# Make me one with everything
cores = keywrap modexp trng ecdsa256 ecdsa384 sha1 sha256 sha512

[project hsm-keywrap-mkmif]
cores = keywrap modexp trng

# [core] sections
#
# vfiles: A list of Verilog files to include in the vfiles list when
#   including a particular core. File paths are relative to the cores/
#   directory. All (optional) cores must have a vfiles option, so that the
#   configuration program knows what to put into core_vfiles.mk.
#
# requires: A list of other cores whose vfiles must be loaded to build
#   this core.  This has no effect on the generated core_selector.v
#   file, and has no effect at all if an instance of a core named here
#   is already included in the build.
#
# subcores: The TRNG core has an internal mux with slots for 16 sub-cores
#   (although it only uses 4). Unlike 'requires', subcores consume address
#   space and have to be accounted for in core_selector.v.
#
# core blocks: By default, each core gets a block of 256 registers. If a
#   core needs more address space (e.g. for block memories or subcores),
#   set the number of 256-block registers here.
#
# error wire: boolean indicating whether the core wants a error wire.
#
# block memory: boolean indicating whether the core uses block memory.
#   Effect of this is a bit strange: setting it triggers generation of
#   a one-cycle timing delay for every core in this build that does
#   *not* use block memory.  When no cores in the build use block
#   memory, the delay isn't necessary and is therefore omitted.
#
# reset name: what name to use for the reset wire, because we don't
#   seem to be able to agree on whether this is "reset_n" or "rst_n".
#
# extra ports: Extra port definitions in the core instance.
#   Note this is a blob of text, not interpreted, so formatting and commas
#   will be copied out verbatim.
#
# parameter XXXX: parameter to be passed when instantiating core.

[core sha1]
vfiles =
	hash/sha1/src/rtl/sha1.v
	hash/sha1/src/rtl/sha1_core.v
	hash/sha1/src/rtl/sha1_w_mem.v

[core sha256]
vfiles =
	hash/sha256/src/rtl/sha256.v
	hash/sha256/src/rtl/sha256_core.v
	hash/sha256/src/rtl/sha256_k_constants.v
	hash/sha256/src/rtl/sha256_w_mem.v

[core sha512]
vfiles =
	hash/sha512/src/rtl/sha512.v
	hash/sha512/src/rtl/sha512_core.v
	hash/sha512/src/rtl/sha512_h_constants.v
	hash/sha512/src/rtl/sha512_k_constants.v
	hash/sha512/src/rtl/sha512_w_mem.v

[core sha3]
module name = sha3_wrapper
reset name = rst_n
error wire = no
vfiles =
	hash/sha3/src/rtl/sha3_wrapper.v
	hash/sha3/src/rtl/sha3.v

[core trng]
requires = chacha sha512
core blocks = 16
subcores =
	avalanche_entropy
	rosc_entropy
	trng_mixer
	trng_csprng
extra ports =
      .avalanche_noise(noise),
      .debug(debug),
vfiles =
	rng/avalanche_entropy/src/rtl/avalanche_entropy.v
	rng/avalanche_entropy/src/rtl/avalanche_entropy_core.v
	rng/rosc_entropy/src/rtl/rosc.v
	rng/rosc_entropy/src/rtl/rosc_entropy.v
	rng/rosc_entropy/src/rtl/rosc_entropy_core.v
	rng/trng/src/rtl/trng.v
	rng/trng/src/rtl/trng_csprng.v
	rng/trng/src/rtl/trng_csprng_fifo.v
	rng/trng/src/rtl/trng_mixer.v

[core aes]
vfiles =
	cipher/aes/src/rtl/aes.v
	cipher/aes/src/rtl/aes_core.v
	cipher/aes/src/rtl/aes_decipher_block.v
	cipher/aes/src/rtl/aes_encipher_block.v
	cipher/aes/src/rtl/aes_inv_sbox.v
	cipher/aes/src/rtl/aes_key_mem.v
	cipher/aes/src/rtl/aes_sbox.v

[core chacha]
vfiles =
	cipher/chacha/src/rtl/chacha.v
	cipher/chacha/src/rtl/chacha_core.v
	cipher/chacha/src/rtl/chacha_qr.v

[core modexpng]
# next-gen ModExp for Xilinx Artix-7
core blocks = 16
block memory = yes
error wire = no
module name = modexpng_wrapper
reset name = rst_n
extra ports =
      .clk_core(core_clk),
vfiles =
	math/modexpng/rtl/modexpng_wrapper.v
	math/modexpng/rtl/modexpng_core_top.v
	math/modexpng/rtl/modexpng_general_worker.v
	math/modexpng/rtl/modexpng_mmm_dual.v
	math/modexpng/rtl/modexpng_reductor.v
	math/modexpng/rtl/modexpng_dsp_array_block.v
	math/modexpng/rtl/modexpng_io_block.v
	math/modexpng/rtl/modexpng_io_manager.v
	math/modexpng/rtl/modexpng_storage_block.v
	math/modexpng/rtl/modexpng_storage_manager.v
	math/modexpng/rtl/modexpng_uop_rom.v
	math/modexpng/rtl/modexpng_uop_engine.v
	math/modexpng/rtl/modexpng_recombinator_block.v
	math/modexpng/rtl/modexpng_recombinator_cell.v
	math/modexpng/rtl/modexpng_dsp_slice_mult_wrapper_xilinx.v
	math/modexpng/rtl/modexpng_dsp_slice_addsub_wrapper_xilinx.v
	math/modexpng/rtl/modexpng_sdp_36k_x18_wrapper_xilinx.v
	math/modexpng/rtl/modexpng_sdp_36k_x16_x32_wrapper_xilinx.v
	math/modexpng/rtl/modexpng_sdp_36k_x32_x16_wrapper_xilinx.v
	math/modexpng/rtl/modexpng_tdp_36k_x16_x32_wrapper_xilinx.v

[core modexpa7]
# ModExp for Xilinx Artix-7
core blocks = 8
block memory = yes
error wire = no
module name = modexpa7_wrapper
reset name = rst_n
parameter OPERAND_ADDR_WIDTH = 7
parameter SYSTOLIC_ARRAY_POWER = 1
vfiles =
	math/modexpa7/src/rtl/modexpa7_exponentiator.v
	math/modexpa7/src/rtl/modexpa7_factor.v
	math/modexpa7/src/rtl/modexpa7_n_coeff.v
	math/modexpa7/src/rtl/modexpa7_simple_fifo.v
	math/modexpa7/src/rtl/modexpa7_systolic_multiplier.v
	math/modexpa7/src/rtl/modexpa7_systolic_multiplier_array.v
	math/modexpa7/src/rtl/modexpa7_top.v
	math/modexpa7/src/rtl/modexpa7_wrapper.v
	lib/memory/bram_1rw_1ro_readfirst.v
	lib/memory/bram_1rw_readfirst.v
	lib/lowlevel/artix7/adder32_artix7.v
	lib/lowlevel/artix7/adder32_ce_artix7.v
	lib/lowlevel/artix7/subtractor32_artix7.v
	lib/lowlevel/artix7/subtractor32_ce_artix7.v
	lib/lowlevel/artix7/modexp_multiplier32_artix7.v
	lib/lowlevel/artix7/modexp_systolic_pe_artix7.v
	lib/lowlevel/artix7/dsp48e1_wrapper.v
	lib/lowlevel/artix7/dsp48e1_wrapper_modexp.v

[core modexps6]
# ModExp for Xilinx Spartan-6
core blocks = 4
block memory = yes
error wire = no
module name = modexps6_wrapper
vfiles =
	math/modexps6/src/rtl/modexps6_adder64_carry32.v
	math/modexps6/src/rtl/modexps6_buffer_core.v
	math/modexps6/src/rtl/modexps6_buffer_user.v
	math/modexps6/src/rtl/modexps6_modinv32.v
	math/modexps6/src/rtl/modexps6_montgomery_coeff.v
	math/modexps6/src/rtl/modexps6_montgomery_multiplier.v
	math/modexps6/src/rtl/modexps6_top.v
	math/modexps6/src/rtl/modexps6_wrapper.v
	math/modexps6/src/rtl/ram_1rw_1ro_readfirst.v
	math/modexps6/src/rtl/ipcore/multiplier_s6.v
	math/modexps6/src/rtl/ipcore/subtractor_s6.v

[core modexp]
# portable ModExp
error wire = no
vfiles =
	math/modexp/src/rtl/adder.v
	math/modexp/src/rtl/blockmem1r1w.v
	math/modexp/src/rtl/blockmem2r1wptr.v
	math/modexp/src/rtl/blockmem2r1w.v
	math/modexp/src/rtl/blockmem2rptr1w.v
	math/modexp/src/rtl/modexp.v
	math/modexp/src/rtl/modexp_core.v
	math/modexp/src/rtl/montprod.v
	math/modexp/src/rtl/residue.v
	math/modexp/src/rtl/shl.v
	math/modexp/src/rtl/shr.v

[core mkmif]
# Master Key Memory Interface
error wire = no
extra ports =
      .spi_sclk(mkm_sclk),
      .spi_cs_n(mkm_cs_n),
      .spi_do(mkm_do),
      .spi_di(mkm_di),
vfiles =
	util/mkmif/src/rtl/mkmif.v
	util/mkmif/src/rtl/mkmif_core.v
	util/mkmif/src/rtl/mkmif_spi.v

[core ecdsa256]
# ECDSA-P256 point multipler
# I *think* this all fits in one 256-register core block (see address map in ecdsa256/README.md)
# but I may be reading this cross-eyed so come back to this if the resulting bitstream acts weird.
block memory = yes
error wire = no
module name = ecdsa256_wrapper
vfiles =
	pkey/ecdsa256/rtl/ecdsa256_banks_array.v
	pkey/ecdsa256/rtl/ecdsa256_base_point_multiplier.v
	pkey/ecdsa256/rtl/ecdsa256_core_top.v
	pkey/ecdsa256/rtl/ecdsa256_microcode_rom.v
	pkey/ecdsa256/rtl/ecdsa256_operand_bank.v
	pkey/ecdsa256/rtl/ecdsa256_uop_worker.v
	pkey/ecdsa256/rtl/ecdsa256_wrapper.v
	math/ecdsalib/rtl/modular/ecdsa256_modular_multiplier.v
	math/ecdsalib/rtl/modular/ecdsa256_modular_reductor.v
	math/ecdsalib/rtl/modular/ecdsa256_modulus_distmem.v
	lib/memory/bram_1rw_1ro_readfirst.v
	lib/lowlevel/artix7/mac16_artix7.v
	lib/lowlevel/artix7/adder32_artix7.v
	lib/lowlevel/artix7/subtractor32_artix7.v
	lib/lowlevel/artix7/adder47_artix7.v
	lib/multiword/multiword_mover.v
	lib/multiword/multiword_comparator.v
	lib/modular/modular_adder.v
	lib/modular/modular_subtractor.v
	lib/lowlevel/artix7/dsp48e1_wrapper.v


[core ecdsa384]
# ECDSA-P384 point multipler
# I *think* this all fits in one 256-register core block (see address map in ecdsa384/README.md)
# but I may be reading this cross-eyed so come back to this if the resulting bitstream acts weird.
block memory = yes
error wire = no
module name = ecdsa384_wrapper
vfiles =
	pkey/ecdsa384/rtl/ecdsa384_banks_array.v
	pkey/ecdsa384/rtl/ecdsa384_base_point_multiplier.v
	pkey/ecdsa384/rtl/ecdsa384_core_top.v
	pkey/ecdsa384/rtl/ecdsa384_microcode_rom.v
	pkey/ecdsa384/rtl/ecdsa384_operand_bank.v
	pkey/ecdsa384/rtl/ecdsa384_uop_worker.v
	pkey/ecdsa384/rtl/ecdsa384_wrapper.v
	math/ecdsalib/rtl/modular/ecdsa384_modular_multiplier.v
	math/ecdsalib/rtl/modular/ecdsa384_modular_reductor.v
	math/ecdsalib/rtl/modular/ecdsa384_modulus_distmem.v
	lib/memory/bram_1rw_1ro_readfirst.v
	lib/lowlevel/artix7/mac16_artix7.v
	lib/lowlevel/artix7/adder32_artix7.v
	lib/lowlevel/artix7/subtractor32_artix7.v
	lib/lowlevel/artix7/adder47_artix7.v
	lib/multiword/multiword_mover.v
	lib/multiword/multiword_comparator.v
	lib/modular/modular_adder.v
	lib/modular/modular_subtractor.v
	lib/lowlevel/artix7/dsp48e1_wrapper.v

[core keywrap]
# AES-keywrap core
requires = aes mkmif
parameter ADDR_BITS = 12
core blocks = 16
block memory = yes
error wire = yes
module name = keywrap
extra ports =
      .mkm_spi_sclk(mkm_sclk),
      .mkm_spi_cs_n(mkm_cs_n),
      .mkm_spi_do(mkm_do),
      .mkm_spi_di(mkm_di),
vfiles =
	util/keywrap/src/rtl/keywrap.v
	util/keywrap/src/rtl/keywrap_core.v
	util/keywrap/src/rtl/keywrap_mkmif.v
	util/keywrap/src/rtl/keywrap_mem.v