From: Luke Kenneth Casson Leighton Date: Fri, 3 May 2019 06:36:28 +0000 (+0100) Subject: split out InputTest code into separate fpmux.py X-Git-Tag: ls180-24jan2020~1045 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c5fb1df9409ba4038a1429cec96e67b2daa74368;p=ieee754fpu.git split out InputTest code into separate fpmux.py --- diff --git a/src/ieee754/fpcommon/test/fpmux.py b/src/ieee754/fpcommon/test/fpmux.py new file mode 100644 index 00000000..01832ec4 --- /dev/null +++ b/src/ieee754/fpcommon/test/fpmux.py @@ -0,0 +1,128 @@ +""" key strategic example showing how to do multi-input fan-in into a + multi-stage pipeline, then multi-output fanout. + + the multiplex ID from the fan-in is passed in to the pipeline, preserved, + and used as a routing ID on the fanout. +""" + +from random import randint +from nmigen.compat.sim import run_simulation +from nmigen.cli import verilog, rtlil + + +class InputTest: + def __init__(self, dut, width, fpkls, fpop): + self.dut = dut + self.fpkls = fpkls + self.fpop = fpop + self.di = {} + self.do = {} + self.tlen = 10 + self.width = width + for mid in range(dut.num_rows): + self.di[mid] = {} + self.do[mid] = [] + for i in range(self.tlen): + op1 = randint(0, (1<