Was it a formal PIP, though? In my experience there are many managers who'll do that for employees that they wish to retain, but who, for various reasons, aren't performing up to snuff. However, I've never heard of a manager bringing HR in, doing the PIP paperwork, and the employee surviving the PIP. In general, the moment HR gets involved (either in person or via formal paperwork) between you or your manager, you know you're done. As others have stated, treat the time of your PIP as a form of severance pay, do the minimum amount of work necessary to not get fired that day, and look for a job elsewhere.
It wasn't my manager who "brought HR in", though. Performance evaluation at my company isn't just the manager's discretion, and low performance will eventually get you a PIP.
Okay, fair enough. In that case, it may have been the case that your manager disagreed with HR's assessment and was willing to give you a second chance. In all of the cases I've heard of, however, HR has been brought in at the manager's request, when other, more informal mechanisms have failed.
I'm not even sure a manager here can fire you by his own choice, for what it's worth. The company invests a ton in its engineers; a failed investment is a big waste. Also, it's the manager's job to make his reports more productive, so that kind of failure reflects on him too.