fhdl/specials: add Keep SynthesisDirective
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Mon, 22 Jun 2015 22:35:58 +0000 (00:35 +0200)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Tue, 23 Jun 2015 14:14:42 +0000 (16:14 +0200)
migen/fhdl/specials.py

index 7264e83866534294fb867857927d0f3a7dcc45e0..cb176a8bccb1161f806d660a7d78bd1e6994437c 100644 (file)
@@ -337,3 +337,8 @@ class SynthesisDirective(Special):
         name_dict = dict((k, ns.get_name(sig)) for k, sig in directive.signals.items())
         formatted = directive.template.format(**name_dict)
         return "// synthesis " + formatted + "\n"
+
+
+class Keep(SynthesisDirective):
+    def __init__(self, signal):
+        SynthesisDirective.__init__(self, "attribute keep of {s} is true", s=signal)