bug fix in Lit + ROM, improvement in calculating clock domain