#!/bin/csh -f

alias BEGIN 'cat <<END'

# hierarchical names used in lower modules
set u1_name = "system.U1.U1.U1"
set u2_name = "system.U1.U2.U1"
set u3_name = "system.U1.U3.U1"
set u4_name = "system.U1.U4.U1"
set u5_name = "system.U1.U5.U1"

foreach arg ($*)
  if ($arg =~ fullctlsva) then
    set u1_name = "system.U1.U1.u10"
  else if ($arg =~ fullctlsvb) then
    set u2_name = "system.U1.U2.u10"
  else if ($arg =~ fullfsm) then
    set u3_name = "system.U1.U3.u9"
  else if ($arg =~ fulldataa) then
    set u4_name = "system.U1.U4.u8"
  else if ($arg =~ fulldatab) then
    set u5_name = "system.U1.U5.u8"
  endif
end


BEGIN
/* Output files for Interface Board */

\`timescale 1 ns / 10 ps

module ifcout ;

	parameter cycle = 1000 ;

	// file output variables
	integer
		sbfile,		// file in which SBus signals are displayed
		fsmfile,	// file in which state machine states are displayed
		scfsmfile,	// file in which SBus control state machine signals are displayed
		srwfsmfile,	// file in which SBus read & write state machine signals are displayed
		pfsmfile,	// file in which PBus state machine states are displayed
		ctlfile,	// file in which control register outputs are displayed
		svfile,		// file in which slave register outputs are displayed
		intfile,	// file in which interrupt register outputs are displayed
		difile,		// file in which data in register contents are displayed
		dofile,		// file in which data out register contents are
				//  displayed
		pbfile,		// file in which PBus signals are displayed
		hnpfile,	// file in which hnp_fsm signals are displayed
		syncfile,	// file in which sync related signals are displayed
		ptyfile,	// file in which parity related signals
				//	are displayed
		mafile,	// file in which misc control signals are displayed
		mbfile;	// second file in which misc control signals are displayed

	always @(posedge system.sb_clk)
		if (system.idebug)
		begin
		#(cycle-1) ;

		\$fstrobe (sbfile, \$stime,
		"   %h %h %h %h %h   %h %h %h %h %h   %h %h  %h",
			system.sb_as_,			//      Address Strobe from System
			system.sb_pa,			//      [27:0] Phys. Adress bus from System
			system.sb_d,			//      [31:0] Data Bus from System/Master/Slave
			system.sb_siz,			//      [2:0] Transfer Size from System/Master
			system.sb_rd,			//      Read from System/Master

			system.sb_ack_,		//      [2:0] Acknowledge bits
			system.sb_merr_,		//      LateError_ in new spec
			system.sb_br_,			//      [7:0] Bus Request from Master
			system.sb_bg_,			//      [7:0] Bus Grant from System
			system.sb_sel_,		//      [7:0] Select from System

			system.sb_irq_,		//      [7:1] Interrupt Requests from Master/Slave
			system.sb_reset_,		//      Reset from System

			U1.sbus_err) ;

		\$fstrobe (fsmfile, \$stime,
			"   %h %h  %h %h %h  %h %h %h  %h  %h %h", 

			// svfsm state
			{
			$u3_name.u78.u31.sr4.q,
			$u3_name.u78.u31.sr3.q,
			$u3_name.u78.u31.sr2.q,
			$u3_name.u78.u31.sr1.q
			},

			// sbugfixfsm state
			{
			$u3_name.u78.u38.sr3.q,
			$u3_name.u78.u38.sr2.q,
			$u3_name.u78.u38.sr1.q
			},

			// sctlfsm state
			{
			$u3_name.u4.u1.sr4.q,
			$u3_name.u4.u1.sr3.q,
			$u3_name.u4.u1.sr2.q,
			$u3_name.u4.u1.sr1.q
			},

			// swrfsm state
			{
			$u3_name.u4.u4.sr2.q,
			$u3_name.u4.u4.sr1.q
			},

			// srdfsm state
			{
			$u3_name.u4.u5.sr3.q,
			$u3_name.u4.u5.sr2.q,
			$u3_name.u4.u5.sr1.q
			},

			// pctlfsm state
			{
			$u3_name.u1.u4.u2.sr3.q,
			$u3_name.u1.u4.u2.sr2.q,
			$u3_name.u1.u4.u2.sr1.q
			},

			// pwrfsm state
			{
			$u3_name.u1.u5.u2.sr2.q,
			$u3_name.u1.u5.u2.sr1.q
			},

			// prdfsm state
			{
			$u3_name.u1.u6.u2.sr3.q,
			$u3_name.u1.u6.u2.sr2.q,
			$u3_name.u1.u6.u2.sr1.q
			},

			{$u4_name.u1.u85.u1\$1.sr1.q,
			$u4_name.u1.u85.u1\$2.sr1.q,
			$u4_name.u1.u85.u1\$3.sr1.q,
			$u4_name.u1.u85.u1\$4.sr1.q,
			$u5_name.u1.u85.u1\$1.sr1.q,
			$u5_name.u1.u85.u1\$2.sr1.q,
			$u5_name.u1.u85.u1\$3.sr1.q,
			$u5_name.u1.u85.u1\$4.sr1.q,
			$u4_name.u1.u85.u1\$5.sr1.q,
			$u4_name.u1.u85.u1\$6.sr1.q,
			$u4_name.u1.u85.u1\$7.sr1.q,
			$u4_name.u1.u85.u1\$8.sr1.q,
			$u5_name.u1.u85.u1\$5.sr1.q,
			$u5_name.u1.u85.u1\$6.sr1.q,
			$u5_name.u1.u85.u1\$7.sr1.q,
			$u5_name.u1.u85.u1\$8.sr1.q
			},

			U1.sc,		// control, data address

			// PBus word count
			{
			$u1_name.u2.u48.u4.u27.q,
			$u1_name.u2.u48.u4.u25.q,
			$u1_name.u2.u48.u4.u21.q,
			$u1_name.u2.u48.u4.u26.q,
			$u1_name.u2.u48.u3.u27.q,
			$u1_name.u2.u48.u3.u25.q,
			$u1_name.u2.u48.u3.u21.q,
			$u1_name.u2.u48.u3.u26.q,
			$u1_name.u2.u48.u2.u27.q,
			$u1_name.u2.u48.u2.u25.q,
			$u1_name.u2.u48.u2.u21.q,
			$u1_name.u2.u48.u2.u26.q,
			$u1_name.u2.u48.u1.u27.q,
			$u1_name.u2.u48.u1.u25.q,
			$u1_name.u2.u48.u1.u21.q,
			$u1_name.u2.u48.u1.u26.q,
			$u2_name.u2.u48.u4.u27.q,
			$u2_name.u2.u48.u4.u25.q,
			$u2_name.u2.u48.u4.u21.q,
			$u2_name.u2.u48.u4.u26.q,
			$u2_name.u2.u48.u3.u27.q,
			$u2_name.u2.u48.u3.u25.q,
			$u2_name.u2.u48.u3.u21.q,
			$u2_name.u2.u48.u3.u26.q,
			$u2_name.u2.u48.u2.u27.q,
			$u2_name.u2.u48.u2.u25.q,
			$u2_name.u2.u48.u2.u21.q,
			$u2_name.u2.u48.u2.u26.q,
			$u2_name.u2.u48.u1.u27.q,
			$u2_name.u2.u48.u1.u25.q,
			$u2_name.u2.u48.u1.u21.q,
			$u2_name.u2.u48.u1.u26.q
			}
			) ;

		\$fstrobe (scfsmfile, \$stime,
                        "   %h  %h%h%h%h%h %h%h%h%h%h %h%h%h  %h%h%h%h%h %h%h%h%h %h%h%h",

			// sctlfsm state
			{
			$u3_name.u4.u1.sr4.q,
			$u3_name.u4.u1.sr3.q,
			$u3_name.u4.u1.sr2.q,
			$u3_name.u4.u1.sr1.q
			},

			// inputs
			{
			$u3_name.u4.u1.\ack[2] ,
			$u3_name.u4.u1.\ack[1] ,
			$u3_name.u4.u1.\ack[0] 
			},
			$u3_name.u4.u1.wait_eos,
			$u3_name.u4.u1.dones,
			$u3_name.u4.u1.rd_full,
			$u3_name.u4.u1.eos,

			$u3_name.u4.u1.error,
			$u3_name.u4.u1.hstop,
			$u3_name.u4.u1.immed,
			$u3_name.u4.u1.del_bg_n,
			$u3_name.u4.u1.rd,

			$u3_name.u4.u1.sb_bg_n,
			$u3_name.u4.u1.late_err,
			$u3_name.u4.u1.clr_suspend,

			// outputs
			$u3_name.u4.u1.sb_br_n,
			$u3_name.u4.u1.sb_rd,
			$u3_name.u4.u1.clrdone,
			$u3_name.u4.u1.enwt,
			$u3_name.u4.u1.fst,

			$u3_name.u4.u1.hcond,
			$u3_name.u4.u1.instr,
			$u3_name.u4.u1.sc_ld,
			{
			$u3_name.u4.u1.\sc[2] ,
			$u3_name.u4.u1.\sc[1] ,
			$u3_name.u4.u1.\sc[0] 
			},

			$u3_name.u4.u1.suspend,
			$u3_name.u4.u1.partial_xfer,
			$u3_name.u4.u1.word_1

			) ;

                \$fstrobe (srwfsmfile, \$stime,
                        "   %h%h%h%h %h%h%h  %h %h%h%h%h  %h %h%h",

			// inputs
			{
			$u3_name.u4.u4.\ack[2] ,
			$u3_name.u4.u4.\ack[1] ,
			$u3_name.u4.u4.\ack[0] 
			},
			$u3_name.u4.u4.din_empty,
			$u3_name.u4.u4.fst,
			$u3_name.u4.u4.instr,

			$u3_name.u4.u4.del_bg_n,
			$u3_name.u4.u4.sc2,
			$u3_name.u4.u4.rd,

			// swrfsm state
			{
			$u3_name.u4.u4.sr2.q,
			$u3_name.u4.u4.sr1.q
			},

			// outputs
			$u3_name.u4.u4.incadr,
			$u3_name.u4.u4.scwr,
			$u3_name.u4.u4.sinc,
			$u3_name.u4.u4.sirdy,

			// srdfsm state
			{
			$u3_name.u4.u5.sr3.q,
			$u3_name.u4.u5.sr2.q,
			$u3_name.u4.u5.sr1.q
			},

			// outputs
			$u3_name.u4.u5.incadr,
			$u3_name.u4.u5.sinc) ;

		\$fstrobe (pfsmfile, \$stime,
		"   %h%h%h%h%h %h%h%h %h %h%h%h%h %h%h  %h%h%h%h %h%h%h %h %h%h%h%h%h %h  %h%h%h%h%h %h%h %h %h%h%h %h%h%h",

			// inputs
			$u3_name.u1.u4.cwait,
			$u3_name.u1.u4.done,
			$u3_name.u1.u4.enwt,
			$u3_name.u1.u4.eofin,
			$u3_name.u1.u4.error,

			$u3_name.u1.u4.pirdy,
			$u3_name.u1.u4.op_done,
			$u3_name.u1.u4.rd,

			// pctlfsm state
			{
			$u3_name.u1.u4.u2.sr3.q,
			$u3_name.u1.u4.u2.sr2.q,
			$u3_name.u1.u4.u2.sr1.q
			},

			// outputs
			$u3_name.u1.u4.op_en,
			$u3_name.u1.u4.pty_en,
			$u3_name.u1.u4.eofout,
			$u3_name.u1.u4.u2.pcld,

			$u3_name.u1.u4.pcwr,
			$u3_name.u1.u4.op_shift,

			// inputs
			$u3_name.u1.u5.u2.done,
			$u3_name.u1.u5.u2.eofin,
			$u3_name.u1.u5.u2.immed,
			$u3_name.u1.u5.u2.ok,

			$u3_name.u1.u5.u2.pdav,
			$u3_name.u1.u5.u2.prco,
			$u3_name.u1.u5.u2.rd,

			// pwrfsm state
			{
			$u3_name.u1.u5.u2.sr2.q,
			$u3_name.u1.u5.u2.sr1.q
			},

			// outputs
			$u3_name.u1.u5.u2.eofout,
			$u3_name.u1.u5.u2.pcwr,
			$u3_name.u1.u5.u2.pdata_en,
			$u3_name.u1.u5.u2.pdata2_en,
			$u3_name.u1.u5.u2.pinc,

			$u3_name.u1.u5.u2.pldec,

			// inputs
			$u3_name.u1.u6.done,
			$u3_name.u1.u6.eofin,
			$u3_name.u1.u6.u2.eofout_q,
			$u3_name.u1.u6.flg8,
			$u3_name.u1.u6.ok,

			$u3_name.u1.u6.pdrd,
			$u3_name.u1.u6.rd,

			// prdfsm state
			{
			$u3_name.u1.u6.u2.sr3.q,
			$u3_name.u1.u6.u2.sr2.q,
			$u3_name.u1.u6.u2.sr1.q
			},

			// outputs
			$u3_name.u1.u6.eofout_d,
			$u3_name.u1.u6.pld1,
			$u3_name.u1.u6.pld2,

			$u3_name.u1.u6.pld3,
			$u3_name.u1.u6.pld4,
			$u3_name.u1.u6.pldec) ;

		\$fstrobe (ctlfile, \$stime,
			"   %h %h %h %h  %h %h %h %h %h  %h  %h %h %h",

			// Control register 0 flags, (bits 31-28)
			$u1_name.u2.u1.\r0[15] ,
			$u1_name.u2.u1.\r0[14] ,
			$u1_name.u2.u1.\r0[13] ,
			$u1_name.u2.u1.\r0[12] ,

			// Control register 0 flags, (bits 15-12)
			$u2_name.u2.u1.\r0[15] ,
			$u2_name.u2.u1.\r0[14] ,
			$u2_name.u2.u1.\r0[13] ,
			$u2_name.u2.u1.\r0[12] ,
			$u2_name.u2.u1.\r0[11] ,

			// Opcode register
			{
			$u2_name.u2.u1.\r0[4] ,
			$u2_name.u2.u1.\r0[3] ,
			$u2_name.u2.u1.\r0[2] ,
			$u2_name.u2.u1.\r0[1] ,
			$u2_name.u2.u1.\r0[0] 
			},

			// Burst transfer address
			{
			$u1_name.u2.u1.u103.\sbdout[15] ,
			$u1_name.u2.u1.u103.\sbdout[14] ,
			$u1_name.u2.u1.u103.\sbdout[13] ,
			$u1_name.u2.u1.u103.\sbdout[12] ,
			$u1_name.u2.u1.u103.\sbdout[11] ,
			$u1_name.u2.u1.u103.\sbdout[10] ,
			$u1_name.u2.u1.u103.\sbdout[9] ,
			$u1_name.u2.u1.u103.\sbdout[8] ,
			$u1_name.u2.u1.u103.\sbdout[7] ,
			$u1_name.u2.u1.u103.\sbdout[6] ,
			$u1_name.u2.u1.u103.\sbdout[5] ,
			$u1_name.u2.u1.u103.\sbdout[4] ,
			$u1_name.u2.u1.u103.\sbdout[3] ,
			$u1_name.u2.u1.u103.\sbdout[2] ,
			$u1_name.u2.u1.u103.\sbdout[1] ,
			$u1_name.u2.u1.u103.\sbdout[0] ,
			$u2_name.u2.u1.u103.\sbdout[15] ,
			$u2_name.u2.u1.u103.\sbdout[14] ,
			$u2_name.u2.u1.u103.\sbdout[13] ,
			$u2_name.u2.u1.u103.\sbdout[12] ,
			$u2_name.u2.u1.u103.\sbdout[11] ,
			$u2_name.u2.u1.u103.\sbdout[10] ,
			$u2_name.u2.u1.u103.\sbdout[9] ,
			$u2_name.u2.u1.u103.\sbdout[8] ,
			$u2_name.u2.u1.u103.\sbdout[7] ,
			$u2_name.u2.u1.u103.\sbdout[6] ,
			$u2_name.u2.u1.u103.\sbdout[5] ,
			$u2_name.u2.u1.u103.\sbdout[4] ,
			$u2_name.u2.u1.u103.\sbdout[3] ,
			$u2_name.u2.u1.u103.\sbdout[2] ,
			$u2_name.u2.u1.u103.\sbdout[1] ,
			$u2_name.u2.u1.u103.\sbdout[0] 
			},

			// burst transfer count holding reg
			{
			$u1_name.u2.u1.\r2[15] ,
			$u1_name.u2.u1.\r2[14] ,
			$u1_name.u2.u1.\r2[13] ,
			$u1_name.u2.u1.\r2[12] ,
			$u1_name.u2.u1.\r2[11] ,
			$u1_name.u2.u1.\r2[10] ,
			$u1_name.u2.u1.\r2[9] ,
			$u1_name.u2.u1.\r2[8] ,
			$u1_name.u2.u1.\r2[7] ,
			$u1_name.u2.u1.\r2[6] ,
			$u1_name.u2.u1.\r2[5] ,
			$u1_name.u2.u1.\r2[4] ,
			$u1_name.u2.u1.\r2[3] ,
			$u1_name.u2.u1.\r2[2] ,
			$u1_name.u2.u1.\r2[1] ,
			$u1_name.u2.u1.\r2[0] ,
			$u2_name.u2.u1.\r2[15] ,
			$u2_name.u2.u1.\r2[14] ,
			$u2_name.u2.u1.\r2[13] ,
			$u2_name.u2.u1.\r2[12] ,
			$u2_name.u2.u1.\r2[11] ,
			$u2_name.u2.u1.\r2[10] ,
			$u2_name.u2.u1.\r2[9] ,
			$u2_name.u2.u1.\r2[8] ,
			$u2_name.u2.u1.\r2[7] ,
			$u2_name.u2.u1.\r2[6] ,
			$u2_name.u2.u1.\r2[5] ,
			$u2_name.u2.u1.\r2[4] ,
			$u2_name.u2.u1.\r2[3] ,
			$u2_name.u2.u1.\r2[2] ,
			$u2_name.u2.u1.\r2[1] ,
			$u2_name.u2.u1.\r2[0] 
			},

			// Slist link address
			{
			$u1_name.u2.u1.\r3[15] ,
			$u1_name.u2.u1.\r3[14] ,
			$u1_name.u2.u1.\r3[13] ,
			$u1_name.u2.u1.\r3[12] ,
			$u1_name.u2.u1.\r3[11] ,
			$u1_name.u2.u1.\r3[10] ,
			$u1_name.u2.u1.\r3[9] ,
			$u1_name.u2.u1.\r3[8] ,
			$u1_name.u2.u1.\r3[7] ,
			$u1_name.u2.u1.\r3[6] ,
			$u1_name.u2.u1.\r3[5] ,
			$u1_name.u2.u1.\r3[4] ,
			$u1_name.u2.u1.\r3[3] ,
			$u1_name.u2.u1.\r3[2] ,
			$u1_name.u2.u1.\r3[1] ,
			$u1_name.u2.u1.\r3[0] ,
			$u2_name.u2.u1.\r3[15] ,
			$u2_name.u2.u1.\r3[14] ,
			$u2_name.u2.u1.\r3[13] ,
			$u2_name.u2.u1.\r3[12] ,
			$u2_name.u2.u1.\r3[11] ,
			$u2_name.u2.u1.\r3[10] ,
			$u2_name.u2.u1.\r3[9] ,
			$u2_name.u2.u1.\r3[8] ,
			$u2_name.u2.u1.\r3[7] ,
			$u2_name.u2.u1.\r3[6] ,
			$u2_name.u2.u1.\r3[5] ,
			$u2_name.u2.u1.\r3[4] ,
			$u2_name.u2.u1.\r3[3] ,
			$u2_name.u2.u1.\r3[2] ,
			$u2_name.u2.u1.\r3[1] ,
			$u2_name.u2.u1.\r3[0] 
			} );


		\$fstrobe (svfile, \$stime,
			"   %h %h %h %h  %h %h %h %h  %h %h %h %h  %h %h %h  %h %h",

			// Host next pointer
			{
			$u1_name.u1.u124.\r0[15] ,
			$u1_name.u1.u124.\r0[14] ,
			$u1_name.u1.u124.\r0[13] ,
			$u1_name.u1.u124.\r0[12] ,
			$u1_name.u1.u124.\r0[11] ,
			$u1_name.u1.u124.\r0[10] ,
			$u1_name.u1.u124.\r0[9] ,
			$u1_name.u1.u124.\r0[8] ,
			$u1_name.u1.u124.\r0[7] ,
			$u1_name.u1.u124.\r0[6] ,
			$u1_name.u1.u124.\r0[5] ,
			$u1_name.u1.u124.\r0[4] ,
			$u1_name.u1.u124.\r0[3] ,
			$u1_name.u1.u124.\r0[2] ,
			$u1_name.u1.u124.\r0[1] ,
			$u1_name.u1.u124.\r0[0] ,
			$u2_name.u1.u124.\r0[15] ,
			$u2_name.u1.u124.\r0[14] ,
			$u2_name.u1.u124.\r0[13] ,
			$u2_name.u1.u124.\r0[12] ,
			$u2_name.u1.u124.\r0[11] ,
			$u2_name.u1.u124.\r0[10] ,
			$u2_name.u1.u124.\r0[9] ,
			$u2_name.u1.u124.\r0[8] ,
			$u2_name.u1.u124.\r0[7] ,
			$u2_name.u1.u124.\r0[6] ,
			$u2_name.u1.u124.\r0[5] ,
			$u2_name.u1.u124.\r0[4] ,
			$u2_name.u1.u124.\r0[3] ,
			$u2_name.u1.u124.\r0[2] ,
			$u2_name.u1.u124.\r0[1] ,
			$u2_name.u1.u124.\r0[0] 
			},

			// Interrupt register
			{
			$u1_name.u1.u124.\intreg[15] ,
			$u1_name.u1.u124.\intreg[14] ,
			$u1_name.u1.u124.\intreg[13] ,
			$u1_name.u1.u124.\intreg[12] ,
			$u1_name.u1.u124.\intreg[11] ,
			$u1_name.u1.u124.\intreg[10] ,
			$u1_name.u1.u124.\intreg[9] ,
			$u1_name.u1.u124.\intreg[8] ,
			$u1_name.u1.u124.\intreg[7] ,
			$u1_name.u1.u124.\intreg[6] ,
			$u1_name.u1.u124.\intreg[5] ,
			$u1_name.u1.u124.\intreg[4] ,
			$u1_name.u1.u124.\intreg[3] ,
			$u1_name.u1.u124.\intreg[2] ,
			$u1_name.u1.u124.\intreg[1] ,
			$u1_name.u1.u124.\intreg[0] ,
			$u2_name.u1.u124.\intreg[15] ,
			$u2_name.u1.u124.\intreg[14] ,
			$u2_name.u1.u124.\intreg[13] ,
			$u2_name.u1.u124.\intreg[12] ,
			$u2_name.u1.u124.\intreg[11] ,
			$u2_name.u1.u124.\intreg[10] ,
			$u2_name.u1.u124.\intreg[9] ,
			$u2_name.u1.u124.\intreg[8] ,
			$u2_name.u1.u124.\intreg[7] ,
			$u2_name.u1.u124.\intreg[6] ,
			$u2_name.u1.u124.\intreg[5] ,
			$u2_name.u1.u124.\intreg[4] ,
			$u2_name.u1.u124.\intreg[3] ,
			$u2_name.u1.u124.\intreg[2] ,
			$u2_name.u1.u124.\intreg[1] ,
			$u2_name.u1.u124.\intreg[0] 
			},

			// Current slist pointer
			{
			$u1_name.u1.u124.\r2[15] ,
			$u1_name.u1.u124.\r2[14] ,
			$u1_name.u1.u124.\r2[13] ,
			$u1_name.u1.u124.\r2[12] ,
			$u1_name.u1.u124.\r2[11] ,
			$u1_name.u1.u124.\r2[10] ,
			$u1_name.u1.u124.\r2[9] ,
			$u1_name.u1.u124.\r2[8] ,
			$u1_name.u1.u124.\r2[7] ,
			$u1_name.u1.u124.\r2[6] ,
			$u1_name.u1.u124.\r2[5] ,
			$u1_name.u1.u124.\r2[4] ,
			$u1_name.u1.u124.\r2[3] ,
			$u1_name.u1.u124.\r2[2] ,
			$u1_name.u1.u124.\r2[1] ,
			$u1_name.u1.u124.\r2[0] ,
			$u2_name.u1.u124.\r2[15] ,
			$u2_name.u1.u124.\r2[14] ,
			$u2_name.u1.u124.\r2[13] ,
			$u2_name.u1.u124.\r2[12] ,
			$u2_name.u1.u124.\r2[11] ,
			$u2_name.u1.u124.\r2[10] ,
			$u2_name.u1.u124.\r2[9] ,
			$u2_name.u1.u124.\r2[8] ,
			$u2_name.u1.u124.\r2[7] ,
			$u2_name.u1.u124.\r2[6] ,
			$u2_name.u1.u124.\r2[5] ,
			$u2_name.u1.u124.\r2[4] ,
			$u2_name.u1.u124.\r2[3] ,
			$u2_name.u1.u124.\r2[2] ,
			$u2_name.u1.u124.\r2[1] ,
			$u2_name.u1.u124.\r2[0] 
			},

			// Previous slist pointer
			{
			$u1_name.u1.u124.\r3[15] ,
			$u1_name.u1.u124.\r3[14] ,
			$u1_name.u1.u124.\r3[13] ,
			$u1_name.u1.u124.\r3[12] ,
			$u1_name.u1.u124.\r3[11] ,
			$u1_name.u1.u124.\r3[10] ,
			$u1_name.u1.u124.\r3[9] ,
			$u1_name.u1.u124.\r3[8] ,
			$u1_name.u1.u124.\r3[7] ,
			$u1_name.u1.u124.\r3[6] ,
			$u1_name.u1.u124.\r3[5] ,
			$u1_name.u1.u124.\r3[4] ,
			$u1_name.u1.u124.\r3[3] ,
			$u1_name.u1.u124.\r3[2] ,
			$u1_name.u1.u124.\r3[1] ,
			$u1_name.u1.u124.\r3[0] ,
			$u2_name.u1.u124.\r3[15] ,
			$u2_name.u1.u124.\r3[14] ,
			$u2_name.u1.u124.\r3[13] ,
			$u2_name.u1.u124.\r3[12] ,
			$u2_name.u1.u124.\r3[11] ,
			$u2_name.u1.u124.\r3[10] ,
			$u2_name.u1.u124.\r3[9] ,
			$u2_name.u1.u124.\r3[8] ,
			$u2_name.u1.u124.\r3[7] ,
			$u2_name.u1.u124.\r3[6] ,
			$u2_name.u1.u124.\r3[5] ,
			$u2_name.u1.u124.\r3[4] ,
			$u2_name.u1.u124.\r3[3] ,
			$u2_name.u1.u124.\r3[2] ,
			$u2_name.u1.u124.\r3[1] ,
			$u2_name.u1.u124.\r3[0] 
			},

			// Command register
			// cam reset bit
			$u1_name.u1.u125.cam_rst_n,

			// Interface reset bit
			$u1_name.u1.u125.u8.u185.q,

			// Interface halt
			$u2_name.u1.u125.u8.set_halt,

			// Clear exception bit (pulse)
			$u2_name.u1.u125.u8.clr_excptn,


			// Status bits
			$u2_name.u1.u124.halted,
			$u2_name.u1.u124.wtg_hst,
			$u2_name.u1.u124.excptn,
			$u2_name.u1.u124.hnp_valid,

			$u2_name.u1.u124.pcnt_done,
			$u2_name.u1.u124.partial_xfer,
			$u2_name.u1.u124.suspend,

			$u2_name.u1.u124.scan_act,
			$u2_name.u1.u124.cam_int
			);

		\$fstrobe (difile, \$stime,
			"   %h %h %h %h",

			// datain, r4
			{
			$u4_name.u1.u87\$1.u1.q,
			$u4_name.u1.u87\$2.u1.q,
			$u4_name.u1.u87\$3.u1.q,
			$u4_name.u1.u87\$4.u1.q,
			$u5_name.u1.u87\$1.u1.q,
			$u5_name.u1.u87\$2.u1.q,
			$u5_name.u1.u87\$3.u1.q,
			$u5_name.u1.u87\$4.u1.q,
			$u4_name.u1.u87\$5.u1.q,
			$u4_name.u1.u87\$6.u1.q,
			$u4_name.u1.u87\$7.u1.q,
			$u4_name.u1.u87\$8.u1.q,
			$u5_name.u1.u87\$5.u1.q,
			$u5_name.u1.u87\$6.u1.q,
			$u5_name.u1.u87\$7.u1.q,
			$u5_name.u1.u87\$8.u1.q,
			$u4_name.u1.u87\$9.u1.q,
			$u4_name.u1.u87\$10.u1.q,
			$u4_name.u1.u87\$11.u1.q,
			$u4_name.u1.u87\$12.u1.q,
			$u5_name.u1.u87\$9.u1.q,
			$u5_name.u1.u87\$10.u1.q,
			$u5_name.u1.u87\$11.u1.q,
			$u5_name.u1.u87\$12.u1.q,
			$u4_name.u1.u87\$13.u1.q,
			$u4_name.u1.u87\$14.u1.q,
			$u4_name.u1.u87\$15.u1.q,
			$u4_name.u1.u87\$16.u1.q,
			$u5_name.u1.u87\$13.u1.q,
			$u5_name.u1.u87\$14.u1.q,
			$u5_name.u1.u87\$15.u1.q,
			$u5_name.u1.u87\$16.u1.q
			},

			// datain, r5
			{
			$u4_name.u1.u87\$1.u2.q,
			$u4_name.u1.u87\$2.u2.q,
			$u4_name.u1.u87\$3.u2.q,
			$u4_name.u1.u87\$4.u2.q,
			$u5_name.u1.u87\$1.u2.q,
			$u5_name.u1.u87\$2.u2.q,
			$u5_name.u1.u87\$3.u2.q,
			$u5_name.u1.u87\$4.u2.q,
			$u4_name.u1.u87\$5.u2.q,
			$u4_name.u1.u87\$6.u2.q,
			$u4_name.u1.u87\$7.u2.q,
			$u4_name.u1.u87\$8.u2.q,
			$u5_name.u1.u87\$5.u2.q,
			$u5_name.u1.u87\$6.u2.q,
			$u5_name.u1.u87\$7.u2.q,
			$u5_name.u1.u87\$8.u2.q,
			$u4_name.u1.u87\$9.u2.q,
			$u4_name.u1.u87\$10.u2.q,
			$u4_name.u1.u87\$11.u2.q,
			$u4_name.u1.u87\$12.u2.q,
			$u5_name.u1.u87\$9.u2.q,
			$u5_name.u1.u87\$10.u2.q,
			$u5_name.u1.u87\$11.u2.q,
			$u5_name.u1.u87\$12.u2.q,
			$u4_name.u1.u87\$13.u2.q,
			$u4_name.u1.u87\$14.u2.q,
			$u4_name.u1.u87\$15.u2.q,
			$u4_name.u1.u87\$16.u2.q,
			$u5_name.u1.u87\$13.u2.q,
			$u5_name.u1.u87\$14.u2.q,
			$u5_name.u1.u87\$15.u2.q,
			$u5_name.u1.u87\$16.u2.q
			},

			// datain, r6
			{
			$u4_name.u1.u87\$1.u3.q,
			$u4_name.u1.u87\$2.u3.q,
			$u4_name.u1.u87\$3.u3.q,
			$u4_name.u1.u87\$4.u3.q,
			$u5_name.u1.u87\$1.u3.q,
			$u5_name.u1.u87\$2.u3.q,
			$u5_name.u1.u87\$3.u3.q,
			$u5_name.u1.u87\$4.u3.q,
			$u4_name.u1.u87\$5.u3.q,
			$u4_name.u1.u87\$6.u3.q,
			$u4_name.u1.u87\$7.u3.q,
			$u4_name.u1.u87\$8.u3.q,
			$u5_name.u1.u87\$5.u3.q,
			$u5_name.u1.u87\$6.u3.q,
			$u5_name.u1.u87\$7.u3.q,
			$u5_name.u1.u87\$8.u3.q,
			$u4_name.u1.u87\$9.u3.q,
			$u4_name.u1.u87\$10.u3.q,
			$u4_name.u1.u87\$11.u3.q,
			$u4_name.u1.u87\$12.u3.q,
			$u5_name.u1.u87\$9.u3.q,
			$u5_name.u1.u87\$10.u3.q,
			$u5_name.u1.u87\$11.u3.q,
			$u5_name.u1.u87\$12.u3.q,
			$u4_name.u1.u87\$13.u3.q,
			$u4_name.u1.u87\$14.u3.q,
			$u4_name.u1.u87\$15.u3.q,
			$u4_name.u1.u87\$16.u3.q,
			$u5_name.u1.u87\$13.u3.q,
			$u5_name.u1.u87\$14.u3.q,
			$u5_name.u1.u87\$15.u3.q,
			$u5_name.u1.u87\$16.u3.q
			},

			// datain, r7
			{
			$u4_name.u1.u87\$1.u4.q,
			$u4_name.u1.u87\$2.u4.q,
			$u4_name.u1.u87\$3.u4.q,
			$u4_name.u1.u87\$4.u4.q,
			$u5_name.u1.u87\$1.u4.q,
			$u5_name.u1.u87\$2.u4.q,
			$u5_name.u1.u87\$3.u4.q,
			$u5_name.u1.u87\$4.u4.q,
			$u4_name.u1.u87\$5.u4.q,
			$u4_name.u1.u87\$6.u4.q,
			$u4_name.u1.u87\$7.u4.q,
			$u4_name.u1.u87\$8.u4.q,
			$u5_name.u1.u87\$5.u4.q,
			$u5_name.u1.u87\$6.u4.q,
			$u5_name.u1.u87\$7.u4.q,
			$u5_name.u1.u87\$8.u4.q,
			$u4_name.u1.u87\$9.u4.q,
			$u4_name.u1.u87\$10.u4.q,
			$u4_name.u1.u87\$11.u4.q,
			$u4_name.u1.u87\$12.u4.q,
			$u5_name.u1.u87\$9.u4.q,
			$u5_name.u1.u87\$10.u4.q,
			$u5_name.u1.u87\$11.u4.q,
			$u5_name.u1.u87\$12.u4.q,
			$u4_name.u1.u87\$13.u4.q,
			$u4_name.u1.u87\$14.u4.q,
			$u4_name.u1.u87\$15.u4.q,
			$u4_name.u1.u87\$16.u4.q,
			$u5_name.u1.u87\$13.u4.q,
			$u5_name.u1.u87\$14.u4.q,
			$u5_name.u1.u87\$15.u4.q,
			$u5_name.u1.u87\$16.u4.q
			}
			);

		\$fstrobe (dofile, \$stime,
			"       %h %h %h %h  %h %h %h %h %h  %h %h  %h  %h",

			// dataout, r4
			{
			$u4_name.u2.u121\$2.u1\$1.q,
			$u4_name.u2.u121\$2.u1\$2.q,
			$u4_name.u2.u121\$2.u1\$3.q,
			$u4_name.u2.u121\$2.u1\$4.q,
			$u5_name.u2.u121\$2.u1\$1.q,
			$u5_name.u2.u121\$2.u1\$2.q,
			$u5_name.u2.u121\$2.u1\$3.q,
			$u5_name.u2.u121\$2.u1\$4.q,
			$u4_name.u2.u122\$2.u1\$1.q,
			$u4_name.u2.u122\$2.u1\$2.q,
			$u4_name.u2.u122\$2.u1\$3.q,
			$u4_name.u2.u122\$2.u1\$4.q,
			$u5_name.u2.u122\$2.u1\$1.q,
			$u5_name.u2.u122\$2.u1\$2.q,
			$u5_name.u2.u122\$2.u1\$3.q,
			$u5_name.u2.u122\$2.u1\$4.q,
			$u4_name.u2.u121\$1.u1\$1.q,
			$u4_name.u2.u121\$1.u1\$2.q,
			$u4_name.u2.u121\$1.u1\$3.q,
			$u4_name.u2.u121\$1.u1\$4.q,
			$u5_name.u2.u121\$1.u1\$1.q,
			$u5_name.u2.u121\$1.u1\$2.q,
			$u5_name.u2.u121\$1.u1\$3.q,
			$u5_name.u2.u121\$1.u1\$4.q,
			$u4_name.u2.u122\$1.u1\$1.q,
			$u4_name.u2.u122\$1.u1\$2.q,
			$u4_name.u2.u122\$1.u1\$3.q,
			$u4_name.u2.u122\$1.u1\$4.q,
			$u5_name.u2.u122\$1.u1\$1.q,
			$u5_name.u2.u122\$1.u1\$2.q,
			$u5_name.u2.u122\$1.u1\$3.q,
			$u5_name.u2.u122\$1.u1\$4.q
			},

			// dataout, r5
			{
			$u4_name.u2.u121\$2.u2\$1.q,
			$u4_name.u2.u121\$2.u2\$2.q,
			$u4_name.u2.u121\$2.u2\$3.q,
			$u4_name.u2.u121\$2.u2\$4.q,
			$u5_name.u2.u121\$2.u2\$1.q,
			$u5_name.u2.u121\$2.u2\$2.q,
			$u5_name.u2.u121\$2.u2\$3.q,
			$u5_name.u2.u121\$2.u2\$4.q,
			$u4_name.u2.u122\$2.u2\$1.q,
			$u4_name.u2.u122\$2.u2\$2.q,
			$u4_name.u2.u122\$2.u2\$3.q,
			$u4_name.u2.u122\$2.u2\$4.q,
			$u5_name.u2.u122\$2.u2\$1.q,
			$u5_name.u2.u122\$2.u2\$2.q,
			$u5_name.u2.u122\$2.u2\$3.q,
			$u5_name.u2.u122\$2.u2\$4.q,
			$u4_name.u2.u121\$1.u2\$1.q,
			$u4_name.u2.u121\$1.u2\$2.q,
			$u4_name.u2.u121\$1.u2\$3.q,
			$u4_name.u2.u121\$1.u2\$4.q,
			$u5_name.u2.u121\$1.u2\$1.q,
			$u5_name.u2.u121\$1.u2\$2.q,
			$u5_name.u2.u121\$1.u2\$3.q,
			$u5_name.u2.u121\$1.u2\$4.q,
			$u4_name.u2.u122\$1.u2\$1.q,
			$u4_name.u2.u122\$1.u2\$2.q,
			$u4_name.u2.u122\$1.u2\$3.q,
			$u4_name.u2.u122\$1.u2\$4.q,
			$u5_name.u2.u122\$1.u2\$1.q,
			$u5_name.u2.u122\$1.u2\$2.q,
			$u5_name.u2.u122\$1.u2\$3.q,
			$u5_name.u2.u122\$1.u2\$4.q
			},

			// dataout, r6
			{
			$u4_name.u2.u121\$2.u3\$1.q,
			$u4_name.u2.u121\$2.u3\$2.q,
			$u4_name.u2.u121\$2.u3\$3.q,
			$u4_name.u2.u121\$2.u3\$4.q,
			$u5_name.u2.u121\$2.u3\$1.q,
			$u5_name.u2.u121\$2.u3\$2.q,
			$u5_name.u2.u121\$2.u3\$3.q,
			$u5_name.u2.u121\$2.u3\$4.q,
			$u4_name.u2.u122\$2.u3\$1.q,
			$u4_name.u2.u122\$2.u3\$2.q,
			$u4_name.u2.u122\$2.u3\$3.q,
			$u4_name.u2.u122\$2.u3\$4.q,
			$u5_name.u2.u122\$2.u3\$1.q,
			$u5_name.u2.u122\$2.u3\$2.q,
			$u5_name.u2.u122\$2.u3\$3.q,
			$u5_name.u2.u122\$2.u3\$4.q,
			$u4_name.u2.u121\$1.u3\$1.q,
			$u4_name.u2.u121\$1.u3\$2.q,
			$u4_name.u2.u121\$1.u3\$3.q,
			$u4_name.u2.u121\$1.u3\$4.q,
			$u5_name.u2.u121\$1.u3\$1.q,
			$u5_name.u2.u121\$1.u3\$2.q,
			$u5_name.u2.u121\$1.u3\$3.q,
			$u5_name.u2.u121\$1.u3\$4.q,
			$u4_name.u2.u122\$1.u3\$1.q,
			$u4_name.u2.u122\$1.u3\$2.q,
			$u4_name.u2.u122\$1.u3\$3.q,
			$u4_name.u2.u122\$1.u3\$4.q,
			$u5_name.u2.u122\$1.u3\$1.q,
			$u5_name.u2.u122\$1.u3\$2.q,
			$u5_name.u2.u122\$1.u3\$3.q,
			$u5_name.u2.u122\$1.u3\$4.q
			},

			// dataout, r7
			{
			$u4_name.u2.u121\$2.u4\$1.q,
			$u4_name.u2.u121\$2.u4\$2.q,
			$u4_name.u2.u121\$2.u4\$3.q,
			$u4_name.u2.u121\$2.u4\$4.q,
			$u5_name.u2.u121\$2.u4\$1.q,
			$u5_name.u2.u121\$2.u4\$2.q,
			$u5_name.u2.u121\$2.u4\$3.q,
			$u5_name.u2.u121\$2.u4\$4.q,
			$u4_name.u2.u122\$2.u4\$1.q,
			$u4_name.u2.u122\$2.u4\$2.q,
			$u4_name.u2.u122\$2.u4\$3.q,
			$u4_name.u2.u122\$2.u4\$4.q,
			$u5_name.u2.u122\$2.u4\$1.q,
			$u5_name.u2.u122\$2.u4\$2.q,
			$u5_name.u2.u122\$2.u4\$3.q,
			$u5_name.u2.u122\$2.u4\$4.q,
			$u4_name.u2.u121\$1.u4\$1.q,
			$u4_name.u2.u121\$1.u4\$2.q,
			$u4_name.u2.u121\$1.u4\$3.q,
			$u4_name.u2.u121\$1.u4\$4.q,
			$u5_name.u2.u121\$1.u4\$1.q,
			$u5_name.u2.u121\$1.u4\$2.q,
			$u5_name.u2.u121\$1.u4\$3.q,
			$u5_name.u2.u121\$1.u4\$4.q,
			$u4_name.u2.u122\$1.u4\$1.q,
			$u4_name.u2.u122\$1.u4\$2.q,
			$u4_name.u2.u122\$1.u4\$3.q,
			$u4_name.u2.u122\$1.u4\$4.q,
			$u5_name.u2.u122\$1.u4\$1.q,
			$u5_name.u2.u122\$1.u4\$2.q,
			$u5_name.u2.u122\$1.u4\$3.q,
			$u5_name.u2.u122\$1.u4\$4.q
			},

			$u4_name.u2.pld1,
			$u4_name.u2.pld2,
			$u4_name.u2.pld3,
			$u4_name.u2.pld4,
			$u4_name.u2.flg8,

			$u4_name.u2.ptr_inc,
			$u4_name.u2.u188.latch_ld,

			{
			$u4_name.u2.\pc[1] ,
			$u4_name.u2.\pc[0] 
			},

			{
			$u4_name.u2.u188.\q_n[1] ,
			$u4_name.u2.u188.\q_n[0] 
			}

			);

		\$fstrobe (pbfile, \$stime,
		"   %b %b  %h %h %h   %h %h %h %h",
			system.pb_dl [15:8],
			system.pb_dl [7:0],
			system.pb_eofout,
			system.pb_eofin,
			system.pb_iosel,

			system.pb_status,
			system.pb_sync,
			system.pb_clk,
			system.pb_rst_n) ;

		\$fstrobe (hnpfile, \$stime,,,
			// hnp_fsm state
			{
                        $u2_name.u1.u176.\state_out[2] ,
                        $u2_name.u1.u176.\state_out[1] ,
                        $u2_name.u1.u176.\state_out[0] 
			},,,

                        $u2_name.u1.u176.addr_ld,,
                        $u2_name.u1.u176.clr_excptn,,
                        $u2_name.u1.u176.excptn,,
                        $u2_name.u1.u176.halted,,
                        $u2_name.u1.u176.hj,,,

                        $u2_name.u1.u176.hnp_en,,
                        $u2_name.u1.u176.hnp_ld,,
                        $u2_name.u1.u176.hnp_sel_in,,
                        $u2_name.u1.u176.hnp_sel_out,,
                        $u2_name.u1.u176.hnp_valid,,,

                        $u2_name.u1.u176.hstop,,
                        $u2_name.u1.u176.hw,,
                        $u2_name.u1.u176.r0_ld_n,,
                        $u2_name.u1.u176.r0_valid,,
                        U1.sclr_n,,,

                        {
			$u2_name.u1.u176.\sc[2] ,
                        $u2_name.u1.u176.\sc[1] ,
                        $u2_name.u1.u176.\sc[0]
                        },,
                        system.sb_reset_,,
                        $u2_name.u1.u176.sb_va_en,,
                        $u2_name.u1.u176.set_halt,,,

                        $u2_name.u1.u176.tmcmint
                        );

		\$fstrobe (syncfile, \$stime,,,
			"%h%h%h%h%h %h %h%h%h%h%h %h%h%h%h %h%h %h %h  %h%h%h%h%h %h %h%h%h%h%h %h%h%h%h %h%h %h %h", 

			// MSB chip signals
			// fsm inputs
			$u1_name.u1.u124.u30.u52.sync_in,
			$u1_name.u1.u124.u30.u52.sync_en,
			$u1_name.u1.u124.u30.u52.sel,
			$u1_name.u1.u124.u30.u52.blank_zero,
			$u1_name.u1.u124.u30.u52.scan_zero,

			// sync_fsm state
			{
			$u1_name.u1.u124.u30.u52.sr3.q,
			$u1_name.u1.u124.u30.u52.sr2.q,
			$u1_name.u1.u124.u30.u52.sr1.q
			},

			// fsm outputs
			$u1_name.u1.u124.u30.u52.sync_out,
			$u1_name.u1.u124.u30.u52.scan_dec,
			$u1_name.u1.u124.u30.u52.scan_ld,
			$u1_name.u1.u124.u30.u52.blank_dec,
			$u1_name.u1.u124.u30.u52.blank_ld,

/*			$u1_name.u1.u124.u30.u65.u100.z,
			$u1_name.u1.u124.u30.u65.u100.s,
			$u1_name.u1.u124.u30.u65.u100.i0,
			$u1_name.u1.u124.u30.u65.u100.i1,
*/
			// %debug
			1'b1,
			1'b1,
			1'b1,
			1'b1,

			$u1_name.u1.u124.u30.r3_ld_n,
			$u1_name.u1.u124.u30.r2_ld_n,

			// vertical scan counter
			{
			$u1_name.u1.u124.u30.u41.u2.u2.u27.q,
			$u1_name.u1.u124.u30.u41.u2.u2.u25.q,
			$u1_name.u1.u124.u30.u41.u2.u2.u21.q,
			$u1_name.u1.u124.u30.u41.u2.u2.u26.q,
			$u1_name.u1.u124.u30.u41.u2.u1.u27.q,
			$u1_name.u1.u124.u30.u41.u2.u1.u25.q,
			$u1_name.u1.u124.u30.u41.u2.u1.u21.q,
			$u1_name.u1.u124.u30.u41.u2.u1.u26.q,
			$u1_name.u1.u124.u30.u41.u1.u2.u27.q,
			$u1_name.u1.u124.u30.u41.u1.u2.u25.q,
			$u1_name.u1.u124.u30.u41.u1.u2.u21.q,
			$u1_name.u1.u124.u30.u41.u1.u2.u26.q,
			$u1_name.u1.u124.u30.u41.u1.u1.u27.q,
			$u1_name.u1.u124.u30.u41.u1.u1.u25.q,
			$u1_name.u1.u124.u30.u41.u1.u1.u21.q,
			$u1_name.u1.u124.u30.u41.u1.u1.u26.q
			},

			// vertical blank counter
			{
			$u1_name.u1.u124.u30.u48.u2.u2.u27.q,
			$u1_name.u1.u124.u30.u48.u2.u2.u25.q,
			$u1_name.u1.u124.u30.u48.u2.u2.u21.q,
			$u1_name.u1.u124.u30.u48.u2.u2.u26.q,
			$u1_name.u1.u124.u30.u48.u2.u1.u27.q,
			$u1_name.u1.u124.u30.u48.u2.u1.u25.q,
			$u1_name.u1.u124.u30.u48.u2.u1.u21.q,
			$u1_name.u1.u124.u30.u48.u2.u1.u26.q,
			$u1_name.u1.u124.u30.u48.u1.u2.u27.q,
			$u1_name.u1.u124.u30.u48.u1.u2.u25.q,
			$u1_name.u1.u124.u30.u48.u1.u2.u21.q,
			$u1_name.u1.u124.u30.u48.u1.u2.u26.q,
			$u1_name.u1.u124.u30.u48.u1.u1.u27.q,
			$u1_name.u1.u124.u30.u48.u1.u1.u25.q,
			$u1_name.u1.u124.u30.u48.u1.u1.u21.q,
			$u1_name.u1.u124.u30.u48.u1.u1.u26.q
			},

			// LSB chip signals
			// fsm inputs
			$u2_name.u1.u124.u30.u52.sync_in,
			$u2_name.u1.u124.u30.u52.sync_en,
			$u2_name.u1.u124.u30.u52.sel,
			$u2_name.u1.u124.u30.u52.blank_zero,
			$u2_name.u1.u124.u30.u52.scan_zero,

			// sync_fsm state
			{
			$u2_name.u1.u124.u30.u52.sr3.q,
			$u2_name.u1.u124.u30.u52.sr2.q,
			$u2_name.u1.u124.u30.u52.sr1.q
			},

			// fsm outputs
			$u2_name.u1.u124.u30.u52.sync_out,
			$u2_name.u1.u124.u30.u52.scan_dec,
			$u2_name.u1.u124.u30.u52.scan_ld,
			$u2_name.u1.u124.u30.u52.blank_dec,
			$u2_name.u1.u124.u30.u52.blank_ld,

/*			$u2_name.u1.u124.u30.u65.u100.z,
			$u2_name.u1.u124.u30.u65.u100.s,
			$u2_name.u1.u124.u30.u65.u100.i0,
			$u2_name.u1.u124.u30.u65.u100.i1,
*/
			// %debug
			1'b1,
			1'b1,
			1'b1,
			1'b1,

			$u2_name.u1.u124.u30.r3_ld_n,
			$u2_name.u1.u124.u30.r2_ld_n,

			// horizontal scan counter
			{
			$u2_name.u1.u124.u30.u41.u2.u2.u27.q,
			$u2_name.u1.u124.u30.u41.u2.u2.u25.q,
			$u2_name.u1.u124.u30.u41.u2.u2.u21.q,
			$u2_name.u1.u124.u30.u41.u2.u2.u26.q,
			$u2_name.u1.u124.u30.u41.u2.u1.u27.q,
			$u2_name.u1.u124.u30.u41.u2.u1.u25.q,
			$u2_name.u1.u124.u30.u41.u2.u1.u21.q,
			$u2_name.u1.u124.u30.u41.u2.u1.u26.q,
			$u2_name.u1.u124.u30.u41.u1.u2.u27.q,
			$u2_name.u1.u124.u30.u41.u1.u2.u25.q,
			$u2_name.u1.u124.u30.u41.u1.u2.u21.q,
			$u2_name.u1.u124.u30.u41.u1.u2.u26.q,
			$u2_name.u1.u124.u30.u41.u1.u1.u27.q,
			$u2_name.u1.u124.u30.u41.u1.u1.u25.q,
			$u2_name.u1.u124.u30.u41.u1.u1.u21.q,
			$u2_name.u1.u124.u30.u41.u1.u1.u26.q
			},

			// horizontal blank counter
			{
			$u2_name.u1.u124.u30.u48.u2.u2.u27.q,
			$u2_name.u1.u124.u30.u48.u2.u2.u25.q,
			$u2_name.u1.u124.u30.u48.u2.u2.u21.q,
			$u2_name.u1.u124.u30.u48.u2.u2.u26.q,
			$u2_name.u1.u124.u30.u48.u2.u1.u27.q,
			$u2_name.u1.u124.u30.u48.u2.u1.u25.q,
			$u2_name.u1.u124.u30.u48.u2.u1.u21.q,
			$u2_name.u1.u124.u30.u48.u2.u1.u26.q,
			$u2_name.u1.u124.u30.u48.u1.u2.u27.q,
			$u2_name.u1.u124.u30.u48.u1.u2.u25.q,
			$u2_name.u1.u124.u30.u48.u1.u2.u21.q,
			$u2_name.u1.u124.u30.u48.u1.u2.u26.q,
			$u2_name.u1.u124.u30.u48.u1.u1.u27.q,
			$u2_name.u1.u124.u30.u48.u1.u1.u25.q,
			$u2_name.u1.u124.u30.u48.u1.u1.u21.q,
			$u2_name.u1.u124.u30.u48.u1.u1.u26.q
			}
			) ;

		\$fstrobe (ptyfile, \$stime,
		"   %h %h %h %h %h  %h %h  %h %h %h %h",

			// inputs
			{
			$u5_name.u1.u85.\pb_d[7] ,
			$u5_name.u1.u85.\pb_d[6] ,
			$u5_name.u1.u85.\pb_d[5] ,
			$u5_name.u1.u85.\pb_d[4] ,
			$u5_name.u1.u85.\pb_d[3] ,
			$u5_name.u1.u85.\pb_d[2] ,
			$u5_name.u1.u85.\pb_d[1] ,
			$u5_name.u1.u85.\pb_d[0] 
			},

			$u5_name.u1.u85.eofin,
			$u5_name.u1.u85.eofout,
			$u5_name.u1.u85.pdata_dr,
			$u5_name.u1.u85.u94\$1.a2,

			// state machines
			{
			$u5_name.u1.u85.u1\$1.sr1.q,
			$u5_name.u1.u85.u1\$2.sr1.q,
			$u5_name.u1.u85.u1\$3.sr1.q,
			$u5_name.u1.u85.u1\$4.sr1.q,
			$u5_name.u1.u85.u1\$5.sr1.q,
			$u5_name.u1.u85.u1\$6.sr1.q,
			$u5_name.u1.u85.u1\$7.sr1.q,
			$u5_name.u1.u85. u1\$8.sr1.q
			},

			// parity bits
			{
			$u5_name.u1.u85.u1\$1.pty_bit,
			$u5_name.u1.u85.u1\$2.pty_bit,
			$u5_name.u1.u85.u1\$3.pty_bit,
			$u5_name.u1.u85.u1\$4.pty_bit,
			$u5_name.u1.u85.u1\$5.pty_bit,
			$u5_name.u1.u85.u1\$6.pty_bit,
			$u5_name.u1.u85.u1\$7.pty_bit,
			$u5_name.u1.u85. u1\$8.pty_bit
			},

			// data enables to cam
			$u5_name.u1.pdata2_en_n, 
			$u5_name.u1.pdata_en,
			$u5_name.u1.op_en_n,
			$u5_name.u1.pty_en_n
			);

		\$fstrobe (mafile, \$stime,
		"  %h%h%h%h %h%h%h%h%h %h%h%h%h %h%h%h%h %h%h%h%h%h %h%h%h%h%h",
			$u3_name.ack_dr_n,
			U1.cw,
			U1.donep,
			U1.dr,

			U1.sb_irq_ [U1.slot],
			$u3_name.u1.op_en,
			$u3_name.param_dr_n,
			$u3_name.u1.pty_en,
			$u1_name.sbd_dr_n,

			U1.sbus_err,
			U1.flg8,
			U1.hnp_sel,
			U1.hstop,

			$u2_name.hw_rd,
			U1.immed,
			U1.incadr,
			U1.inca16,
			U1.ldctl,

			U1.op_data,
			U1.pc,
			U1.pcwr,
			U1.pdav,

			U1.pdec_0,
			$u4_name.pdata_dr_n,
			$u5_name.pdata_dr_n,
			$u3_name.u1.pdata2_en,
			$u3_name.u1.pdata_en) ;

		\$fstrobe (mbfile, \$stime,
		"  %h%h%h%h%h  %h%h%h%h %h%h%h%h%h %h%h%h %h%h%h%h %h",
			$u3_name.u1.pld1,
			$u3_name.u1.pld2,
			$u3_name.u1.pld3,
			$u3_name.u1.pld4,
			U1.pldec,

			U1.prom_dr_n,
			U1.ps16,
			U1.ps8,
			U1.psd,

			U1.op_shift,
			U1.pspty,
			U1.sc,
			U1.U4.sdr_out_n_d,
			U1.U5.sdr_out_n_d,

                        $u2_name.u1.u176.sb_va_en,
			U1.sld,
			U1.sv_en,

			U1.sv_ld,
			U1.sv_sel,
			U1.sv_on,
			U1.tmint,

			U1.sclr_n) ;

		end

	initial
		begin
		wait (system.idebug !== 1'bx)
		if (system.idebug === 1'b1)
			begin
			sbfile = \$fopen (\`SB_NAME) ;
			if (sbfile == 0) \$finish ;

			fsmfile = \$fopen (\`FSM_NAME) ;
			if (fsmfile == 0) \$finish ;

			scfsmfile = \$fopen (\`SCTLFSM_NAME) ;
			if (scfsmfile == 0) \$finish ;

			srwfsmfile = \$fopen (\`SRWFSM_NAME) ;
			if (srwfsmfile == 0) \$finish ;

			pfsmfile = \$fopen (\`PFSM_NAME) ;
			if (pfsmfile == 0) \$finish ;

			ctlfile = \$fopen (\`CTL_NAME) ;
			if (ctlfile == 0) \$finish ;

			svfile = \$fopen (\`SV_NAME) ;
			if (svfile == 0) \$finish ;

			difile = \$fopen (\`DI_NAME) ;
			if (difile == 0) \$finish ;

			dofile = \$fopen (\`DO_NAME) ;
			if (dofile == 0) \$finish ;

			pbfile = \$fopen (\`PB_NAME) ;
			if (pbfile == 0) \$finish ;

			hnpfile = \$fopen (\`HNP_NAME) ;
			if (hnpfile == 0) \$finish ;

			syncfile = \$fopen (\`SYNC_NAME) ;
			if (syncfile == 0) \$finish ;

			ptyfile = \$fopen (\`PTY_NAME) ;
			if (ptyfile == 0) \$finish ;

			mafile = \$fopen (\`MA_NAME) ;
			if (mafile == 0) \$finish ;

			mbfile = \$fopen (\`MB_NAME) ;
			if (mbfile == 0) \$finish ;

\$fdisplay
	(sbfile, "             s       s        s s s   s s s  s  s     s s  s  ") ;
\$fdisplay
	(sbfile, "             b       b        b b b   b b b  b  b     b b  b  ") ;
\$fdisplay
	(sbfile, "             _       _        _ _ _   _ _ _  _  _     _ _  _  ") ;
\$fdisplay
	(sbfile, "             a       p        d s r   a m b  b  s     i r  e  ") ;
\$fdisplay
	(sbfile, "             s       a          i d   c e r  g  e     r e  r  ") ;
\$fdisplay
	(sbfile, "             _                  z     k r _  _  l     q s  r  ") ;
\$fdisplay
	(sbfile, "                                      _ r       _     _ e     ") ;
\$fdisplay
	(sbfile, "                                        _               t     ") ;
\$fdisplay
	(sbfile, "                                                        _     ") ;

\$fdisplay
	(fsmfile, "             s s  s s s  p p p  p     s    d") ;
\$fdisplay
	(fsmfile, "             v b  c c c  c w r  a     c    n") ;
\$fdisplay
	(fsmfile, "             f u  t a a  t r d  r          c") ;
\$fdisplay
	(fsmfile, "             s g  l m m  l      f          t") ;
\$fdisplay
	(fsmfile, "             m f    w r         s          r") ;
\$fdisplay
	(fsmfile, "               i    r d         m          1") ;
\$fdisplay
	(fsmfile, "               x                           6") ;


\$fdisplay
        (scfsmfile, "             s  awdre ehidr blc  sscef hiss spw") ;
\$fdisplay
        (scfsmfile, "             c  caodo rsmed gal  bblns cncc uao") ;
\$fdisplay
        (scfsmfile, "             t  kin_s rtml  _tr  __rwt os_  srr") ;
\$fdisplay
        (scfsmfile, "             l   tef  ooe_  ne_  brdt  ntl  ptd") ;
\$fdisplay
        (scfsmfile, "             _   _su  rpdb   _s  rdo   drd  ei_") ;
\$fdisplay
        (scfsmfile, "             q   e l     g   eu  _ n        na1") ;
\$fdisplay
        (scfsmfile, "                 o l     _   rs  n e        dl ") ;
\$fdisplay
        (scfsmfile, "                 s       n   rp              _ ") ;


\$fdisplay
        (srwfsmfile, "             adfi ssr  s isss  s is") ;
\$fdisplay
        (srwfsmfile, "             cisn bcd  c ncii  c ni") ;
\$fdisplay
        (srwfsmfile, "             knts _2   a cwnr  a cn") ;
\$fdisplay
        (srwfsmfile, "              _ t b    m arcd  m ac") ;
\$fdisplay
        (srwfsmfile, "              e r g    w d  y  r d ") ;
\$fdisplay
        (srwfsmfile, "              m   _    r r     d r ") ;
\$fdisplay
        (srwfsmfile, "              p   n                ") ;
\$fdisplay
        (srwfsmfile, "              t                    ") ;
\$fdisplay
        (srwfsmfile, "              y                    ") ;

\$fdisplay
        (pfsmfile, "             cdeee por p opep po  deio ppr p epppp p  deefo pr p epp ppp") ;
\$fdisplay
        (pfsmfile, "             wonor ipd c ptoc cp  oomk drd w ocddi l  ooolk dd r oll lll") ;
\$fdisplay
        (pfsmfile, "             anwfr r_  t _yfl w_  nfm  ac  r fwran d  nffg  r  d fdd ddd") ;
\$fdisplay
        (pfsmfile, "             ietio dd  l e_od rs  eie  vo  f ordtc e  eio8  d  f o12 34e") ;
\$fdisplay
        (pfsmfile, "             t  nr yo  f neu   h   nd      s u aa  c   nu      s u     c") ;
\$fdisplay
        (pfsmfile, "                    n  s  nt   i           m t t2       t      m t      ") ;
\$fdisplay
        (pfsmfile, "                    e  m       f               a_       _        _      ") ;
\$fdisplay
        (pfsmfile, "                               t                e       q        d      ") ;
\$fdisplay
        (pfsmfile, "                                                n                      ") ;

\$fdisplay
	(ctlfile, "             r c i f  h h s c b  o     b        l        l") ;
\$fdisplay
	(ctlfile, "             s a m l  s s f a i  p     u        e        i") ;
\$fdisplay
	(ctlfile, "             r m m g  t t t m g  c     r        n        n") ;
\$fdisplay
	(ctlfile, "             v w e 8  j w i w _  o     s        g        k") ;
\$fdisplay
	(ctlfile, "             d a d    m a n r x  d     t        t        a") ;
\$fdisplay
	(ctlfile, "               i      p i t   f  e     a        h        d") ;
\$fdisplay
	(ctlfile, "               t        t     e        d                 r") ;

\$fdisplay
	(svfile, "                h        i        c        p      c i s c  h w e h  p p s  s c ") ;
\$fdisplay
	(svfile, "                n        n        u        r      a f e l  a t x n  c a u  c a ") ;
\$fdisplay
	(svfile, "                x        t        r        e      m c t r  l g c p  n r s  a m ") ;
\$fdisplay
	(svfile, "                t        r        a        v      r r _ _  t _ p _  t t p  n _ ") ;
\$fdisplay
	(svfile, "                p        e        d        a      s s h e  e h t v  d i e  _ i ") ;
\$fdisplay
	(svfile, "                t        g        r        d      t t a x  d s n l  o a n  a n ") ;
\$fdisplay
	(svfile, "                r                          r          l c    t   d  n l d  c t ") ;
\$fdisplay
	(svfile, "                                                      t             e x    t   ") ;

\$fdisplay
	(difile, "             d        d        d        d") ;
\$fdisplay
	(difile, "             i        i        i        i") ;
\$fdisplay
	(difile, "             n        n        n        n") ;
\$fdisplay
	(difile, "             4        5        6        7") ;
\$fdisplay
	(difile, "                                         ") ;

\$fdisplay
	(dofile, "                     d        d        d       d      p p p p f  p l  p  q") ;
\$fdisplay
	(dofile, "                     o        o        o       o      l l l l l  t a  c  _") ;
\$fdisplay
	(dofile, "                     u        u        u       u      d d d d g  r t  [  n") ;
\$fdisplay
	(dofile, "                     t        t        t       t      1 2 3 4 8  _ c  1  [") ;
\$fdisplay
	(dofile, "                     4        5        6       7                 i h  :  1") ;
\$fdisplay
	(dofile, "                                                                 n _  0  :") ;
\$fdisplay
	(dofile, "                                                         c l ] 0") ;
\$fdisplay
	(dofile, "                                                           d   ]") ;

\$fdisplay
	(pbfile, "                     p          p p p   p p p p") ;
\$fdisplay
	(pbfile, "                     b          b b b   b b b b") ;
\$fdisplay
	(pbfile, "                     _          _ _ _   _ _ _ _") ;
\$fdisplay
	(pbfile, "                     d          e e i   s s c r") ;
\$fdisplay
	(pbfile, "                     l          o o o   t y l s") ;
\$fdisplay
	(pbfile, "                                f f s   a n k t") ;
\$fdisplay
	(pbfile, "                                o i e   t c   _") ;
\$fdisplay
	(pbfile, "                                u n l   u _    ") ;
\$fdisplay
	(pbfile, "                                t       s n    ") ;

\$fdisplay
	(hnpfile, "            h  a c e h h  h h h h h  h h r r s  s s s s  t") ;
\$fdisplay
	(hnpfile, "            n  d l x a j  n n n n n  s w 0 0 c  c b b e  m") ;
\$fdisplay
	(hnpfile, "            p  d r c l    p p p p p  t   _ _ l  [ _ _ t  c") ;
\$fdisplay
	(hnpfile, "            _  r _ p t    _ _ _ _ _  o   l v r  2 r v _  m") ;
\$fdisplay
	(hnpfile, "            f  _ e t e    e l s s v  p   d a _  : e a h  i") ;
\$fdisplay
	(hnpfile, "            s  l x n d    n d e e a      _ l n  0 s _ a  n") ;
\$fdisplay
	(hnpfile, "            m  d c            l l l      n i    ] e e l  t") ;
\$fdisplay
	(hnpfile, "                 p            _ _ i        d      t n t   ") ;
\$fdisplay
	(hnpfile, "                 t            i o d               _       ") ;
\$fdisplay
	(hnpfile, "                 n            n u                         ") ;

\$fdisplay
	(syncfile, "           Usssbs s sssbb uuuu rr  v    v   Usssbs s sssbb uuuu rr  h    h  ") ;
\$fdisplay
	(syncfile, "           1yyelc y yccll 5555 32  s    b   2yyelc y yccll 5555 32  s    b  ") ;
\$fdisplay
	(syncfile, "            nnlaa n naaaa 8888 __  c    l    nnlaa n naaaa 8888 __  c    l  ") ;
\$fdisplay
	(syncfile, "            cc nn c cnnnn zsii ll  a    a    cc nn c cnnnn zsii ll  a    a  ") ;
\$fdisplay
	(syncfile, "            __ k_ _ ___kk   01 dd  n    n    __ k_ _ ___kk   01 dd  n    n  ") ;
\$fdisplay
	(syncfile, "            ie _z f odl__      __       k    ie _z f odl__      __       k  ") ;
\$fdisplay
	(syncfile, "            nn ze s ueddl      nn  c         nn ze s ueddl      nn  c       ") ;
\$fdisplay
	(syncfile, "               er m tc ed          t    c       er m tc ed          t    c  ") ;
\$fdisplay
	(syncfile, "               ro      c           r    t       ro      c           r    t  ") ;
\$fdisplay
	(syncfile, "               o                        r       o                        r  ") ;

\$fdisplay
	(ptyfile, "              p e e p p   p  p  p p o p") ;
\$fdisplay
	(ptyfile, "              b o o d t   t  t  d d p t") ;
\$fdisplay
	(ptyfile, "              - f f a y   y  y  a a _ y") ;
\$fdisplay
	(ptyfile, "              d i o t _   f     t t e _") ;
\$fdisplay
	(ptyfile, "                n u a e   s  b  a a n e") ;
\$fdisplay
	(ptyfile, "                  t _ n   m  i  2 _   n") ;
\$fdisplay
	(ptyfile, "                    d        t  _ e   ") ;
\$fdisplay
	(ptyfile, "                    r        s  e n   ") ;
\$fdisplay
	(ptyfile, "                                n     ") ;

\$fdisplay
	(mafile, "            acdd dodps sfhh hiiil oppp ppppp") ;
\$fdisplay
	(mafile, "            cwor rprtb blns wmnnd pccd ddddd") ;
\$fdisplay
	(mafile, "            k n  i_pyd _gpt  mccc _ wa eeeaa") ;
\$fdisplay
	(mafile, "            _ e  nea__ e8_o  eaat d rv cnntt") ;
\$fdisplay
	(mafile, "            d p  tnred r sp  dd1l a    _hlaa") ;
\$fdisplay
	(mafile, "            r      anr r e    r6  t    0__2_") ;
\$fdisplay
	(mafile, "            _      m _   l        a     nn_e") ;
\$fdisplay
	(mafile, "            n        n                    en") ;
\$fdisplay
	(mafile, "                                          n ") ;

\$fdisplay
	(mbfile, "            ppppp  pppp opsss sss ssst s") ;
\$fdisplay
	(mbfile, "            lllll  rsss pscdd blv vvvm c") ;
\$fdisplay
	(mbfile, "            ddddd  o18d _p ee _d_ ___i l") ;
\$fdisplay
	(mbfile, "            1234e  m6   st nn v e lson r") ;
\$fdisplay
	(mbfile, "                c  _    hy hl a n dent _") ;
\$fdisplay
	(mbfile, "                   d    i  __ _    l   n") ;
\$fdisplay
	(mbfile, "                   r    f  nn e         ") ;
\$fdisplay
	(mbfile, "                   _    t     n         ") ;
\$fdisplay
	(mbfile, "                   n                    ") ;

			end
		end

endmodule


END
