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): ...@@ -47,8 +47,8 @@ def dict_compare(d1, d2):
d1_keys = set(d1.keys()) d1_keys = set(d1.keys())
d2_keys = set(d2.keys()) d2_keys = set(d2.keys())
shared_keys = d1_keys.intersection(d2_keys) shared_keys = d1_keys.intersection(d2_keys)
added = d1_keys - d2_keys added = d2_keys - d1_keys
removed = 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]} 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]) same = set(o for o in shared_keys if d1[o] == d2[o])
return added, removed, modified, same return added, removed, modified, same
...@@ -59,11 +59,11 @@ def pprint(o): ...@@ -59,11 +59,11 @@ def pprint(o):
else: else:
print(None) print(None)
def compare_netlist(netlist1, netlist2): def compare_netlist(netlistref, netlistnew):
comp1, con1 = netlist1 compref, conref = netlistref
comp2, con2 = netlist2 compnew, connew = netlistnew
comp_added, comp_removed, comp_modified, comp_same = dict_compare(comp2, comp1) comp_added, comp_removed, comp_modified, comp_same = dict_compare(compref, compnew)
con_added, con_removed, con_modified, con_same = dict_compare(con2, con1) con_added, con_removed, con_modified, con_same = dict_compare(conref, connew)
print("******************************************************") print("******************************************************")
print("******************** COMPONENTS **********************") 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