![]() |
![]() |
![]() |
![]() |
mti_RemoveEnvCB()
Removes an environment change callback.
Syntax
mti_RemoveEnvCB( func, param )Returns
Arguments
Description
mti_RemoveEnvCB() removes the specified function from the environment change callback list. The param parameter must be the same parameter that was specified in the call to mti_AddEnvCB() when the callback was created.
Related functions
Example
FLI code
#include "mti.h" void envCallback( void * param ) { mtiRegionIdT region = (mtiRegionIdT)param; mti_PrintFormatted( "Foreign Arch in Region %s: " "the current region is now %s.\n", mti_GetRegionName( region ), mti_GetRegionName( mti_GetCurrentRegion() ) ); if ( mti_Now() >= 20 ) { mti_RemoveEnvCB( envCallback, 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_AddEnvCB( envCallback, 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"; begin end a; entity bottom is end bottom; architecture b of bottom is begin end b; 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); component bottom is end component; begin bot : bottom; 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.bottom(b) # Loading work.for_model(a) # Loading ./for_model.sl # Foreign Arch in Region i1: the current region is now top. VSIM 1> env # sim:/top VSIM 2> run 10 VSIM 3> env /top/i1 # Foreign Arch in Region i1: the current region is now i1. # sim:/top/i1 VSIM 4> run 8 VSIM 5> env /top/bot # Foreign Arch in Region i1: the current region is now bot. # sim:/top/bot VSIM 6> run 5 VSIM 7> env /top/i1 # Foreign Arch in Region i1: the current region is now i1. # sim:/top/i1 VSIM 8> run 2 VSIM 9> env /top # sim:/top VSIM 10> quit
![]() Model Technology Inc. Voice: (503) 641-1340 Fax: (503)526-5410 http://www.model.com sales@model.com |
![]() |
![]() |
![]() |
![]() |