add new urjtag-based code, fjmem
[fleet.git] / src / edu / berkeley / fleet / fpga / fjmem / vbscan.v
1 /********************************************************************
2  * Copied from data sheet:
3  *
4  * BSCAN_VIRTEX2 provides access to the BSCAN sites on a Virtex-II,
5  * Virtex-II Pro, or Virtex-II Pro X device. It is used to create
6  * internal boundary scan chains. The 4-pin JTAG interface (TDI,
7  * TDO, TCK, and TMS) are dedicated pins in Virtex-II, Virtex-II
8  * Pro, and Virtex-II Pro X. To use normal JTAG for boundary scan
9  * purposes, just hook up the JTAG pins to the port and go. The pins
10  * on the BSCAN_VIRTEX2 symbol do not need to be connected, unless
11  * those special functions are needed to drive an internal scan
12  * chain.
13  *
14  * A signal on the TDO1 input is passed to the external TDO output
15  * when the USER1 instruction is executed; the SEL1 output goes High
16  * to indicate that the USER1 instruction is active.The DRCK1 output
17  * provides USER1 access to the data register clock (generated by
18  * the TAP controller). The TDO2 and SEL2 pins perform a similar
19  * function for the USER2 instruction and the DRCK2 output provides
20  * USER2 access to the data register clock (generated by the TAP
21  * controller). The RESET, UPDATE, SHIFT, and CAPTURE pins represent
22  * the decoding of the corresponding state of the boundary scan
23  * internal state machine. The TDI pin provides access to the TDI
24  * signal of the JTAG port in order to shift data into an internal
25  * scan chain.
26  *******************************************************************/
27
28 /* rest of module copied from
29  *   http://www.xilinx.com/itp/xilinx4/data/docs/sim/vtex4.html
30  * except that BSCAN_VIRTEX was chanegd to BSCAN_VIRTEX5 and
31  * #(.JTAG_CHAIN(1)) was added
32  */
33
34 module vbscan (di,clk, qo, rst); 
35 input di; 
36 input clk; 
37 output qo; 
38 input rst; 
39 wire  
40 q0,update,shift,reset,tdi,sel1,drck1,sel2,drck2,tdo1, tdo2; 
41 BSCAN_VIRTEX5 
42 #(.JTAG_CHAIN(1))
43         bscanvirtex(.TDO(tdo2), 
44                     .UPDATE(update), 
45                     .SHIFT(shift), 
46                     .RESET(reset), 
47                     .TDI(tdi), 
48                     .SEL(sel), 
49                     .DRCK(drck2)) ; 
50 FDCE u0(.D(di), 
51                     .CE(update), 
52                     .C (clk), 
53                     .CLR (reset), 
54                     .Q (tdo2)); 
55 FDCE u1 (.D (shift), 
56                     .CE(tdi), 
57                     .C (clk), 
58                     .CLR(sel2), 
59                       .Q (q1)); 
60 FDCE u2(.D (q1), 
61                       .CE(drck2), 
62                       .C (clk), 
63                       .CLR (rst), 
64                       .Q (qo)) ; 
65 endmodule