DB4HLS
Tutorial
This page offers a few examples of SQL scripts that can be used to interact with the tutorial. In addition, are shown examples for defining a configuration space with the proposed DSL, and, lastly, how to use the gnu-parallel framework to concurrently run synthesis processes is described.
DB interaction
Herein follows a list of SQL scripts to gather data from DB4HLS:
Retrieve the designs from the database
The following script retrieves all the available designs in the database independently from their original benchmark and application.
SQL Script:
Example of output:
Retrieve all the configurations associated with a design configuration space
The following script given a configuration space identifier (i.e., id_configuration_space) retrieves all the associated configurations in the database. The id_configuration_space=455 is associated to the configuration space with name=aes_addRoundKey_aes_aes.
SQL Script:
Example of output:
Retrieve all the completed implementations given the configuration hashes
The following script extracts all the completed synthesis (hls_exit_value=0) given a list of configuration hashes (hash_configuration). The hashes can be retrieved from the table obtained in the example above.
SQL Script:
Example of output:
Retrieve performance results from a list of implementations
The following script, given the id_performance_result of the extracted implementations (see example above), retrieves all the associated performance results.
SQL Script:
Example of output:
DSL examples
Herein follows a few DSL scripts to automatically generate generate all the configurations of the defined configuration space:
- aes256_encrypt_ecb: 1944 configurations using multiple bindings;
- get_delta_matrix_weights1: 21952 configurations using directive values generators;
The DSL parser and other examples can be found in the db4hls github repository
aes256_encrypt_ecb
Example of configuration space defined for the aes256_encrypt_ecb function from MachSuite. The following script defines a configuration space with 1944 different configurations.
The binding decorator @A is used to constraint the directive values of knobs at lines 4,5,6 and 9 to share the same directive value in all the generated configurations. Therefore, there are no configurations generated with all the permutations of three possible directive values for the bound knobs. In the same way, knob @B and @C bind the knobs at lines 12 and 17, and 14, 15, and 16, respectively.
Retrieve all the configurations associated to a design configuration space
Example of configuration space defined for the get_delta_matrix_weights1 function from MachSuite. The following script defines a configuration space with 21952 different configurations.
The directive value generators are used in this example to populate all the directive value sets, but the clock one. The generators allow to automatically generate the desired values without enumerating them. In the example, the 1->832,integer_divisors generator, generates a set of values which are all the integer divisors of 832 with the starting elements (i.e., 1) and the last one (i.e., 832) included.
Another possible generator supported by the DSL is pow_2, which generates all the powers of two in between the starting and the ending numbers specified.
Parallel framework for Design Space Explorations.
In order to use the parallel framework to run exhaustive DSEs, clone the db4hls github repository with the source files and instructions on how to run it.
Author
Lorenzo Ferretti, Ph.D. student at Università della Svizzera italiana (USI).
You can find more information about my work here and for any question you can contact me at [email protected].