cva6/.gitlab-ci/scripts/report_fpga.py
Valentin Thomazic 3d267f9344
Some checks are pending
bender-up-to-date / bender-up-to-date (push) Waiting to run
ci / build-riscv-tests (push) Waiting to run
ci / execute-riscv64-tests (push) Blocked by required conditions
ci / execute-riscv32-tests (push) Blocked by required conditions
refactor gitlab ci & collect full fpga build artifacts (#2576)
* refactor gitlab ci & collect full fpga build artifacts
* remove fpga log.tail from dashboard
2024-11-04 19:37:52 +01:00

51 lines
1.6 KiB
Python

# Copyright 2022 Thales Silicon Security
#
# Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
# You may obtain a copy of the License at https://solderpad.org/licenses/
#
# Original Author: Guillaume Chauvon(guillaume.chauvon@thalesgroup.com)
import re
import sys
import report_builder as rb
with open(str(sys.argv[1]), "r") as f:
log = f.read()
pattern = re.compile(
"\|(?P<ind> +)(?P<Instance>[\w()\[\].]+) +\| +(?P<Module>[\w()\[\].]+) \| +(?P<TotalLUTs>\d+) \| +(?P<LogicLUTs>\d+) \| +(?P<LUTRAMs>\d+) \| +(?P<SRLs>\d+) \| +(?P<FFs>\d+) \| +(?P<RAMB36>\d+) \| +(?P<RAMB18>\d+) \| +(?P<DSP48Blocks>\d+) \|"
)
data = []
for line in pattern.finditer(log):
l = line.groupdict()
if l["Instance"] == "i_ariane_peripherals":
break
data.append(l)
report = rb.Report()
metric = rb.TableMetric('Utilization Results')
for i in data:
if (i["ind"]).count(" ") < 10:
if i["Instance"] == "ariane_xilinx":
total = int(i["TotalLUTs"]) // 1000
report.label = f"{total} kLUTs"
metric.add_value(
i["Instance"],
i["Module"],
i["TotalLUTs"] + " TotalLUTs",
i["LogicLUTs"] + " LogicLUTs",
i["LUTRAMs"] + " LUTRAMs",
i["SRLs"] + " SRLs",
i["FFs"] + " FFs",
i["RAMB36"] + " RAMB36",
i["RAMB18"] + " RAMB18",
i["DSP48Blocks"] + " DSP48Blocks",
)
report.add_metric(metric)
report.dump()