ReconfigureIO / reco

A command line tool for interacting with Reconfigure.io services
Apache License 2.0
6 stars 3 forks source link

add ability to view build reports #35

Closed CampGareth closed 6 years ago

CampGareth commented 6 years ago

This PR adds the reco build report <id> command which allows a user to view build reports for a completed build. These reports include utilisation of various FPGA components.

Sample output:

$ reco build report e9c2a4c0-f6fb-4efc-9461-f47dc1dc16b3
Build Report: {
    "partName": "xcvu9p-flgb2104-2-i",
    "lutSummary": {
        "used": 809,
        "detail": {
            "lutLogic": {
                "used": 808,
                "available": 1182240,
                "description": "LUT as Logic",
                "utilisation": 0.07
            },
            "lutMemory": {
                "used": 1,
                "available": 591840,
                "description": "LUT as Memory",
                "utilisation": 0.01
            }
        },
        "available": 1182240,
        "description": "CLB LUTs",
        "utilisation": 0.07
    },
    "moduleName": "reconfigure_io_sdaccel_builder_stub_0_1",
    "regSummary": {
        "used": 1765,
        "detail": {
            "regLatch": {
                "used": 0,
                "available": 2364480,
                "description": "Register as Latch",
                "utilisation": 0
            },
            "regFlipFlop": {
                "used": 1765,
                "available": 2364480,
                "description": "Register as Flip Flop",
                "utilisation": 0.07
            }
        },
        "available": 2364480,
        "description": "CLB Registers",
        "utilisation": 0.07
    },
    "blockRamSummary": {
        "used": 1,
        "detail": {
            "blockRamB18": {
                "used": 0,
                "available": 4320,
                "description": "RAMB18",
                "utilisation": 0
            },
            "blockRamB36": {
                "used": 1,
                "available": 2160,
                "description": "RAMB36/FIFO",
                "utilisation": 0.05
            }
        },
        "available": 2160,
        "description": "Block RAM Tile",
        "utilisation": 0.05
    },
    "dspBlockSummary": {
        "used": 0,
        "available": 6840,
        "description": "DSPs",
        "utilisation": 0
    },
    "ultraRamSummary": {
        "used": 0,
        "available": 960,
        "description": "URAM",
        "utilisation": 0
    },
    "weightedAverage": {
        "used": 5257,
        "available": 9067200,
        "description": "Weighted Average",
        "utilisation": 0.06
    }
}
CampGareth commented 6 years ago

I'm not sure where I'd start with testing. I could mock Report to test the cmd side but the underlying Report function does a lot of stuff... and maybe that's the point, it should be broken down into a JSON formatter and a request doer which are each easier to test.