From: Cesar Strauss Date: Wed, 3 Jun 2020 09:30:04 +0000 (-0300) Subject: Check completion of the sub-processes X-Git-Tag: div_pipeline~637^2~8 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3d6c2798a4614175d3bb6e620ddee3a442b2f19a;p=soc.git Check completion of the sub-processes This detects the case where busy_o goes low before the rel / go cycle finishes. --- diff --git a/src/soc/experiment/test/test_compalu_multi.py b/src/soc/experiment/test/test_compalu_multi.py index 64b8daec..9399908d 100644 --- a/src/soc/experiment/test/test_compalu_multi.py +++ b/src/soc/experiment/test/test_compalu_multi.py @@ -142,6 +142,9 @@ class CompUnitParallelTest: # input data: self.operands = (0, 0) + # Indicates completion of the sub-processes + self.rd_complete = [False, False] + def driver(self): print("Begin parallel test.") yield from self.operation(5, 2, InternalOp.OP_ADD, inv_a=0, @@ -159,9 +162,16 @@ class CompUnitParallelTest: self.imm_control = (zero_a, imm_ok) self.rdmaskn = rdmaskn + # Initialize completion flags + self.rd_complete = [False, False] + # trigger operation cycle yield from self.issue() + # check that the sub-processes completed, before the busy_o cycle ended + for completion in self.rd_complete: + assert completion + def issue(self): # issue_i starts inactive yield self.dut.issue_i.eq(0) @@ -248,6 +258,7 @@ class CompUnitParallelTest: # TODO: don't exit the process, monitor rd instead to ensure it # doesn't rise on its own if self.rdmaskn[rd_idx] or self.imm_control[rd_idx]: + self.rd_complete[rd_idx] = True return # issue_i has risen. rel must rise on the next cycle @@ -291,6 +302,11 @@ class CompUnitParallelTest: rel = yield self.dut.rd.rel[rd_idx] assert not rel + self.rd_complete[rd_idx] = True + + # TODO: check that rel doesn't rise again until the end of the + # busy_o cycle + def wr(self, wr_idx): # monitor self.dut.wr.req[rd_idx] and sets dut.wr.go[idx] for one cycle yield