Chirp-compensated 40-GHz mode-locked lasers integrated with electroabsorption modulators and chirped gratings