Self-alignedtop-gate