-
Notifications
You must be signed in to change notification settings - Fork 97
Description
Parameter ssr_nr_credits is defined in the default HW configuration:
| ssr_nr_credits: 4, |
However, this parameter is actually not used anywhere. The correct name for this parameter would be data_credits:
| "{shift_width}, {rpt_width}, {index_credits}, {isect_slave_credits}, {data_credits}, "\ |
Regardless what value is set to ssr_nr_credits, the default for data_credits which is defined in the schema file is used:
snitch_cluster/docs/schema/snitch_cluster.schema.json
Lines 576 to 581 in e90dceb
| "data_credits": { | |
| "type": "number", | |
| "description": "Number of credits and buffer depth of the data word FIFO.", | |
| "minimum": 1, | |
| "default": 4 | |
| }, |
To avoid incurring in the same situation in the future, the HW configuration file should be validated against the schema upon hardware generation, producing an error if some parameter is not defined in the schema.
This is done to some extent in the Generator class:
snitch_cluster/util/clustergen/cluster.py
Lines 73 to 80 in e90dceb
| def validate(self, cfg): | |
| # Validate the schema. This can fail. | |
| try: | |
| DefaultValidatingDraft7Validator( | |
| self.root_schema, resolver=self.resolver).validate(cfg) | |
| except ValidationError as e: | |
| print(e) | |
| exit(e) |
But only against the root schema, which doesn't include all parameters. The ssr_nr_credits parameter is in the remote schema for the SnitchClusterTB class:
snitch_cluster/util/clustergen/cluster.py
Lines 357 to 369 in e90dceb
| class SnitchClusterTB(Generator): | |
| """ | |
| A very simplistic system, which instantiates a single cluster and | |
| surrounding DRAM to test and simulate this system. This can also serve as a | |
| starting point on how to use the `snitchgen` library to generate more | |
| complex systems. | |
| """ | |
| def __init__(self, cfg): | |
| schema = Path(__file__).parent / "../../docs/schema/snitch_cluster_tb.schema.json" | |
| remote_schemas = [Path(__file__).parent / "../../docs/schema/snitch_cluster.schema.json"] | |
| super().__init__(schema, remote_schemas) | |
| # Validate the schema. | |
| self.validate(cfg) |