Create new models
You can create new models with the Create New Model dialog.
There are various ways to invoke the Create New Model dialog. You can use the menu bar by selecting File→New, the toolbar button New Model, or you can right-click on a Tree View item of type Library, choose New Model and select the type of model you want to create.
- Type of Model
- From the drop-down menu, select the type of model you wish to create. Possible values are Library, System, Module, Primitive, FSM, or Probe.
It is not possible to change the type of model after its creation.
- Logical Name
- In this field you must define a logical name for the model. The logical name is used to identify the model in the Tree View.
- Library
- Here you can select the library to which the new model will belong. This determines the location of the new model, it becomes a subdirectory of the chosen library. The button on the right of the Library input field invokes the Select Library dialog where you can select a location to save the model. If it is a Library you are about to create, you may leave this field empty. The new library will then be located in My Libraries as a top-level library.
- Modeling Domain
- If the new model is of type system, module, or primitive select the domain that defines the model of computation for the model from the drop-down menu.
- Derive
- If the new model is of type primitive, this field is used to define from which existing primitive model the new one will derive, that is, from which primitive the new one inherits model parameters, ports, memories, events and resources.
- Physical Name
- In this field you can define the physical name of the new model component. If no physical name is entered, it is generated from the logical name and all characters which are not letters or digits are replaced with an underscore ( _ ). Either the physical or the logical name must be defined.
- Physical Location
- This field is only active for top-level libraries and is used to specify the model base (My Libraries or Shared Libraries) where the library and all models such as primitives, modules or systems contained in the library are stored.
- Group Permissions
- While creating a new library, you can set access rights for members of your user group. By default the group members have read and write access to the models. If you create any other type of model, that is, system, module, or primitive, the permissions are determined by the library to which the new model will belong.
MLDesigner on Windows® does not handle permissions as yet. New models inherit the permissions from the model base.
- World Permissions
- While creating a new library, you can set the access rights for users that do not belong to your user group. By default, other users have only read access to your models. If you create any other type of model, that is, system, module, or primitive, the permissions are determined by the library to which the new model will belong.
MLDesigner on Windows® does not handle permissions as yet. New models inherit the permissions from the model base.
- Description
- This description is used for tooltip texts generated for instances of the new model as well as for short descriptions in automatically generated online model documentation.
- Load Mode
- Defines the load mode. This property is only available for primitives and probes. FSM primitives do not use this option. You can select the load mode as Dynamic or Permanent. If you select load mode Dynamic, a shared library containing the primitive code is created on loading. This shared library is linked dynamically to the simulation process so the primitive can be reloaded after changes are made to it without re-entering simulation mode In contrast, by selecting load mode Permanent, the primitive is linked to the simulation process when entering simulation mode as is the case with built-in primitives (MLDesigner Libraries). Changes to permanently loaded Primitives or Probes only take effect after re-entering simulation mode.
It only makes sense to set the load mode to Permanent if you are going to create new primitives derived from the permanently loaded primitive. In such cases the permanently loaded primitive is known as the base primitive.
MLDesigner checks whether there is already a directory or a model with the same physical name in the directory of the selected library. If there is either a directory or a model with the same physical name, a warning message is displayed. In that case, you must change the physical name of the new model or select another library to save the model in.
It is possible to give the new model the same logical name as an existing model in the same location.
It is NOT possible to create a primitive with the same physical name in the same domain regardless of the location. Primitives must be given unique names.
The new directory contains all files necessary to describe the model. Dependent on its type these are:
- An XML (eXtensible Markup Language) model file with extension .mml and filename that corresponds to the Physical Name, for example, SDFMy_Primitive.mml.
- In case of a primitive, the primitive source file that serves as a template defining the functionality, for example, SDFMy_Primitive.pl.
- In case of a primitive, a makefile needed for its compilation.
- A file containing the hypertext documentation of the model in HTML format, for example, SDFMy_Primitive.htm