From 54516bb49c631f447dbd443557fbde3285074c8a Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Sun, 27 Sep 2015 19:20:26 -0400 Subject: Add "requires" option. --- config/config.cfg | 8 +++++++- config/config.py | 4 ++++ config/core_vfiles.mk | 8 ++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) 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 \ -- cgit v1.2.3