Ejemplo n.º 1
0
def get_actual_usage(v_list: List[Vertex], init_slot: Slot) -> float:
    usage = 0
    for r in RESOURCE_TYPES:
        total = sum(v.getVertexAndInboundFIFOArea()[r] for v in v_list)
        avail = init_slot.getArea()[r]
        percent = round(total / avail, 2)
        usage = max(usage, percent)

    return usage
Ejemplo n.º 2
0
def print_vertex_areas(v_list: List[Vertex], init_slot: Slot) -> None:
    _logger.info('The area of each vertex is listed as below.')
    _logger.info(
        'Note that the area of each vertex includes the area of all its in-bound FIFOs.'
    )
    for v in v_list:
        _logger.info(f'    {v.name}: ' +
                     ' '.join(f'{r}: {v.getVertexAndInboundFIFOArea()[r]}'
                              for r in RESOURCE_TYPES))

    _logger.info('The total area of the design:')
    for r in RESOURCE_TYPES:
        total = sum(v.getVertexAndInboundFIFOArea()[r] for v in v_list)
        avail = init_slot.getArea()[r]
        percent = round(total * 100 / avail, 1)
        _logger.info(f'  {r}: {total} / {avail} = {percent}%')