Commit ca5ee584 authored by Sebastien Bourdeauducq's avatar Sebastien Bourdeauducq
Browse files

vivado: keep -> dont_touch

parent 20ef4805
from migen.fhdl.specials import Keep
from migen.build.generic_platform import GenericPlatform
from migen.build.xilinx import common, vivado, ise
......@@ -18,6 +19,8 @@ class XilinxPlatform(GenericPlatform):
so = dict(common.xilinx_special_overrides)
if self.device[:3] == "xc7":
so.update(common.xilinx_s7_special_overrides)
if isinstance(self.toolchain, vivado.XilinxVivadoToolchain):
so[Keep] = vivado.VivadoKeep
so.update(special_overrides)
return GenericPlatform.get_verilog(self, *args, special_overrides=so, **kwargs)
......
......@@ -6,6 +6,7 @@ import subprocess
import sys
from migen.fhdl.structure import _Fragment
from migen.fhdl.specials import SynthesisDirective
from migen.build.generic_platform import *
from migen.build import tools
from migen.build.xilinx import common
......@@ -70,6 +71,13 @@ def _run_vivado(build_name, vivado_path, source, ver=None):
raise OSError("Subprocess failed")
class VivadoKeep:
@staticmethod
def emit_verilog(directive, ns, add_data_file):
sig_name = ns.get_name(directive.signals["s"])
return "// synthesis attribute dont_touch of " + sig_name + " is true\n"
class XilinxVivadoToolchain:
def __init__(self):
self.bitstream_commands = []
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment