def METHOD_NAME(self, cd, freq, phase=0, margin=0, name="", with_reset=True):
    assert self.nclkouts < self.nclkouts_max
    clk_out_name = f"{self.name}_clkout{self.nclkouts}" if name == "" else name
    if cd is not None:
        self.platform.add_extension([(clk_out_name, 0, Pins(1))])
        clk_name = f"{cd.name}_clk"
        clk_out = self.platform.request(clk_out_name)
        self.comb += cd.clk.eq(clk_out)
        self.platform.add_period_constraint(clk=clk_out, period=1e9/freq, name=clk_name)
        if with_reset:
            self.specials += AsyncResetSynchronizer(cd, ~self.locked)
        self.platform.toolchain.excluded_ios.append(clk_out_name)
    create_clkout_log(self.logger, clk_out_name, freq, margin, self.nclkouts)
    self.nclkouts += 1
    block = self.platform.toolchain.ifacewriter.get_block(self.name)
    block["clk_out"].append([clk_out_name, freq, phase, margin])