Since programming a self aware machine would require us to understand our brain function and our own self awareness, I highly doubt that it will ever happen.
Because if your brain would be simple enough for you to understand it, you would be to dumb to ask how it works.