From f976b65cf17fe6a4986cfc7f7668672f66728f8c Mon Sep 17 00:00:00 2001 From: Florent Kermarrec Date: Sat, 6 Dec 2014 14:35:18 +0100 Subject: [PATCH] link: add auto-check on link_tb --- lib/sata/test/link_tb.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/sata/test/link_tb.py b/lib/sata/test/link_tb.py index 40ed74e6..1dded9a4 100644 --- a/lib/sata/test/link_tb.py +++ b/lib/sata/test/link_tb.py @@ -66,14 +66,14 @@ class LinkLogger(Module): class TB(Module): def __init__(self): self.submodules.bfm = BFM(phy_debug=False, - link_random_level=50, transport_debug=True, transport_loopback=True) + link_random_level=50, transport_debug=False, transport_loopback=True) self.submodules.link_layer = SATALinkLayer(self.bfm.phy) self.submodules.streamer = LinkStreamer() streamer_ack_randomizer = AckRandomizer(link_layout(32), level=50) self.submodules += streamer_ack_randomizer self.submodules.logger = LinkLogger() - logger_ack_randomizer = AckRandomizer(link_layout(32), level=80) + logger_ack_randomizer = AckRandomizer(link_layout(32), level=50) self.submodules += logger_ack_randomizer self.comb += [ Record.connect(self.streamer.source, streamer_ack_randomizer.sink), @@ -86,12 +86,13 @@ class TB(Module): for i in range(24): yield for i in range(8): + streamer_packet = LinkTXPacket([i for i in range(64)]) yield from self.streamer.send(LinkTXPacket([i for i in range(64)])) yield from self.logger.receive() - print("Logger:") - print("-------") - for v in self.logger.packet: - print("%08x" %v) + + # check results + s, l, e = check(streamer_packet, self.logger.packet) + print("shift "+ str(s) + " / length " + str(l) + " / errors " + str(e)) if __name__ == "__main__": -- 2.30.2