Open colluca opened 3 months ago
Parameter ssr_nr_credits is defined in the default HW configuration: https://github.com/pulp-platform/snitch_cluster/blob/e90dceb6a6c9bdb6bb5d1502b62b920242be9fa8/target/snitch_cluster/cfg/default.hjson#L115
ssr_nr_credits
However, this parameter is actually not used anywhere. The correct name for this parameter would be data_credits: https://github.com/pulp-platform/snitch_cluster/blob/e90dceb6a6c9bdb6bb5d1502b62b920242be9fa8/hw/snitch_cluster/src/snitch_cluster_wrapper.sv.tpl#L205
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: https://github.com/pulp-platform/snitch_cluster/blob/e90dceb6a6c9bdb6bb5d1502b62b920242be9fa8/docs/schema/snitch_cluster.schema.json#L576-L581
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: https://github.com/pulp-platform/snitch_cluster/blob/e90dceb6a6c9bdb6bb5d1502b62b920242be9fa8/util/clustergen/cluster.py#L73-L80
Generator
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: https://github.com/pulp-platform/snitch_cluster/blob/e90dceb6a6c9bdb6bb5d1502b62b920242be9fa8/util/clustergen/cluster.py#L357-L369
SnitchClusterTB
Parameter
ssr_nr_credits
is defined in the default HW configuration: https://github.com/pulp-platform/snitch_cluster/blob/e90dceb6a6c9bdb6bb5d1502b62b920242be9fa8/target/snitch_cluster/cfg/default.hjson#L115However, this parameter is actually not used anywhere. The correct name for this parameter would be
data_credits
: https://github.com/pulp-platform/snitch_cluster/blob/e90dceb6a6c9bdb6bb5d1502b62b920242be9fa8/hw/snitch_cluster/src/snitch_cluster_wrapper.sv.tpl#L205Regardless what value is set to
ssr_nr_credits
, the default fordata_credits
which is defined in the schema file is used: https://github.com/pulp-platform/snitch_cluster/blob/e90dceb6a6c9bdb6bb5d1502b62b920242be9fa8/docs/schema/snitch_cluster.schema.json#L576-L581To 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: https://github.com/pulp-platform/snitch_cluster/blob/e90dceb6a6c9bdb6bb5d1502b62b920242be9fa8/util/clustergen/cluster.py#L73-L80But only against the root schema, which doesn't include all parameters. The
ssr_nr_credits
parameter is in the remote schema for theSnitchClusterTB
class: https://github.com/pulp-platform/snitch_cluster/blob/e90dceb6a6c9bdb6bb5d1502b62b920242be9fa8/util/clustergen/cluster.py#L357-L369