def METHOD_NAME(env, header):
    clock_pattern = re.compile(r"^#define\s+(?P<clk_per>(MCLK|PM))_(?P<clk>(AHB|APB[A-E]))MASK_(?P<per>([A-Z0-9])+(_2X)?(_[A-Z]+)?)_Pos(\s+)(?P<pos>([0-9]+))")
    peripheral_pattern = re.compile(r"^(?P<name>[A-Za-z]+([0-9]+[A-Za-z]+)?(_2X)?(_[A-Z]+)?)(?P<instance>[0-9]?)$")
    clock_map = {}
    with open(header, "r") as clock_header:
        for line in clock_header:
            m = clock_pattern.match(line)
            if m:
                m2 = peripheral_pattern.match(m.group("per"))
                (peripheral, instance) = (m2.group("name"), m2.group("instance"))
                if (peripheral, instance) in clock_map:
                    clock_map[(peripheral, instance)].append((m.group("clk_per"), m.group("clk"), m.group("pos")))
                else:
                    clock_map[(peripheral, instance)] = [(m.group("clk_per"), m.group("clk"), m.group("pos"))]
    return clock_map