We recommend you to check with PSoC 4 instead of PSoC 6.
In PSoC 4 there is a digital peripheral called UDB which you might be aware of. You can design custom digital component/glue logic/state machine uisng the UDB components in PSoC 4.
Your requirement seems to be possible using UDBs in PSoC 4. But it also depends on the type and how big the size of logic that you are implementing. The UDBs present inside the PSoC may or may not be suficient to implement the software logic that you presently have. We recommend you to check with PSoC 4L device family.
Please check the attached documentation which provides documents related to UDB.
Also, we recommend you to look at a new product from Cypress (link given below) which provides 2 Motor Control Accelerator blocks. Please note that for this particular product, there are no UDB blocks available. The tentative release of this product is by the end of this month.
I believe that the problem is artificial. During the overload conditions, the PWM duty cycle comes from the PSoC C-code, so it simply should be limited in the code before applying it to the PWM.
Thanks GaneshD_41 for all the info on UDBs that I was aware but I have not yet dig deeper into them.
I've studied a bit of Verilog during my bacelor's degree, but it might be hard for me to pursuit that way.
However I was not aware that PSoC 6 does not provide UDBs, does it?
The choice of PSoC 6 is not yet definitive for us, but there are many other reasons to make the switch with it, and I'm sorry that the question I asked was instead a bit unrelated and more general to the whole PSoC world.
I was wondering something more like using a simple logic with the already present blocks (comparators, ADC, DAC, ...) to implement a simple PWM limiter, but I think that is not that easy (or even feasible, as said by BoTa_264741) by using only the official blocks.
Maybe a custom UDB block that implements a custom PWM generator and also includes the current check could be a choice, but I think I'm not skilled enough for that.
Anyway, thanks to both of you!
Some PSoC6s have UDBs others do not.
For those PSoC6 that have UDBs, they can only be programmed in Creator at this time. ModusToolbox does not support UDBs.