// ============================================================================= // Module Name: IPat_BsrBC_2.v // Revision: 20220504a // Author: Altmo toolbox // Description: // + JTAG BSR type BC_2 // ============================================================================= `timescale 1ns/1ns module IPat_BsrBC_2 ( 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 ); parameter u_dly = 1; // unit delay for registers input reg r_capture; // BSR capture/shift-FF reg r_update; // BSR update-FF assign fo = (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