Skip to content

Commit 118e618

Browse files
Tweaks suggested by Copilot
Signed-off-by: James Ball <jameball@qti.qualcomm.com>
1 parent 0792f76 commit 118e618

7 files changed

Lines changed: 19 additions & 8 deletions

File tree

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
| qux.QQQ
2-
| Other
2+
a| Other +
3+
func-of: foo.GHI
34
| FLD:qux.QQQ
45
a|
56
* https://riscv.github.io/riscv-isa-manual/snapshot/norm-rules/norm-rules.html#QUX_QQQ_WLRL_OTHER[QUX_QQQ_WLRL_OTHER]
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
| qux.QQQ
2-
| Other
2+
a| Other +
3+
func-of: foo.GHI
34
| FLD:qux.QQQ
45
a|
56
* https://riscv.github.io/riscv-isa-manual/snapshot/norm-rules/norm-rules.html#QUX_QQQ_WLRL_OTHER[QUX_QQQ_WLRL_OTHER]

tests/params/expected/test-csr-table-variants/test-csr-table-reordered/test-ch2/qux.QQQ.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
| Other
1+
a| Other +
2+
func-of: foo.GHI
23
| FLD:qux.QQQ
34
| qux.QQQ
45
a|

tests/params/expected/test-params.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -456,7 +456,7 @@ <h1 class="grand-total-heading">42 Parameters, 5 WARL/WLRL CSRs</h1>
456456
</tr>
457457
<tr>
458458
<td rowspan=1 id="qux.QQQ">qux.QQQ</td>
459-
<td rowspan=1>Other</td>
459+
<td rowspan=1>Other<br>func-of: foo.GHI</td>
460460
<td rowspan=1>FLD:qux.QQQ</td>
461461
<td><a href="test-ch2.html#norm:qux_qqq_wlrl_other">The qux.QQQ CSR field has implementation-defined behavior<br>that doesn't match any of the defined WARL/WLRL types.</a></td>
462462
</tr>

tests/params/expected/test-params.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1535,7 +1535,6 @@
15351535
"chapter_name": "Two",
15361536
"category": "WARL",
15371537
"type": "LegalEnum",
1538-
"func-of-reg-name": "foo",
15391538
"func-of-field-name": "GHI",
15401539
"impl-defs": [
15411540
{
@@ -1624,6 +1623,8 @@
16241623
"chapter_name": "Two",
16251624
"category": "WLRL",
16261625
"type": "Other",
1626+
"func-of-reg-name": "foo",
1627+
"func-of-field-name": "GHI",
16271628
"impl-defs": [
16281629
{
16291630
"name": "QUX_QQQ_WLRL_OTHER",

tests/params/test-ch2.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ csr_definitions:
5454
- reg-name: foo
5555
field-name: ABC
5656
type: LegalEnum
57-
func-of-reg-name: foo
5857
func-of-field-name: GHI
5958
impl-def: FOO_ABC_WARL_ENUM
6059

@@ -72,7 +71,10 @@ csr_definitions:
7271
impl-def: ZORT_XYZ_WLRL_RO_MASK
7372

7473
# Case 4: CSR field that doesn't match any of the above cases.
74+
# Also test func-of relationship to a field in a different register.
7575
- reg-name: qux
7676
field-name: QQQ
77+
func-of-reg-name: foo
78+
func-of-field-name: GHI
7779
type: Other
7880
impl-def: QUX_QQQ_WLRL_OTHER

tools/create_params.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1235,9 +1235,14 @@ def html_csr_table_row(f, csr: Dict[str, Any], chapter_name: Optional[str]):
12351235
isinstance(func_of_field_name, str)
12361236
and func_of_field_name
12371237
):
1238-
func_of_target = ""
1238+
base_reg_name: str = ""
12391239
if isinstance(func_of_reg_name, str) and func_of_reg_name:
1240-
func_of_target = func_of_reg_name
1240+
base_reg_name = func_of_reg_name
1241+
elif isinstance(func_of_field_name, str) and func_of_field_name:
1242+
if isinstance(reg_name, str) and reg_name:
1243+
base_reg_name = reg_name
1244+
1245+
func_of_target = base_reg_name
12411246
if isinstance(func_of_field_name, str) and func_of_field_name:
12421247
if func_of_target:
12431248
func_of_target = f"{func_of_target}.{func_of_field_name}"

0 commit comments

Comments
 (0)