diff --git a/tools/AutoTuner/test/smoke_test_vizier.py b/tools/AutoTuner/test/smoke_test_vizier.py new file mode 100644 index 0000000000..66d882bda6 --- /dev/null +++ b/tools/AutoTuner/test/smoke_test_vizier.py @@ -0,0 +1,66 @@ +import unittest +import subprocess +import os +from datetime import datetime + +cur_dir = os.path.dirname(os.path.abspath(__file__)) + + +class BaseVizierSmokeTest(unittest.TestCase): + platform = "" + design = "" + + def setUp(self): + self.config = os.path.join( + cur_dir, + f"../../../flow/designs/{self.platform}/{self.design}/autotuner.json", + ) + self.experiment = f"smoke-test-tune-{self.platform}-{datetime.now().strftime('%Y-%m-%d-%H-%M-%S')}" + self.command = ( + "python3 -m autotuner.vizier" + f" --design {self.design}" + f" --platform {self.platform}" + f" --experiment {self.experiment}" + f" --config {self.config}" + f" --iteration 1 --suggestions 1" + ) + + @unittest.skip("abstract_method") + def test_tune(self): + raise NotImplementedError( + "This method needs to be implemented in the derivative classes." + ) + + +class ASAP7VizierSmokeTest(BaseVizierSmokeTest): + platform = "asap7" + design = "gcd" + + def test_tune(self): + out = subprocess.run(self.command, shell=True, check=True) + successful = out.returncode == 0 + self.assertTrue(successful) + + +class SKY130HDVizierSmokeTest(BaseVizierSmokeTest): + platform = "sky130hd" + design = "gcd" + + def test_tune(self): + out = subprocess.run(self.command, shell=True, check=True) + successful = out.returncode == 0 + self.assertTrue(successful) + + +class IHPSG13G2VizierSmokeTest(BaseVizierSmokeTest): + platform = "ihp-sg13g2" + design = "gcd" + + def test_tune(self): + out = subprocess.run(self.command, shell=True, check=True) + successful = out.returncode == 0 + self.assertTrue(successful) + + +if __name__ == "__main__": + unittest.main()