Skip to content

Commit b5ec63b

Browse files
authored
Merge branch 'main' into mstatus
2 parents b52f055 + 9607bb8 commit b5ec63b

File tree

5 files changed

+70
-0
lines changed

5 files changed

+70
-0
lines changed

arch/ext/V.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# yaml-language-server: $schema=../../schemas/ext_schema.json
2+
3+
V:
4+
type: unprivileged
5+
long_name: Variable-length vector
6+
versions:
7+
- version: "1.0.0"
8+
state: ratified
9+
ratification_date: null
10+
description: |
11+
TODO
12+
params:
13+
MUTABLE_MISA_V:
14+
description: |
15+
Indicates whether or not the `V` extension can be disabled with the `misa.V` bit.
16+
schema:
17+
type: boolean

backends/crd_doc/templates/crd.adoc.erb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -514,6 +514,10 @@ h| Privilege Mode | <%= csr.priv_mode %>
514514

515515

516516
==== Format
517+
518+
Green fields are present in <%= crd.name %>.
519+
Red fields are defined by the RISC-V ISA but not present in <%= crd.name %>.
520+
517521
<% unless csr.dynamic_length?(crd.arch_def) || csr.fields.any? { |f| f.dynamic_location?(crd.arch_def) } -%>
518522
<%# CSR has a known static length, so there is only one format to display -%>
519523
.<%= csr.name %> format

cfgs/generic_rv64/implemented_exts.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ implemented_extensions:
1414
- [Smhpm, "1.12.0"]
1515
- [Smpmp, "1.12.0"]
1616
- [U, "1.12.0"]
17+
- [V, "1.0.0"]
1718
- [Zicntr, "2.0.0"]
1819
- [Zicsr, "2.0.0"]
1920
- [Zihpm, "2.0.0"]

cfgs/generic_rv64/params.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,10 @@ params:
372372
# the extension can be disabled in the `misa.U` bit.
373373
MUTABLE_MISA_U: false
374374

375+
# when the V extensions is supported, indicates whether or not
376+
# the extension can be disabled in the `misa.V` bit.
377+
MUTABLE_MISA_V: false
378+
375379
# size of a cache block, in bytes
376380
CACHE_BLOCK_SIZE: 64
377381

lib/arch_obj_models/extension.rb

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,28 @@ def csrs
225225
@csrs = arch_def.csrs.select { |csr| csr.defined_by?(ExtensionVersion.new(name, max_version)) }
226226
end
227227

228+
# @return [Array<Csr>] the list of CSRs implemented by this extension (may be empty)
229+
def implemented_csrs(archdef)
230+
raise "should only be called with a fully configured arch def" unless archdef.fully_configured?
231+
232+
return @implemented_csrs unless @implemented_csrs.nil?
233+
234+
@implemented_csrs = archdef.implemented_csrs.select do |csr|
235+
versions.any? { |ver| csr.defined_by?(ExtensionVersion.new(name, ver["version"])) }
236+
end
237+
end
238+
239+
# @return [Array<Csr>] the list of CSRs implemented by this extension (may be empty)
240+
def implemented_instructions(archdef)
241+
raise "should only be called with a fully configured arch def" unless archdef.fully_configured?
242+
243+
return @implemented_instructions unless @implemented_instructions.nil?
244+
245+
@implemented_instructions = archdef.implemented_instructions.select do |inst|
246+
versions.any? { |ver| inst.defined_by?(ExtensionVersion.new(name, ver["version"])) }
247+
end
248+
end
249+
228250
# return the set of reachable functions from any of this extensions's CSRs or instructions in the given evaluation context
229251
#
230252
# @param symtab [Idl::SymbolTable] The evaluation context
@@ -329,6 +351,28 @@ def <=>(other)
329351
@version <=> other.version
330352
end
331353
end
354+
355+
# @return [Array<Csr>] the list of CSRs implemented by this extension version (may be empty)
356+
def implemented_csrs(archdef)
357+
raise "should only be called with a fully configured arch def" unless archdef.fully_configured?
358+
359+
return @implemented_csrs unless @implemented_csrs.nil?
360+
361+
@implemented_csrs = archdef.implemented_csrs.select do |csr|
362+
csr.defined_by?(self)
363+
end
364+
end
365+
366+
# @return [Array<Csr>] the list of CSRs implemented by this extension version (may be empty)
367+
def implemented_instructions(archdef)
368+
raise "should only be called with a fully configured arch def" unless archdef.fully_configured?
369+
370+
return @implemented_instructions unless @implemented_instructions.nil?
371+
372+
@implemented_instructions = archdef.implemented_instructions.select do |inst|
373+
inst.defined_by?(self)
374+
end
375+
end
332376
end
333377

334378
# Represents an extension requirement, that is an extension name paired with version requirement(s)

0 commit comments

Comments
 (0)