Skip to content

Commit 764f8bb

Browse files
author
Derek Hower
committed
Rename ArchDef -> ConfiguredArchitecture, ArchDefObj -> DatabaseObject, add Zce
1 parent 8bb3b95 commit 764f8bb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

84 files changed

+847
-833
lines changed

Rakefile

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,14 @@ end
1919

2020
directory "#{$root}/.stamps"
2121

22-
def arch_def_for(config_name)
22+
def cfg_arch_for(config_name)
2323
Rake::Task["#{$root}/.stamps/resolve-#{config_name}.stamp"].invoke
2424

25-
@arch_defs ||= {}
26-
return @arch_defs[config_name] if @arch_defs.key?(config_name)
25+
@cfg_archs ||= {}
26+
return @cfg_archs[config_name] if @cfg_archs.key?(config_name)
2727

28-
@arch_defs[config_name] =
29-
ArchDef.new(
28+
@cfg_archs[config_name] =
29+
ConfiguredArchitecture.new(
3030
config_name,
3131
$root / "gen" / "resolved_arch" / config_name,
3232
overlay_path: $root / "cfgs" / config_name / "arch_overlay"
@@ -37,7 +37,7 @@ namespace :gen do
3737
desc "Generate documentation for the ruby tooling"
3838
task tool_doc: "#{$root}/.stamps/dev_gems" do
3939
Dir.chdir($root) do
40-
sh "bundle exec yard doc --yardopts arch_def.yardopts"
40+
sh "bundle exec yard doc --yardopts cfg_arch.yardopts"
4141
sh "bundle exec yard doc --yardopts idl.yardopts"
4242
end
4343
end
@@ -103,9 +103,7 @@ end
103103

104104
desc "Clean up all generated files"
105105
task :clean do
106-
FileUtils.rm_rf $root / "gen"
107-
FileUtils.rm_rf $root / ".stamps"
108-
FileUtils.rm_rf $root / ".home"
106+
warn "Don't run clean using Rake. Run `./do clean` (alias for `./bin/clean`) instead."
109107
end
110108

111109
namespace :test do
@@ -124,16 +122,16 @@ namespace :test do
124122
end
125123
task idl: ["gen:resolved_arch", "#{$root}/.stamps/resolve-rv32.stamp", "#{$root}/.stamps/resolve-rv64.stamp"] do
126124
print "Parsing IDL code for RV32..."
127-
arch_def32 = arch_def_for("rv32")
125+
cfg_arch32 = cfg_arch_for("rv32")
128126
puts "done"
129127

130-
arch_def32.type_check
128+
cfg_arch32.type_check
131129

132130
print "Parsing IDL code for RV64..."
133-
arch_def64 = arch_def_for("rv64")
131+
cfg_arch64 = cfg_arch_for("rv64")
134132
puts "done"
135133

136-
arch_def64.type_check
134+
cfg_arch64.type_check
137135

138136
puts "All IDL passed type checking"
139137
end
@@ -143,7 +141,7 @@ def insert_warning(str, from)
143141
# insert a warning on the second line
144142
lines = str.lines
145143
first_line = lines.shift
146-
lines.unshift(first_line, "\n# WARNING: This file is auto-generated from #{Pathname.new(from).relative_path_from($root)}\n\n").join("")
144+
lines.unshift(first_line, "\n# WARNING: This file is auto-generated from #{Pathname.new(from).relative_path_from($root)}").join("")
147145
end
148146
private :insert_warning
149147

arch/csr/H/hcounteren.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# yaml-language-server: $schema=../../../schemas/csr_schema.json
22

33
# WARNING: This file is auto-generated from arch/csr/H/hcounteren.layout
4-
54
$schema: csr_schema.json#
65
kind: csr
76
name: hcounteren

arch/csr/I/mcounteren.layout

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,6 @@ description: |
8080
<%%- end -%>
8181
.
8282
<%%- end -%>
83-
84-
8583
definedBy: U # actually, defined by RV64, but must implement U-mode for this CSR to exist
8684
fields:
8785
CY:

arch/csr/I/mcounteren.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# yaml-language-server: $schema=../../schemas/csr_schema.json
22

33
# WARNING: This file is auto-generated from arch/csr/I/mcounteren.layout
4-
54
$schema: csr_schema.json#
65
kind: csr
76
name: mcounteren
@@ -82,7 +81,6 @@ description: |
8281
<%- end -%>
8382
.
8483
<%- end -%>
85-
8684
definedBy: U # actually, defined by RV64, but must implement U-mode for this CSR to exist
8785
fields:
8886
CY:

arch/csr/I/pmpcfgN.layout

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -22,39 +22,39 @@ fields:
2222
base: 64 # upper half doesn't exist in RV32
2323
<%- end -%>
2424
description: |
25-
*PMP configuration for entry <%= pmpcfg_num*4 + i %>*
25+
*PMP configuration for entry <%= pmpcfg_num*4 + i %>*
2626

27-
The bits are as follows:
27+
The bits are as follows:
2828

29-
[separator="!",%autowidth]
30-
!===
31-
! Name ! Location ! Description
29+
[separator="!",%autowidth]
30+
!===
31+
! Name ! Location ! Description
3232

33-
h! L ! <%= ((i+1)*8)-1 %> ! Locks the entry from further modification. Additionally, when set, PMP checks also apply to M-mode for the entry.
34-
h! - ! <%= ((i+1)*8)-2 %>:<%= ((i+1)*8)-3 %> ! _Reserved_ Writes shall be ignored.
35-
h! A ! <%= ((i+1)*8)-4 %>:<%= ((i+1)*8)-5 %>
36-
a! Address matching mode. One of:
33+
h! L ! <%= ((i+1)*8)-1 %> ! Locks the entry from further modification. Additionally, when set, PMP checks also apply to M-mode for the entry.
34+
h! - ! <%= ((i+1)*8)-2 %>:<%= ((i+1)*8)-3 %> ! _Reserved_ Writes shall be ignored.
35+
h! A ! <%= ((i+1)*8)-4 %>:<%= ((i+1)*8)-5 %>
36+
a! Address matching mode. One of:
3737

38-
[when="PMP_GRANULARITY < 2"]
39-
* *OFF* (0) - Null region (disabled)
40-
* *TOR* (1) - Top of range
41-
* *NA4* (2) - Naturally aligned four-byte region
42-
* *NAPOT* (3) - Natrually aligned power of two
38+
[when="PMP_GRANULARITY < 2"]
39+
* *OFF* (0) - Null region (disabled)
40+
* *TOR* (1) - Top of range
41+
* *NA4* (2) - Naturally aligned four-byte region
42+
* *NAPOT* (3) - Natrually aligned power of two
4343

44-
[when="PMP_GRANULARITY >= 2"]
45-
* *OFF* (0) - Null region (disabled)
46-
* *TOR* (1) - Top of range
47-
* *NAPOT* (3) - Natrually aligned power of two
44+
[when="PMP_GRANULARITY >= 2"]
45+
* *OFF* (0) - Null region (disabled)
46+
* *TOR* (1) - Top of range
47+
* *NAPOT* (3) - Natrually aligned power of two
4848

49-
[when="PMP_GRANULARITY >= 2"]
50-
Naturally aligned four-byte region, *NA4* (2), is not valid (not needed when the PMP granularity is larger than 4 bytes).
49+
[when="PMP_GRANULARITY >= 2"]
50+
Naturally aligned four-byte region, *NA4* (2), is not valid (not needed when the PMP granularity is larger than 4 bytes).
5151

52-
h! X ! <%= ((i)*8)+2 %> ! When clear, instruction fetchs cause an `Access Fault` for the matching region and privilege mode.
53-
h! W ! <%= ((i)*8)+1 %> ! When clear, stores and AMOs cause an `Access Fault` for the matching region and privilege mode.
54-
h! R ! <%= ((i)*8)+0 %> ! When clear, loads cause an `Access Fault` for the matching region and privilege mode.
55-
!===
52+
h! X ! <%= ((i)*8)+2 %> ! When clear, instruction fetchs cause an `Access Fault` for the matching region and privilege mode.
53+
h! W ! <%= ((i)*8)+1 %> ! When clear, stores and AMOs cause an `Access Fault` for the matching region and privilege mode.
54+
h! R ! <%= ((i)*8)+0 %> ! When clear, loads cause an `Access Fault` for the matching region and privilege mode.
55+
!===
5656

57-
The combination of R = 0, W = 1 is reserved.
57+
The combination of R = 0, W = 1 is reserved.
5858
type(): |
5959
if (NUM_PMP_ENTRIES > <%= pmpcfg_num*4 + i %>) {
6060
return CsrFieldType::RWR;

arch/csr/S/scounteren.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# yaml-language-server: $schema=../../schemas/csr_schema.json
22

33
# WARNING: This file is auto-generated from arch/csr/S/scounteren.layout
4-
54
$schema: csr_schema.json#
65
kind: csr
76
name: scounteren

arch/csr/Zicntr/mcountinhibit.layout

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ description: |
4141

4242
definedBy:
4343
anyOf:
44-
- name: Sm
45-
- name: Smhpm
44+
- name: Sm
45+
- name: Smhpm
4646
fields:
4747
CY:
4848
location: 0

arch/csr/Zicntr/mcountinhibit.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# yaml-language-server: $schema=../../../schemas/csr_schema.json
22

33
# WARNING: This file is auto-generated from arch/csr/Zicntr/mcountinhibit.layout
4-
54
$schema: csr_schema.json#
65
kind: csr
76
name: mcountinhibit

arch/csr/Zihpm/mhpmevent10.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# WARNING: This file is auto-generated from arch/csr/Zihpm/mhpmeventN.layout
2-
3-
# yaml-language-server: $schema=../../../schemas/csr_schema.json
1+
# WARNING: This file is auto-generated from arch/csr/Zihpm/mhpmeventN.layout# yaml-language-server: $schema=../../../schemas/csr_schema.json
42

53
$schema: csr_schema.json#
64
kind: csr

arch/csr/Zihpm/mhpmevent11.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
# WARNING: This file is auto-generated from arch/csr/Zihpm/mhpmeventN.layout
2-
3-
# yaml-language-server: $schema=../../../schemas/csr_schema.json
1+
# WARNING: This file is auto-generated from arch/csr/Zihpm/mhpmeventN.layout# yaml-language-server: $schema=../../../schemas/csr_schema.json
42

53
$schema: csr_schema.json#
64
kind: csr

0 commit comments

Comments
 (0)