From ce832239699f948b17a47fbc6e3ee2a1fa120b0b Mon Sep 17 00:00:00 2001 From: Miical <879754743@qq.com> Date: Fri, 6 Sep 2024 12:57:22 +0800 Subject: [PATCH] Update uftb-raw to mlvp v0.1.0 --- tests/Makefile | 2 +- tests/uFTB-raw/FauFTB.py | 12 ++++-------- tests/uFTB-raw/test_raw.py | 18 +++++++----------- 3 files changed, 12 insertions(+), 20 deletions(-) diff --git a/tests/Makefile b/tests/Makefile index 09ce85a..bbaf223 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -3,7 +3,7 @@ TEST_FOLDER=./$(TEST) PYTHON=python3 run: - pytest --mlvp-report -sv $(TEST_FOLDER) + pytest --mlvp-report -n=auto -sv $(TEST_FOLDER) clean: rm -rf reports/ diff --git a/tests/uFTB-raw/FauFTB.py b/tests/uFTB-raw/FauFTB.py index f75a315..a793c14 100644 --- a/tests/uFTB-raw/FauFTB.py +++ b/tests/uFTB-raw/FauFTB.py @@ -89,18 +89,18 @@ class FauFTB(DUTFauFTB): self.resp_meta_hit_r_1 = xsp.XPin( outer_instance.io_out_last_stage_meta.xdata.SubDataRef( - "resp_meta_hit_r_1", 0, - 0 + 0, + "resp_meta_hit_r_1" ), outer_instance.event, ) self.resp_meta_pred_way_r_1 = xsp.XPin( outer_instance.io_out_last_stage_meta.xdata.SubDataRef( - "resp_meta_pred_way_r_1", 1, - 5 + 5, + "resp_meta_pred_way_r_1" ), outer_instance.event, ) @@ -150,10 +150,6 @@ class FauFTB(DUTFauFTB): self.io_out_s1_full_pred = self.Io_out_s1_full_pred(self) self._io_out_last_stage_meta = self.Io_out_last_stage_meta(self) self.io_update_bits_ftb_entry = self.Io_update_bits_ftb_entry(self) - self.InitClock("clock") - - def finalize(self): - super().Finish() def check_dup_equation(self, *inputs): return all(i == inputs[0] for i in inputs) diff --git a/tests/uFTB-raw/test_raw.py b/tests/uFTB-raw/test_raw.py index d8440ce..3143a18 100644 --- a/tests/uFTB-raw/test_raw.py +++ b/tests/uFTB-raw/test_raw.py @@ -32,15 +32,14 @@ def set_update(uFTB: FauFTB, entry: Tuple[int, FTBEntry, bool, bool]): uFTB.update_ftb_entry(entry[0], entry[1], (entry[2], entry[3])) +from mlvp import * import mlvp.funcov as fc from mlvp.reporter import * -def test_raw(request): +def test_raw(mlvp_request): + uFTB: FauFTB = mlvp_request - uFTB: FauFTB = FauFTB( - waveform_filename="report/uftb_raw.fst", coverage_filename="report/uftb_raw_coverage.dat" - ) ftb_entry_list() uFTB.reset.value = 1 uFTB.Step(100) @@ -57,10 +56,7 @@ def test_raw(request): print("main", pred[0], pred[1].__dict__) uFTB.Step(1) - uFTB.Finish() - - set_line_coverage(request, "report/uftb_raw_coverage.dat") - - -if __name__ == "__main__": - test_raw() +import pytest +@pytest.fixture() +def mlvp_request(mlvp_pre_request: PreRequest): + return mlvp_pre_request.create_dut(FauFTB, "clock")