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 on the binary part 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. The known Simulation Types are: * Operation Point * DC transfer characteristic * AC Analysis * Transient Analysis * Noise Spectral Density - (V/Hz½ or A/Hz½) * Transfer Function + 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 exmple on a TRAN simulation. * "complex" -> Traces in the raw file contain complex values. As for exmple 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. * "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 as described below + Binary: => Start of the binary section. 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 Binary Section -------------- The binary section of .RAW file is where the data is usually written, unless the user had explicitly specified an ASCII representation. In this case this section is replaced with a "Values" section. LTSpice 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 the type of data changes. On TRAN simulations the timestamp is always stored as 8 bytes float (double) and trace values as a 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 LTSpice 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. PyLTSpice supports both Normal and Fast Access formats