def extract_axi_res_from_hls_rpt(rpt_path):
    """Extract the resource usage for AXI modules from the HLS report in text format

    Parameters
    ----------
    rpt_path: str
        The path of HLS report

    Returns
    -------
    BRAM18K, FF, LUT
    """
    with open(rpt_path) as f:
        lines = f.readlines()
    BRAM18K_total = 0
    FF_total = 0
    LUT_total = 0
    for line in lines:
        if line.find("kernel0_gmem_") != -1:
            line = line.split("|")
            BRAM18K_total += float(line[3])
            FF_total += float(line[5])
            LUT_total += float(line[6])
    return BRAM18K_total, FF_total, LUT_total