def parse_cpd(vpr_log):
    """Returns the critical path delay sequence from a VPR log.

    Parameters
    ----------
    vpr_log : str
        Path to the VPR log.

    Returns
    -------
    List[float]
        List of critical path delays, per routing iteration.
    """

    with open(vpr_log, "r") as inf:
        lines = inf.readlines()

    
    cpd = []
    for line in lines:
        if "Restoring best routing" in line:
            break
        elif "%" in line:
            cpd.append(float(line.split()[-6]))

    for line in lines:
        if "Critical path:" in line:
            cpd.append(float(line.split()[-2]))

    return cpd