Skip to content

Commit b6ad7db

Browse files
authored
Merge pull request hdl#319 from hzeller/20240515-updated-proto
Refine proto buffer describing PPA results.
2 parents 1d2c3bd + ad06dbf commit b6ad7db

File tree

3 files changed

+191
-6
lines changed

3 files changed

+191
-6
lines changed

synthesis/BUILD

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,22 @@ pkg_tar(
3535
strip_prefix = "./",
3636
)
3737

38+
proto_library(
39+
name = "power_performance_area_proto",
40+
srcs = ["power_performance_area.proto"],
41+
)
42+
43+
py_proto_library(
44+
name = "power_performance_area_py_proto",
45+
deps = [":power_performance_area_proto"],
46+
)
47+
48+
cc_proto_library(
49+
name = "power_performance_area_cc_proto",
50+
deps = [":power_performance_area_proto"],
51+
)
52+
53+
# Deprecated old version of the above.
3854
proto_library(
3955
name = "performance_power_area_proto",
4056
srcs = ["performance_power_area.proto"],

synthesis/performance_power_area.proto

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ syntax = "proto2";
22

33
package hdl.ppa;
44

5+
// Deprecated. Will go away. Have a look at
6+
// PowerPerformanceArea proto in this same directory.
7+
58
message PerformancePowerAreaProto {
69
// ====== Performance ======
710
// The worst slack min.
@@ -22,11 +25,11 @@ message PerformancePowerAreaProto {
2225
optional float max_capacitance_violations = 8;
2326

2427
// ====== Power ======
25-
optional Power power_total = 10;
26-
optional Power power_sqeuential = 11;
27-
optional Power power_combinational = 12;
28-
optional Power power_macro = 13;
29-
optional Power power_pad = 14;
28+
optional PowerElements power_total = 10;
29+
optional PowerElements power_sqeuential = 11;
30+
optional PowerElements power_combinational = 12;
31+
optional PowerElements power_macro = 13;
32+
optional PowerElements power_pad = 14;
3033

3134
// ====== Area ======
3235
// The die area in um^2.
@@ -49,7 +52,7 @@ message PerformancePowerAreaProto {
4952
optional int32 num_combinational_gates = 28;
5053
}
5154

52-
message Power {
55+
message PowerElements {
5356
// The unit scale such as micro (u), nano (n), etc.
5457
optional string magnitude = 1;
5558
// The internal power simulated
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
syntax = "proto2";
2+
3+
package hdl.ppa;
4+
5+
// A word about units: The units used by the EDA-tools internally might vary
6+
// depending on context or as provided by the PDK.
7+
//
8+
// This proto is meant to always use standardized units so that it is
9+
// easy to compare; the program that is closest to the source of the data
10+
// reading logfiles and reports can convert these metrics once;
11+
// downstream we don't have to worry about it anymore.
12+
//
13+
// We're using
14+
// - power units: always watts (that reads easiest in scientific notation).
15+
// - time units: always picoseconds. This allows sufficient resolution to
16+
// store them as integer values.
17+
// - length units: always micrometers (or micrometers squared for area).
18+
19+
// A protocol buffer describing performance metrics for a particular design.
20+
message PowerPerformanceAreaProto {
21+
optional Power power = 1;
22+
optional Performance performance = 2;
23+
optional Area area = 3;
24+
25+
// Information about the operating corner.
26+
optional string cell_library = 4;
27+
optional float operating_voltage = 5;
28+
29+
// Arbitrary string that might be used to describe the
30+
// job that created this data, e.g. command line options.
31+
optional string build_info = 10;
32+
}
33+
34+
message Area {
35+
// Length units here are abbreviated in ASCII-compatible
36+
// way in the identifier suffixes.
37+
// `um` - Micrometer (length)
38+
// `um2` - square Micrometer (area)
39+
40+
// The whole die area.
41+
optional float die_area_um2 = 1;
42+
43+
// Area only covered by cells.
44+
optional float cell_area_um2 = 2;
45+
46+
// If height and width are provided, this allows to
47+
// calculate die_area_um2. Protocol buffer writers
48+
// that know and provide width and height SHOULD also
49+
// always provide die_area_um2.
50+
// The following invariants hold:
51+
// die_area_um2 = die_height_um * die_width_um;
52+
// cell_area_um2 = die_area_um2 * cell_utilization_fraction
53+
optional float die_height_um = 3;
54+
optional float die_width_um = 4;
55+
56+
// A fraction of die_area_um2 used by cells. Range of [0..1]
57+
optional float cell_utilization_fraction = 5;
58+
59+
// Leaving out proto tags 6..9 for later use.
60+
61+
// The total number of standard cells used.
62+
// Invariance:
63+
// total_cells = buffers + timing_buffers + sequential + combinational;
64+
optional int32 num_total_cells = 10;
65+
66+
// The number of combinational gate cells.
67+
optional int32 num_combinational = 11;
68+
69+
// The number of non-timing buffers.
70+
optional int32 num_buffers = 12;
71+
72+
// The number of timing buffers.
73+
optional int32 num_timing_buffers = 13;
74+
75+
// The number of sequential elements, such as flops.
76+
optional int32 num_sequential = 14;
77+
78+
// Leaving out proto tags 15..19 for later use.
79+
80+
// Cell type mapping to fraction used in the area, e.g.
81+
// {{ "svt: 0.7 }, { "lvt": 0.3}}
82+
map<string, float> celltype_fractions = 20;
83+
}
84+
85+
message Performance {
86+
// Desired clock period this PPA metric was generated for.
87+
// It influences the choice of area-impacting optimization, so this
88+
// helps to understand area size in that context.
89+
optional int32 clock_period_ps = 1;
90+
91+
// Longest path in picoseconds.
92+
optional int32 critical_path_ps = 2;
93+
94+
// == Slack ==
95+
// Abbreviations
96+
// wns = worst negative slack (worst negative slack observed in all paths)
97+
// (encoded as sint32 as these are always negative and zigzag encoding
98+
// is preferable)
99+
// tns = total negative slack (sum of slacks over all paths that have
100+
// negative slack). Can get big, so sint64
101+
//
102+
// Slack is the amount we have leftover in some clock period,
103+
// so if positive, we're good. Negative slack is the one interesting
104+
// to evaluate timing. In fact, tools rarely report a positive slack
105+
// just simply zero as 'mission accomplished'.
106+
// So the following numbers are negative if there is anything to
107+
// worry about.
108+
// Approximate invariant:
109+
// clock_period_ps - critical_path_ps = setup_wns_ps
110+
111+
// If negative, not enough time to have data ready for DFF to take data, i.e.
112+
// the combinational path that exceeds that time the most.
113+
optional sint32 setup_wns_ps = 3;
114+
optional sint64 setup_tns_ps = 4;
115+
116+
// If negative, new data arrives too early for the DFF to ingest
117+
// the previous one reliably.
118+
optional sint32 hold_wns_ps = 5;
119+
optional sint64 hold_tns_ps = 6;
120+
121+
// How far off the clock is between two different parts of the chip.
122+
optional sint32 clock_skew_ps = 7;
123+
124+
// Leaving out proto tags 8..9 for later use.
125+
126+
optional int32 num_setup_violations = 10;
127+
optional int32 num_hold_violations = 11;
128+
optional int32 num_slew_violations = 12;
129+
optional int32 num_fanout_violations = 13;
130+
optional int32 num_capacitance_violations = 14;
131+
132+
// The number of cells in the longest topological path which can be
133+
// determined before timing analysis has been done.
134+
optional int32 longest_topological_path = 15;
135+
136+
// Number of cells in the critical path based on timing if available.
137+
optional int32 critical_path_cells = 16;
138+
}
139+
140+
message Power {
141+
// The total power. Typically the sum of all of the below,
142+
// but could be more if not all summands are mentioned below.
143+
optional PowerBreakdown total = 1;
144+
145+
optional PowerBreakdown sequential = 2;
146+
optional PowerBreakdown combinational = 3;
147+
148+
// Macro and/or black_box
149+
optional PowerBreakdown macro = 4;
150+
151+
// IO pads
152+
optional PowerBreakdown pad = 5;
153+
154+
// Clock tree
155+
optional PowerBreakdown clock = 6;
156+
}
157+
158+
message PowerBreakdown {
159+
// The total power. Typically the sum of all of the below,
160+
// but could be more if not all summands are mentioned below.
161+
optional float total_watts = 1;
162+
163+
optional float internal_watts = 2;
164+
optional float switching_watts = 3;
165+
optional float leakage_watts = 4;
166+
}

0 commit comments

Comments
 (0)