CONTEXT: I work as a software developer in a very small company (10 people, we all work on the same floor) that specializes in open-source software. I'm on a trial period that is supposed to end in September.
It is a very convenient job for me. Given my profile I would have a hard time finding another job that isn't significantly worse for me.
PROBLEM: I did rather OK the first few months because I was given easy tasks as a beginner, but now I moved on to bigger and more difficult projects. I work too slowly on those projects and need several days to do something that would take a normal developer only a few hours.
Relation with my boss (who is also the CEO) has been going progressively worse. I've been told 4 times in private that I work too slowly, am not concentrated and don't ask enough questions (but when I do I'm told that they already told me that and should have listened) but now it has gotten worse. His pity has turned into contempt. He recently publicly humiliated me and doesn't even greet me in the morning anymore.
The thing is: When I'm being berated I can't answer simply because it is justified. To be clear: my incompetence is due to factors intrinsic to me (cognitive), not a lack of knowledge, training, etc.
I'm on a trial period so I am in danger of being fired at any moment and if things continue this way I won't last long but I don't know what to do about it. I just can't approach my boss and tell him all of this because I would basically justify my own firing but I have to do something.
TL;DR: I want to keep my current job but I'm bad at it and my boss know it. What can I do to defuse the situation ?
NOTE: Some of you might say that it's unethical for me to want to keep a job despite knowing that I'm bad at it. I don't think so. I'd likely never find another decent job again if I lose this one.