From 40badcf87eb03200ef5383aba99f04f06d72a6ce Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 10 Apr 2019 08:51:34 +0100 Subject: [PATCH] add FIFO chain-test --- src/add/test_buf_pipe.py | 34 +++++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/add/test_buf_pipe.py b/src/add/test_buf_pipe.py index fcb1ca31..b695e537 100644 --- a/src/add/test_buf_pipe.py +++ b/src/add/test_buf_pipe.py @@ -769,6 +769,26 @@ class FIFOTest16(FIFOtest): FIFOtest.__init__(self, 16, 2) +###################################################################### +# Test 21 +###################################################################### + +class ExampleFIFOPassThruPipe1(ControlBase): + + def elaborate(self, platform): + m = ControlBase._elaborate(self, platform) + + pipe1 = FIFOTest16() + pipe2 = ExamplePassAdd1Pipe() + + m.submodules.pipe1 = pipe1 + m.submodules.pipe2 = pipe2 + + m.d.comb += self.connect([pipe1, pipe2]) + + return m + + ###################################################################### # Test 997 ###################################################################### @@ -860,7 +880,7 @@ class ExampleBufUnBufPipe(ControlBase): # Unit Tests ###################################################################### -num_tests = 100 +num_tests = 10 if __name__ == '__main__': print ("test 1") @@ -1054,6 +1074,18 @@ if __name__ == '__main__': with open("test_fifo20.il", "w") as f: f.write(vl) + print ("test 21") + dut = ExampleFIFOPassThruPipe1() + data = data_chain1() + test = Test5(dut, test12_resultfn, data=data) + run_simulation(dut, [test.send, test.rcv], vcd_name="test_fifopass21.vcd") + ports = [dut.p.i_valid, dut.n.i_ready, + dut.n.o_valid, dut.p.o_ready] + \ + [dut.p.i_data] + [dut.n.o_data] + vl = rtlil.convert(dut, ports=ports) + with open("test_fifopass21.il", "w") as f: + f.write(vl) + print ("test 997") dut = ExampleBufPassThruPipe2() data = data_chain1() -- 2.30.2