[dashboard] Add multiple revisions
As IP grows and updated, it is needed to have multiple versions of IPs
to be managed in the dashboard. For instance, as UART, GPIO, RV_TIMER
were signed off, their versions shall be increased when the logic design
is changed.
This change introduces `revisions` field in the project Hjson file. If
this field is defined, the dashboard prints out new format.
Revised `uart` IP to show the example.
Signed-off-by: Eunchan Kim <eunchan@opentitan.org>
diff --git a/util/dashboard/dashboard_validate.py b/util/dashboard/dashboard_validate.py
index 099453e..e323651 100644
--- a/util/dashboard/dashboard_validate.py
+++ b/util/dashboard/dashboard_validate.py
@@ -38,6 +38,17 @@
'notes': ['s', "random notes"],
}
+entry_required = {
+ 'version': ['s', "module version"],
+ 'life_stage': ['s', "life stage of module"]
+}
+entry_optional = {
+ 'design_stage': ['s', "design stage of module"],
+ 'verification_stage': ['s', "verification stage of module"],
+ 'commit_id': ['s', "Staged commit ID"],
+ 'notes': ['s', "notes"],
+}
+
def validate(regs):
if not 'name' in regs:
@@ -45,8 +56,26 @@
return 1
component = regs['name']
- error = check_keys(regs, field_required, field_optional, component)
+ # If `revisions` is not in the object keys, the tool runs previous
+ # version checker, which has only one version entry.
+ if not "revisions" in regs:
+ error = check_keys(regs, field_required, field_optional, component)
+ if (error > 0):
+ log.error("Component has top level errors. Aborting.")
+ return error
+
+ # Assumes `revisions` field exists in the Hjson object.
+ # It iterates the entries in the `revisions` group.
+ error = 0
+ if not isinstance(regs['revisions'], list):
+ error += 1
+ log.error("`revisions` field should be a list of version entries")
+ return error
+
+ for rev in regs['revisions']:
+ error += check_keys(rev, entry_required, entry_optional, component)
+
if (error > 0):
- log.error("Component has top level errors. Aborting.")
+ log.error("Component has errors in revision field. Aborting.")
return error