How to Run in Batch Mode
========================

Specador can be invoked in batch mode using the ``specador.sh`` script from the `DVT (Design and Verification Tools) <https://eda.amiq.com/download>`_ distro.

Examples
--------

.. code-block:: console

   $ $DVT_HOME/bin/specador.sh -lang vlog -cmd /path/to/simulation.f -title "MY CHIP"

.. code-block:: console

   $ $DVT_HOME/bin/specador.sh -lang vhdl -cmd /path/to/file_list.f -preferences /path/to/specador_preferences.xml

.. code-block:: console

   $ $DVT_HOME/bin/specador.sh -lang e -ignore_compile_errors -cmd irun.args -title "USB 3.0 uVC"


Exit Codes
^^^^^^^^^^

.. list-table::
   :header-rows: 1
   :widths: 10 90

   * - Code
     - Description
   * - 0
     - Execution completed successfully.
   * - 1
     - A compilation failure or internal error occurred.
   * - 2
     - Invalid usage or unsupported/incorrect arguments were provided.
   * - 3
     - A required external dependency is missing (e.g., ``make`` or ``latexmk`` for PDF generation).


Available arguments
^^^^^^^^^^^^^^^^^^^

.. option:: -cmd FILE

   Compile using the specified compilation arguments file. If not specified, compilation arguments are automatically detected by scanning the current working directory for source files.

.. option:: -lang (vlog|vhdl|elang)

   Specify the language of your project. This argument can be specified multiple times for mixed-language projects.

.. option:: -gen_preferences_xml
   
   Generate an XML file with all supported preferences and their default value.

.. option:: -preferences FILE
   
   Use the preferences specified in the XML file to customize the generated documentation.

.. option:: -title TITLE

   Use specified title. It has precedence over the title specified by preferences.

.. option:: -pdf
   
   Set the output format to PDF.
   
   .. note:: 
    
      When generating documentation in PDF format, **latexmk**, **texlive-luatex** and **texlive-formats-extra** packages are required as dependencies.

.. option:: -index FILE

   Provide a custom Table of Contents description.

.. option:: -attach DIR

   Provide a path containing files to be included in the generation process.

.. option:: -diagram_generation_timeout SECONDS

   Increase the timeout when generating a diagram (default: **30 seconds**).

.. option:: -diagram_layout_attempts ATTEMPTS

   Increase the layout attempts when generating a diagram (default: **3 attempts**).

.. option:: -ignore_build_config_errors

   Ignore build configuration errors.

.. option:: -ignore_compile_errors

   Ignore compile errors.

.. option:: -compile_waivers FILE

   Waive compilation errors using the waivers specified in the XML file.

.. option:: -print_all_compile_problems

   Print all compile problems. Include waived problems if used with **-print_compile_waivers_info**.

.. option:: -print_compile_waivers_info

   Prints how many problems each compile waiver has matched.

.. option:: -silent

   Turn on minimal output.

.. option:: -stack_size SIZE

   Set the Java thread stack size (syntax is <N>[g|G|m|M|k|K]). Default is **4m**.

.. option:: -heap_size SIZE

   Set the Java heap size (syntax is <N>[g|G|m|M|k|K]) (default is **3072m**).

.. option:: -license_queue_timeout TIMEOUT

   Maximum time in seconds to wait in queue for a license when one is not available.

.. option:: -log FILE

   Log output to specified file.

.. option:: -help

   Print help and exit.
