RAW File Structure ================== This section is written to help understand the why the structure of classes is defined as it is. The RAW file starts with a text preamble that contains information about the names of the traces the order they appear and some extra information. In the preamble, the lines are always started by one of the following identifiers: + Title: => Contains the path of the source .asc file used to make the simulation preceded by * + Date: => Date when the simulation started + Plotname: => Name of the simulation. Some known Simulation Types are: * AC Analysis * DC transfer characteristic * Operating Point * Transient Analysis * Transfer Function * Noise Spectral Density * Frequency Response Analysis * Noise Spectral Density Curves * Integrated Noise + Flags: => Flags that are used in this plot. The simulation can have any combination of these flags. * "real" -> The traces in the raw file contain real values. As for example on a TRAN simulation. * "complex" -> Traces in the raw file contain complex values. As for example on an AC simulation. * "forward" -> Tells whether the simulation has more than one point. DC transfer characteristic, AC Analysis, Transient Analysis or Noise Spectral Density have the forward flag. Operating Point and Transfer Function don't have this flag activated. * "log" -> The preferred plot view of this data is logarithmic. * "linear" -> The preferred plot view of this data is linear. * "stepped" -> The simulation had .STEP primitives. * "FastAccess" -> Order of the data is changed to speed up access. See Binary section for details. + No. Variables: => number of variables contained in this dataset. See section below for details. + No. Points: => number of points per each variable in + Offset: => when the saving of data started + Command: => Name of the simulator executable generating this file. + Backannotation: => Backannotation alerts that occurred during simulation + Variables: => a list of variable, one per line. See section below for details. + Binary|Values: => Start of the trace section, resp. in binary form or ASCII form. See section below for details. Variables List -------------- The variable list contains the list of measurements saved in the raw file. The order of the variables defines how they are stored in the binary section. The format is one variable per line, using the following format: Here is an example: .. code-block:: text 0 time time 1 V(n001) voltage 2 V(n004) voltage 3 V(n003) voltage 4 V(n006) voltage 5 V(adcc) voltage 6 V(n002) voltage 7 V(3v3_m) voltage 8 V(n005) voltage 9 V(n007) voltage 10 V(24v_dsp) voltage 11 I(C3) device_current 12 I(C2) device_current 13 I(C1) device_current 14 I(I1) device_current 15 I(R4) device_current 16 I(R3) device_current 17 I(V2) device_current 18 I(V1) device_current 19 Ix(u1:+) subckt_current 20 Ix(u1:-) subckt_current Trace Section -------------- The trace section of .RAW file is where the data is usually written. It is in binary format or in text format. Spice stores data directly onto the disk during simulation, writing per each time or frequency step the list of values, as exemplified below for a .TRAN simulation. ... ... ... ... ... Depending on the type of simulation, and the configuration of the simulator, when using the binary format, the type of data changes. On TRAN simulations the timestamp is always stored as 8 bytes float (double) and trace values as 4 bytes (single). On AC simulations the data is stored in complex format, which includes a real part and an imaginary part, each with 8 bytes. The way we determine the size of the data is dividing the total block size by the number of points, then taking only the integer part. Fast Access ----------- Once a simulation is done, the user can ask the simulator to optimize the data structure in such that variables are stored contiguously as illustrated below. ... ... ... ... ... ... This can speed up the data reading. Note that this transformation is not done automatically. Transforming data to Fast Access must be requested by the user. If the transformation is done, it is registered in the Flags: line in the header. RawReader supports both Normal and Fast Access formats. Multiple data sets/plots in one RAW file ----------------------------------------- Some simulators can create multiple result sets/plots in the same raw file. These are simply individual plots concatenated in the same file. See :doc:`../modules/read_rawfiles` for more information on this.