Gaw Data file formats

Introduction

This page gives a short description of the data file formats that can be used with Gaw and simple examples on how to generate them in your programs. You don't need to know about to use Gaw. This information may be incomplete and should not be taken as reference.

Ascii format

The ascii format is the simplier to use. It consists of one header line and n lines or rows of data. Each row is divided in columns separated with space or tabs. The first column is the independent variable, the others are the dependant variables. All the variable columns create a dataset. Here is an example with 6 dependant variables.

#time v(1) v(2) v(3) v(4) v(5) v(6)
1 12 0 0 0 0 12
2 23 0 0 0 0 35
3 33 0 0 0 0 68
.  . . . . . .
n 112 0 0 0 0 955

It is allowed to use punctuation characters at the beginning of the first line. They will be stripped off. The current list is '#', '!' and ' ' the SPACE character. The first line is important to detect the field names and number of fields.

You may have multiple datasets in the same file. You have just to follow the previous data with an empty line and write your rows again. But this empty line should not appear if not followed by data.

And now a simple example on how to generate each row.

     fprintf(datafd, "%lu %d %d %d %d %d %d\n", recv_sample_time,
              sample, modulation, ret_val, sig_info , ss_p, ss0 );

CAzM format

CAzM-format files contain a multiline header. The second to last line of the header identifies the analysis type, for example TRANSIENT or AC or TRANSFER. The last line of the header contains the names of the variables, seperated by whitespace. The data rows are the same as for ascii format. Here is an example of header :

* CAZM-format output from *

TRANSIENT ANALYSIS
Time Clk a1 a2 b1 b2 out 

Nsout format

Nsout is the NanoSim output format from Synopsis. Comments in the file are introduced with ';'. The file begins with one or more comment lines which must contains the word NanoSim or output_format for the format to be recognized.

Following the comments, line started with '.' are some instructions on how to interpret the data. They are voltage_resolution, current_resolution, time_resolution, high_threshold, high_threshold, etc...

The special intruction .index is followed with the variable name, variable index, and variable type. The index value is used later to provide a value to this variable at the corresponding independant variable.

After variable declaration, the data block begins with a value for independant variable and value for dependant variable indicated by index value.

; ------------------------------------------------------- 
;|               NanoSim Output Format                   |
;|                                                       |
;|                  Generated by Gaw                     |
;|                                                       |
; ------------------------------------------------------- 
;
; Tue Oct 13 09:16:34 2009
;
.voltage_resolution 1
.current_resolution 1
.time_resolution 1
;
.index sample 132 U
.index modulation 134 U
.index ret_val 136 U
.index sig_info 138 U
.index ss_p 140 U
.index zero_h 142 U
.index zero_l 144 U
.index in_win 146 U
1.00000000
132 251.00000000
134 0.00000000
136 0.00000000
138 0.00000000
140 0.00000000
142 148.00000000
144 108.00000000
146 0.00000000
2.00000000
; some more values
...

Spice2raw format

Spice2 is a binary format. All the sized blocks are contiguous. Data are expressed in little endian coding.

{ signature[8]
  header
     title[80]
     date[8];
     time[8];
     mode[2];
     nvars[2]
     const4[2]
  varname0[8]
  .
  varnamen[8]      # n is nvars - 1
  vartype0[2]
  .
  vartypen[2]
  varloc0[2]
  .
  varlocn[2]
  s2title[24]
  val_0[8]
  .
  val_n[8]        # n = nrows * nvars - 1
} repeated one or more times 

Spice3raw format

Spice3 comes in 2 formats : ascii and binary but share the same general format. The ascii format contains a Values: block that is replaced by a Binary: block in the binary format.

If the flag complex is given instead of real, each point takes 2 values real and imaginary. In binary format, these values are expressed with float (4 bytes) instead of double (8 bytes) in real mode.

Binary format looks to be in little endian coding.

Title: Title Card String
Date: Date
  { Plotname: Plot Name
    Flags: complex or real
    No. Variables: numoutputs 
    No. Points: numpoints
    Command: nutmeg command
    Variables:    0 varname1 typename1
                  1 varname2 typename2
                  etc...
    Values:
       0   n       n       n       n       ...
       1   n       n       n       n       ...
            And so forth...
  } repeated one or more times

Cadence Spectre is using this output format for the Values field:

 <rownumber><tab><point>         # starting new row
<tab><point>                     #   continuing a row                 
 <rownumber><tab><point>,<point> # starting new row, complex notation
<tab><point>,<point>             #   continuing with complex.

The Cadence file has a space before the row number a comma to separate the two parts of the complex number. The # and the following characters are a comment for this page and not part of the format. Here is an example:

Values:
 00.1,0.5
0.5,0.0
.
.

Hspice format

Hspice output can be ascii or binary and can be described as a header block followed with a data block

Variable names may cross lines and you can find spaces at end of the line. The value .10000E+31 indicates the end of this data block.

Header block
  line1 : 5 four digits numbers may be followed by comments
    nauto        : number of auto variables
    nprobe       : number of probe variables
    nsweepparam  : number of sweep parameters (usually 1)
    0000
    version : 9007 or 9601
    
  line2 : date time copyright etc
  line3 : number of data sets, may be 0 if only 1 set.
  line4 and +  : ended with special string "$&%#"
    num0 ... numn       : variable types  0 ... n
    string0 ... stringn : variable names  0 ... n
    sweep0 ... sweepn   : sweep parameter name (usually 1)
    
Data Block
{                          # line oriented with fixed-width fields
   d0 d1 ...      d7       # usually 7
   ...
   dn  .10000E+31
} repeated as many time as the number of data sets

The Hspice binary format looks like the following. The first data block has the same contents as line 1 to line 4 + of the ascii format with line feed removed.

Each value in values block is a float (4 bytes sized). Processing stops when the expected number of values have been read. This number is calculated from the block size.

Header block : fixed size 16 bytes.
  h1 endian indicator
  h2
  h3 endian indicator
  next block size
first data block
trailer block : fixed size 4 bytes. : size of the previous block

{
  Header block
  values block
  trailer block
} repeated as many time as the number of data sets