Skip to content

Commit

Permalink
fix python lint
Browse files Browse the repository at this point in the history
Signed-off-by: luarss <[email protected]>
  • Loading branch information
luarss committed Aug 9, 2024
1 parent 85ed24e commit 100d84b
Showing 1 changed file with 20 additions and 12 deletions.
32 changes: 20 additions & 12 deletions tools/AutoTuner/test/smoke_test_sample_iteration.py
Original file line number Diff line number Diff line change
@@ -1,27 +1,33 @@
import unittest
import subprocess
import os

cur_dir = os.path.dirname(os.path.abspath(__file__))
src_dir = os.path.join(cur_dir, "../src/autotuner")
os.chdir(src_dir)


class BaseSampleIterationSmokeTest(unittest.TestCase):
platform = ""
design = ""

def setUp(self):
self.config = os.path.join(cur_dir, f"../../../flow/designs/{self.platform}/{self.design}/autotuner.json")
self.config = os.path.join(
cur_dir,
f"../../../flow/designs/{self.platform}/{self.design}/autotuner.json",
)
self.experiment = f"smoke-test-sample-iteration-{self.platform}"
self.matrix = [(5,1), (1,5), (2,2), (1,1)]
self.matrix = [(5, 1), (1, 5), (2, 2), (1, 1)]
self.commands = [
f"python3 distributed.py"
f" --design {self.design}"
f" --platform {self.platform}"
f" --experiment {self.experiment}"
f" --config {self.config}"
f" tune --samples {s} --iterations {i}"
for s, i in self.matrix
]
f"python3 distributed.py"
f" --design {self.design}"
f" --platform {self.platform}"
f" --experiment {self.experiment}"
f" --config {self.config}"
f" tune --samples {s} --iterations {i}"
for s, i in self.matrix
]


class ASAP7SampleIterationSmokeTest(BaseSampleIterationSmokeTest):
platform = "asap7"
Expand All @@ -34,6 +40,7 @@ def test_sample_iteration(self):
successful = out.returncode == 0
self.assertTrue(successful)


class SKY130HDSampleIterationSmokeTest(BaseSampleIterationSmokeTest):
platform = "sky130hd"
design = "gcd"
Expand All @@ -45,6 +52,7 @@ def test_sample_iteration(self):
successful = out.returncode == 0
self.assertTrue(successful)


class IHPSG13G2SampleIterationSmokeTest(BaseSampleIterationSmokeTest):
platform = "ihp-sg13g2"
design = "gcd"
Expand All @@ -56,6 +64,6 @@ def test_sample_iteration(self):
successful = out.returncode == 0
self.assertTrue(successful)

if __name__ == '__main__':

if __name__ == "__main__":
unittest.main()

0 comments on commit 100d84b

Please sign in to comment.