Don't worry about generating PWM. It's what you're doing, but it's not
why you're doing it.
Why are you doing it? To build current in an inductor.
In a flyback converter, that inductor is the transformer.
In a forward converter, it's the filter choke, which can be on the input or output side, but traditionally is on the output.
The equation you're using is:
V = L * dI/dt
V is the supply voltage, minus losses. Stepped through the transformer ratio, if applicable. L is supposed to be constant (but it does drop at high current, hence why you want to buy an inductor with saturation current greater than the peak current you're using). dI is a change in current. The inductor remembers its current from cycle to cycle, unless it's been discharged fully (and you aren't using a synchronous converter that forces continuous current flow). dt is the pulse width.
This only gives the change in current, dI. The total current is made up from all the dI's added together. When the switch is on, dI is positive and V is supply; when off, dI is negative, and V is the output voltage (which is negative, from the perspective of the inductor, mind).
If dI_rising is more than dI_falling, current keeps ramping up.
If you don't control current in some way, just setting any random PWM value from the controller, current could rise to dangerous levels. What's worse, if you accidentally allow setting PWM = 100%, switching never occurs, and no voltage is ever delivered to the secondary side!
Easy enough to set a hard limit so PWM% never goes too high, but that won't prevent current from ramping up under certain conditions.
So what to do? Measure current, and control that first.
Then control the current setpoint with a second error amplifier, to regulate output voltage.
That PSoC might have a fast enough ADC to do this (you want to measure current about as often as it's switching), or it may have a comparator (also check that it's fast, under a microsecond say) that can be linked to the PWM timer, or output pin. These would be used for average current control, or peak current control, respectively.
Typically, you'll choose average current control for higher power converters, with larger inductors that are cheaper, but can't handle as much ripple current (say, dI < 0.2 * I, that is, the ripple fraction at full current output is 20% or less). The lower ripple current also means some savings on capacitors.
Conversely, peak current mode control is good for smaller converters, say under 100W, where the economy of scale hasn't kicked in yet, and capacitors and inductors can handle relatively high ripple currents.
Both of these controls are easy enough to do without an SoC at all: the UC3842 family is the go-to peak current controller, and TL494 can be used for average current control, or you can build one from op-amps and comparators:
https://www.eevblog.com/forum/projects/building-a-simple-switching-circuit/msg1252706/#msg1252706Indeed, a PSoC is likely to just get in the way, as it brings a whole mess of software issues along with it, any one slip-up which can explode the switching transistor!
It's not that a tightly integrated software control isn't possible, it's just that it's a whole hell of a lot harder to pull off, guaranteeing that it will behave itself!
If digital control is needed, better to use DACs and ADCs to control and monitor an analog circuit, which is able to run, independently and safely, even if the updates stop, and which can never be forced into a dangerous condition over the range of settings it can be given.
Tim