If you need PSoC4 I2C samples, CE222306 can help. In this sample, Master and Slave are provided as separate projects. I needed a Master and a Slave on one PSoC4 for evaluation, so I merged two projects into one. Thus, I2C loopback works on one PSoC4. If you need the same, my sample may be useful for you.
The Slave sample was added to the Master sample of CE222306. The page 2 of TopDesign.cysch of my project was copied from Slave project. The source code I changed is simple, please see the definition of "#ifdef I2C_SLAVE" in main.c and main.h. Because I reassigned SCL and SDA of Slave component to P6.0 and P6.1 respectively, you need to wire them to SCL (P3.0) and SDA (P3.1) of Master component respectively. It's evaluated with CY8CKIT-149 for PSoC 4100S Plus.