add diag pattern match fucntion and timing calculation function