component metalmusings_encoder;
pin io bit index-c-enable;
pin in u32 index-status;
pin out u32 index-latch-enable;

function _;
license "GPL";
;;

//main function
FUNCTION(_) {
    index_latch_enable = index_c_enable;
    if (index_latch_enable) {
        if (index_status) {
            index_c_enable = 0;
	}
	     // else wait for index-status
    } else {
       index_c_enable = index_status;
    }
}
