def check_lru(sc):
    """ Check LRU replacement of sim_cache. """

    sc.reset()

    # Setup 5 addresses with different tags but in the same set
    address = [sc.merge_address(i, 0, 0) for i in range(5)]

    # Write different data to each address
    for i in range(5):
        sc.write(address[i], "1111", i + 1)

    # address[0] must be evicted
    if sc.find_way(address[0]) is not None:
        return False

    sc.read(address[1])
    sc.read(address[0])

    # address[2] must be evicted
    if sc.find_way(address[2]) is not None:
        return False

    return True