From 5403c0f8640141e3e5418d501738977eabc4ad71 Mon Sep 17 00:00:00 2001 From: Michael Nolan Date: Wed, 4 Mar 2020 11:09:06 -0500 Subject: [PATCH] Generate ilang for whole decoder --- src/decoder/test/test_power_decoder.py | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/src/decoder/test/test_power_decoder.py b/src/decoder/test/test_power_decoder.py index 9b054b1d..f64f4b96 100644 --- a/src/decoder/test/test_power_decoder.py +++ b/src/decoder/test/test_power_decoder.py @@ -89,49 +89,37 @@ class DecoderTestCase(FHDLTestCase): in1_sel, in2_sel]): sim.run() - def generate_ilang(self, bitsel, csvname, opint=True, suffix=None): - prefix = os.path.splitext(csvname)[0] - if suffix: - prefix += ".%s" % str(suffix).replace(" ", "")[1:-1] - dut = PowerDecoder(32, get_csv(csvname), bitsel=bitsel, - opint=opint, suffix=suffix) - vl = rtlil.convert(dut, ports=dut.ports()) - with open("%s_decoder.il" % prefix, "w") as f: + def generate_ilang(self): + vl = rtlil.convert(pdecode, ports=pdecode.ports()) + with open("decoder.il", "w") as f: f.write(vl) def test_major(self): self.run_tst((26, 32), "major.csv") - self.generate_ilang((26, 32), "major.csv") + self.generate_ilang() def test_minor_19(self): self.run_tst((1, 11), "minor_19.csv", minor=(19, (26, 32)), suffix=(0, 5)) - self.generate_ilang((1, 11), "minor_19.csv", suffix=(0, 5)) # def test_minor_19_00000(self): # self.run_tst((1, 11), "minor_19_00000.csv") - # self.generate_ilang((1, 11), "minor_19_00000.csv") def test_minor_30(self): self.run_tst((1, 5), "minor_30.csv", minor=(30, (26, 32))) - self.generate_ilang((1, 5), "minor_30.csv") def test_minor_31(self): self.run_tst((1, 11), "minor_31.csv", minor=(31, (26, 32))) - self.generate_ilang((1, 11), "minor_31.csv", suffix=(0, 5)) def test_minor_58(self): self.run_tst((0, 2), "minor_58.csv", minor=(58, (26, 32))) - self.generate_ilang((0, 2), "minor_58.csv") def test_minor_62(self): self.run_tst((0, 2), "minor_62.csv", minor=(62, (26, 32))) - self.generate_ilang((0, 2), "minor_62.csv") # #def test_minor_31_prefix(self): # # self.run_tst(10, "minor_31.csv", suffix=(5, 10)) - # # self.generate_ilang(10, "minor_31.csv", suffix=(5, 10)) # def test_extra(self): # self.run_tst(32, "extra.csv", opint=False) -- 2.30.2