Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ For booting operating system images, see the information under the
- Zkr extension for entropy source, v1.0
- Zkt extension for data independent execution latency, v1.0 (no impact on model)
- V extension for vector operations, v1.0
- Zve32x, Zve32f, Zve64x, Zve64f, and Zve64d extensions for vector operations on embedded processors, v1.0
- Zvl32b, Zvl64b, Zvl128b, Zvl256b, Zvl512b, and Zvl1024b extensions for minimum vector length, v1.0
- Zvfh and Zvfhmin extensions for vector half-precision floating-point operations, v1.0
- Zvbb extension for vector basic bit-manipulation, v1.0
- Zvbc extension for vector carryless multiplication, v1.0
- Zvkb extension for vector cryptography bit-manipulation, v1.0
Expand Down
3 changes: 3 additions & 0 deletions config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ foreach (CONFIG__BASE__XLEN IN ITEMS 32 64)
set(CONFIG_XLEN_IS_64 "false")
set(CONFIG_XLEN_IS_${CONFIG__BASE__XLEN} "true")

set(CONFIG_ELEN_IS_64 "false")
set(CONFIG_ELEN_IS_${elen} "true")

configure_file(config.json.in ${CMAKE_CURRENT_BINARY_DIR}/${config_filename})

install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${config_filename}
Expand Down
25 changes: 20 additions & 5 deletions config/config.json.in
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,19 @@
"supported": true
},
"V": {
"supported": true,
"supported": @CONFIG_ELEN_IS_64@,
"vlen_exp": @CONFIG__V__VLEN_EXP@,
"elen_exp": @CONFIG__V__ELEN_EXP@,
"vl_use_ceil": false
"vl_use_ceil": false,
"x": {
"supported": true
},
"f": {
"supported": true
},
"d": {
"supported": @CONFIG_ELEN_IS_64@
}
Comment on lines 75 to +88
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this version is arguably more confusing now. Having a key called supported would indicate to me that everything within the V key is gated by that, not that it just enables a few extra instructions that only come with the full V extension. What about having all of this within a vector_configuration key (or something along those lines)?

"vector_configuration": {
    "vlen_exp": 5,
    "elen_exp": 5,
    "vl_use_ceil": false,
    "supported": true, // this takes the place of "x" to indicate that vector instructions are supported
    "f_supported": true,
    "d_supported": true,
    "V_ext_supported": true
}

Copy link
Contributor

@nadime15 nadime15 Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually like the x_supported, what about:

"vector_configuration": {
  "V_ext_supported" true,
  "vlen_exp": 7,
  "elen_exp": 5,
  "vl_use_ceil": false,
  "x_supported": true,
  "f_supported": true,   
  "d_supported": true,
 }

},
"B": {
"supported": true
Expand Down Expand Up @@ -154,7 +163,7 @@
"supported": true
},
"Zfhmin": {
"supported": false
"supported": true
},
"Zfinx": {
"supported": false
Expand Down Expand Up @@ -226,11 +235,17 @@
"Zhinxmin": {
"supported": false
},
"Zvfh": {
"supported": true
},
"Zvfhmin": {
"supported": true
},
"Zvbb": {
"supported": true
},
"Zvbc": {
"supported": true
"supported": @CONFIG_ELEN_IS_64@
},
"Zvkb": {
"supported": false
Expand All @@ -245,7 +260,7 @@
"supported": true
},
"Zvknhb": {
"supported": true
"supported": @CONFIG_ELEN_IS_64@
},
"Zvksed": {
"supported": true
Expand Down
3 changes: 3 additions & 0 deletions doc/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
- Zicbop
- Zihintntl
- Zihintpause
- Zve32x, Zve32f, Zve64x, Zve64f, and Zve64d
- Zvl32b, Zvl64b, Zvl128b, Zvl256b, Zvl512b, and Zvl1024b
- Zvfh and Zvfhmin
- Svrsw60t59b

- Switch to ELFIO for ELF parsing, and add symbolization in the
Expand Down
60 changes: 60 additions & 0 deletions model/riscv_extensions.sail
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,51 @@ enum clause extension = Ext_Zhinxmin
mapping clause extensionName = Ext_Zhinxmin <-> "zhinxmin"
function clause hartSupports(Ext_Zhinxmin) = config extensions.Zhinxmin.supported

// Standard Vector Extensions
// Minimum Vector Length Standard Extensions
enum clause extension = Ext_Zvl32b
mapping clause extensionName = Ext_Zvl32b <-> "zvl32b"
function clause hartSupports(Ext_Zvl32b) = sizeof(vlen_exp) >= 5
enum clause extension = Ext_Zvl64b
mapping clause extensionName = Ext_Zvl64b <-> "zvl64b"
function clause hartSupports(Ext_Zvl64b) = sizeof(vlen_exp) >= 6
enum clause extension = Ext_Zvl128b
mapping clause extensionName = Ext_Zvl128b <-> "zvl128b"
function clause hartSupports(Ext_Zvl128b) = sizeof(vlen_exp) >= 7
enum clause extension = Ext_Zvl256b
mapping clause extensionName = Ext_Zvl256b <-> "zvl256b"
function clause hartSupports(Ext_Zvl256b) = sizeof(vlen_exp) >= 8
enum clause extension = Ext_Zvl512b
mapping clause extensionName = Ext_Zvl512b <-> "zvl512b"
function clause hartSupports(Ext_Zvl512b) = sizeof(vlen_exp) >= 9
enum clause extension = Ext_Zvl1024b
mapping clause extensionName = Ext_Zvl1024b <-> "zvl1024b"
function clause hartSupports(Ext_Zvl1024b) = sizeof(vlen_exp) >= 10
// Vector Extensions for Embedded Processors
enum clause extension = Ext_Zve32f
mapping clause extensionName = Ext_Zve32f <-> "zve32f"
function clause hartSupports(Ext_Zve32f) = sizeof(elen_exp) >= 5 & config extensions.V.f.supported
enum clause extension = Ext_Zve32x
mapping clause extensionName = Ext_Zve32x <-> "zve32x"
function clause hartSupports(Ext_Zve32x) = sizeof(elen_exp) >= 5 & config extensions.V.x.supported
enum clause extension = Ext_Zve64d
mapping clause extensionName = Ext_Zve64d <-> "zve64d"
function clause hartSupports(Ext_Zve64d) = sizeof(elen_exp) >= 6 & config extensions.V.d.supported
enum clause extension = Ext_Zve64f
mapping clause extensionName = Ext_Zve64f <-> "zve64f"
function clause hartSupports(Ext_Zve64f) = sizeof(elen_exp) >= 6 & config extensions.V.f.supported
enum clause extension = Ext_Zve64x
mapping clause extensionName = Ext_Zve64x <-> "zve64x"
function clause hartSupports(Ext_Zve64x) = sizeof(elen_exp) >= 6 & config extensions.V.x.supported
// Vector Extension for Half-Precision Floating-Point
enum clause extension = Ext_Zvfh
mapping clause extensionName = Ext_Zvfh <-> "zvfh"
function clause hartSupports(Ext_Zvfh) = config extensions.Zvfh.supported
// Vector Extension for Minimal Half-Precision Floating-Point
enum clause extension = Ext_Zvfhmin
mapping clause extensionName = Ext_Zvfhmin <-> "zvfhmin"
function clause hartSupports(Ext_Zvfhmin) = config extensions.Zvfhmin.supported

// Vector Basic Bit-manipulation
enum clause extension = Ext_Zvbb
mapping clause extensionName = Ext_Zvbb <-> "zvbb"
Expand Down Expand Up @@ -470,6 +515,21 @@ let extensions_ordered_for_isa_string = [
Ext_Zksh,
Ext_Zkt,

// Zvl, Zve and Zvfh
Ext_Zvl32b,
Ext_Zvl64b,
Ext_Zvl128b,
Ext_Zvl256b,
Ext_Zvl512b,
Ext_Zvl1024b,
Ext_Zve32f,
Ext_Zve32x,
Ext_Zve64d,
Ext_Zve64f,
Ext_Zve64x,
Ext_Zvfh,
Ext_Zvfhmin,

// Zv
Ext_Zvbb,
Ext_Zvbc,
Expand Down
Loading
Loading