A library of simulated-diffraction signals for an integrated circuit periodic grating is generated by generating gets of intermediate layer data. Each set of intermediate layer data corresponding to a separate one of a plurality of hypothetical layers of a hypothetical profile of the periodic grating. Each separate hypothetical layer has one of a plurality of possible combinations of hypothetical values of properties for that hypothetical layer. The generated sets of intermediate layer data are stored. Simulated-diffraction signals for each of a plurality of hypothetical profiles are generated based on the stored generated sets of intermediate layer data.
展开▼