Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/norm-rule/expected/test-ch1-norm-tags.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"norm:inline": "inside inline",
"norm:inline-with-hash": "includes a hash # symbol.",
"norm:extension-dependency": "The F extensions depends on the Zicsr extension.",
"norm:all-bases": "Everyone loves RISC-V!",
"norm:clarification-without-text": "isn't clear enough.",
"norm:clarification-with-text": "also isn't clear enough.",
"norm:cat-colors": "Cats come in many colors.",
Expand Down Expand Up @@ -81,6 +82,7 @@
"norm:inline",
"norm:inline-with-hash",
"norm:extension-dependency",
"norm:all-bases",
"norm:clarification-without-text",
"norm:clarification-with-text",
"norm:cat-colors",
Expand Down
6 changes: 5 additions & 1 deletion tests/norm-rule/expected/test-norm-rules.html
Original file line number Diff line number Diff line change
Expand Up @@ -223,14 +223,18 @@ <h1 class="grand-total-heading">82 Normative Rules: Includes 19 Implementation-D
<td>Rule's "instance" property</td>
</tr>
<tr>
<td rowspan=2 id="all_bases">all_bases</td>
<td rowspan=3 id="ALL_BASES">ALL_BASES</td>
<td>base</td>
<td>Rule's "kind" property</td>
</tr>
<tr>
<td>Any</td>
<td>Rule's "instance" property</td>
</tr>
<tr>
<td>Everyone loves RISC-V!</td>
<td><a href="test-ch1.html#norm:all-bases">norm:all-bases</a></td>
</tr>
<tr>
<td rowspan=2 id="clarification-without-text">clarification-without-text</td>
<td>isn't clear enough.</td>
Expand Down
12 changes: 10 additions & 2 deletions tests/norm-rule/expected/test-norm-rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,23 @@
"tags": []
},
{
"name": "all_bases",
"name": "ALL_BASES",
"def_filename": "tests/norm-rule/test-ch1.yaml",
"chapter_name": "One",
"kind": "base",
"impl-def-behavior": false,
"instances": [
"Any"
],
"tags": []
"tags": [
{
"name": "norm:all-bases",
"context": false,
"text": "Everyone loves RISC-V!",
"tag_filename": "/build/test-ch1-norm-tags.json",
"stds_doc_url": "test-ch1.html"
}
]
},
{
"name": "clarification-without-text",
Expand Down
3 changes: 3 additions & 0 deletions tests/norm-rule/test-ch1.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ Use inline anchor that [#norm:inline-with-hash]+includes a hash # symbol.+
[[norm:extension-dependency]]
The F extensions depends on the Zicsr extension.

[[norm:all-bases]]
Everyone loves RISC-V!

// PASSES
This normative text [#norm:clarification-without-text]#isn't clear enough.#
This normative text [#norm:clarification-with-text]#also isn't clear enough.#
Expand Down
3 changes: 2 additions & 1 deletion tests/norm-rule/test-ch1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,10 @@ normative_rule_definitions:
- name: one_base
kind: base
instance: RV32I
- name: all_bases
- name: ALL_BASES
kind: base
instance: Any
tag: "norm:all-bases"
- name: clarification-without-text
tag: "norm:clarification-without-text"
clarification-link: https://www.github.com/riscv/jfkd/issues/67
Expand Down
22 changes: 14 additions & 8 deletions tests/params/expected/test-params.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
.sticky-caption{position:sticky;top:0;background:#fff;padding:8px 0;z-index:1}
.col-name{width:18%}
.col-type{width:22%}
.col-extensions{width:18%}
.col-bases-extensions{width:18%}
.col-descriptions{width:42%}
@media (max-width: 1000px){
.app{grid-template-columns:1fr}
Expand All @@ -47,25 +47,25 @@
<aside class="sidebar">
<h2>Parameters by Chapter</h2>
<nav class="nav">
<a href="#table-params-ch-1" data-target="table-params-ch-1">One<span class="subtitle">12 entries</span></a>
<a href="#table-params-ch-1" data-target="table-params-ch-1">One<span class="subtitle">13 entries</span></a>
<a href="#table-params-ch-2" data-target="table-params-ch-2">Two<span class="subtitle">5 entries</span></a>
</nav>
</aside>
<main>
<style>.grand-total-heading { font-size: 24px; font-weight: bold; }</style>
<h1 class="grand-total-heading">17 Parameters</h1>
<h1 class="grand-total-heading">18 Parameters</h1>

<section id="table-params-ch-1" class="section">
<table>
<caption class="sticky-caption">Chapter One: 12 Parameters</caption>
<caption class="sticky-caption">Chapter One: 13 Parameters</caption>
<colgroup>
<col class="col-name">
<col class="col-type">
<col class="col-extensions">
<col class="col-bases-extensions">
<col class="col-descriptions">
</colgroup>
<thead>
<tr><th>Parameter Name</th><th>Type</th><th>Extension(s)</th><th>Description(s)</th></tr>
<tr><th>Parameter Name</th><th>Type</th><th>Bases/Extensions</th><th>Description(s)</th></tr>
</thead>
<tbody>
<tr>
Expand Down Expand Up @@ -143,6 +143,12 @@ <h1 class="grand-total-heading">17 Parameters</h1>
<td rowspan=1>Zch1-A, Zch1-B</td>
<td><a href="test-ch1.html#norm:list-int">This is a list with values 1, 2 and 4.</a></td>
</tr>
<tr>
<td rowspan=1 id="ALL_BASES">ALL_BASES</td>
<td rowspan=1>int2</td>
<td rowspan=1>Any</td>
<td><a href="test-ch1.html#norm:all-bases">Everyone loves RISC-V!</a></td>
</tr>
</tbody>
</table>
</section>
Expand All @@ -153,11 +159,11 @@ <h1 class="grand-total-heading">17 Parameters</h1>
<colgroup>
<col class="col-name">
<col class="col-type">
<col class="col-extensions">
<col class="col-bases-extensions">
<col class="col-descriptions">
</colgroup>
<thead>
<tr><th>Parameter Name</th><th>Type</th><th>Extension(s)</th><th>Description(s)</th></tr>
<tr><th>Parameter Name</th><th>Type</th><th>Bases/Extensions</th><th>Description(s)</th></tr>
</thead>
<tbody>
<tr>
Expand Down
32 changes: 32 additions & 0 deletions tests/params/expected/test-params.json
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,38 @@
}
]
},
{
"name": "ALL_BASES",
"def_filename": "test-ch1.yaml",
"chapter_name": "One",
"type": "int2",
"json-schema": {
"type": "integer",
"minimum": -2,
"maximum": 1
},
"impl-defs": [
{
"name": "ALL_BASES",
"def_filename": "tests/norm-rule/test-ch1.yaml",
"chapter_name": "One",
"kind": "base",
"impl-def-behavior": false,
"instances": [
"Any"
],
"tags": [
{
"name": "norm:all-bases",
"context": false,
"text": "Everyone loves RISC-V!",
"tag_filename": "/build/test-ch1-norm-tags.json",
"stds_doc_url": "test-ch1.html"
}
]
}
]
},
{
"name": "ROSE_COLORS",
"def_filename": "test-ch2.yaml",
Expand Down
3 changes: 3 additions & 0 deletions tests/params/test-ch1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,6 @@ parameter_definitions:
- name: LIST_INT
impl-def: LIST_INT
type: [1, 2, 4]
- name: ALL_BASES
impl-def: ALL_BASES
type: int2
16 changes: 8 additions & 8 deletions tools/create_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def html_head(f, table_names: List[str]):
.sticky-caption{position:sticky;top:0;background:#fff;padding:8px 0;z-index:1}
.col-name{width:18%}
.col-type{width:22%}
.col-extensions{width:18%}
.col-bases-extensions{width:18%}
.col-descriptions{width:42%}
@media (max-width: 1000px){
.app{grid-template-columns:1fr}
Expand Down Expand Up @@ -596,11 +596,11 @@ def html_table_header(f, table_name: str, table_caption: str):
f.write(' <colgroup>\n')
f.write(' <col class="col-name">\n')
f.write(' <col class="col-type">\n')
f.write(' <col class="col-extensions">\n')
f.write(' <col class="col-bases-extensions">\n')
f.write(' <col class="col-descriptions">\n')
f.write(' </colgroup>\n')
f.write(' <thead>\n')
f.write(' <tr><th>Parameter Name</th><th>Type</th><th>Extension(s)</th><th>Description(s)</th></tr>\n')
f.write(' <tr><th>Parameter Name</th><th>Type</th><th>Bases/Extensions</th><th>Description(s)</th></tr>\n')
f.write(' </thead>\n')
f.write(' <tbody>\n')

Expand Down Expand Up @@ -631,15 +631,15 @@ def html_param_table_row(f, param: Dict[str, Any], chapter_name: Optional[str]):
impl_defs = filter_impldefs_for_chapter(impl_defs_all, chapter_name)
type_display = format_param_type_for_html(param)

extension_names: List[str] = []
base_extension_names: List[str] = []
for impl_def in impl_defs:
if not isinstance(impl_def, dict):
continue
instances = impl_def.get("instances")
if isinstance(instances, list):
for instance in instances:
if isinstance(instance, str) and instance not in extension_names:
extension_names.append(instance)
if isinstance(instance, str) and instance not in base_extension_names:
base_extension_names.append(instance)

descriptions: List[str] = []
if isinstance(note, str):
Expand Down Expand Up @@ -674,14 +674,14 @@ def html_param_table_row(f, param: Dict[str, Any], chapter_name: Optional[str]):
if not descriptions:
descriptions.append("(No description available)")

extensions_str = ", ".join(extension_names) if extension_names else "(none)"
base_extension_str = ", ".join(base_extension_names) if base_extension_names else "(none)"

row_span = len(descriptions)

f.write(' <tr>\n')
f.write(f' <td rowspan={row_span} id="{name}">{name}</td>\n')
f.write(f' <td rowspan={row_span}>{type_display}</td>\n')
f.write(f' <td rowspan={row_span}>{extensions_str}</td>\n')
f.write(f' <td rowspan={row_span}>{base_extension_str}</td>\n')
f.write(f' <td>{descriptions[0]}</td>\n')
f.write(' </tr>\n')

Expand Down
Loading