A method and apparatus are disclosed for depositing a dielectric film in a
gap having an aspect ratio at least as large as 6:1. By cycling the gas
chemistry of a high-density-plasma chemical-vapor-deposition system
between deposition and etching conditions, the gap may be substantially
100% filled. Such filling is achieved by adjusting the flow rates of the
precursor gases such that the deposition to sputtering ratio during the
deposition phases is within certain predetermined limits.