def render_help_lines(wavedrom):
    """
    Produce TikZ for a set of helplines on clock edges large enough to fill the
    space taken by the given WaveDrom.
    """
    width = max((int(len(signal.get("wave", "")) * signal.get("period", 1.0))
                 - int(signal.get("phase", 0.0)))
                for signal in wavedrom["signal"]
                )

    height = len(wavedrom["signal"])

    return r"""
       \foreach \tick in {0,...,%d}{
          \draw [draw=black!75!white, dotted]
                ([xshift=\tick*2.0*\wavewidth,yshift=0.5*\waveheight]last waveform)
             -- ++(0, -%d*\wavesep + \wavesep - \waveheight);
       }
    """ % (
        width, height
    )