Skip to content

Commit

Permalink
[Handshake] Make sure things are integers
Browse files Browse the repository at this point in the history
  • Loading branch information
hovind committed Nov 21, 2024
1 parent b538893 commit f4d4ae9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async def sendMultiple(dut):
["out0", "out1", "out2"])

N = 10
res0 = [i * (i + 1) / 2 for i in range(N)]
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))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ async def sendMultiple(dut):

N = 10
# 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)]
res = [(n**3 + 3 * n**2 + 2 * n) // 6 for n in range(N)]

out0Check = cocotb.start_soon(out0.checkOutputs(res))

Expand Down

0 comments on commit f4d4ae9

Please sign in to comment.