MVLSIM AET File Format

Introduction

Note: If you don't know what MVLSIM or TexSim is or are not interested in random access (indexed/striped) simulation dump formats, hit your back button now as this information will mean nothing to you.

This document details the internal file structure of the MVLSIM format AET. As information on this file format has not been released, its characteristics were determined through exhaustive examination and experimentation. As such, there is some incomplete information present (e.g., it is yet unknown how parallel instantiation AETs are represented and some bytes have unknown uses) and some information may be incorrect. This file is being provided such that converters may be written for architectures that the aetrdr.o AET reader API has not been ported to. Sample converters mvl2vcd and tex2vcd are provided for more "complete" documentation purposes. They seem to work fine with non-parallel instance models under Texsim-7.1.6. However, use at your own risk.


Header Information

This contains information such as the date and time of model creation and simulation, the model name, the number of facilities in the model, facility geometries, etc. Note that all numeric variables stored are in PPC "big endian" format.

00000000: d0 00 00 00 00 06 00 02 00 00 00 b8 31 32 33 34  ............1234
00000010: f1 f2 f3 f4 30 35 2f 30 38 2f 30 31 31 34 3a 34  ....05/08/0114:4
00000020: 32 3a 30 35 3a f8 3d fd 00 00 00 00 00 00 12 e2  2:05:.=.........
00000000: d0 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --  MVLSIM format AET
00000000: -- -- -- -- -- -- -- -- -- -- -- -- 31 32 33 34  ASCII vs
00000010: f1 f2 f3 f4 -- -- -- -- -- -- -- -- -- -- -- --  EBCDIC encoding
00000010: -- -- -- -- 30 35 2f 30 38 2f 30 31 31 34 3a 34  AET generation date
00000020: 32 3a 30 35 -- -- -- -- -- -- -- -- -- -- -- --  and time
00000020: -- -- -- -- -- -- -- -- -- -- -- -- 00 00 12 e2  Amt of var mem needed?

00000030: 00 00 00 00 00 00 00 00 00 00 34 00 00 01 00 00  ..........4.....
00000030: -- -- -- -- -- -- -- -- -- -- -- -- 00 01 00 00  FacIndx Trampoline = 65536 facs
                                                           (TexSim only?)

00000040: 00 00 00 02 00 00 02 a9 00 00 b1 a3 00 00 00 00  ................
00000050: 00 00 00 01 00 00 00 00 30 35 2f 30 38 2f 30 31  ........05/08/01
00000060: 31 34 3a 34 30 3a 32 34 64 65 73 00 00 00 00 00  14:40:24des.....
00000040: -- -- -- -- 00 00 02 a9 -- -- -- -- -- -- -- --  Number of facs in model
00000050: -- -- -- -- -- -- -- -- 30 35 2f 30 38 2f 30 31  Model creation date
00000060: 31 34 3a 34 30 3a 32 34 64 65 73 00 -- -- -- --  and C fmt model name

00000070: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
00000090: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000b0: 30 00 00 00 80 00 84 00 00 00 00 00 00 00 00 00  0...............
Unknown what 00000070-000000bf represent.

000000c0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 02 a9  ................
000000d0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000e0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000f0: 00 00 02 a9 00 00 00 00 00 00 00 00 00 00 00 00  ................
000000c0: -- -- -- -- -- -- -- -- -- -- -- -- 00 00 02 a9  Number of facs
000000f0: 00 00 02 a9 -- -- -- -- -- -- -- -- -- -- -- --  in model

00000100: 00 00 00 00 00 01 00 01 01 00 00 00 00 00 12 e2  First fac geometry (#0)
00000110: 00 00 00 00 00 01 00 41 38 00 00 00 00 00 12 e2  Second fac geometry (#1)
.
.
.
00002b80: 00 00 00 00 00 01 00 05 38 00 00 00 00 00 12 e2  This is last fac geometry (#2a8)
00000110: -- -- -- -- 00 01 -- -- -- -- -- -- -- -- -- --  Rows (> 1 is array)
00000110: -- -- -- -- -- -- 00 41 -- -- -- -- -- -- -- --  Columns (# bits = 65 for this fac)
00000110: -- -- -- -- -- -- -- -- 38 -- -- -- -- -- -- --  MSB set if an MVL bus (*)
00000110: -- -- -- -- -- -- -- -- -- -- -- -- 00 00 12 e2  Amt of mem for facs?
(*) Single bits seem to be 01, vectors 38. Note that you OR 0x80 with this if it's an MVL bus. In that case, 2 bits will represent each of four MVL values for encodings in the value change part of the AET.

00: 0
01: 1
10: X
11: H (aka 'Z' in verilog)


Name Table

This contains delta compressed facility names. This seems to be alphabetically sorted in ascending order which is a handy way of efficiently encoding hierarchies--especially deep ones:

00002b90: 00 00 63 6c 6b 00 00 01 74 00 00 00 6b 31 30 78  ..clk...t...k10x
00002ba0: 00 00 02 31 78 00 00 02 32 78 00 00 02 33 78 00  ...1x...2x...3x.
00002bb0: 00 02 34 78 00 00 02 35 78 00 00 02 36 78 00 00  ..4x...5x...6x..
00002bc0: 02 78 00 00 01 32 78 00 00 01 33 78 00 00 01 34  .x...2x...3x...4
00002bd0: 78 00 00 01 35 78 00 00 01 36 78 00 00 01 37 78  x...5x...6x...7x
00002be0: 00 00 01 38 78 00 00 01 39 78 00 00 01 65 79 00  ...8x...9x...ey.
00002bf0: 00 03 73 63 68 65 64 2e 63 30 78 00 00 0a 31 30  ..sched.c0x...10
Encoding: Prefix copy length (2 bytes) + null terminated suffix. Assume first prefix name is "", hence the above represents:
00 00 "clk" 00          -> "" + "clk" = "clk"
00 01 "t" 00            -> "c" + "t" = "ct"
00 00 "k10x" 00         -> "" + "k10x" = "k10x"
00 02 "1x" 00           -> "k1" + "1x" = "k11x"
and so forth...
Value Change Section

Encoding is a command byte followed by relevant (if any) data. Note that the following "back references" exist:

2x -- --                -> 2 byte offset from start of file of prev change
4x -- -- --             -> 3 byte offset from start of file of prev change
6x -- -- -- --          -> 4 byte offset from start of file of prev change
The previous change offset is used to find the preceeding value change for a given signal. The method for reading a signal's value changes is that you have to start at the END of the file and work your way backwards. This is the *only* way to correlate which value change goes with which facility! (The index for the final value change for each facility is encoded at the end of the file and will be explained below.) Thus, MVLSIM format AETs are "striped" in that you have to read one signal backwards at a time. In order to get around this limitation, you can place all your facilities in a priority queue and work your way backwards stepwise.

  • Value Change Section Command Encodings

    There are several commands and some have "overloaded" functions:

    20 aa aa                -> Set to '0' (only for single bit facilities)
    aa aa = previous value change offset
    
    20 aa aa bb ...         -> Super Value Change escape sequence
    bb ... = "super value change" column bytes.  Currently, only "01XH" (corresponding
    to 0x00..0x03) are known.  these ONLY apply if the facility column length > 1 bit
    
    22 aa aa bb cc ...      -> Array row encode
    aa aa = previous value change offset
    bb = row index (this is 2 bytes if your array has > 255 rows)
    cc ... = row data (1 bit per column for "regular", 2 bits per column for MVL fac)
    
    24 aa aa bb ...         -> Set to '1'
    aa aa = previous value change offset
    bb ... = column bits (1 bit per column for "regular", 2 bits per column for MVL fac)
    column bits are only specified when the facility column length > 1 bit.
    
    28 aa aa                -> Set to 'X' (with offset)
    
    2c aa aa                -> Set to 'H' (with offset)
    
    (*) Note that for 20, 24, 28, 2c, the 3 and 4 byte variants exist with nybble prefixes of 4 and 6 (i.e., for 40, 44, 48, 4c the aa aa field is aa aa aa, and for 60, 64, 68, 6c the aa aa field is aa aa aa aa). Additionally, it seems that sometimes the command byte has to be ANDed with 0x7f, but it is unknown when this applies.
    a4 xx xx xx xx          -> Explicit timechange
    a5 xx                   -> Increment time by xx ticks
    a6                      -> Increment cycle time by one
    
    ac                      -> Flash all facilities to '0'
    ad                      -> Flash all facilities to '1'
    ae                      -> Flash all facilities to 'X'
    af                      -> Flash all facilities to 'H'
    
    b4                      -> Stop parsing
    
  • Example of starting of value change

    As you can see, if you do not begin at the end of file, you will not know which value change corresponds with which facility:

    
    00003e70: -- -- -- -- -- -- -- -- -- -- a4 00 00 00 00 ac  
    00003e80: a6 a6 a6 24 00 00 a6 24 00 00 24 00 00 24 00 00  
    00003e90: 24 00 00 24 00 00 24 00 00 24 00 00 24 00 00 24  
    00003ea0: 00 00 24 00 00 24 00 00 24 00 00 24 00 00 24 00  
    00003eb0: 00 24 00 00 24 00 00 24 00 00 24 00 00 24 00 00  
    00003ec0: 24 00 00 24 00 00 24 00 00 24 00 00 24 00 00 24  
    00003ed0: 00 00 24 00 00 24 00 00 24 00 00 24 00 00 24 00  
    00003ee0: 00 24 00 00 24 00 00 24 00 00 24 00 00 24 00 00  
    00003ef0: 24 00 00 24 00 00 24 00 00 24 00 00 24 00 00 24  
    00003f00: 00 00 24 00 00 24 00 00 24 00 00 24 00 00 24 00  
    00003f10: 00 24 00 00 24 00 00 24 00 00 24 00 00 24 00 00  
    00003f20: 24 00 00 24 00 00 24 00 00 24 00 00 24 00 00 24  
    
    Let's skip a bit...
    000046f0: 36 24 00 00 6e 24 00 00 6e 24 00 00 72 20 3e 83  6$..n$..n$..r >.
    00004700: 24 00 00 37 8b 78 b7 be fc 80 24 00 00 36 24 00  $..7.x....$..6$.
    00004710: 00 62 24 00 00 36 24 00 00 62 24 00 00 36 24 00  .b$..6$..b$..6$.
    00004720: 00 6e 24 00 00 6e 24 00 00 72 a6 20 3e 87 20 3e  .n$..n$..r. >. >
    00004730: 8a 20 3e 8d 20 3e 90 20 3e 93 20 3e 96 20 3e 99  . >. >. >. >. >.
    
    You can see backpointers in action at 46fd: 20 3e 83
    and 472b: 20 3e 87
    and 472e: 20 3e 8a
    and 4731: 20 3e 8d
    etc...
    Time Table Format

    The time table is concatenated onto the end of the value change data. The format for each entry is:

    aa aa aa aa bb bb bb bb
    
    aa aa aa aa = Offset in file
    bb bb bb bb = Time value at that offset
    
    00141ae0: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 00 00  
    00141af0: 3e 80 00 00 00 00 00 00 3e 81 00 00 00 01 00 00  
    00141b00: 3e 82 00 00 00 02 00 00 3e 83 00 00 00 03 00 00  
    00141b10: 3e 87 00 00 00 04 00 00 47 2b 00 00 00 05 00 00  
    
    So...
    00003e80 = cycle 0
    00003e81 = cycle 1
    00003e82 = cycle 2
    00003e83 = cycle 3
    00003e87 = cycle 4
    0000472b = cycle 5

    If you look at the position of the a6 values earlier in the AET, you will see that this is indeed how the table is set up.


    AET Epilogue

    The last 23 bytes are very important as they give the offsets for several important data areas in the AET:

    00146410: -- -- 00 00 0a a4 00 00 04 44 00 00 07 d0 b4 c5
    00146420: 00 00 00 00 00 00 04 43 b4
    
    00146410: -- -- 00 00 0a a4 -- -- -- -- -- -- -- -- -- --  Unknown, varies.
    00146410: -- -- -- -- -- -- 00 00 04 44 -- -- -- -- -- --  Last cycle + 1.
    00146410: -- -- -- -- -- -- -- -- -- -- 00 00 07 d0 -- --  2000.  Have seen 1000
                                                               here also..appears to be
                                                               some internal size alloc value.
    00146410: -- -- -- -- -- -- -- -- -- -- -- -- -- -- b4 --  End of section.
    00146410: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- c5  Unknown.  Sime kind of flag?
    00146420: 00 00 00 00 -- -- -- -- --                       First cycle.
    00146420: -- -- -- -- 00 00 04 43 --                       Last Cycle.
    00146420: -- -- -- -- -- -- -- -- b4                       Marks end of file--used for
                                                               early truncation detection.
    
    The section before the 23 bytes of eplilogue is an in-order four byte per entry offset table that indicates where the LAST value change is for each facility in the AET. This is the key to being able to decode the value change section:
    001463e0: 19 d6 00 13 a1 27 00 14 19 d2 00 13 a1 2c 00 14
    001463f0: 19 ce 00 13 a2 2b 00 13 a2 30 00 13 a2 35 00 13
    00146400: 98 a5 00 13 a2 3a 00 13 a2 3f 00 13 a2 44 00 13
    00146410: a2 49 -- -- -- -- -- -- -- -- -- -- -- -- -- --
    
    Facility 02a8 final value change is at 0013a249
    Facility 02a7 final value change is at 0013a244
    Facility 02a6 final value change is at 0013a23f
    Facility 02a5 final value change is at 0013a23a
    etc

    If a facility has no value change ever, it will have an offset of 00000000.


    Last Words: TexSim Encodings

    TexSim AETs are different in that they do not require timetables, they encode only single bits, and can be read from front to back. Some of the MVLSIM AET command bytes derive their heritage from TexSim AETs. Note that to extend the number of addressable facilities over 64k facs, "offsets" are used. The offset is a base address that a 2 byte value is added to to derive the "correct" fac number. In effect, offsets are used to trampoline greater than 64k. Another difference is that facility names are stored uncompressed. Here are the commands:

    a4 xx xx xx xx                   Absolute time
    a5 xx                            Delta time
    a6                               Increment time by one
    a7                               Reset time to zero
    a8 xx xx xx xx                   Absolute offset
    a9 xx                            New offset += xx * multiplier (32-bit val @ 0x3c in AET)
    aa                               a9 but xx is implied to be 1
    ab                               Reset offset to zero
    ac                               Flash all facs to '0'
    ad                               Flash all facs to '1'
    ae                               Flash all facs to 'X'
    af                               Flash all facs to 'H'
    b0 xx xx yy yy...                Change the next xx xx facs in following list to '0'
    b1 xx xx yy yy...                Change the next xx xx facs in following list to '1'
    b2 xx xx yy yy...                Change the next xx xx facs in following list to 'X'
    b3 xx xx yy yy...                Change the next xx xx facs in following list to 'H'
    b4                               Stop tag
    b5 xx xx xx                      Explicitly change fac xx xx xx to '0' (no offset used)
    b6 xx xx xx                      Explicitly change fac xx xx xx to '1' (no offset used)
    b7 xx xx xx                      Explicitly change fac xx xx xx to 'X' (no offset used)
    b8 xx xx xx                      Explicitly change fac xx xx xx to 'H' (no offset used)
    


    02jun01 bybell@nc.rr.com / bybell@xxedgexx.com
    Return to the GTKWave Homepage...