![]() |
![]() |
![]() |
![]() |
mti_TickDir()
Syntax
direction = mti_TickDir( type_id )Returns
Name Type Description direction mtiInt32T +1 for ascending, -1 for descending, or 0 for no directionArguments
Name Type Description type_id mtiTypeIdT A handle to a VHDL typeDescription
mti_TickDir() returns the index direction of an array type or the range direction of any type that has a range.
Related functions
Example
FLI code
#include <mti.h> static char * getTypeStr( mtiTypeIdT typeid ) { switch ( mti_GetTypeKind( typeid ) ) { case MTI_TYPE_SCALAR: return "Scalar"; case MTI_TYPE_ARRAY: return "Array"; case MTI_TYPE_RECORD: return "Record"; case MTI_TYPE_ENUM: return "Enumeration"; case MTI_TYPE_PHYSICAL: return "Physical"; case MTI_TYPE_REAL: return "Real"; case MTI_TYPE_TIME: return "Time"; default: return "UNKNOWN"; } } static char * getDirStr( mtiTypeIdT typeid ) { switch( mti_TickDir( typeid ) ) { case -1: return "Descending"; case 0: return "No direction"; case 1: return "Ascending"; default: return "UNKNOWN"; } } static void initInstance( void ) { mtiSignalIdT sigid; mtiTypeIdT typeid; mti_PrintMessage( "Design Signals:\n" ); for ( sigid = mti_FirstSignal( mti_GetTopRegion() ); sigid; sigid = mti_NextSignal() ) { typeid = mti_GetSignalType( sigid ); mti_PrintFormatted( "%14s: type %-12s; direction = %s (%d)\n", mti_GetSignalName( sigid ), getTypeStr( typeid ), getDirStr( typeid ), mti_TickDir( typeid ) ); } } 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; library ieee; use ieee.std_logic_1164.all; entity top is type bitarray is array( 3 downto 0 ) of bit; type rectype is record a : bit; b : integer; c : bitarray; end record; type bigtime is range 0 to integer'high units hour; day = 24 hour; week = 7 day; month = 4 week; year = 12 month; end units; end top; architecture a of top is signal bitsig : bit := '1'; signal intsig : integer := 42; signal physsig : bigtime := 3 hour; signal realsig : real := 10.2; signal timesig : time := 3 ns; signal stdlogicsig : std_logic := 'H'; signal bitarr : bitarray := "1100"; signal stdlogicarr : std_logic_vector( 3 downto 0 ) := "01LH"; signal uparray : bit_vector( 1 to 4 ) := "0101"; signal rec : rectype := ( '0', 0, "1001" ); component for_model end component; for all : for_model use entity work.for_model(a); begin inst1 : 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 .../modeltech/sunos5/../ieee.std_logic_1164(body) # Loading work.top(a) # Loading work.for_model(a) # Loading ./for_model.sl # Design Signals: # bitsig: type Enumeration ; direction = Ascending (1) # intsig: type Scalar ; direction = Ascending (1) # physsig: type Physical ; direction = Ascending (1) # realsig: type Real ; direction = Ascending (1) # timesig: type Time ; direction = Ascending (1) # stdlogicsig: type Enumeration ; direction = Ascending (1) # bitarr: type Array ; direction = Descending (-1) # stdlogicarr: type Array ; direction = Descending (-1) # uparray: type Array ; direction = Ascending (1) # rec: type Record ; direction = No direction (0) VSIM 1> quit
![]() Model Technology Inc. Voice: (503) 641-1340 Fax: (503)526-5410 http://www.model.com sales@model.com |
![]() |
![]() |
![]() |
![]() |