From: Sergiusz Bazanski Date: Tue, 23 Jan 2018 00:23:20 +0000 (+0000) Subject: Allow for multiple synthesis directives in specials. X-Git-Tag: 24jan2021_ls180~1742^2~2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=21bd26dcdd68285bfbf9d78618002c674c56f734;p=litex.git Allow for multiple synthesis directives in specials. This is needed to specify timing constraints on some Lattice Diamond library specials, like the EHXPLLL. To keep backwards compatibility we allow the directive to still be a single string. If it's not, we assume it's an iterable. --- diff --git a/litex/gen/fhdl/specials.py b/litex/gen/fhdl/specials.py index 4b7ab386..e3fdafdf 100644 --- a/litex/gen/fhdl/specials.py +++ b/litex/gen/fhdl/specials.py @@ -181,11 +181,18 @@ class Instance(Special): r += "\t." + name_inst + "(" + name_design + ")" if not firstp: r += "\n" - if instance.synthesis_directive is not None: - synthesis_directive = "/* synthesis {} */".format(instance.synthesis_directive) - r += ")" + synthesis_directive + ";\n\n" - else: - r += ");\n\n" + + directives = instance.synthesis_directive + if directives is None: + directives = [] + elif type(directives) == str : + directives = [directives,] + + r += ")"; + for directive in directives: + r += "\n\t/* synthesis {} */".format(directive) + r += ";\n\n" + return r