From e5b7b6780f9748b6f13ef91e3e22d53ebdf47968 Mon Sep 17 00:00:00 2001 From: Mohammad Alian Date: Wed, 8 Jun 2016 09:12:41 -0500 Subject: dist, dev: Fixed the packet ordering in etherswitch This patch fixes the order that packets gets pushed into the output fifo of etherswitch. If two packets arrive at the same tick to the etherswitch, we sort and push them based on their source port id. In dist-gem5 simulations, if there is no ordering inforced while two packets arrive at the same tick, it can lead to non-deterministic simulations Committed by Jason Lowe-Power --- util/cpt_upgraders/etherswitch.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 util/cpt_upgraders/etherswitch.py (limited to 'util') diff --git a/util/cpt_upgraders/etherswitch.py b/util/cpt_upgraders/etherswitch.py new file mode 100644 index 000000000..e4094f97d --- /dev/null +++ b/util/cpt_upgraders/etherswitch.py @@ -0,0 +1,21 @@ +def upgrader(cpt): + for sec in cpt.sections(): + if sec == "system": + options = cpt.items(sec) + for it in options: + opt_split = it[0].split('.') + new_sec_name = opt_split[1] + old_opt_name = opt_split[len(opt_split) - 1] + if "outputFifo" in new_sec_name: + new_sec_name = new_sec_name.rstrip("outputFifo") + new_sec_name += ".outputFifo" + new_sec_name = "system.system.%s" %(new_sec_name) + if not cpt.has_section(new_sec_name): + cpt.add_section(new_sec_name) + if old_opt_name == "size": + cpt.set(new_sec_name, "_size", it[1]) + elif old_opt_name == "packets": + cpt.set(new_sec_name, "fifosize", it[1]) + else: + cpt.set(new_sec_name, old_opt_name, it[1]) + cpt.remove_option(sec, it[0]) -- cgit v1.2.3