here are the instructions from GM service information site

Replace and Program Control Module

To program a replacement K20 Engine Control Module (ECM), perform the following procedure:

Install EL-49642 SPS programming support tool.
Access the Service Programming System (SPS) and follow the on-screen instructions.
Before removing the old control module, perform the SPS function Prepare Control Module for Removal, if available.

Note: The Prepare Control Module for Removal function can only be performed when communication with the old control module is still possible.
Replace the ECM.
Perform the SPS function K20 Engine Control Module - Programming and follow the on-screen instructions.
Clear the DTCs after completing the Programming procedure.
Perform the SPS function Immobilizer Learn and follow the on-screen instructions. Refer to Immobilizer System Component Programming.
Perform the SPS function K20 Engine Control Module - Configuration & Setup and follow the on-screen instructions.
Clear DTCs after completing the Configuration & Setup procedure.