Table of Contents Previous page Next page Index

ModelSim

Model Technology Inc.


mti_GetRunStopTime()

Gets the stop time of the current simulation run.

Syntax

mti_GetRunStopTime( stop_time ) 

Returns

Nothing

Arguments

Name
Type
Description
stop_time
mtiTime64T *
Returns the stop time of the current simulation run

Description

mti_GetRunStopTime() returns the stop time of the current simulation run in the stop_time parameter.

Related functions

mti_GetNextEventTime()

mti_GetNextNextEventTime()

mti_Now()

mti_NowIndirect()

mti_NowUpper()

Example

FLI code

#include <mti.h>

static void checkStopTime( void )
{
  mtiTime64T stop_time;

  mti_GetRunStopTime( &stop_time );
  mti_PrintFormatted( "Time [%d,%d]: Run stop time is [%d,%d]\n",
                     mti_NowUpper(), mti_Now(),
                     MTI_TIME64_HI32(stop_time),
                     MTI_TIME64_LO32(stop_time) );
}

static void initInstance( void )
{
  mtiProcessIdT procid;

  procid = mti_CreateProcess( "Test Process", checkStopTime, 0 );
  mti_Sensitize( procid, mti_FindSignal( "/top/s1" ), MTI_EVENT );
}

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_AddLoadDoneCB( initInstance, 0 );
} 

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 top is
end top;

architecture a of top is

  component for_model
  end component;

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

  signal s1 : bit := '0';

begin

  s1 <= not s1 after 5 ns;

  finst  : for_model;

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 6
# Time [0,5]: Run stop time is [0,6]
VSIM 2> run 7
# Time [0,10]: Run stop time is [0,13]
VSIM 3> run 6
# Time [0,15]: Run stop time is [0,19]
VSIM 4> quit 


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

ModelSim