aboutsummaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2015-09-27 19:20:26 -0400
committerRob Austein <sra@hactrn.net>2015-09-27 19:20:26 -0400
commit54516bb49c631f447dbd443557fbde3285074c8a (patch)
tree4696642d14f05c67431f2ed4e289ecc2452754d6 /config
parent0ef997a7567156ed271f36b64e077bd75c9e1798 (diff)
Add "requires" option.
Diffstat (limited to 'config')
-rw-r--r--config/config.cfg8
-rwxr-xr-xconfig/config.py4
-rw-r--r--config/core_vfiles.mk8
3 files changed, 19 insertions, 1 deletions
diff --git a/config/config.cfg b/config/config.cfg
index 5f3cf21..9bb01ae 100644
--- a/config/config.cfg
+++ b/config/config.cfg
@@ -1,6 +1,6 @@
# Config file for the Cryptech Novena FPGA framework.
#
-# At present, there are three kinds of variables in this file.
+# At present, there are four kinds of variables in this file:
#
# default-section: Name of the configuration to build if the user
# doesn't specify one. Only meaningful in the default section.
@@ -11,6 +11,11 @@
# including a particular core. 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.
[default]
default-section = rsa
@@ -52,6 +57,7 @@ vfiles =
hash/sha512/src/rtl/sha512_w_mem.v
[trng]
+requires = chacha sha512
vfiles =
rng/avalanche_entropy/src/rtl/avalanche_entropy.v
rng/avalanche_entropy/src/rtl/avalanche_entropy_core.v
diff --git a/config/config.py b/config/config.py
index bf77a36..814826f 100755
--- a/config/config.py
+++ b/config/config.py
@@ -132,6 +132,10 @@ class Core(object):
def add_vfiles(self, cfg):
if self.instance_number == 0:
self.vfiles = cfg.get(self.name, "vfiles").split()
+ if cfg.has_option(self.name, "requires"):
+ for required in cfg.get(self.name, "requires").split():
+ if required not in self._instance_count:
+ self.vfiles.extend(cfg.get(required, "vfiles").split())
@property
def instance_name(self):
diff --git a/config/core_vfiles.mk b/config/core_vfiles.mk
index bd1c6d4..8def572 100644
--- a/config/core_vfiles.mk
+++ b/config/core_vfiles.mk
@@ -21,6 +21,14 @@ vfiles += \
$(CORE_TREE)/rng/trng/src/rtl/trng_csprng.v \
$(CORE_TREE)/rng/trng/src/rtl/trng_csprng_fifo.v \
$(CORE_TREE)/rng/trng/src/rtl/trng_mixer.v \
+ $(CORE_TREE)/cipher/chacha/src/rtl/chacha.v \
+ $(CORE_TREE)/cipher/chacha/src/rtl/chacha_core.v \
+ $(CORE_TREE)/cipher/chacha/src/rtl/chacha_qr.v \
+ $(CORE_TREE)/hash/sha512/src/rtl/sha512.v \
+ $(CORE_TREE)/hash/sha512/src/rtl/sha512_core.v \
+ $(CORE_TREE)/hash/sha512/src/rtl/sha512_h_constants.v \
+ $(CORE_TREE)/hash/sha512/src/rtl/sha512_k_constants.v \
+ $(CORE_TREE)/hash/sha512/src/rtl/sha512_w_mem.v \
$(CORE_TREE)/math/modexp/src/rtl/adder.v \
$(CORE_TREE)/math/modexp/src/rtl/blockmem1r1w.v \
$(CORE_TREE)/math/modexp/src/rtl/blockmem2r1wptr.v \