Skip to content

fix: display UDB extension dependency information correctly in ISA Explorer #723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
14 commits
Select commit Hold shift + click to select a range
4ab355b
fix: avoid Sorbet errors and improve consistency of database to avoid…
james-ball-qualcomm May 2, 2025
3f94451
fix: testing if PR can avoid listing commits of older PR
james-ball-qualcomm May 2, 2025
21b4cef
fix: display implied-by and requires columns from UDB & bugs it exposed
james-ball-qualcomm May 5, 2025
6aeebb9
Merge branch 'main' into 597-isa-explorer-backend-missing-extension-d…
james-ball-qualcomm May 5, 2025
a1ae8ba
Merge branch 'main' into 597-isa-explorer-backend-missing-extension-d…
james-ball-qualcomm May 5, 2025
6e6fbec
Merge branch 'main' into 597-isa-explorer-backend-missing-extension-d…
james-ball-qualcomm May 7, 2025
01a14f1
Merge remote-tracking branch 'origin/main' into 731-still-have-404-er…
james-ball-qualcomm May 7, 2025
14a485d
fix: improved clarity of result logging and fixed bad links to profil…
james-ball-qualcomm May 7, 2025
5afe5aa
Merge branch '597-isa-explorer-backend-missing-extension-dependencies…
james-ball-qualcomm May 7, 2025
498588b
Merge pull request #739 from riscv-software-src/731-still-have-404-er…
james-ball-qualcomm May 7, 2025
ca5f011
Merge branch 'main' into 597-isa-explorer-backend-missing-extension-d…
james-ball-qualcomm May 7, 2025
5ae5c99
Merge branch 'main' into 597-isa-explorer-backend-missing-extension-d…
james-ball-qualcomm May 7, 2025
dfcfb74
fix: make deploy.sh start & end message consistent
james-ball-qualcomm May 7, 2025
06075b0
Merge branch 'main' into 597-isa-explorer-backend-missing-extension-d…
james-ball-qualcomm May 12, 2025
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
14 changes: 14 additions & 0 deletions arch/ext/Zve32f.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# yaml-language-server: $schema=../../schemas/ext_schema.json

$schema: "ext_schema.json#"
kind: extension
name: Zve32f
long_name: Vector Extension for Minimal Single-Precision Embedded Floating-Point
description: |
TBD - See GitHub issue 616
type: unprivileged
versions:
- version: "1.0.0"
state: ratified
ratification_date: null
requires: F
20 changes: 9 additions & 11 deletions backends/isa_explorer/isa_explorer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def arch2ext_table(arch)
},
{name: "Description", formatter: "textarea", sorter: "alphanum", headerFilter: true},
{name: "IC", formatter: "textarea", sorter: "alphanum", headerFilter: true},
{name: "Extensions\nIncluded\n(subsets)", formatter: "textarea", sorter: "alphanum"},
{name: "Implied By\n(and\ntransitives)", formatter: "textarea", sorter: "alphanum"},
{name: "Incompatible\n(and\ntransitives)", formatter: "textarea", sorter: "alphanum"},
{name: "Implied By", formatter: "textarea", sorter: "alphanum"},
{name: "Requires", formatter: "textarea", sorter: "alphanum"},
{name: "Incompatible", formatter: "textarea", sorter: "alphanum"},
{name: "Ratified", formatter: "textarea", sorter: "boolean", headerFilter: true},
{name: "Ratification\nDate", formatter: "textarea", sorter: "alphanum", headerFilter: true},
sorted_profile_releases.map do |pr|
Expand All @@ -55,14 +55,12 @@ def arch2ext_table(arch)

arch.extensions.sort_by!(&:name).each do |ext|
row = [
ext.name,
ext.long_name,
ext.compact_priv_type,
"UDB Missing",
# See https://github.com/riscv-software-src/riscv-unified-db/issues/597 for the next 2 columns.
ext.max_version.implied_by.map(&:name),
# ext.max_version.transitive_conflicts.map(&:name),
"UDB MISSING",
ext.name, # Name
ext.long_name, # Description
ext.compact_priv_type, # IC
ext.max_version.implied_by.map(&:name), # Implied By
ext.max_version.requirement_condition.empty? ? "" : ext.max_version.requirement_condition.to_logic_tree.to_s, # Requires
ext.conflicts_condition.empty? ? "" : ext.conflicts_condition.to_logic_tree.to_s, # Incompatible
ext.ratified,
if ext.ratified
if ext.min_ratified_version.ratification_date.nil? || ext.min_ratified_version.ratification_date.empty?
Expand Down
48 changes: 26 additions & 22 deletions lib/arch_obj_models/req_expression.rb
Original file line number Diff line number Diff line change
Expand Up @@ -466,32 +466,36 @@ def to_logic_tree(hsh = @hsh, term_idx: [0], expand: true)
when "oneOf"
# expand oneOf into AND
roots = T.let([], T::Array[LogicNode])
raise "unexpected" if hsh["oneOf"].size < 2

hsh["oneOf"].size.times do |k|
root =
if k.zero?
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:)])])
elsif k == 1
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:)])
else
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:)])])
end
(2...hsh["oneOf"].size).each do |i|

if hsh["oneOf"].size < 2
to_logic_tree(hsh["oneOf"][0], term_idx:, expand:)
else
hsh["oneOf"].size.times do |k|
root =
if k == i
LogicNode.new(TYPES::And, [root, to_logic_tree(hsh["oneOf"][i], term_idx:, expand:)])
if k.zero?
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:)])])
elsif k == 1
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:)])
else
LogicNode.new(TYPES::And, [root, LogicNode.new(TYPES::Not, [to_logic_tree(hsh["oneOf"][i], term_idx:, expand:)])])
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:)])])
end
end
roots << root
end
root = LogicNode.new(TYPES::Or, [T.must(roots[0]), T.must(roots[1])])
(2...roots.size).each do |i|
root = LogicNode.new(TYPES::Or, [root, T.must(roots[i])])
(2...hsh["oneOf"].size).each do |i|
root =
if k == i
LogicNode.new(TYPES::And, [root, to_logic_tree(hsh["oneOf"][i], term_idx:, expand:)])
else
LogicNode.new(TYPES::And, [root, LogicNode.new(TYPES::Not, [to_logic_tree(hsh["oneOf"][i], term_idx:, expand:)])])
end
end
roots << root
end

root = LogicNode.new(TYPES::Or, [T.must(roots[0]), T.must(roots[1])])
(2...roots.size).each do |i|
root = LogicNode.new(TYPES::Or, [root, T.must(roots[i])])
end
root
end
root
when "not"
LogicNode.new(TYPES::Not, [to_logic_tree(hsh["not"], term_idx:, expand:)])
else
Expand Down
86 changes: 65 additions & 21 deletions lib/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@

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

# Default to success
# Initialize globals used to track failures.
exit_status=0
declare -a failures # Array

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

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

# Put "FAIL" between [DEPLOY] and date to make it easier to grep for failures (ie.., "\[DEPLOY\] FAIL" RE does the trick)
# Don't put "FAIL" in [DEPLOY] so that we can first grep for [DEPLOY] and see all messages from this deploy.sh script.
# Record failures but don't exit so that we can see which artifacts pass & fail.
function deploy_fail() {
echo "[DEPLOY] FAIL $(date) $*"
failures+=("$*") # Append to array
exit_status=1
}

function deploy_mkdir() {
[[ $# -ne 1 ]] && {
deploy_log "deploy_mkdir(): Passed $# args but it needs 1"
deploy_fail "deploy_mkdir(): Passed $# args but it needs 1"

# Exit if args are wrong.
exit 1
}

local dst_dir="$1"
mkdir -p $dst_dir || {
deploy_log "mkdir -p $dst_dir failed"
exit_status=1
deploy_fail "mkdir -p $dst_dir failed"
}
}

function deploy_do() {
deploy_log "$@"
deploy_log
deploy_log 'vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv'
deploy_log "./do $*"
deploy_log '^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^'
deploy_log
./do "$@" || {
deploy_log "./do $* failed"
exit_status=1
deploy_fail "./do $*"
}
}

function deploy_cp_recursive() {
[[ $# -ne 2 ]] && {
deploy_log "deploy_cp_recursive(): Passed $# args but it needs 2"
deploy_fail "deploy_cp_recursive(): Passed $# args but it needs 2"

# Exit if args are wrong.
exit 1
}

local src_dir="$1"
local dst_dir="$2"

cp -R ${src_dir} ${dst_dir} || {
deploy_log "cp -R ${src_dir} ${dst_dir} failed"
exit_status=1
deploy_fail "cp -R ${src_dir} ${dst_dir} failed"
}
}

function deploy_cp() {
[[ $# -ne 2 ]] && {
deploy_log "deploy_cp(): Passed $# args but it needs 2"
deploy_fail "deploy_cp(): Passed $# args but it needs 2"

# Exit if args are wrong.
exit 1
}

local src_file="$1"
local dst_dir="$2"

cp ${src_file} ${dst_dir} || {
deploy_log "cp ${src_file} ${dst_dir} failed"
exit_status=1
deploy_fail "cp ${src_file} ${dst_dir} failed"
}
}

deploy_log "Starting"
deploy_log '***************************************************************'
deploy_log '* DEPLOY STARTING *'
deploy_log '***************************************************************'

deploy_mkdir $DEPLOY_DIR
deploy_mkdir $DEPLOY_DIR/example_cfg
Expand Down Expand Up @@ -113,6 +131,9 @@ deploy_cp_recursive gen/isa_explorer/browser $DEPLOY_DIR/isa_explorer
deploy_log "Copy isa_explorer_spreadsheet"
deploy_cp_recursive gen/isa_explorer/spreadsheet $DEPLOY_DIR/isa_explorer

deploy_log "Build manual"
deploy_do "gen:html_manual" "MANUAL_NAME=isa" "VERSIONS=all"

deploy_log "Copy manual html"
deploy_cp_recursive gen/manual/isa/top/all/html $DEPLOY_DIR/manual

Expand All @@ -127,6 +148,9 @@ for profile in RVI20 RVA20 RVA22 RVA23 RVB23; do
done

for crd in AC100 AC200 MC100-32 MC100-64 MC200-32 MC200-64 MC300-32 MC300-64; do
deploy_log "Create ${crd}-CRD PDF Spec"
deploy_do "gen:proc_crd_pdf[$crd]"

deploy_log "Copy ${crd}-CRD PDF"
deploy_cp gen/proc_crd/pdf/${crd}-CRD.pdf $DEPLOY_DIR/pdfs
done
Expand Down Expand Up @@ -174,17 +198,17 @@ cat <<- EOF > $DEPLOY_DIR/index.html
<li><a href="$PAGES_URL/isa_explorer/browser/ext_table.html">Extensions</a></li>
<li><a href="$PAGES_URL/isa_explorer/browser/inst_table.html">Instructions</a></li>
<li><a href="$PAGES_URL/isa_explorer/browser/csr_table.html">CSRs</a></li>
<li><a href="$PAGES_URL/isa_explorer.xlsx">Excel version (includes Extensions, Instructions, CSRs)</a></li>
<li><a href="$PAGES_URL/isa_explorer/spreadsheet/isa_explorer.xlsx">Excel version (includes Extensions, Instructions, CSRs)</a></li>
</ul>

<br/>
<h3>Profile Releases</h3>
<ul>
<li><a href="$PAGES_URL/pdfs/RVI20.pdf">RVI20 Profile Release</a></li>
<li><a href="$PAGES_URL/pdfs/RVA20.pdf">RVA20 Profile Release</a></li>
<li><a href="$PAGES_URL/pdfs/RVA22.pdf">RVA22 Profile Release</a></li>
<li><a href="$PAGES_URL/pdfs/RVA23.pdf">RVA23 Profile Release</a></li>
<li><a href="$PAGES_URL/pdfs/RVB23.pdf">RVB23 Profile Release</a></li>
<li><a href="$PAGES_URL/pdfs/RVI20ProfileRelease.pdf">RVI20 Profile Release</a></li>
<li><a href="$PAGES_URL/pdfs/RVA20ProfileRelease.pdf">RVA20 Profile Release</a></li>
<li><a href="$PAGES_URL/pdfs/RVA22ProfileRelease.pdf">RVA22 Profile Release</a></li>
<li><a href="$PAGES_URL/pdfs/RVA23ProfileRelease.pdf">RVA23 Profile Release</a></li>
<li><a href="$PAGES_URL/pdfs/RVB23ProfileRelease.pdf">RVB23 Profile Release</a></li>
</ul>

<br/>
Expand Down Expand Up @@ -223,6 +247,26 @@ cat <<- EOF > $DEPLOY_DIR/index.html
</html>
EOF

deploy_log "Complete"
[[ $exit_status -eq 1 ]] && {
deploy_log
deploy_log '***************************************************************'
deploy_log '* DEPLOY FAILED *'
deploy_log '***************************************************************'
deploy_log
deploy_log "LIST OF FAILURES:"

# Iterate through each failure array element.
for f in "${failures[@]}"; do
deploy_log " $f"
done
}

deploy_log
deploy_log "Overall exit status is $exit_status"
deploy_log

deploy_log '***************************************************************'
deploy_log '* DEPLOY COMPLETE *'
deploy_log '***************************************************************'

exit $exit_status
Loading