![]() |
![]() |
![]() |
![]() |
mti_PrintFormatted()
Prints a formatted message to the main transcript window.
Syntax
mti_PrintFormatted( format, ... )Returns
Arguments
Name Type Description format char * The formatted string to be printed ... Zero or more arguments corresponding to the conversion characters in the format stringDescription
mti_PrintFormatted() prints a formatted message in the Main simulator window and in the transcript file. The functionality is similar to the C printf() function. The format string must contain newline characters where line breaks are desired.
Related functions
Example
FLI code
#include <mti.h> void printHierarchy( mtiRegionIdT region, int indent ) { char * region_name; mtiRegionIdT parent; mtiRegionIdT regid; region_name = mti_GetRegionFullName( region ); mti_PrintFormatted( "%*cRegion %s", indent, ' ', region_name ); mti_VsimFree( region_name ); parent = mti_HigherRegion( region ); if ( parent ) { mti_PrintFormatted( " (Parent region is %s)\n", mti_GetRegionName( parent )); } else { mti_PrintFormatted( "\n" ); } indent += 2; for ( regid = mti_FirstLowerRegion( region ); regid; regid = mti_NextRegion( regid ) ) { printHierarchy( regid, indent ); } } void loadDoneCB( void * param ) { mtiRegionIdT regid; mti_PrintFormatted( "\nHierarchy:\n" ); for ( regid = mti_GetTopRegion(); regid; regid = mti_NextRegion( regid ) ) { printHierarchy( regid, 1 ); } } 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( loadDoneCB, 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 inv is generic ( delay : time := 5 ns ); port ( a : in bit; b : out bit ); end inv; architecture b of inv is begin b <= a after delay; end b; entity mid is end mid; architecture a of mid is signal s1 : bit := '0'; signal s2 : bit := '0'; signal s3 : bit := '0'; signal s4 : bit := '0'; component for_model is end component; for all : for_model use entity work.for_model(a); component inv is generic ( delay : time := 5 ns ); port ( a : in bit; b : out bit ); end component; begin flip : inv port map ( s3, s4 ); i1 : for_model; s1 <= not s1 after 5 ns; s3 <= not s3 after 5 ns; toggle : inv port map ( s1, s2 ); end a; entity top is end top; architecture a of top is component mid is end component; begin inst1 : mid; 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.mid(a) # Loading work.inv(b) # Loading work.for_model(a) # Loading ./for_model.sl # # Hierarchy: # Region /top # Region /top/inst1 (Parent region is top) # Region /top/inst1/flip (Parent region is inst1) # Region /top/inst1/i1 (Parent region is inst1) # Region /top/inst1/toggle (Parent region is inst1) # Region /standard VSIM 1> quit
![]() Model Technology Inc. Voice: (503) 641-1340 Fax: (503)526-5410 http://www.model.com sales@model.com |
![]() |
![]() |
![]() |
![]() |