Main Content

writeva

Generate Verilog-A description of rational object

    Description

    status = writeva(h,filename,innets,outnets,discipline,printformat,filestoinclude) writes a Verilog-A module that describes a 1-port rational object, h to a file specified using filename argument.

    The function, writeva implements the object in Verilog-A using Laplace transform S-domain filters and returns a status of True, if the write operation is successful, and False, if the write operation is unsuccessful.

    example

    Examples

    collapse all

    Create a S-parameters object from the S-parameter data and frequency.

    S = sparameters(0.5,2.4e9);

    Perform rational fitting of the S-parameters.

    h = rational(S);

    Write Verilog-A description of an rational object.

    status = writeva(h,'oneportS', ...
        'line_in', 'line_out', 'electrical', '%12.10e', 'disciplines.vams')
    status = logical
       1
    
    

    Input Arguments

    collapse all

    Rational function object, specified as a 1-port rational object.

    Verilog-A file name to which to write the module, specified as character vector or string scalar.

    The filename can be specified with or without a path name and extension. The default extension, .va, is added automatically if filename does not end in this extension. The module name that is used in the file is the part of the filename argument that remains when the path name and extension are removed.

    Name of each of the module's input nets, specified as a character vector or string scalar.

    Name of each of the module's output nets, specified as a character vector or string scalar.

    Precision of the following Verilog-A module parameters using the C language conversion specifications, specified as a character vector or string scalar. The C language conversion specifications includes:

    • The numerator and denominator coefficients of the Verilog-A filter.

    • The module's delay value and constant offset (or direct feedthrough), which are taken directly from the rational function object.

    For more information on how to specify printformat, see the Format specification for fprintf.

    Predefined Verilog-A discipline of the nets, specified as a character vector or string scalar. The discipline argument defines attributes and characteristics associated with the nets.

    List of header files to include in the module using Verilog-A 'include' statements, specified as a character vector or string scalar.

    Note

    The write function only accepts a single rationalfit object. It does not work with an array/matrix of rationalfit objects,

    Output Arguments

    collapse all

    Status of write operation, returned as a logical vector. The argument, status returns True, if the Verilog-A write operation is successful, and False if the Verilog-A write operation is unsuccessful.

    Version History

    Introduced before R2006a

    expand all