Skip to content

Commit 3db85e8

Browse files
committed
Address inconsistencies across specs of CompatFeature.short
1 parent f70a124 commit 3db85e8

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

py/dml/compat.py

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class port_proxy_ifaces(CompatFeature):
6161
e.g., banks inside groups were not allowed in Simics 5, so such
6262
banks do not need proxies for backward compatibility.
6363
'''
64-
short = "Don't generate proxy port interfaces for banks and ports"
64+
short = "Generate proxy port interfaces for banks and ports"
6565
last_api_version = api_7
6666

6767

@@ -75,8 +75,8 @@ class port_proxy_attrs(CompatFeature):
7575
Proxy attributes are not created for all banks and ports, in the
7676
same manner as documented in the `port_proxy_ifaces` feature.
7777
'''
78-
short = ("Don't generate top-level proxy attributes"
79-
+ " for attributes in banks and ports")
78+
short = ("Generate top-level proxy attributes for attributes in banks and "
79+
+ "ports")
8080
last_api_version = api_7
8181

8282

@@ -101,19 +101,20 @@ class port_obj_param(CompatFeature):
101101
the `obj` parameter of banks and ports resolves to `dev.obj`
102102
rather than the port object.
103103
'''
104-
short = "bank.obj and port.obj resolve to dev.obj"
104+
short = "Make 'obj' of ports and banks resolve to 'dev.obj'"
105105
last_api_version = api_5
106106

107107

108108
@feature
109109
class dml12_inline(CompatFeature):
110110
'''When using `inline` to inline a method in a DML 1.2 device,
111-
constant parameters passed in typed arguments are inlined as
111+
constant arguments passed in typed parameters are inlined as
112112
constants when this feature is enabled. This can improve
113113
compilation time in some cases, but has some unintuitive semantic
114114
implications.
115115
'''
116-
short = "Don't inline method arguments with a declared type in DML 1.2"
116+
short = ("Make inline method calls in DML 1.2 inline every constant "
117+
+ "argument, even when typed")
117118
last_api_version = api_6
118119

119120

@@ -123,7 +124,7 @@ class dml12_not(CompatFeature):
123124
'''DML 1.2-specific: the operand of the `!` operator is not
124125
type-checked; in particular, negation expressions on the form
125126
`!$reg`, where `reg` is a register, are permitted'''
126-
short = "Disallow ! operator on register references in DML 1.2"
127+
short = "Allow ! operator on register references in DML 1.2"
127128
last_api_version = api_5
128129

129130

@@ -163,7 +164,7 @@ class dml12_misc(CompatFeature):
163164
`constant` or `loggroup`)
164165
165166
'''
166-
short = "Disable various DML 1.2 quirks"
167+
short = "Enable various legacy DML 1.2 quirks"
167168
last_api_version = api_6
168169

169170

@@ -175,7 +176,7 @@ class dml12_goto(CompatFeature):
175176
block; since this is sometimes nontrivial, it can be useful to disable
176177
the `goto` statement separately.
177178
'''
178-
short = "Disable the goto statement in DML 1.2"
179+
short = "Enable the goto statement in DML 1.2"
179180
last_api_version = api_6
180181

181182

py/dml/dmlc.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,11 +299,13 @@ def print_help(self):
299299
> compat.apis[default_api_version()])):
300300
by_version.setdefault(feature.last_api_version, []).append(
301301
feature)
302+
longest_name = max(len(name) for name in compat.features)
302303
for (api, features) in sorted(by_version.items()):
303304
print(f' Features available with --simics-api={api.str}'
304305
' or older:')
305306
for feature in sorted(features, key=lambda f: f.tag()):
306-
print(f' {feature.tag():20s} {feature.short}')
307+
print(f' {feature.tag().ljust(longest_name)} '
308+
+ feature.short)
307309

308310
def main(argv):
309311
# DML files must be utf8, but are generally opened without specifying

0 commit comments

Comments
 (0)