|
From: Maciej S. <mac...@ce...> - 2014-09-02 08:16:19
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I would like to ask for your opinion about executing the ivtest suite on parallel cores. I have modified the vvp_reg.pl script [1], so it can use multiple instances of vvp at the same time. The script uses Parallel::ForkManager (available in CPAN) to run iverilog & vvp instances in separate processes to decrease the time required to perform tests on modern CPUs. I have managed to go down from ~1 minute to ~15 seconds on 8-core i7 with SSD. The approximate performance boost increases linearly up to 4 cores, then the difference becomes insignificant. You may specify the number of used processes by modifying the CPUS environmental variable, e.g. "CPUS=8 ./par_vvp_reg.pl" runs with 8 processes. Otherwise the number of available cores is autodetected (works only in Linux, relies on /proc/cpuinfo). Unfortunately, there are drawbacks too: * I modified fscanf* tests, because they were using the same file and therefore stayed in conflict. It does not change results for the default vvp_reg.pl script. It is an example of restrictions that test writers would have to obey. * The output is not fully compatible with the default output stored in the repository. I decided to sort the test results in lexical order, otherwise the order would be random each run (depends on the time when a test ends). * There are two tests (pr2509349a & sys_func_task_error) that I could not fix. I guess this might be a result of changing the iverilog output file name from vsim to $tname.vsim (to avoid conflicts). I did not modified them, because I do not want to break the default test scripts. * Output files are saved in the main directory, they are removed at the end of the script. I do not remove ivl_vhdl_work directory between tests, because it could be used in another process. More elegant solution would be to use separate directories. If you think this is completely wrong - please let me know. * This is the first time I write code in Perl, therefore I am not sure if everything is done in accordance with the art. With all the mentioned shortcomings, I think that it might be a good tool for quick, preliminary checks that could save developer's time. What do you think? Regards, Orson [1] https://github.com/orsonmmz/ivtest/tree/parallel_test -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBAgAGBQJUBXzJAAoJEBRwGu1hpbJ1etMIAJyQSFeF0/p4YWlBQgpWQPml NIv2YZeKlCQHYSYfNFDIVkevnfCSNXvv6+4l0BWy4F66yfOJiZ8Y01KOH/sPWg11 2NLfnlYxbMNKLpnvERsxp6NVe41ylxjg/QPS9RFqg4NvXEAhbIW4rtd9wT1GRG3y 1+tSj4IIrC0PrVS7t0vB18dA/MB1X38aiP8yRav0EzZoRPGQHKT+yhvuoesfjtbO fD10GPqjaZnVTK+2TBfh7R00XwwVgIVuxaqall78OuKk5s1Xr5nWD7XZjsGSQGRu S/gjOtd77KSTXRNq+1jkOf/DR1DhVsBXLtaSk5tvLn1JJtjS431vMyxXxro7bjo= =w7yz -----END PGP SIGNATURE----- |