From b1c7db74f651b3adee9420dced7782398286767e Mon Sep 17 00:00:00 2001 From: Howard Mao Date: Tue, 26 Feb 2019 00:19:00 +0000 Subject: [PATCH] fix up bandwidth test scripts --- .../bw-test-two-instances/bw-test-graph.py | 4 +- .../bw-test-two-instances/switchpatch.patch | 39 ++----------------- 2 files changed, 5 insertions(+), 38 deletions(-) diff --git a/deploy/workloads/bw-test-two-instances/bw-test-graph.py b/deploy/workloads/bw-test-two-instances/bw-test-graph.py index 6a518a96..97cb6ca8 100644 --- a/deploy/workloads/bw-test-two-instances/bw-test-graph.py +++ b/deploy/workloads/bw-test-two-instances/bw-test-graph.py @@ -6,7 +6,7 @@ import numpy as np import re import sys -DATA_RE = re.compile(r"^packet timestamp: (\d+), len: (\d+)\r$") +DATA_RE = re.compile(r"^packet timestamp: (\d+), len: (\d+), receiver: (\d+)\r$") TIME_STEP = 100000 CYCLES_PER_NANO = 3.2 CYCLES_PER_MILLI = CYCLES_PER_NANO * 1e6 @@ -20,7 +20,7 @@ def parse_log(f): for line in f: match = DATA_RE.match(line) if match: - tss, lens = match.groups() + tss, lens = match.group(1, 2) yield (int(tss), int(lens)) def compute_bw(packet_data): diff --git a/deploy/workloads/bw-test-two-instances/switchpatch.patch b/deploy/workloads/bw-test-two-instances/switchpatch.patch index c745b09c..ea9e474c 100644 --- a/deploy/workloads/bw-test-two-instances/switchpatch.patch +++ b/deploy/workloads/bw-test-two-instances/switchpatch.patch @@ -1,46 +1,13 @@ -diff --git a/target-design/switch/baseport.h b/target-design/switch/baseport.h -index 8252b64..152461e 100644 ---- a/target-design/switch/baseport.h -+++ b/target-design/switch/baseport.h -@@ -86,7 +86,7 @@ void BasePort::write_flits_to_output() { - uint64_t timestampdiff = outputtimestamp > basetime ? outputtimestamp - basetime : 0L; - flitswritten = std::max(flitswritten, timestampdiff); - -- printf("intended timestamp: %ld, actual timestamp: %ld, diff %ld\n", outputtimestamp, basetime + flitswritten, (int64_t)(basetime + flitswritten) - (int64_t)(outputtimestamp)); -+ //printf("intended timestamp: %ld, actual timestamp: %ld, diff %ld\n", outputtimestamp, basetime + flitswritten, (int64_t)(basetime + flitswritten) - (int64_t)(outputtimestamp)); - int i = thispacket->amtread; - for (;(i < thispacket->amtwritten) && (flitswritten < LINKLATENCY); i++) { - write_last_flit(current_output_buf, flitswritten, i == (thispacket->amtwritten-1)); -@@ -100,6 +100,8 @@ void BasePort::write_flits_to_output() { - flitswritten++; - } - if (i == thispacket->amtwritten) { -+ printf("packet timestamp: %ld, len: %ld\n", -+ basetime + flitswritten, thispacket->amtwritten); - // we finished sending this packet, so get rid of it - outputqueue.pop(); - free(thispacket); diff --git a/target-design/switch/switch.cc b/target-design/switch/switch.cc -index 8626e4a..eb56216 100644 +index d1c04cf..9186988 100644 --- a/target-design/switch/switch.cc +++ b/target-design/switch/switch.cc -@@ -11,7 +11,7 @@ - #include +@@ -12,7 +12,7 @@ #include + #include -#define IGNORE_PRINTF +//#define IGNORE_PRINTF #ifdef IGNORE_PRINTF #define printf(fmt, ...) (0) -@@ -163,8 +163,8 @@ while (!pqueue.empty()) { - switchpacket * tsp = pqueue.top().switchpack; - pqueue.pop(); - uint16_t send_to_port = get_port_from_flit(tsp->dat[0], 0 /* junk remove arg */); -- printf("packet for port: %x\n", send_to_port); -- printf("packet timestamp: %ld\n", tsp->timestamp); -+ //printf("packet for port: %x\n", send_to_port); -+ //printf("packet timestamp: %ld\n", tsp->timestamp); - if (send_to_port == BROADCAST_ADJUSTED) { - #define ADDUPLINK (NUMUPLINKS > 0 ? 1 : 0) - // this will only send broadcasts to the first (zeroeth) uplink.