Electronic structure and antiferromagnetism in CaCuO2 and Sr2CuO2Cl2