/**************************************************************************/ /* VFI_BIP.TDL */ /* */ /* Program for U21 of the VME-Fastbus Interface for the SuperK OD DAQ: */ /* */ /* 1) OR of 4 BIP signals coming from the BIP cards. */ /* 2) selectable busy signal for the 'TRGVETO' veto. */ /* 3) End-of-BIP flag for the V533 fifo(s). */ /* */ /* User selection jumper inputs: */ /* BIP_INVERT: high: BIP input signals inverted */ /* low: BIP input signals not inverted */ /* BIP_VETO: high: BIP Veto option enabled (BIPBUSY = BIPOR) */ /* low: BIP Veto option disbaled (BIPBUSY = 0) */ /* BIP_LONG: high: length of BIPBUSY = BIPOR + 200 nsec */ /* low: BIPBUSY = BIPOR */ /* */ /* first 07/09/96 */ /* added 08/11/96: additional external veto input OR-ed to veto_out */ /**************************************************************************/ #define PALNAME VFI_BIP #define JEDFILE "VFI_BIP.JED" #define PALTYPE "p22v10" #define DESIGNER H.G. Berns #define COMPANY SuperK group, UW-Physics, Seattle #define PARTNUM P22V10 #define REVISION V1.1 (last: August 11, 1996) #define COMMENTS \ VFI module: BIP OR and edge detector, and Reset Veto. /************ I/O definitions *********************************************/ PALNAME (in 50MHz_clock, /* Clock input (50 MHz) */ bip4..1, /* BIP inputs (from Hut 1 ... 4) */ reset_veto, /* Reset Veto input (VME selected) */ !ext_veto, /* external veto input (low active) */ bip_invert, /* jumper to select BIP inv./noninv. inputs */ bip_veto, /* jumper to enable/disable veto/busy funct. */ bip_long, /* jumper to select prolonged busy/veto */ reset_veto_en, /* jumper to enable/disable RVETO */ reg_clear; /* reset signal (test) */ reg veto_out, /* BIP/Reset veto output for 'TRGVETO' PLD */ bip_or_out, /* output BIP 'or' */ end_of_bip, /* End-of-BIP flag */ intern_reg, /* internal multi-purpose register */ count_reg_3..0) /* internal counter registers */ /************ PLD equations ***********************************************/ { group rgs[veto_out, bip_or_out, end_of_bip, intern_reg, count_reg_3..0], count_reg[count_reg_3..0]; rgs[].ck = 50MHz_clock; /* register clock hook up */ rgs[].pre = 0; /* no presets */ rgs[].aclr = reg_clear; /* register clear */ rgs[].oe = ~0; /* all outputs enabled */ if (bip_invert) /* BIP OR output */ bip_or_out = !bip1 | !bip2 | !bip3 | !bip4; else bip_or_out = bip1 | bip2 | bip3 | bip4; intern_reg = bip_or_out; /* internal registers */ if (intern_reg & !bip_or_out) { /* end of bip detector */ end_of_bip = 1; count_reg[] = 10; /* start 200ns counter */ } else { end_of_bip = count_reg[]==10; if (count_reg[]!=0) count_reg[]--; /* count down until 0 */ else count_reg[] = 0; /* then stop at 0 */ } if (bip_veto) { /* veto_out signal gen.*/ if (bip_long) { if (bip_invert) { veto_out = !bip1 | !bip2 | !bip3 | !bip4 | intern_reg | count_reg[]!=0 | reset_veto & reset_veto_en | ext_veto; } else { veto_out = bip1 | bip2 | bip3 | bip4 | intern_reg | count_reg[]!=0 | reset_veto & reset_veto_en | ext_veto; } } else { if (bip_invert) { veto_out = !bip1 | !bip2 | !bip3 | !bip4 | reset_veto & reset_veto_en | ext_veto; } else { veto_out = bip1 | bip2 | bip3 | bip4 | reset_veto & reset_veto_en | ext_veto; } } } else { veto_out = reset_veto & reset_veto_en | ext_veto; } /************ PLD part definition *****************************************/ putpart(PALTYPE, JEDFILE, 50MHz_clock, /* pin 1 */ /* (clock) */ bip1, /* pin 2 */ bip2, /* pin 3 */ bip3, /* pin 4 */ bip4, /* pin 5 */ reset_veto, /* pin 6 */ ext_veto, /* pin 7 */ reset_veto_en, /* pin 8 */ bip_veto, /* pin 9 */ bip_long, /* pin 10 */ bip_invert, /* pin 11 */ GND, /* pin 12 = GND (fixed) */ reg_clear, /* pin 13 */ _, /* pin 14 */ /* (n/c) */ _, /* pin 15 */ /* (n/c) */ intern_reg, /* pin 16 */ count_reg_0, /* pin 17 */ count_reg_1, /* pin 18 */ count_reg_2, /* pin 19 */ count_reg_3, /* pin 20 */ veto_out, /* pin 21 */ end_of_bip, /* pin 22 */ bip_or_out, /* pin 23 */ VCC); /* pin 24 = VCC (fixed) */ /************ Test vector(s) *********************************************/ test (50MHz_clock, reg_clear, reset_veto_en, reset_veto, ext_veto, bip_invert, bip_veto, bip_long, bip1, bip2, bip3, bip4 => intern_reg, count_reg[], veto_out, end_of_bip, bip_or_out) { tracef("%w %w %w %w %w %w %w %w %w %w %w %w => %w %2d %w %w %w", 50MHz_clock, reg_clear, reset_veto_en, reset_veto, ext_veto, bip_invert, bip_veto, bip_long, bip1, bip2, bip3, bip4, intern_reg, count_reg[], veto_out, end_of_bip, bip_or_out); ( 0,1,?,?,?,?,?,?,?,?,?,? => 0, 0,0,0,0); /* init (reset) */ (\C,0,0,0,1,0,0,0,0,0,0,0 => _, _,_,_,_); (\C,_,?,0,1,0,0,0,1,0,0,0 => _, _,_,_,1); /* inv=0 veto=0 long=0 */ (\C,_,_,_,_,_,_,_,0,1,0,0 => 1, _,_,_,_); (\C,_,_,_,_,_,_,_,0,0,1,0 => _, _,_,_,_); (\C,_,_,_,_,_,_,_,0,0,0,1 => _, _,_,_,_); (\C,_,_,_,?,_,_,_,1,1,1,1 => _, _,?,_,_); /* (ext_veto = ?) */ (\C,_,_,1,_,_,_,_,0,1,0,1 => _, _,_,_,_); /* with reset veto */ (\C,_,_,_,_,_,_,_,0,0,0,0 => _, _,_,_,0); (\C,_,_,_,_,_,_,_,_,_,_,_ => 0,10,_,1,_); (\C,_,1,_,_,_,_,_,_,_,_,_ => _, 9,1,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 8,_,0,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 7,_,_,_); (\C,_,_,_,1,_,_,_,_,_,_,_ => _, 6,_,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 5,_,_,_); (\C,_,_,0,_,_,_,_,_,_,_,_ => _, 4,0,_,_); (\C,_,_,_,0,_,_,_,_,_,_,_ => _, 3,1,_,_); (\C,_,_,_,1,_,_,_,_,_,_,_ => _, 2,0,_,_); (\C,_,0,_,_,_,_,_,_,_,_,_ => _, 1,_,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 0,_,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, _,_,_,_); (\C,_,_,_,_,1,?,0,0,1,1,1 => _, _,?,_,1); /* inv=1 veto=? long=0 */ (\C,_,_,_,_,_,_,_,1,0,1,1 => 1, _,_,_,_); (\C,_,_,_,_,_,_,_,1,1,0,1 => _, _,_,_,_); (\C,_,_,_,_,_,_,_,1,1,1,0 => _, _,_,_,_); (\C,_,_,_,_,_,_,_,0,0,0,0 => _, _,_,_,_); (\C,_,_,_,_,_,_,_,0,1,1,0 => _, _,_,_,_); (\C,_,_,_,_,_,_,_,1,1,1,1 => _, _,0,_,0); (\C,_,_,_,_,_,_,_,_,_,_,_ => 0,10,_,1,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 9,_,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 8,_,0,_); (\C,_,1,_,_,_,_,_,_,_,_,_ => _, 7,_,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 6,_,_,_); (\C,_,_,_,0,_,_,_,_,_,_,_ => _, 5,1,_,_); (\C,_,_,?,1,_,_,_,_,_,_,_ => _, 4,?,_,_); /* another reset veto */ (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 3,_,_,_); (\C,_,_,1,_,_,_,_,_,_,_,_ => _, 2,1,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 1,_,_,_); (\C,_,_,0,_,_,_,_,_,_,_,_ => _, 0,0,_,_); (\C,_,?,_,_,_,_,_,_,_,_,_ => _, _,_,_,_); (\C,_,_,_,_,0,1,1,1,0,0,0 => _, _,1,_,1); /* inv=0 veto=1 long=1 */ (\C,_,_,_,_,_,_,_,0,1,0,0 => 1, _,_,_,_); (\C,_,_,_,_,_,_,_,0,0,1,0 => _, _,_,_,_); (\C,_,_,_,_,_,_,_,0,0,0,1 => _, _,_,_,_); (\C,_,_,_,_,_,_,_,1,1,1,1 => _, _,_,_,_); (\C,_,_,_,_,_,_,_,0,1,0,1 => _, _,_,_,_); (\C,_,_,_,_,_,_,_,0,0,0,0 => _, _,_,_,0); (\C,_,_,_,_,_,_,_,_,_,_,_ => 0,10,_,1,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 9,_,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 8,_,0,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 7,_,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 6,_,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 5,_,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 4,_,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 3,_,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 2,_,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 1,_,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, 0,_,_,_); (\C,_,_,_,_,_,_,_,_,_,_,_ => _, _,0,_,_); } } /************ end of TDL file *********************************************/