Skip to main content

CovInstance

Struct CovInstance 

Source
pub struct CovInstance {
    pub type_name: String,
    pub options: Options,
    pub samples: u64,
    /* private fields */
}

Fields§

§type_name: String

The covergroup type’s name.

§options: Options

option.* of the covergroup (including name, set_inst_name).

§samples: u64

Sample events this instance took part in (not stopped).

Implementations§

Source§

impl CovInstance

Source

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.

Source

pub fn name(&self) -> &str

Source

pub fn set_inst_name(&mut self, name: &str)

set_inst_name(name) (19.8).

Source

pub fn coverpoints(&self) -> &[Coverpoint]

Source

pub fn crosses(&self) -> &[Cross]

Source

pub fn coverpoint(&self, name: &str) -> Option<&Coverpoint>

Source

pub fn cross(&self, name: &str) -> Option<&Cross>

Source

pub fn find_item(&self, name: &str) -> Option<ItemRef>

The reference to the coverpoint or cross called name.

Source

pub fn is_started(&self, item: ItemRef) -> Result<bool, CovError>

Whether the item is collecting (the covergroup must be started too).

Source

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.

Source

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).

Source

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).

Source

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.

Source

pub fn get_option(&self, item: ItemRef, name: &str) -> Result<Val, CovError>

option.<name> read back.

Source

pub fn weight(&self, item: ItemRef) -> Result<i64, CovError>

The option.weight of an item of this instance.

Source

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).

Source

pub fn item_bins(&self, item: ItemRef) -> Result<Vec<(String, u64)>, CovError>

The bins an item’s coverage is measured over, with hit counts.

Source

pub fn own_score(&self, item: ItemRef) -> Result<Score, CovError>

get_inst_coverage() of this instance’s own bins (19.11.1-19.11.2, the weighted average of 19.11 for the group). 19.11.3’s exception for merge_instances is applied by the caller that knows the type.

Trait Implementations§

Source§

impl Debug for CovInstance

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V