init sw for matrix