Table of Contents Previous page Next page Index

ModelSim

Model Technology Inc.


mti_RemoveSimStatusCB()

Removes a simulator run status change callback.

Syntax

mti_RemoveSimStatusCB( func, param ) 

Returns

Nothing

Arguments

Name
Type
Description
func
mtiVoidFuncPtrT
A pointer to a function being called at simulator run status change
param
void *
The parameter that was specified in the call to mti_AddSimStatusCB() when the callback was created

Description

mti_RemoveSimStatusCB() removes the specified function from the simulator run status change callback list. The param parameter must be the same parameter that was specified in the call to mti_AddSimStatusCB() when the callback was created.

Related functions

mti_AddSimStatusCB()

Example

FLI code

#include <mti.h>

void simStatusCallback( void * param, int run_status )
{
  mtiRegionIdT region = (mtiRegionIdT)param;

  mti_PrintFormatted( "Time [%ld,%ld]: Region %s: the simulator %s\n",
                     mti_NowUpper(), mti_Now(),
                     mti_GetRegionName( region ),
                     (run_status == 1) ? "is about to run" :
                                         "just completed a run" );
  if ( mti_Now() >= 25 ) {
    mti_RemoveSimStatusCB( simStatusCallback, param );
  }
}

void initForeign(
  mtiRegionIdT       region,   /* The ID of the region in which this     */
                               /* foreign architecture is instantiated.  */
  char              *param,    /* The last part of the string in the     */
                               /* foreign attribute.                     */
  mtiInterfaceListT *generics, /* A list of generics for the foreign model.*/
  mtiInterfaceListT *ports     /* A list of ports for the foreign model.   */
)
{
  mti_AddSimStatusCB( simStatusCallback, region );
} 

HDL code

entity for_model is
end for_model;

architecture a of for_model is
  attribute foreign of a : architecture is
    "initForeign for_model.sl; for_model";
begin
end a;

entity top is
end top;

architecture a of top is

  signal s1 : bit := '0';

  component for_model is
  end component;

  for all : for_model use entity work.for_model(a);

begin

  i1 : for_model;

  s1 <= not s1 after 5 ns;

end a; 

Simulation output

% vsim -c top
Reading .../modeltech/sunos5/../tcl/vsim/pref.tcl 

# 5.4b

# vsim -c top 
# Loading .../modeltech/sunos5/../std.standard
# Loading work.top(a)
# Loading work.for_model(a)
# Loading ./for_model.sl
VSIM 1> run 15
# Time [0,0]: Region i1: the simulator is about to run
# Time [0,15]: Region i1: the simulator just completed a run
VSIM 2> run 5
# Time [0,15]: Region i1: the simulator is about to run
# Time [0,20]: Region i1: the simulator just completed a run
VSIM 3> run 8
# Time [0,20]: Region i1: the simulator is about to run
# Time [0,28]: Region i1: the simulator just completed a run
VSIM 4> run 27
VSIM 5> echo $now
# 55 
VSIM 6> run 15
VSIM 7> quit 


Model Technology Inc.
Voice: (503) 641-1340
Fax: (503)526-5410
http://www.model.com
sales@model.com
TOC PREV NEXT INDEX

ModelSim