Skip to content

Commit 407adae

Browse files
fix: display UDB extension dependency information correctly in ISA Explorer (#723)
Fixes #597 and #731 (and a few more bugs found in the process). This is a work in progress. Issue #730 tracks what needs to happen next to fully fix #597. Note that I accidentally merged in commits from branch "731 still have 404 errors on artifacts" with PR #739 into this branch. So, you'll commits for both issues #597 and #731 in this PR. --------- Signed-off-by: james-ball-qualcomm <quic_jameball@quicinc.com>
1 parent 293bc58 commit 407adae

File tree

4 files changed

+108
-54
lines changed

4 files changed

+108
-54
lines changed

arch/ext/Zve32f.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# yaml-language-server: $schema=../../schemas/ext_schema.json
2+
3+
$schema: "ext_schema.json#"
4+
kind: extension
5+
name: Zve32f
6+
long_name: Vector Extension for Minimal Single-Precision Embedded Floating-Point
7+
description: |
8+
TBD - See GitHub issue 616
9+
type: unprivileged
10+
versions:
11+
- version: "1.0.0"
12+
state: ratified
13+
ratification_date: null
14+
requires: F

backends/isa_explorer/isa_explorer.rb

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ def arch2ext_table(arch)
3939
},
4040
{name: "Description", formatter: "textarea", sorter: "alphanum", headerFilter: true},
4141
{name: "IC", formatter: "textarea", sorter: "alphanum", headerFilter: true},
42-
{name: "Extensions\nIncluded\n(subsets)", formatter: "textarea", sorter: "alphanum"},
43-
{name: "Implied By\n(and\ntransitives)", formatter: "textarea", sorter: "alphanum"},
44-
{name: "Incompatible\n(and\ntransitives)", formatter: "textarea", sorter: "alphanum"},
42+
{name: "Implied By", formatter: "textarea", sorter: "alphanum"},
43+
{name: "Requires", formatter: "textarea", sorter: "alphanum"},
44+
{name: "Incompatible", formatter: "textarea", sorter: "alphanum"},
4545
{name: "Ratified", formatter: "textarea", sorter: "boolean", headerFilter: true},
4646
{name: "Ratification\nDate", formatter: "textarea", sorter: "alphanum", headerFilter: true},
4747
sorted_profile_releases.map do |pr|
@@ -55,14 +55,12 @@ def arch2ext_table(arch)
5555

5656
arch.extensions.sort_by!(&:name).each do |ext|
5757
row = [
58-
ext.name,
59-
ext.long_name,
60-
ext.compact_priv_type,
61-
"UDB Missing",
62-
# See https://github.com/riscv-software-src/riscv-unified-db/issues/597 for the next 2 columns.
63-
ext.max_version.implied_by.map(&:name),
64-
# ext.max_version.transitive_conflicts.map(&:name),
65-
"UDB MISSING",
58+
ext.name, # Name
59+
ext.long_name, # Description
60+
ext.compact_priv_type, # IC
61+
ext.max_version.implied_by.map(&:name), # Implied By
62+
ext.max_version.requirement_condition.empty? ? "" : ext.max_version.requirement_condition.to_logic_tree.to_s, # Requires
63+
ext.conflicts_condition.empty? ? "" : ext.conflicts_condition.to_logic_tree.to_s, # Incompatible
6664
ext.ratified,
6765
if ext.ratified
6866
if ext.min_ratified_version.ratification_date.nil? || ext.min_ratified_version.ratification_date.empty?

lib/arch_obj_models/req_expression.rb

Lines changed: 26 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -466,32 +466,36 @@ def to_logic_tree(hsh = @hsh, term_idx: [0], expand: true)
466466
when "oneOf"
467467
# expand oneOf into AND
468468
roots = T.let([], T::Array[LogicNode])
469-
raise "unexpected" if hsh["oneOf"].size < 2
470-
471-
hsh["oneOf"].size.times do |k|
472-
root =
473-
if k.zero?
474-
LogicNode.new(TYPES::And, [to_logic_tree(hsh["oneOf"][0], term_idx:, expand:), LogicNode.new(TYPES::Not, [to_logic_tree(hsh["oneOf"][1], term_idx:, expand:)])])
475-
elsif k == 1
476-
LogicNode.new(TYPES::And, [LogicNode.new(TYPES::Not, [to_logic_tree(hsh["oneOf"][0], term_idx:, expand:)]), to_logic_tree(hsh["oneOf"][1], term_idx:, expand:)])
477-
else
478-
LogicNode.new(TYPES::And, [LogicNode.new(TYPES::Not, [to_logic_tree(hsh["oneOf"][0], term_idx:, expand:)]), LogicNode.new(TYPES::Not, [to_logic_tree(hsh["oneOf"][1], term_idx:, expand:)])])
479-
end
480-
(2...hsh["oneOf"].size).each do |i|
469+
470+
if hsh["oneOf"].size < 2
471+
to_logic_tree(hsh["oneOf"][0], term_idx:, expand:)
472+
else
473+
hsh["oneOf"].size.times do |k|
481474
root =
482-
if k == i
483-
LogicNode.new(TYPES::And, [root, to_logic_tree(hsh["oneOf"][i], term_idx:, expand:)])
475+
if k.zero?
476+
LogicNode.new(TYPES::And, [to_logic_tree(hsh["oneOf"][0], term_idx:, expand:), LogicNode.new(TYPES::Not, [to_logic_tree(hsh["oneOf"][1], term_idx:, expand:)])])
477+
elsif k == 1
478+
LogicNode.new(TYPES::And, [LogicNode.new(TYPES::Not, [to_logic_tree(hsh["oneOf"][0], term_idx:, expand:)]), to_logic_tree(hsh["oneOf"][1], term_idx:, expand:)])
484479
else
485-
LogicNode.new(TYPES::And, [root, LogicNode.new(TYPES::Not, [to_logic_tree(hsh["oneOf"][i], term_idx:, expand:)])])
480+
LogicNode.new(TYPES::And, [LogicNode.new(TYPES::Not, [to_logic_tree(hsh["oneOf"][0], term_idx:, expand:)]), LogicNode.new(TYPES::Not, [to_logic_tree(hsh["oneOf"][1], term_idx:, expand:)])])
486481
end
487-
end
488-
roots << root
489-
end
490-
root = LogicNode.new(TYPES::Or, [T.must(roots[0]), T.must(roots[1])])
491-
(2...roots.size).each do |i|
492-
root = LogicNode.new(TYPES::Or, [root, T.must(roots[i])])
482+
(2...hsh["oneOf"].size).each do |i|
483+
root =
484+
if k == i
485+
LogicNode.new(TYPES::And, [root, to_logic_tree(hsh["oneOf"][i], term_idx:, expand:)])
486+
else
487+
LogicNode.new(TYPES::And, [root, LogicNode.new(TYPES::Not, [to_logic_tree(hsh["oneOf"][i], term_idx:, expand:)])])
488+
end
489+
end
490+
roots << root
491+
end
492+
493+
root = LogicNode.new(TYPES::Or, [T.must(roots[0]), T.must(roots[1])])
494+
(2...roots.size).each do |i|
495+
root = LogicNode.new(TYPES::Or, [root, T.must(roots[i])])
496+
end
497+
root
493498
end
494-
root
495499
when "not"
496500
LogicNode.new(TYPES::Not, [to_logic_tree(hsh["not"], term_idx:, expand:)])
497501
else

lib/deploy.sh

Lines changed: 59 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
# deploy artifacts to a directory, in preparation for GitHub deployment
44

5-
# Default to success
5+
# Initialize globals used to track failures.
66
exit_status=0
7+
declare -a failures # Array
78

89
ROOT=$(dirname $(dirname $(realpath ${BASH_SOURCE[0]})))
910

@@ -14,58 +15,75 @@ function deploy_log() {
1415
echo "[DEPLOY] $(date) $*"
1516
}
1617

18+
# Put "FAIL" between [DEPLOY] and date to make it easier to grep for failures (ie.., "\[DEPLOY\] FAIL" RE does the trick)
19+
# Don't put "FAIL" in [DEPLOY] so that we can first grep for [DEPLOY] and see all messages from this deploy.sh script.
20+
# Record failures but don't exit so that we can see which artifacts pass & fail.
21+
function deploy_fail() {
22+
echo "[DEPLOY] FAIL $(date) $*"
23+
failures+=("$*") # Append to array
24+
exit_status=1
25+
}
26+
1727
function deploy_mkdir() {
1828
[[ $# -ne 1 ]] && {
19-
deploy_log "deploy_mkdir(): Passed $# args but it needs 1"
29+
deploy_fail "deploy_mkdir(): Passed $# args but it needs 1"
30+
31+
# Exit if args are wrong.
2032
exit 1
2133
}
2234

2335
local dst_dir="$1"
2436
mkdir -p $dst_dir || {
25-
deploy_log "mkdir -p $dst_dir failed"
26-
exit_status=1
37+
deploy_fail "mkdir -p $dst_dir failed"
2738
}
2839
}
2940

3041
function deploy_do() {
31-
deploy_log "$@"
42+
deploy_log
43+
deploy_log 'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv'
44+
deploy_log "./do $*"
45+
deploy_log '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'
46+
deploy_log
3247
./do "$@" || {
33-
deploy_log "./do $* failed"
34-
exit_status=1
48+
deploy_fail "./do $*"
3549
}
3650
}
3751

3852
function deploy_cp_recursive() {
3953
[[ $# -ne 2 ]] && {
40-
deploy_log "deploy_cp_recursive(): Passed $# args but it needs 2"
54+
deploy_fail "deploy_cp_recursive(): Passed $# args but it needs 2"
55+
56+
# Exit if args are wrong.
4157
exit 1
4258
}
4359

4460
local src_dir="$1"
4561
local dst_dir="$2"
4662

4763
cp -R ${src_dir} ${dst_dir} || {
48-
deploy_log "cp -R ${src_dir} ${dst_dir} failed"
49-
exit_status=1
64+
deploy_fail "cp -R ${src_dir} ${dst_dir} failed"
5065
}
5166
}
5267

5368
function deploy_cp() {
5469
[[ $# -ne 2 ]] && {
55-
deploy_log "deploy_cp(): Passed $# args but it needs 2"
70+
deploy_fail "deploy_cp(): Passed $# args but it needs 2"
71+
72+
# Exit if args are wrong.
5673
exit 1
5774
}
5875

5976
local src_file="$1"
6077
local dst_dir="$2"
6178

6279
cp ${src_file} ${dst_dir} || {
63-
deploy_log "cp ${src_file} ${dst_dir} failed"
64-
exit_status=1
80+
deploy_fail "cp ${src_file} ${dst_dir} failed"
6581
}
6682
}
6783

68-
deploy_log "Starting"
84+
deploy_log '***************************************************************'
85+
deploy_log '* DEPLOY STARTING *'
86+
deploy_log '***************************************************************'
6987

7088
deploy_mkdir $DEPLOY_DIR
7189
deploy_mkdir $DEPLOY_DIR/example_cfg
@@ -174,17 +192,17 @@ cat <<- EOF > $DEPLOY_DIR/index.html
174192
<li><a href="$PAGES_URL/isa_explorer/browser/ext_table.html">Extensions</a></li>
175193
<li><a href="$PAGES_URL/isa_explorer/browser/inst_table.html">Instructions</a></li>
176194
<li><a href="$PAGES_URL/isa_explorer/browser/csr_table.html">CSRs</a></li>
177-
<li><a href="$PAGES_URL/isa_explorer.xlsx">Excel version (includes Extensions, Instructions, CSRs)</a></li>
195+
<li><a href="$PAGES_URL/isa_explorer/spreadsheet/isa_explorer.xlsx">Excel version (includes Extensions, Instructions, CSRs)</a></li>
178196
</ul>
179197
180198
<br/>
181199
<h3>Profile Releases</h3>
182200
<ul>
183-
<li><a href="$PAGES_URL/pdfs/RVI20.pdf">RVI20 Profile Release</a></li>
184-
<li><a href="$PAGES_URL/pdfs/RVA20.pdf">RVA20 Profile Release</a></li>
185-
<li><a href="$PAGES_URL/pdfs/RVA22.pdf">RVA22 Profile Release</a></li>
186-
<li><a href="$PAGES_URL/pdfs/RVA23.pdf">RVA23 Profile Release</a></li>
187-
<li><a href="$PAGES_URL/pdfs/RVB23.pdf">RVB23 Profile Release</a></li>
201+
<li><a href="$PAGES_URL/pdfs/RVI20ProfileRelease.pdf">RVI20 Profile Release</a></li>
202+
<li><a href="$PAGES_URL/pdfs/RVA20ProfileRelease.pdf">RVA20 Profile Release</a></li>
203+
<li><a href="$PAGES_URL/pdfs/RVA22ProfileRelease.pdf">RVA22 Profile Release</a></li>
204+
<li><a href="$PAGES_URL/pdfs/RVA23ProfileRelease.pdf">RVA23 Profile Release</a></li>
205+
<li><a href="$PAGES_URL/pdfs/RVB23ProfileRelease.pdf">RVB23 Profile Release</a></li>
188206
</ul>
189207
190208
<br/>
@@ -223,6 +241,26 @@ cat <<- EOF > $DEPLOY_DIR/index.html
223241
</html>
224242
EOF
225243

226-
deploy_log "Complete"
244+
[[ $exit_status -eq 1 ]] && {
245+
deploy_log
246+
deploy_log '***************************************************************'
247+
deploy_log '* DEPLOY FAILED *'
248+
deploy_log '***************************************************************'
249+
deploy_log
250+
deploy_log "LIST OF FAILURES:"
251+
252+
# Iterate through each failure array element.
253+
for f in "${failures[@]}"; do
254+
deploy_log " $f"
255+
done
256+
}
257+
258+
deploy_log
259+
deploy_log "Overall exit status is $exit_status"
260+
deploy_log
261+
262+
deploy_log '***************************************************************'
263+
deploy_log '* DEPLOY COMPLETE *'
264+
deploy_log '***************************************************************'
227265

228266
exit $exit_status

0 commit comments

Comments
 (0)