An agreement in principle was reached in New York on Tuesday between the league and its veteran referees on a new two-year contract that will end the lockout of the NBA's 57 regular officials and get them on the court in time for next week's regular season opener, according to a source with knowledge of the discussions.