Table of Contents Previous page Next page Index

ModelSim

Model Technology Inc.


mti_WriteProjectEntry()

Writes an entry into the project (.ini) file.

Syntax

mti_WriteProjectEntry( key, value ) 

Returns

Nothing

Arguments

Name
Type
Description
key
char *
A string containing a keyword
value
char *
A string containing the value of the keyword

Description

mti_WriteProjectEntry() writes an entry into the modelsim.ini project file in the form:

key = value

The new entry is written at the end of the [vsim] section.

Related functions

mti_FindProjectEntry()

Example

FLI code

#include <mti.h>

void loadDoneCallback( void * param )
{
  char * entry;

  entry = mti_FindProjectEntry( "vsim", "MyConfig", 0 );
  mti_PrintFormatted( "MyConfig = %s\n", entry );
  mti_VsimFree( entry );

  entry = mti_FindProjectEntry( "vsim", "MyDesign", 0 );
  mti_PrintFormatted( "MyDesign = %s\n", entry );
  mti_VsimFree( entry );

  entry = mti_FindProjectEntry( "vsim", "MyMemory", 0 );
  mti_PrintFormatted( "MyMemory = %s\n", entry );
  mti_VsimFree( entry );
}

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( loadDoneCallback, 0 );
  mti_WriteProjectEntry( "MyConfig", "Solaris" );
  mti_WriteProjectEntry( "MyDesign", "cpu" );
  mti_WriteProjectEntry( "MyMemory", "4Meg" );
} 

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

  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
# MyConfig = Solaris
# MyDesign = cpu
# MyMemory = 4Meg
VSIM 1> quit
% grep My modelsim.ini
MyConfig = Solaris
MyDesign = cpu
MyMemory = 4Meg 


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

ModelSim