# File: veriptbl.src
#
# Loads and dumps IP tables and lists.
#
# Created M Levay 04.09.20--includes crop,limb, and other lists
#                           and dumps for verification 
# Heritage .. Iptbload  93.12.17 M. Levay
#          .. with mods 94.09.01 R Rehse 
#          .. Added Crop List load and Dump 94.09.18 M Levay
#          .. Added Limb Figure List load and Dump 94.09.20 M Levay
#          .. Added Vector and Medium-l List load and Dump 94.09.21 M Levay
#          .. Changed Vector to a "realistic" one supplied by TDT
#             And Added Rectangular Bin Lists 94.09.22 M Levay
#	   .. Fixed a couple of minor bugd    94.09.29 M Levay
# Assumptions:
#	IP Flight Code version xx.xx or higher has been loaded
#	Memory 16 has been initialized for 2 byte edac
#	Memory 17 has been initialized for 8 byte edac
#   These assumptions are realized by executing ipstrtf

program "@(#) MODULE: veriptbl.src RELEASE: %R%.%L% CREATED: %G% %U%"
source "/mdisw/cfl/eof/src/veriptbl.src"
descr "  veriptbl - Loads IP tables and lists"

display "Executing procedure veriptbl."


#  Load reciprocal table
tcblock mbiptbl 0 0 0x800a 0
wait time 10 

#  Load sqr root compr table
tcblock mbiptbl 1 0 0x8009 0
wait time 10 

#  Load velocity look-up table
tcblock mbiptbl 2 0x8000 0x800a 0
wait time 12 

# Load the geometry
tcblock mbiptbl 0x10 4000 3800 4096 4096 1024
wait time 10

# Load the Full Disk Crop List
tcblock mbiptbl 3 0 0x8800 0
wait time 15

# Load the Limb Figure List
tcblock mbiptbl 4 0x1000 0x8800 0 4000 3952 \
                176 24 0 0x6800 0 0 0x200 0xFA 0xF70
wait time 15

# Load X-vector for use by Medium-l
tcblock mbiptbl 0x11 1920 3584 6016 9472 13824 18816 23936 28416 31488 \
            32640 31488 28416 23936 18816 13824 9472 6016 3584 1920

wait time 2
# Load Y-vector for use by Medium-l
tcblock mbiptbl 0x12 1920 3584 6016 9472 13824 18816 23936 28416 31488 \
            32640 31488 28416 23936 18816 13824 9472 6016 3584 1920

wait time 5
# Load the Medium-l List
tcblock mbiptbl 6 0x7000 0x8800 0 3840 6 0x0008 \
                192 4 0 0x3001 0 0 0x1000 0x1000 0
wait time 15

# Load a Line Depth List
tcblock mbiptbl 7 0x1000 0x8801 0 3840 8 8 8 0x800A 1 0\
                208 24 0xC000 0x3001 0 0 450 0x3000 0
wait time 15

#                                 Pause the queue
tcblock mbipldin 0x154

#----------- Load programs to downlink tables
#
#                        Downlink SQCOMP
#              Copy Square root compression to mem 9
tcblock mbipcmd 0x91 300 0x164 0 0x8009 550 0x4800 0x4000 0
#              Set registers for size of transfer
tcblock mbipcmd 0x91 307 0x1b2 518 2 0x3fff 0 
#              Set registers for high rate transfer
tcblock mbipcmd 0x91 312 0x1b2 512 6 0 0 0x4800 0 0xffff 0xff70
#              Initialize high rate frm pg 9
tcblock mbipcmd 0x91 321 0x19C 512
#             Start 1 buffer high rate transfer from mem 9
tcblock mbipcmd 0x91 323 0x174 0x13 0x4800 518 
#              Return
tcblock mbipcmd 0x91 327 0x1FC
#
#                        Downlink RECIPROCAL
#              Copy RECIPROCAL to mem 9
tcblock mbipcmd 0x91 330 0x164 0 0x800A 550 0x4800 0x8000 0
#              Set registers for size of transfer
tcblock mbipcmd 0x91 337 0x1b2 518 2 0x7fff 0 
#              Set registers for high rate transfer
tcblock mbipcmd 0x91 342 0x1b2 512 6 0 0 0x4800 0 0xffff 0xff71
#              Iniitalize high rate from mem 9
tcblock mbipcmd 0x91 351 0x19C 512
#             Start 1 buffer high rate transfer from mem 9
tcblock mbipcmd 0x91 353 0x174 0x13 0x4800 518
#              Return
tcblock mbipcmd 0x91 357 0x1FC
#
#                        Downlink VLOOKFD
#              Copy VLOOKFD to mem 9
tcblock mbipcmd 0x91 360 0x164 0x8000 0x800A 550 0x4800 0x8000 0
#              Set registers for size of transfer
tcblock mbipcmd 0x91 367 0x1b2 518 2 0x7fff 0 
#              Set registers for high rate transfer
tcblock mbipcmd 0x91 372 0x1b2 512 6 0 0 0x4800 0 0xFFFF 0xFF72
#              Iniitalize high rate from mem 9
tcblock mbipcmd 0x91 381 0x19C 512
#             Start 1 buffer high rate transfer from mem 9
tcblock mbipcmd 0x91 383 0x174 0x13 0x4800 518
#              Return
tcblock mbipcmd 0x91 387 0x1FC


#                        Downlink CROPLIST
#              Copy CROPLIST to mem 9
tcb mbipmacl 400 0x164 0x0000 0x8800 550 0x4800 3500 0
#              Iniitalize high rate from mem 9
tcb mbipmacl 9999 0x1b2 512 6 0 0 0x4800 0 0xffff 0xff73
#             Load length to registers 518-519 
tcb mbipmacl  9999 0x1B2 518 2 3500 0
tcb mbipmacl 9999 0x19C 512
#             Start 1 buffer high rate transfer from mem 9
tcb mbipmacl 9999 0x174 0x13 0x4800 518
#              Return
tcb mbipmacl 9999 0x1FC

#                        Downlink LImb Figure List
#              Copy LImb Figure List to mem 9
tcb mbipmacl 500 0x164 0x1000 0x8800 550 0x4800 6500 0
#              Iniitalize high rate from mem 9
tcb mbipmacl 9999 0x1b2 512 6 0 0 0x4800 0 0xffff 0xff74
#             Load length to registers 518-519
tcb mbipmacl  9999 0x1B2 518 2 6500 0
tcb mbipmacl 9999 0x19C 512
#             Start 1 buffer high rate transfer from mem 9
tcb mbipmacl 9999 0x174 0x13 0x4800 518
#              Return
tcb mbipmacl 9999 0x1FC

#                        Downlink Medium-l List
#              Copy Medium-l List to mem 9
tcb mbipmacl 600 0x164 0x7000 0x8800 550 0x4800 42001 0
#              Iniitalize high rate from mem 9
tcb mbipmacl 9999 0x1b2 512 6 0 0 0x4800 0 0xffff 0xff75
#             Load length to registers 518-519
tcb mbipmacl  9999 0x1B2 518 2 42000 0
tcb mbipmacl 9999 0x19C 512
#             Start 1 buffer high rate transfer from mem 9
tcb mbipmacl 9999 0x174 0x13 0x4800 518
#              Return
tcb mbipmacl 9999 0x1FC

#                        Downlink Line Depth List
#              Copy Line Depth List to mem 9
tcb mbipmacl 700 0x164 0x1000 0x8801 550 0x4800 30000 0
#              Iniitalize high rate from mem 9
tcb mbipmacl 9999 0x1b2 512 6 0 0 0x4800 0 0xffff 0xff76
#             Load length to registers 518-519
tcb mbipmacl  9999 0x1B2 518 2 30000 0
tcb mbipmacl 9999 0x19C 512
#             Start 1 buffer high rate transfer from mem 9
tcb mbipmacl 9999 0x174 0x13 0x4800 518
#              Return
tcb mbipmacl 9999 0x1FC



#                              Return queue control to IP
tcblock mbipldin 0x136

open d

display "Start IP table dumps"
#writen !GS9 "Start IP table dumps %s" !TIME

display "Downlinking square root table"
tcblock mbipldin 0x152 300
wait time 5

display "Downlinking reciprocal table"
tcblock mbipldin 0x152 330
wait time 5

display "Downlinking velocity lookup table"
tcblock mbipldin 0x152 360
wait time 5

display "Downlinking Full Disk Crop List"
tcblock mbipldin 0x152 400
wait time 5

display "Downlinking Limb Figure List"
tcblock mbipldin 0x152 500
wait time 5

display "Downlinking Medium-l List"
tcblock mbipldin 0x152 600
wait time 5

display "Downlinking LIne Depth List"
tcblock mbipldin 0x152 700
wait time 5

display "Downlinking LIne Depth List"
tcblock mbipldin 0x152 700
wait time 5

close d

display "Finished procedure veriptbl: %s" !TIME

return

