you need two triangle wave generators and a comparator.
One triangle wave goes to one input of your comparator (at the frequency of you PWM), the other triangle wave is the duty cycle (I imagine this could also be done with just a RC circuit, it does not need to be perfectly linear right?), the comparator will produce a square wave with a duty cycle that steadily goes up.