Let Fq be a field with q elements such that gcd(mp, q(q-1))= 1 and q2 ≡ 1(mod mps), where m is prime and p> m is prime. In this paper, we give all primitive idempotents in a ring . We give the weight distributions of all irreducible cyclic codes of length mps over Fq.