You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Some usecases, it may be useful to test whether a given ID is initialised or not. For example, I have data generators that can be driven by random distributions or a coverage ID. Currently I have a separate "coverage enable" signal to determine whether the coverage is used over the distribution. Instead of having this enable, it could be easier to test whether it is initialised:
--In CoveragePkgconstant COVERAGE_ID_UNINITIALISED : CoverageIdType := (ID :=integer'left);
if some_cov_id = COVERAGE_ID_UNINITIALISED then-- do something using the coverage idelse-- do not use coverage IDendif;
In addition, it would be useful to have an is_initialised function, in case the base types of the IDs ever change, and is more readable for the user and would be common accross packages:
if is_initialised(some_id ) then-- continue with the IDelse-- continue without the ID
Having the constant would also allow variables/signals that are record types that contain IDs to be initialised by name and not have to use integer'left, when the type declaration of the IDs themselves may change in future revisions:
current implementation:
record data_cfg_t is--some controls here
cov_id : CoverageIdType;
endrecord;
constant data_cfg_default : data_cfg_type := (cov_id => (ID =>integer'left)); -- CoverageID format may change in future OSVVM revisions
In Some usecases, it may be useful to test whether a given ID is initialised or not. For example, I have data generators that can be driven by random distributions or a coverage ID. Currently I have a separate "coverage enable" signal to determine whether the coverage is used over the distribution. Instead of having this enable, it could be easier to test whether it is initialised:
In addition, it would be useful to have an
is_initialised
function, in case the base types of the IDs ever change, and is more readable for the user and would be common accross packages:Having the constant would also allow variables/signals that are record types that contain IDs to be initialised by name and not have to use integer'left, when the type declaration of the IDs themselves may change in future revisions:
current implementation:
future proofing could be obtained via
The text was updated successfully, but these errors were encountered: