Languages

CommunityCategory: XMODELConverting Old Parameter File Formats

XMODEL

Converting Old Parameter File Formats

SA Support Team Staff 2015-11-05

From Release 2015.10, the primitives like filter, pwl_func, poly_func, etc. use parameter files described in Python language. But I have been using parameter files in the old format. Is there a way to convert them into the new format?

1 Answers
Best Answer
SA Support Team Staff 2015-11-06

All the parameter files for XMODEL primitives now use Python syntax as a way to provide a consistent format describing parameter values and options for all current and future XMODEL primitives. The parameter file can also be a Python script by itself executing some codes while being read, which can be handy in making parameters themselves be programmable. One example could be randomizing them for each and every simulation run. Starting from Release 2015.10, XMODEL provides a conversion utility called conv_dat , to help you convert the old parameter files into this new format. The basic usage of this conv_dat utility is:

conv_dat  -p  <primitive_name>   -o   <output_filename>    <input_filename>

For instance, if you’d like to convert a parameter file named "pwl.dat" for a pwl_gen primitive into a new format file named "pwl_new.dat", do:

conv_dat  -p  pwl_gen  -o pwl_new.dat  pwl.dat

An example of the new format parameter file is as below:

# XMODEL-PARAMFILE 1.0
# PRIMITIVE: pwl_func
data = [0.0, 10.0,
        0.4, 15.4,
        0.8, 20.1,
        1.2, 25.5,
        1.6, 20.1]