From d3a2b477d0411b006b7f16256d0b2765ea765a83 Mon Sep 17 00:00:00 2001 From: Rob Austein Date: Fri, 25 Sep 2015 18:45:35 -0400 Subject: Minor cleanup. --- config/config.py | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) (limited to 'config') diff --git a/config/config.py b/config/config.py index 65c540f..ddf7d0b 100755 --- a/config/config.py +++ b/config/config.py @@ -111,7 +111,18 @@ class Core(object): return createMux_template.format(core = self, core0 = self) def listVfiles(self): - return "".join(" \\\n\t$(core_tree)/" + vfile for vfile in self.vfiles) + return "".join(" \\\n\t$(CORE_TREE)/" + vfile for vfile in self.vfiles) + + +class BoardCore(Core): + """ + Board-level cores have a slightly different API, which we handle + with a different template, at least for now. + """ + + def createInstance(self): + return createInstance_template_board.format(core = self) + class SubCore(Core): """" @@ -126,16 +137,6 @@ class SubCore(Core): return createMux_template.format(core = self, core0 = self.parent) -class BoardCore(Core): - """ - Board-level cores have a slightly different API, which we handle - with a different template. - """ - - def createInstance(self): - return createInstance_template_board.format(core = self) - - class TRNGCore(Core): """ The TRNG core has an internal mux and a collection of sub-cores. @@ -144,9 +145,11 @@ class TRNGCore(Core): a different instance template in the hope that it is easier to read. """ + subcore_names = ("avalanche_entropy", "rosc_entropy", "trng_mixer", "trng_csprng") + def __init__(self, name): super(TRNGCore, self).__init__(name) - self.subcores = tuple(SubCore(name, self) for name in ("avalanche_entropy", "rosc_entropy", "trng_mixer", "trng_csprng")) + self.subcores = tuple(SubCore(name, self) for name in self.subcore_names) def assign_core_number(self, n): n = super(TRNGCore, self).assign_core_number(n) -- cgit v1.2.3