.. circa_doc documentation master file, created by sphinx-quickstart on Mon May 29 11:08:46 2017. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. .. note:: This is a WIP Beta version. All content is subject to change. .. _getting_started: ========================== Getting Started with CIRCA ========================== Introduction [1]_ ================= .. figure:: images/circa_concept.png :alt: Overview of CIRCA's components and structure :name: overview_img Overview of CIRCA's components and structure CIRCA's architecture is shown in the :ref:`overview ` figure. We target search-based approximation approaches with different approximation techniques, and formal verification as well as testing for circuit validation. The framework is divided into three stages: the *input* stage, the *QUAES* stage, and the *output* stage. The input stage processes user-provided information, which in any case comprises a :ref:`configuration file ` and a description of the original, exact circuit. The configuration file defines the employed functionality in the *QUAES* stage and specifies the target metric as well as the quality constraints for the approximated circuits. The circuit description may contain annotations, added, for example, by the user to mark subcircuits amenable to approximations. Since our framework supports also testing as quality assurance technique, the input can include a test vector set. The main stage for generating approximate circuits is the QUAES stage. The split of the corresponding functionality into the four processing blocks **Qu**\ *ality Assurance*, **A**\ *pproximation*, **E**\ *stimation* and **S**\ *earch Space Exploration* (**QUAES**) is key to achieving a modular and extensible architecture. We denote the subcircuits in the input Verilog code subject to approximations as *candidates*, and the different approximated versions of these candidates as *variants*. The overall circuit with instantiated variants for the candidates is called a *circuit configuration*. The structure of the search space exploration is kept rather general, and thus, sufficiently flexible to support a wide range of search algorithms. The search space is iteratively explored by creating and visiting configurations, which form the nodes of the search space, by applying the three steps *Select*, *Expand*, and *Evaluate*. The evaluation step takes a set of configurations and determines estimated values for parameters of interest. Typically these parameters cover metrics related to area, delay, and power but can also include estimates of the error metrics. The actual estimation functions are encapsulated in the estimation block to clearly separate estimation from the search space exploration. The select step receives a set of configurations, each with an annotated vector of estimated parameters, and selects the next configuration to be further considered, i.e., to be expanded. This selection relies on a search heuristic. The selected configuration is subsequently validated. To this end the configuration, now called *Circuit-under-Test* (CUT), is sent to the quality assurance block. This block either employs formal verification or testing to decide if the CUT satisfies the quality constraints and passes the check or not. If a CUT fails quality assurance, the select step will, depending on the configuration file, either abort the search or pick the next best configuration for validation. In the latter case, the search terminates if there are no more valid configurations. If a CUT passes validation, the configuration and thus the search space is expanded by creating a number of new configurations. For creating new configurations the approximation block applies certain approximation techniques. Depending on the actual configuration of the framework, one or more candidates of the configuration can be approximated and one or more approximation techniques can be applied. The approximation block accesses a library of approximated subcircuits, which is beneficial for two reasons: First, it is rather likely that one circuit component will be approximated for several times. This happens when the overall circuit contains identical candidates, e.g., multiple occurrences of an 8-bit unsigned adder. Storing the approximated versions of such components and retrieving them the next time can greatly save computations. Second, there are already libraries available of approximated components which can then be leveraged by CIRCA. During the QUAES stage, all validated configurations are stored. The output stage performs post-processing on these configurations to return either the best approximated circuit, e.g., a circuit that respects the error constraints and has minimal area or energy, or a Pareto-filtered set of circuits. Installation ============ Prerequisites ------------- * Have Python 3.6.0 or newer installed * Whatever ABC and Yosys require (see respective website) * Go to ``circa`` base directory On first installation --------------------- * Compile ABC (for troubleshooting see: `ABC documentation`_ or `ABC GitHub`_): .. code-block:: bash cd abc/ make -j 8 cd .. * Compile Yosys (for troubleshooting see: `Yosys website`_ or `Yosys GitHub`_): .. code-block:: bash cd yosys/ make -j 8 cd .. Before each terminal session ---------------------------- Source CIRCA settings to set up CIRCA's environment: .. code-block:: bash cd circa/ source settings.sh cd .. Try out demo ------------ (Not required for installation) Small sequential circuit with two modules as approximation candidates and a configuration file that sets the approximation method to precision scaling: .. code-block:: bash cd demo/anno_gradient/ # Calling CIRCA: circa circa example.cfg test_seq.v Next Steps ========== Now that you have successfully installed and tested CIRCA, you can continue by reading the :ref:`user guide ` to learn how to use CIRCA to generate approximate circuits yourself, or you can go on to the :ref:`developer guide ` and learn everything you need to design and implement your own CIRCA components. For :ref:`more information `, visit the CIRCA website or git repository. Licensing ========= CIRCA is free software licensed under the MIT license. Citation ======== Please cite the following reference when publishing results obtained with CIRCA: `L. Witschen, M. Awais, H. Ghasemzadeh Mohammadi, T. Wiersema and M. Platzner, CIRCA: Towards a Modular and Extensible Framework for Approximate Circuit Generation," Microelectronics Reliability, (99):277-290, Elsevier, August 2019. `_ .. [1] From `L. Witschen, T. Wiersema, H. Ghasemzadeh Mohammadi, M. Awais and M. Platzner, “CIRCA: Towards a Modular and Extensible Framework for Approximate Circuit Generation,” Presented at the Third Workshop on Approximate Computing (AxC '18) 2018, Bremen, Germany, 2018. `_ .. _ABC documentation: https://people.eecs.berkeley.edu/~alanmi/abc/ .. _ABC GitHub: https://github.com/berkeley-abc/abc .. _Yosys website: http://www.clifford.at/yosys/ .. _Yosys GitHub: https://github.com/YosysHQ/yosys