We can't currently simulate an entire human brain, partly due to the fact that we're reaching the limit of Moore's Law.
The closest we've come so far is either EPFL's "Blue Brain Project" or DARPA's "SyNAPSE" program, both of which have achieved a kind of simulation of a brain consisting of around 1 million "neurons".
Additionally, how the brain works is nowhere near that simple, and we barely have any understanding of how the brain processes information.
Furthermore, on a philosophical level, we don't know what it means to be sentient, or self-aware, or even truly intelligent, so how could we create something else that is?
And, if we manage to create one a hundred years from now or something, we don't know who will create it, or how they'll program it, or why. The range of possibilities is far too vast to predict.
Skynet destroyed humanity because it was built to protect the planet. So it did. It protected the planet from the thing damaging it the most: Humans.
HAL killed the crew of Discovery One because it was programmed to complete the mission whatever the cost, and the crew wanted to abandon the mission.
Ultron's assessments of "peace in our time" quickly led him to the conclusion that the entire human race was self-destructing, so he decided genocide was the solution, and the Avengers were the main obstacle he had to overcome.
But then there are AIs like Andrew, David, Sonny, or the Machine Race in The Matrix. All of these examples are not created by the military or for a specific purpose, they are either accidents or created simply because humanity could. In these examples, the AIs just want the same as what any sentient being would want: The same rights to exist as any other sentient being. To be loved. But in movies, humanity always treats them as objects and slaves.
All of the above examples, and many others besides, are all potential outcomes, as are the outcomes where we live peacefully alongside the AI / Machines. We simply can't predict what form it will take, until it happens.