Skip to content

Commit 2d6392a

Browse files
author
Derek Hower
committed
Add status dashboard
1 parent e728581 commit 2d6392a

File tree

3 files changed

+110
-0
lines changed

3 files changed

+110
-0
lines changed

.github/workflows/pages.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ jobs:
5151
run: mkdir -p _site/example_cfg
5252
- name: Create _site/manual
5353
run: mkdir -p _site/manual
54+
- name: Create _site/dash
55+
run: mkdir -p _site/dash
5456
- name: Create _site/pdfs
5557
run: mkdir -p _site/pdfs
5658
- name: Create _site/htmls
@@ -71,6 +73,10 @@ jobs:
7173
run: cp gen/crd_doc/html/MC-1.html _site/htmls/MC-1.html
7274
- name: Copy manual html
7375
run: cp -R gen/manual/isa/top/all/html _site/manual
76+
- name: Generate dashboard
77+
run: ./do gen:dash
78+
- name: Copy dashboard
79+
run: cp -R gen/dashboard/* _site/dash
7480
- name: Setup Pages
7581
uses: actions/configure-pages@v5
7682
- name: Upload artifact

backends/dashboard/tasks.rake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# frozen_string_literal: true
2+
3+
require "pathname"
4+
5+
namespace :gen do
6+
desc "Generate status dashboard"
7+
task dash: ["#{$root}/.stamps/arch-gen-_64.stamp"] do
8+
template_path = Pathname.new("#{$root}/backends/dashboard/templates/index.html.erb")
9+
erb = ERB.new template_path.read, trim_mode: "-"
10+
erb.filename = template_path.to_s
11+
12+
arch_def = arch_def_for("_64")
13+
14+
result_path = Pathname.new("#{$root}/gen/dashboard/index.html")
15+
FileUtils.mkdir_p result_path.dirname
16+
File.write result_path, erb.result(binding)
17+
end
18+
end
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
4+
<head>
5+
<meta charset="utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
7+
<link rel="apple-touch-icon" sizes="76x76" href="../assets/img/apple-icon.png">
8+
<link rel="icon" type="image/png" href="../assets/img/favicon.png">
9+
<title>
10+
RISC-V Unified DB Status
11+
</title>
12+
13+
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
14+
15+
</head>
16+
17+
<body class="container">
18+
19+
<h1><span class="font-monospace">riscv-unified-db</span> Status Dashboard <br/><small class="text-muted">Commit <a href="https://github.com/riscv-software-src/riscv-unified-db/tree/<%= `git rev-parse HEAD`.strip %>"><%= `git rev-parse --short HEAD`.strip %></a></small></h1>
20+
21+
22+
<div class="card">
23+
<div class="card-body">
24+
<h5 class="card-title">Instruction Status</h5>
25+
26+
<h6 class="card-subtitle mb-2 text-muted">Of <strong><%= arch_def.instructions.size %></strong> known instructions</h6>
27+
28+
<div class="card-body">
29+
<%- idl_insts = arch_def.instructions.select { |i| !i.data["operation()"].nil? && !i.data["operation()"].empty? } -%>
30+
<%- idl_insts_pct = (idl_insts.size*100) / arch_def.instructions.size -%>
31+
<div class="progress-wrapper">
32+
<div class="progress-info">
33+
<div class="progress-percentage">
34+
<span class="text-sm font-weight-bold">IDL implementation (<%= idl_insts.size %>, <%= idl_insts_pct %>%)</span>
35+
</div>
36+
</div>
37+
<div class="progress">
38+
<div class="progress-bar bg-primary" role="progressbar" aria-valuenow="<%= idl_insts.size %>" aria-valuemin="0" aria-valuemax="<%= arch_def.instructions.size %>" style="width: <%= idl_insts_pct %>%;"></div>
39+
</div>
40+
</div>
41+
42+
<%- sail_insts = arch_def.instructions.select { |i| !i.data["sail()"].nil? && !i.data["sail()"].empty? } -%>
43+
<%- sail_insts_pct = (sail_insts.size*100) / arch_def.instructions.size -%>
44+
<div class="progress-wrapper">
45+
<div class="progress-info">
46+
<div class="progress-percentage">
47+
<span class="text-sm font-weight-bold">Sail implementation (<%= sail_insts.size %>, <%= sail_insts_pct %>%)</span>
48+
</div>
49+
</div>
50+
<div class="progress">
51+
<div class="progress-bar bg-primary" role="progressbar" aria-valuenow="<%= sail_insts.size %>" aria-valuemin="0" aria-valuemax="<%= arch_def.instructions.size %>" style="width: <%= sail_insts_pct %>%;"></div>
52+
</div>
53+
</div>
54+
55+
<%- desc_insts = arch_def.instructions.select { |i| i.data["description"].strip != "No description available." } -%>
56+
<%- desc_insts_pct = (desc_insts.size*100) / arch_def.instructions.size -%>
57+
<div class="progress-wrapper">
58+
<div class="progress-info">
59+
<div class="progress-percentage">
60+
<span class="text-sm font-weight-bold">Descriptions (<%= desc_insts.size %>, <%= desc_insts_pct %>%)</span>
61+
</div>
62+
</div>
63+
<div class="progress">
64+
<div class="progress-bar bg-primary" role="progressbar" aria-valuenow="<%= desc_insts.size %>" aria-valuemin="0" aria-valuemax="<%= arch_def.instructions.size %>" style="width: <%= desc_insts_pct %>%;"></div>
65+
</div>
66+
</div>
67+
68+
<%- lname_insts = arch_def.instructions.select { |i| i.data["long_name"].strip != "No synopsis available." } -%>
69+
<%- lname_insts_pct = (lname_insts.size*100) / arch_def.instructions.size -%>
70+
<div class="progress-wrapper">
71+
<div class="progress-info">
72+
<div class="progress-percentage">
73+
<span class="text-sm font-weight-bold">Long name (<%= lname_insts.size %>, <%= lname_insts_pct %>%)</span>
74+
</div>
75+
</div>
76+
<div class="progress">
77+
<div class="progress-bar bg-primary" role="progressbar" aria-valuenow="<%= lname_insts.size %>" aria-valuemin="0" aria-valuemax="<%= arch_def.instructions.size %>" style="width: <%= lname_insts_pct %>%;"></div>
78+
</div>
79+
</div>
80+
</div>
81+
</div>
82+
</div>
83+
84+
</body>
85+
86+
</html>

0 commit comments

Comments
 (0)