Exchangeable components¶
- Input component
- QualityAssurance component
- Estimation component
- Search component
- Output component
QualityAssurance component¶
The QualityAssurance component (or stage) is responsible for validating the circuits resulting from the approximation process against global quality constraints. Its main function is simply deciding whether or not an approximated circuit satisfies all quality constraints. The result can be used in the search process to recognize boundaries in the search space or eventually terminating the search.
Functions¶
setup(gen_info: GeneralInformation): None¶
Thesetupmethod can be used to initialize this component by storing theGeneralInformationinstance, parsing the global quality constraints from the configuration file and for creating files and directories that are needed for the validation process. The default implementation stores theGeneralInformationinstance and creates a directorysqcc_filesin the base directory, assuming that auxiliary circuits will be created for validation.
validateCircuit(node: Node): Boolean¶
The
validateCircuitmethod validates the circuit of a givenNodeagainst the global quality constraints and only outputs whether the validation was successful or not. To store the result and make it interpretable for the other components, theCircuitinstance’svalidatedattribute should be set toTrueand itsvalidattribute set to the result of the validation.Note that this method works with a
Circuitinstance, but gets aNodeas parameter. This is becauseNodes are the central interface for circuit representations and component interaction. ANodeinstance however stores a reference to its respectiveCircuitinstance, which is accessible vianode.circuit. This attribute will always contain aCircuitinstance if theNodewas put through the approximation process beforehand.Since quality assurance techniques are generally very diverse and require a lot of setup and cleanup, this is typically the start of a toolchain or a series of helper function calls. Feel free to add as many more functions as you need to compute the result of the validation.