Commit 4ff5bd5f authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

tools/compare_netlist.py: correctly display modified components

parent ba9d7b2e
......@@ -47,8 +47,8 @@ def dict_compare(d1, d2):
d1_keys = set(d1.keys())
d2_keys = set(d2.keys())
shared_keys = d1_keys.intersection(d2_keys)
added = d1_keys - d2_keys
removed = d2_keys - d1_keys
added = d2_keys - d1_keys
removed = d1_keys - d2_keys
modified = {o : (d1[o], d2[o]) for o in shared_keys if d1[o] != d2[o]}
same = set(o for o in shared_keys if d1[o] == d2[o])
return added, removed, modified, same
......@@ -59,11 +59,11 @@ def pprint(o):
else:
print(None)
def compare_netlist(netlist1, netlist2):
comp1, con1 = netlist1
comp2, con2 = netlist2
comp_added, comp_removed, comp_modified, comp_same = dict_compare(comp2, comp1)
con_added, con_removed, con_modified, con_same = dict_compare(con2, con1)
def compare_netlist(netlistref, netlistnew):
compref, conref = netlistref
compnew, connew = netlistnew
comp_added, comp_removed, comp_modified, comp_same = dict_compare(compref, compnew)
con_added, con_removed, con_modified, con_same = dict_compare(conref, connew)
print("******************************************************")
print("******************** COMPONENTS **********************")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment