// ============================================================================= // Module Name: IPat_BsrBC_2_HighZ.v // Revision: 20220504a // Author: Altmo toolbox // Description: // + JTAG BSR type BC_2 with High-Z control // ============================================================================= `timescale 1ns/1ns module IPat_BsrBC_2_HighZ ( input fi, // input for normal/user function output fo, // output for normal/user function input si, // BSR chain input output so, // BSR chain output input capture, // BSR capture input shift, // BSR shift input update, // BSR update input mode, // BSR mode (output select) 0:fo=fi, 1:fo=r_update input tck, // BSR clock input highz // BSR highz control ); parameter P_HIGHZ_OUT = 1'b1; // set value for output disable parameter u_dly = 1; // unit delay for registers input reg r_capture; // BSR capture/shift-FF reg r_update; // BSR update-FF assign fo = (highz)? P_HIGHZ_OUT : // force High-Z (mode)? r_update : fi; assign so = r_capture; wire w_capture; wire w_update; always @(posedge tck) begin r_capture <= #u_dly w_capture; end always @(negedge tck) begin r_update <= #u_dly w_update; end assign w_capture = (shift)? si : (capture)? fo : r_capture; // different from BC_1 assign w_update = (update)? r_capture : r_update; endmodule