Examples
The data management example is located in the product directory:
${ICCAP_ROOT}/examples/demo_features/3_MEAS_ORGANIZE_n_
VERIFY_DATA/2_mdm_basics/2_xforms_2_db.mdl
The example model has two setups in the DUT dc_at_temps: fgummel_exp and fgummel_imp_all.
Exporting the Data Using a PEL
In the example, a PEL transform is used to export non-measurable/simulatable attribute-dependent data. The exporting data example uses the setup fgummel_exp. The PEL transform, mdm_export, is available in the setup and in this example, exports temperature.
In the macro (code listing below) line 32 registers a non-measurable/simulatable attribute called Temp. The sweep type is LIN with a start, stop and total number of points of TSTART =-50, TSTOP =50 and TNUM =11. The sweep order is 1. This function also returns the number of points. In lines 50 through 69, the setup (defined by the variable path) is simulated and exported (line 67). The MDM file exported in the example has 11 data-blocks corresponding to 11 different simulations/measurements that were made at the different temperatures.
Figure 41 Example: Exporting Data Using a PEL
! Here is a simple data export example which illustrates the use of the icdb_xxx
! commands. Although simulated data is exported in this example, it is easy
! to see how a simple replacement of the "Simulate" command inside the main
! export loop with a "Measure" would yield a data file with temperature dep-
! endent Gummel-Poon measurement data.
MDM_EXPORT_XFORM_DATA=1 ! flag to also export transform data
path = "/xforms_2_db/dc_at_temps/fgummel_exp" !path to the export setup
LINPUT "enter filename for database file",VAL$(filename),filename
file_exists=SYSTEM("ls "&VAL$(filename))
IF file_exists==0 THEN LINPUT "--WARNING--
overwriting existing file '"&VAL$(filename)&"'","ok",dummy
! This command opens the file that the data will be stored in.
! The function icdb_open returns nothing.
dummy=icdb_open(VAL$(filename))
! This command adds a comment line to the data file
dummy = icdb_add_comment(" Data management file for forward gummel data")
dummy = icdb_add_comment("")
! The next data base function tells IC-CAP to define a linear sweep over
! temperature. The function arguments are: sweep order, sweep start,
! sweep stop, number of points and sweep name. The function returns the
! cumulative number of points in all the registered user sweeps. The value
! "num_pts" is useful for setting up the export loop.
!Note: In this example the icdb_register_lin_sweep and icdb_register_list_sweep
! commands will generate the same file. One of the command must remain
! commented out.
num_pts=icdb_register_lin_sweep(1, TSTART, TSTOP, TNUM, "Temp")
! The next data base function tells IC-CAP to define a list sweep over
! temperature. The function arguments are: sweep order, sweep name,
! and IC-CAP variable array name. The function returns the cumulative
! number of points in all the registered user sweeps. The value "num_pts"
! is useful for setting up the export loop.
!num_pts=icdb_register_list_sweep(1, "Temp", "TEMP_LIST")
ICCAP_FUNC(path&"/ibicvsvb", "Display Plot")
ICCAP_FUNC(path&"/ibicvsvb", "Autoscale OnOff")
|
! Here is the "export" loop. The number of loop iterations should be consistent
! with the dimension of the user sweep space. For example, if a LIST sweep with
! 10 points is defined and a LIN sweep with 5 points is defined, then 5*10 = 50
! iterations of the export loop must be completed. The export functions will
! error out if too many iterations are attempted. However, if too few iter-
! ations are performed, the problem will go undetected until an import is tried.
! Use the return value of the icdb_register_xxx_sweep to set the maximum number
! of iterations. This should minimize the possibility of any errors.
count=0
while count < num_pts
! Once a sweep has been registered, IC-CAP automatically internally updates
! the values of all the user sweep values after each call to icdb_export_data.
! The function icdb_get_sweep_value provides useful means of getting the
! current value of any sweep variable. The function arguments are the index
! of the desired sweep value and the sweep name.
TEMP = icdb_get_sweep_value(count, "Temp")
! Now that we've updated the temperature for the simulator, we can
! re-simulate to compute a new set of data.
ICCAP_FUNC(path, "Simulate")
! This call exports the simulated data ("S") in the current setup out
! to the file. Measured data can be exported by specifying "M" for the
! second argument. The first call to icdb_export_data writes the header
! information as well as the setup data. The function icdb_export_data
! returns nothing. To reference a setup other than the one under which
! a transform is executing, the full path should be passed in as the
! first arguement of icdb_export_data.
dummy = icdb_export_data(".", "S")
count=count+1
end while
! This function closes the file opened with icdb_open. Note, that only one
! file can be opened at a time. The first opened file must be closed before
! a second one is opened. The function icdb_close returns nothing.
dummy=icdb_close()
ICCAP_FUNC(path&"/ibicvsvb", "Autoscale OnOff")
LINPUT "Run Import Data in Setup fgummel_imp_all
and load the beta curves from the data base file too",dummy
! The following code guarantees that the output of this transform will not be
! exported to the mdm file if MDM_EXPORT_XFORM_DATA is set to TRUE.
COMPLEX tmp[1]
RETURN tmp
|
Importing the Data
The importing data example uses the setup fgummel_imp_all. The setup has the non-simulatable attribute Temp defined as a Parameter mode. You can import the data using the Import Data button in the setup. If you wish, you can import a slice of the data. For example you can import data at temperatures 50, 100, 150 for vb between 300 mV and 700 mV.
|