Check engine light comes on. goes into limp mode.
Have replaced knock sensor.
If you post the check engine light codes someone here might be able to help you better. most Autoparts stores like Autozone will scan your car for free.
Limp Mode - Symptoms, Causes & Diagnosis (4 Easy Fixes) (mechanicbase.com)
also, there is a recall on your vehicle that might be causing your problem.
It is something to look into.
NHTSA Campaign Number: 14V614000
Manufacturer General Motors LLC
Components ELECTRICAL SYSTEM
Potential Number of Units Affected 106,307
Summary
General Motors LLC (GM) is recalling certain model year 2013-2014 Cadillac CTS, Escalade, Escalade ESV, Chevrolet Suburban, Tahoe, GMC Yukon, and Yukon XL, and 2014 Buick Enclave, Chevrolet Express, Impala, Silverado HD, Traverse, GMC Acadia, Savana, and Sierra HD vehicles. In the affected vehicles, the chassis electronic module may be internally contaminated, resulting in an electrical short.
Remedy
GM will notify owners, and dealers will replace the chassis electronic module, free of charge. The recall began on December 26, 2014. Owners may contact GM customer service at 1-800-521-7300 (Buick), 1-800-458-006 (Cadillac), 1-800-222-1020 (Chevrolet), and 1-800-462-8782 (GMC). GMs number for this recall is 14515.
Notes
Owners may also contact the National Highway Traffic Safety Administration Vehicle Safety Hotline at 1-888-327-4236 (TTY 1-800-424-9153), or go to www.safercar.gov.
Request Research (Services fees apply)
I don’t think a faulty knock sensor would be a common cause for limp mode. The knock sensor allows the computer to advance the timing a little more than it otherwise would (with no knock sensor). So a faulty knock sensor might cause the ignition timing to be more retarded, and that would show up as perhaps some hesitation on accelerations, perhaps also making the engine run a little hotter and leaner. You might also hear a little “ping” noise from the engine, esp when going uphill, accelerating.
As posted above, the best way to address this is by asking your shop to read out the OBD II drivetrain codes. You are welcome to post them here for more ideas. Usually they start with the letter “P”.