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
¶
Thesetup
method can be used to initialize this component by storing theGeneralInformation
instance, 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 theGeneralInformation
instance and creates a directorysqcc_files
in the base directory, assuming that auxiliary circuits will be created for validation.
validateCircuit(node: Node): Boolean
¶
The
validateCircuit
method validates the circuit of a givenNode
against 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, theCircuit
instance’svalidated
attribute should be set toTrue
and itsvalid
attribute set to the result of the validation.Note that this method works with a
Circuit
instance, but gets aNode
as parameter. This is becauseNode
s are the central interface for circuit representations and component interaction. ANode
instance however stores a reference to its respectiveCircuit
instance, which is accessible vianode.circuit
. This attribute will always contain aCircuit
instance if theNode
was 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.