Skip to content

Commit 8bebb78

Browse files
committed
resolved merge conflict
Signed-off-by: Cho Moon <cmoon@precisioninno.com>
2 parents 94884f6 + 419cd9b commit 8bebb78

File tree

4 files changed

+71
-177
lines changed

4 files changed

+71
-177
lines changed
Lines changed: 6 additions & 146 deletions
Original file line numberDiff line numberDiff line change
@@ -1,144 +1,4 @@
11
{
2-
"cts__flow__warnings__count:CTS-0041": {
3-
"value": 21,
4-
"compare": "<=",
5-
"level": "warning"
6-
},
7-
"cts__flow__warnings__count:RSZ-0062": {
8-
"value": 1,
9-
"compare": "<=",
10-
"level": "warning"
11-
},
12-
"cts__flow__warnings__count:STA-1551": {
13-
"value": 40,
14-
"compare": "<=",
15-
"level": "warning"
16-
},
17-
"detailedplace__flow__warnings__count:STA-1551": {
18-
"value": 40,
19-
"compare": "<=",
20-
"level": "warning"
21-
},
22-
"detailedroute__flow__warnings__count:DRT-0120": {
23-
"value": 54,
24-
"compare": "<=",
25-
"level": "warning"
26-
},
27-
"detailedroute__flow__warnings__count:DRT-0142": {
28-
"value": 5,
29-
"compare": "<=",
30-
"level": "warning"
31-
},
32-
"detailedroute__flow__warnings__count:STA-1551": {
33-
"value": 40,
34-
"compare": "<=",
35-
"level": "warning"
36-
},
37-
"finish__flow__warnings__count:STA-1551": {
38-
"value": 40,
39-
"compare": "<=",
40-
"level": "warning"
41-
},
42-
"floorplan__flow__warnings__count:EST-0027": {
43-
"value": 1,
44-
"compare": "<=",
45-
"level": "warning"
46-
},
47-
"floorplan__flow__warnings__count:IFP-0028": {
48-
"value": 1,
49-
"compare": "<=",
50-
"level": "warning"
51-
},
52-
"floorplan__flow__warnings__count:STA-1551": {
53-
"value": 40,
54-
"compare": "<=",
55-
"level": "warning"
56-
},
57-
"flow__warnings__count:PDN-0110": {
58-
"value": 1001,
59-
"compare": "<=",
60-
"level": "warning"
61-
},
62-
"flow__warnings__count:PDN-0195": {
63-
"value": 33,
64-
"compare": "<=",
65-
"level": "warning"
66-
},
67-
"flow__warnings__count:PDN-1031": {
68-
"value": 1,
69-
"compare": "<=",
70-
"level": "warning"
71-
},
72-
"flow__warnings__count:STA-1551": {
73-
"value": 40,
74-
"compare": "<=",
75-
"level": "warning"
76-
},
77-
"flow__warnings__count:TAP-0014": {
78-
"value": 1,
79-
"compare": "<=",
80-
"level": "warning"
81-
},
82-
"flow__warnings__count:TAP-0015": {
83-
"value": 1,
84-
"compare": "<=",
85-
"level": "warning"
86-
},
87-
"flow__warnings__count:TAP-0016": {
88-
"value": 1,
89-
"compare": "<=",
90-
"level": "warning"
91-
},
92-
"flow__warnings__count:TAP-0017": {
93-
"value": 1,
94-
"compare": "<=",
95-
"level": "warning"
96-
},
97-
"globalplace__flow__warnings__count:GRT-0281": {
98-
"value": 4,
99-
"compare": "<=",
100-
"level": "warning"
101-
},
102-
"globalplace__flow__warnings__count:STA-1551": {
103-
"value": 40,
104-
"compare": "<=",
105-
"level": "warning"
106-
},
107-
"globalroute__flow__warnings__count:DRT-0120": {
108-
"value": 54,
109-
"compare": "<=",
110-
"level": "warning"
111-
},
112-
"globalroute__flow__warnings__count:DRT-0142": {
113-
"value": 5,
114-
"compare": "<=",
115-
"level": "warning"
116-
},
117-
"globalroute__flow__warnings__count:FLW-0010": {
118-
"value": 1,
119-
"compare": "<=",
120-
"level": "warning"
121-
},
122-
"globalroute__flow__warnings__count:STA-1551": {
123-
"value": 40,
124-
"compare": "<=",
125-
"level": "warning"
126-
},
127-
"placeopt__flow__warnings__count:RSZ-0020": {
128-
"value": 1,
129-
"compare": "<=",
130-
"level": "warning"
131-
},
132-
"placeopt__flow__warnings__count:RSZ-0095": {
133-
"value": 1,
134-
"compare": "<=",
135-
"level": "warning"
136-
},
137-
"placeopt__flow__warnings__count:STA-1551": {
138-
"value": 40,
139-
"compare": "<=",
140-
"level": "warning"
141-
},
1422
"constraints__clocks__count": {
1433
"value": 8,
1444
"compare": "=="
@@ -164,11 +24,11 @@
16424
"compare": "<="
16525
},
16626
"cts__timing__setup__ws": {
167-
"value": -202.0,
27+
"value": -100.0,
16828
"compare": ">="
16929
},
17030
"cts__timing__setup__tns": {
171-
"value": -17800.0,
31+
"value": -400.0,
17232
"compare": ">="
17333
},
17434
"cts__timing__hold__ws": {
@@ -200,11 +60,11 @@
20060
"compare": ">="
20161
},
20262
"detailedroute__route__wirelength": {
203-
"value": 11876263,
63+
"value": 13738224,
20464
"compare": "<="
20565
},
20666
"detailedroute__route__drc_errors": {
207-
"value": 4,
67+
"value": 0,
20868
"compare": "<="
20969
},
21070
"detailedroute__antenna__violating__nets": {
@@ -220,7 +80,7 @@
22080
"compare": ">="
22181
},
22282
"finish__timing__setup__tns": {
223-
"value": -1630.0,
83+
"value": -1440.0,
22484
"compare": ">="
22585
},
22686
"finish__timing__hold__ws": {
@@ -235,4 +95,4 @@
23595
"value": 849384,
23696
"compare": "<="
23797
}
238-
}
98+
}

flow/designs/gf12/bp_quad/rules-base.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@
2424
"compare": "<="
2525
},
2626
"cts__timing__setup__ws": {
27-
"value": -271.0,
27+
"value": -572.0,
2828
"compare": ">="
2929
},
3030
"cts__timing__setup__tns": {
31-
"value": -53900.0,
31+
"value": -659000.0,
3232
"compare": ">="
3333
},
3434
"cts__timing__hold__ws": {

flow/designs/gf12/bp_single/rules-base.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,19 @@
3636
"compare": ">="
3737
},
3838
"cts__timing__hold__ws": {
39+
<<<<<<< HEAD
3940
"value": -225.0,
4041
"compare": ">="
4142
},
4243
"cts__timing__hold__tns": {
4344
"value": -2350.0,
45+
=======
46+
"value": -306.0,
47+
"compare": ">="
48+
},
49+
"cts__timing__hold__tns": {
50+
"value": -4360.0,
51+
>>>>>>> origin/master
4452
"compare": ">="
4553
},
4654
"globalroute__antenna_diodes_count": {
@@ -56,11 +64,15 @@
5664
"compare": ">="
5765
},
5866
"globalroute__timing__hold__ws": {
67+
<<<<<<< HEAD
5968
"value": -179.0,
69+
=======
70+
"value": -187.0,
71+
>>>>>>> origin/master
6072
"compare": ">="
6173
},
6274
"globalroute__timing__hold__tns": {
63-
"value": -1540.0,
75+
"value": -2360.0,
6476
"compare": ">="
6577
},
6678
"detailedroute__route__wirelength": {
@@ -99,4 +111,4 @@
99111
"value": 479804,
100112
"compare": "<="
101113
}
102-
}
114+
}

flow/scripts/mem_dump.py

Lines changed: 49 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55

66
def find_top_modules(data):
7-
# There can be some cruft in the modules list so that
8-
# we have multiple top level candidates.
97
top_module = []
108
instantiations = set(
119
[
@@ -14,7 +12,7 @@ def find_top_modules(data):
1412
for cell in minfo2["cells"].values()
1513
]
1614
)
17-
for mname, minfo in data["modules"].items():
15+
for mname in data["modules"].keys():
1816
if mname not in instantiations:
1917
top_module.append(mname)
2018
return top_module
@@ -23,16 +21,6 @@ def find_top_modules(data):
2321
def find_cells_by_type_in_module(
2422
module_name, data, target_type, current_path, matching_cells
2523
):
26-
"""
27-
Searches through hierarchy starting at module_name to find all instances of
28-
the given module/type in the hierarchy.
29-
30-
Returns list of cell paths, which are constructed as:
31-
32-
<top_module_name>.(<child_inst_name>.<child_module_name>+).<memory_inst_name>
33-
34-
where the child_inst_name/child_module_name pairs are repeated for each level of the hierarchy.
35-
"""
3624
for cell_name, cell in data["modules"][module_name]["cells"].items():
3725
cell_path = (
3826
f"{current_path}.{module_name}.{cell_name}"
@@ -42,18 +30,15 @@ def find_cells_by_type_in_module(
4230
if cell["type"] == target_type:
4331
matching_cells.append(cell_path)
4432
elif cell["type"] in data["modules"]:
45-
# Recursively search within the module
4633
matching_cells.extend(
4734
find_cells_by_type_in_module(
4835
cell["type"], data, target_type, cell_path, []
4936
)
5037
)
51-
5238
return matching_cells
5339

5440

5541
def find_cells_by_type(top_modules, data, module_name, current_path=""):
56-
# first find top module, the module without any submodules
5742
names = []
5843
for top_module in top_modules:
5944
names.extend(
@@ -69,13 +54,12 @@ def format_ram_table_from_json(data, max_bits=None):
6954
formatting = "{:>5} | {:>5} | {:>6} | {:<20} | {:<80}\n"
7055
table = formatting.format("Rows", "Width", "Bits", "Module", "Instances")
7156
table += "-" * len(table) + "\n"
57+
7258
max_ok = True
7359
entries = []
7460

75-
# Collect the entries in a list
7661
for module_name, module_info in data["modules"].items():
77-
cells = module_info["cells"]
78-
for cell in cells.values():
62+
for cell in module_info["cells"].values():
7963
if not cell["type"].startswith("$mem"):
8064
continue
8165
parameters = cell["parameters"]
@@ -84,18 +68,38 @@ def format_ram_table_from_json(data, max_bits=None):
8468
instances = find_cells_by_type(top_modules, data, module_name)
8569
instance_bits = size * width
8670
bits = instance_bits * len(instances)
71+
8772
entries.append((size, width, bits, module_name, ", ".join(instances)))
73+
8874
if max_bits is not None and instance_bits > max_bits:
8975
max_ok = False
9076

91-
# Sort the entries by descending bits
9277
entries.sort(key=lambda x: x[2], reverse=True)
9378

94-
# Format the sorted entries into the table
9579
for entry in entries:
9680
table += formatting.format(*entry)
9781

98-
return table, max_ok
82+
# ---- Summary statistics ----
83+
total_bits = sum(e[2] for e in entries)
84+
85+
largest_instance_bits = 0
86+
largest_instance_module = None
87+
88+
for size, width, _, module, _ in entries:
89+
instance_bits = size * width
90+
if instance_bits > largest_instance_bits:
91+
largest_instance_bits = instance_bits
92+
largest_instance_module = module
93+
94+
summary = {
95+
"memory_count": len(entries),
96+
"largest_instance_bits": largest_instance_bits,
97+
"largest_instance_module": largest_instance_module,
98+
"largest_total_bits": entries[0][2] if entries else 0,
99+
"total_bits": total_bits,
100+
}
101+
102+
return table, max_ok, summary
99103

100104

101105
if __name__ == "__main__":
@@ -119,9 +123,27 @@ def format_ram_table_from_json(data, max_bits=None):
119123
print(" " + "\n ".join(src_files))
120124

121125
print("Memories found in the design:")
122-
formatted_table, max_ok = format_ram_table_from_json(json_data, args.max_bits)
126+
formatted_table, max_ok, summary = format_ram_table_from_json(
127+
json_data, args.max_bits
128+
)
129+
123130
print(formatted_table)
124-
if not max_ok:
125-
sys.exit(
126-
f"Error: Synthesized memory size {args.max_bits} exceeds SYNTH_MEMORY_MAX_BITS"
127-
)
131+
132+
print("Summary:")
133+
print(f"- Total inferred memories: {summary['memory_count']}")
134+
print(
135+
f"- Largest single memory instance: "
136+
f"{summary['largest_instance_bits']} bits "
137+
f"(module {summary['largest_instance_module']})"
138+
)
139+
print(f"- Total inferred memory bits (all instances): {summary['total_bits']}")
140+
141+
if args.max_bits is not None:
142+
status = "OK" if max_ok else "FAIL"
143+
print(f"- SYNTH_MEMORY_MAX_BITS: {args.max_bits}")
144+
print(f"- Status: {status}")
145+
146+
if not max_ok:
147+
sys.exit(
148+
f"Error: Synthesized memory size {args.max_bits} exceeds SYNTH_MEMORY_MAX_BITS"
149+
)

0 commit comments

Comments
 (0)