fragment = fragment.get_fragment()
self.finalize(fragment)
- v_src, named_sc, named_pc = self.get_verilog(fragment)
+ v_src, vns = self.get_verilog(fragment)
+ named_sc, named_pc = self._resolve_signals(vns)
v_file = build_name + ".v"
tools.write_to_file(v_file, v_src)
sources = self.sources + [(v_file, "verilog")]
os.chdir("..")
+ return vns
+
def add_period_constraint(self, clk, period):
self.add_platform_command("""set_global_assignment -name DUTY_CYCLE 50 -section_id {clk}""", clk=clk)
self.add_platform_command("""set_global_assignment -name FMAX_REQUIREMENT "{freq} MHz" -section_id {clk}\n""".format(freq=str(float(1/period)*1000), clk="{clk}"), clk=clk)
fragment = fragment.get_fragment()
# generate source
src, vns = gen_fn(fragment)
- named_sc, named_pc = self._resolve_signals(vns)
- return src, named_sc, named_pc
+ return src, vns
def get_verilog(self, fragment, **kwargs):
return self._get_source(fragment, lambda f: verilog.convert(f, self.constraint_manager.get_io_signals(),
ngdbuild_opt = self.ngdbuild_opt
+ vns = None
+
if mode == "xst" or mode == "yosys":
- v_src, named_sc, named_pc = self.get_verilog(fragment)
+ v_src, vns = self.get_verilog(fragment)
+ named_sc, named_pc = self._resolve_signals(vns)
v_file = build_name + ".v"
tools.write_to_file(v_file, v_src)
sources = self.sources + [(v_file, "verilog")]
synthesize(fragment, self.constraint_manager.get_io_signals())
if mode == "edif" or mode == "mist":
- e_src, named_sc, named_pc = self.get_edif(fragment)
+ e_src, vns = self.get_edif(fragment)
+ named_sc, named_pc = self._resolve_signals(vns)
e_file = build_name + ".edif"
tools.write_to_file(e_file, e_src)
isemode = "edif"
os.chdir("..")
+ return vns
+
def add_period_constraint(self, clk, period):
self.add_platform_command("""NET "{clk}" TNM_NET = "GRP{clk}";
TIMESPEC "TS{clk}" = PERIOD "GRP{clk}" """+str(period)+""" ns HIGH 50%;""", clk=clk)
if not isinstance(fragment, _Fragment):
fragment = fragment.get_fragment()
self.finalize(fragment)
- v_src, named_sc, named_pc = self.get_verilog(fragment)
+ v_src, vns = self.get_verilog(fragment)
+ named_sc, named_pc = self._resolve_signals(vns)
v_file = build_name + ".v"
tools.write_to_file(v_file, v_src)
sources = self.sources + [(v_file, "verilog")]
os.chdir("..")
+ return vns
+
def add_period_constraint(self, clk, period):
self.add_platform_command("""create_clock -name {clk} -period """ +\
str(period) + """ [get_ports {clk}]""", clk=clk)