90 Ls B20b shuts off

Hello folks. I’m new here i just got an 1990 Integra ls with a B20b swap with a pr4 ecu automatic has the b18a intake manifold. I’m having some problems the car starts fine today I let it idle for about 20-25 minutes till it reached operating temperature then I press the brake pedal then moved the shifter to Drive the car starts acting up the idle goes from 1000rmp to about 200rpm and it’s stays there while the engine slowly it’s dying after the engine dies the 200rpm goes to zero. The car re starts fine after it shuts off. But if I go to put it to Drive it does the same thing also as the same time I’m shifting the shifter to Drive a lot of the lights on the cluster start behaving erracting flashing on and off . Also I hear the A/T shift solenoid clicking . Anyone knows what’s going on or what I can check?