Specifications
Embedded System Tools Guide (EDK 6.2i) www.xilinx.com 289
UG111 (v1.4) January 30, 2004 1-800-255-7778
Example
R
Example
This section explains the MLD format through an example MLD file and its corresponding 
Tcl file.
Example MLD file for a library
An example MLD file for the xilmfs library is given below:
OPTION psf_version = 2.1.0 ; 
OPTION is a keyword identified by the libgen tool. The option name following the 
OPTION keyword is a directive to the libgen tool to do a specific action. Here psf_version 
of the MLD file is defined to be 2.1. This is the only option that can occur before a BEGIN 
LIBRARY construct now.
BEGIN LIBRARY xilmfs 
The BEGIN LIBRARY construct defines the start of a library named “xilmfs”.
 OPTION DRC = mfs_drc ; 
 OPTION COPYFILES = all;
COPYFILES option indicates the files to be copied for the library. DRC option specifies the 
name of the Tcl procedure that the tool invokes while processing this library. Here 
“mfs_drc” is the Tcl procedure in the xilmfs_v2_1_0.tcl file that would be invoked by 
libgen while processing the xilmfs library.
 PARAM NAME = numbytes, DESC = "Number of Bytes", TYPE = int, DEFAULT = 
100000, DRC = drc_numbytes ; 
PARAM NAME = base_address, DESC = "Base Address", TYPE = int, DEFAULT = 
0x10000, DRC = drc_base_address ; 
 PARAM NAME = init_type, DESC = "Init Type", TYPE = enum, VALUES = ("New 
file system"=MFSINIT_NEW, "MFS Image"=MFSINIT_IMAGE, "ROM 
Image"=MFSINIT_ROM_IMAGE), DEFAULT = MFSINIT_NEW ; 
 PARAM NAME = need_utils, DESC = "Need additional Utilities?", TYPE = 
bool, DEFAULT = false ; 
PARAM defines a library parameter that can be configured. Each PARAM has the 
following properties associated with it whose meaning is self-explanatory - NAME, DESC, 
TYPE, DEFAULT, RANGE, DRC. The property VALUES defines the list of possible values 
associated with an ENUM type.
 BEGIN INTERFACE file 
 PROPERTY HEADER="xilmfs.h" ; 
 FUNCTION NAME=open, VALUE=mfs_file_open ; 
 FUNCTION NAME=close, VALUE=mfs_file_close ; 
 FUNCTION NAME=read, VALUE=mfs_file_read ; 
 FUNCTION NAME=write, VALUE=mfs_file_write ; 
 FUNCTION NAME=lseek, VALUE=mfs_file_lseek ; 
 END INTERFACE 
An Interface contains a list of standard functions. A library defining an interface should 
have values for the list of standard functions. It must also specify a header file where all the 
function prototypes are defined. 










