From 25f26a104bf15eeeb9ba07c343e7992711f86296 Mon Sep 17 00:00:00 2001 From: sadoon Date: Fri, 25 Aug 2023 12:29:07 +0100 Subject: [PATCH] Added VSX testing of binaries --- SFFS/debian_bootstrap.mdwn | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/SFFS/debian_bootstrap.mdwn b/SFFS/debian_bootstrap.mdwn index e9bb4c69c..73d2d6ea0 100644 --- a/SFFS/debian_bootstrap.mdwn +++ b/SFFS/debian_bootstrap.mdwn @@ -86,6 +86,36 @@ If you prefer to use the prebuilt tarball (which will save days of your time), y $ cd .. $ sudo chroot bookworm-sffs +# Testing for VSX in object files + +To verify that our buildflags were applied by the build tools and respected by the build scripts of packages, we need to check for the inclusion of VSX as well as any other instructions not available in SFFS. + +This is not a perfect solution and the proper way would be either to: + +- Simulate an SFFS compliant chip running this code such as [Microwatt](https://libre-soc.org/HDL_workflow/microwatt/) (very time consuming) +- Use a softcore FPGA core or ASIC of Microwatt / LibreSOC to run this code (doable, FPGA softcore in progress [link to bug](link)) +- Use the finalized Libre-SOC chip (doable once it is ready) + +Also note that this only tests for a subset of VSX instructions at the moment, more will be added in the future, this is simply a quick test to run before attempting to run on simulation and/or a softcore as both can be somewhat time consuming. In other words, if this test gives any VSX instructions, don't attempt to run the code in simulation or a softcore to avoid wasting precious time. + +To attempt this test, you will need the scripts from our `dev-env-setup` repository + +$ git clone https://git.libre-soc.org/git/dev-env-setup.git + +Again, previous notes about running the scripts applies here, do make sure to read whatever you run, they are short and human-readable. + +Edit the `test-vsx` script to point the `CHROOT` variable to your respective chroot of Gentoo, read through the script thoroughly, and run + +$ ./test-vsx + +If you see any number of instructions in certain binary files, those files do contain VSX and work needs to be done (patching the build scripts and/or source code) for these packages. If not, great! Try to run this in a proper SFFS environment to fully test the code you have. + +You can also test specific binaries at any time by running this part of the script + +$ objdump -d $OBJ_FILE | fgrep -of VSX_INSNS.txt | sort | uniq -c | awk '{print $2 " " $1}' + +Where $OBJ_FILE is the binary you need to check. + ## Notes and issues * Some packages will refuse to build with sffs compliant build flags and need workarounds, this will be handled in the future. -- 2.30.2