T
Tricky
Guest
I have the following type I can use in testbenches, normally as a
generic:
type stimulus_type is (random, count, from_file)
following the generic, I have to have other generics like:
RANDOM_SEED, COUNT_FROM, FILE_PATH that define how the stimulus is
constrained. But these generics have to always be present and given
some value, even if they are not used. Annoyingly, I have to have
these 3 secondary generics for each ip stimulus.
Would there be a more clever way of doing it to encapsulate the
parameters better, via subtyped records or something (if thats even
allowed) where I could do something like:
generic (
IP_A_STIM : stimulus_type := (type => from_file, filepath => "c:\data
\some_data");
IP_B_STIM : stimulus_type := (type => random, seed => 12345);
....etc
);
This would probably make it difficult, if not impossible to override
the generic via TCL when you call VSIM, but I thought it was an
interesting thought experiment. I cant think how Id even start -
parsing it might fail as the types wouldnt be the same. Anyone else
with some clever ideas?
generic:
type stimulus_type is (random, count, from_file)
following the generic, I have to have other generics like:
RANDOM_SEED, COUNT_FROM, FILE_PATH that define how the stimulus is
constrained. But these generics have to always be present and given
some value, even if they are not used. Annoyingly, I have to have
these 3 secondary generics for each ip stimulus.
Would there be a more clever way of doing it to encapsulate the
parameters better, via subtyped records or something (if thats even
allowed) where I could do something like:
generic (
IP_A_STIM : stimulus_type := (type => from_file, filepath => "c:\data
\some_data");
IP_B_STIM : stimulus_type := (type => random, seed => 12345);
....etc
);
This would probably make it difficult, if not impossible to override
the generic via TCL when you call VSIM, but I thought it was an
interesting thought experiment. I cant think how Id even start -
parsing it might fail as the types wouldnt be the same. Anyone else
with some clever ideas?