Skip to content

Commit

Permalink
Convert a couple handshake cocotb tests to float for comparison.
Browse files Browse the repository at this point in the history
  • Loading branch information
mikeurbach committed Nov 22, 2024
1 parent 25c4333 commit aca1839
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ async def sendMultiple(dut):
res0 = [i * (i + 1) / 2 for i in range(N)]
res1 = [math.factorial(i) for i in range(N)]

out0Check = cocotb.start_soon(out0.checkOutputs(res0))
out1Check = cocotb.start_soon(out1.checkOutputs(res1))
out0Check = cocotb.start_soon(out0.checkOutputs(res0, converter=float))
out1Check = cocotb.start_soon(out1.checkOutputs(res1, converter=float))

for i in range(N):
in0Send = cocotb.start_soon(in0.send(i))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def sendMultiple(dut):
# sum_{i = 0}^n (sum_{j=0}^i i) = 1/6 * (n^3 + 3n^2 + 2n)
res = [(1 / 6) * (n**3 + 3 * n**2 + 2 * n) for n in range(N)]

out0Check = cocotb.start_soon(out0.checkOutputs(res))
out0Check = cocotb.start_soon(out0.checkOutputs(res, converter=float))

for i in range(N):
in0Send = cocotb.start_soon(in0.send(i))
Expand Down

0 comments on commit aca1839

Please sign in to comment.