.. highlight:: c .. _pragma_function_top: Set Custom Top-Level Function ------------------------------- **Syntax** ``#pragma LEGUP function top`` **Description** This pragma specifies the top-level C function that will be compiled to hardware by LegUp. All descendant functions called by the top-level C function will be compiled by LegUp. By default the top-level is the ``main`` function. When a custom top-level module is specified, a custom testbench will be needed for running RTL simulation. Please see :ref:`set_custom_test_bench_module` and :ref:`set_custom_test_bench_file`. **Position** At the beginning of the function definition block. **Examples** .. code-block:: c int sum(int *a) { #pragma LEGUP function top ... } --------------------------------------------------------------------------------