pub struct CovInstance {
pub type_name: String,
pub options: Options,
pub samples: u64,
/* private fields */
}Fields§
§type_name: StringThe covergroup type’s name.
options: Optionsoption.* of the covergroup (including name, set_inst_name).
samples: u64Sample events this instance took part in (not stopped).
Implementations§
Source§impl CovInstance
impl CovInstance
Sourcepub fn new(
decl: &CovGroupDecl,
topts: &TypeOptions,
auto_name: String,
ev: &mut dyn Eval,
ctor: &[Val],
) -> Result<(CovInstance, Vec<String>), CovError>
pub fn new( decl: &CovGroupDecl, topts: &TypeOptions, auto_name: String, ev: &mut dyn Eval, ctor: &[Val], ) -> Result<(CovInstance, Vec<String>), CovError>
Instantiates decl with constructor arguments ctor; topts are the
covergroup’s type options in effect, auto_name the name used when
the covergroup does not assign option.name (19.7: “unique name”).
Returns the instance and the warnings the bins raised.
pub fn name(&self) -> &str
Sourcepub fn set_inst_name(&mut self, name: &str)
pub fn set_inst_name(&mut self, name: &str)
set_inst_name(name) (19.8).
pub fn coverpoints(&self) -> &[Coverpoint]
pub fn crosses(&self) -> &[Cross]
pub fn coverpoint(&self, name: &str) -> Option<&Coverpoint>
pub fn cross(&self, name: &str) -> Option<&Cross>
Sourcepub fn find_item(&self, name: &str) -> Option<ItemRef>
pub fn find_item(&self, name: &str) -> Option<ItemRef>
The reference to the coverpoint or cross called name.
Sourcepub fn is_started(&self, item: ItemRef) -> Result<bool, CovError>
pub fn is_started(&self, item: ItemRef) -> Result<bool, CovError>
Whether the item is collecting (the covergroup must be started too).
Sourcepub fn start(&mut self, item: ItemRef) -> Result<(), CovError>
pub fn start(&mut self, item: ItemRef) -> Result<(), CovError>
start() (19.8): collection resumes. The covergroup’s own switch is
independent of its items’: starting the group does not start a coverpoint
that was stopped on its own.
Sourcepub fn stop(&mut self, item: ItemRef) -> Result<(), CovError>
pub fn stop(&mut self, item: ItemRef) -> Result<(), CovError>
stop() (19.8): later samples do not count. Sequences in flight are
dropped (the gap breaks consecutiveness, see Coverpoint::skip).
Sourcepub fn sample(
&mut self,
ev: &mut dyn Eval,
sargs: &[Val],
) -> Result<Vec<CovEvent>, CovError>
pub fn sample( &mut self, ev: &mut dyn Eval, sargs: &[Val], ) -> Result<Vec<CovEvent>, CovError>
One sampling event with the sample() arguments sargs (19.3, 19.8).
Sourcepub fn set_option(
&mut self,
item: ItemRef,
name: &str,
v: &Val,
) -> Result<(), CovError>
pub fn set_option( &mut self, item: ItemRef, name: &str, v: &Val, ) -> Result<(), CovError>
option.<name> = v executed procedurally (19.7). The options only the
definition may set are refused.
Sourcepub fn get_option(&self, item: ItemRef, name: &str) -> Result<Val, CovError>
pub fn get_option(&self, item: ItemRef, name: &str) -> Result<Val, CovError>
option.<name> read back.
Sourcepub fn weight(&self, item: ItemRef) -> Result<i64, CovError>
pub fn weight(&self, item: ItemRef) -> Result<i64, CovError>
The option.weight of an item of this instance.
Sourcepub fn at_least(&self, item: ItemRef) -> Result<u64, CovError>
pub fn at_least(&self, item: ItemRef) -> Result<u64, CovError>
The option.at_least of an item (the covergroup’s own is only the
default its items started with).