Can you check if these links are of help?
Can you share which MATLAB products you have access to to provide better suggestions? For example do you have access to Simscape Electrical and Simulink? We can provide access to HDL compatible resettable integrator based on additional inputs.