Commit 49142817 authored by Martin Cejp's avatar Martin Cejp
Browse files

Generate badges with f_max, DMIPS

parent 52d95486
Pipeline #567497277 passed with stages
in 4 minutes and 56 seconds
......@@ -2,6 +2,9 @@
![snapshot](_img/snapshot.jpg)
![Fmax badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fmcejp.gitlab.io%2FPoly94%2Ffmax.json)
![Benchmark badge](https://img.shields.io/endpoint?url=https%3A%2F%2Fmcejp.gitlab.io%2FPoly94%2Fdmips.json)
## Connecting ULX3S
You need to connect to USB1 (US1) connector to the host computer in order to program the board.
......
......@@ -34,3 +34,21 @@ Path("builds.html").write_text(template.render(
builds=builds,
project_url=os.environ["CI_PROJECT_URL"]
))
# Generate badges
# TODO: these should take information from "last successful build on master" or something like that, rather than just last build overall
reference_build = builds[0]
reference_clk = "$glbnet$clk_sys"
try:
fmax_str = "%.1f MHz" % reference_build["build"]["fmax"][reference_clk]["achieved"]
except:
fmax_str = "unknown"
try:
dmips_str = "%.1f DMIPS" % reference_build["benchmark"]["dmips"]
except:
dmips_str = "unknown"
Path("fmax.json").write_text(json.dumps(dict(schemaVersion=1, label="Fmax", message=fmax_str, color="orange")))
Path("dmips.json").write_text(json.dumps(dict(schemaVersion=1, label="Benchmark", message=dmips_str, color="blueviolet")))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment