module tdt_dtm_io(      
    input          pad_dtm_jtag2_sel,         
    input          pad_dtm_tap_en,        
    input          pad_dtm_tdi,           
    input          pad_dtm_tms_i,  
    output         dtm_pad_tdo,           
    output         dtm_pad_tdo_en,        
    output         dtm_pad_tms_o,         
    output         dtm_pad_tms_oe,        
    input          chain_io_tdo,             
    input          ctrl_io_tdo_en,              
    input          ctrl_io_tms_oe,                          
    output         io_chain_tdi,             
    output         io_ctrl_tap_en
);

    assign io_ctrl_tap_en = pad_dtm_tap_en;
    assign io_chain_tdi   = pad_dtm_jtag2_sel ? pad_dtm_tms_i : pad_dtm_tdi;
    assign dtm_pad_tdo    = chain_io_tdo;
    assign dtm_pad_tms_o  = chain_io_tdo;
    assign dtm_pad_tdo_en = ctrl_io_tdo_en;
    assign dtm_pad_tms_oe = ctrl_io_tms_oe;

endmodule