fix up bandwidth test scripts

This commit is contained in:
Howard Mao 2019-02-26 00:19:00 +00:00
parent 0f4343730b
commit b1c7db74f6
2 changed files with 5 additions and 38 deletions

View File

@ -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):

View File

@ -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 <omp.h>
@@ -12,7 +12,7 @@
#include <cstdlib>
#include <arpa/inet.h>
-#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.