add tcg tool, for template-based code-gen