1. A method for programming a phase-change memory cell having multilevel programmable cell states, the method comprising: applying at least one control signal to produce a programming pulse for programming the cell; and varying at least one control signal during the programming pulse to shape the programming pulse in dependence on the cell state to be programmed and produce a selected one of a plurality of programming pulse waveforms corresponding to respective programming trajectories for programming the cell states; wherein the selected programming pulse waveform corresponds to a programming trajectory containing the cell state to be programmed; the programming pulse waveform having a fixed total duration comprising a sum of a duration of a first waveform portion and a duration of a second waveform portion, the first waveform portion having a first, constant amplitude, and the second waveform portion having a second, selectable constant amplitude that is lower than the constant amplitude of the first waveform portion; wherein relative durations of the first and second waveform portions are dependent upon the programming trajectory containing the cell state to be programmed, and wherein the second amplitude of the second waveform portion is selected to be within a programming window for the programming trajectory.