Z_Yy^V1vScXMr0Nc=9v)7
zO=BRbJh08TLh<-O$o6CYLMs1OPxQKMaQEW|Br0<=lM+6Ro
z!D2^&rFiXtCTpt^S=dgU7^C))!qsMYvqfLZA_zNaM0}TpRQQ=17M|k+?`8-Zq(yMR
zuV?R5KVu43*P|K8Kli>RRD9sK1bM3?y&(N6RCopWAEf`jrFV|sq9=wjb3j|kaEF{lM8CjS7FG58L-kgGL>>G2Dv>`mt2$%3f??!?^#+9r29WWeS4
z`7Q`{3C`%;g90D#{HOK35vgJHw097n>^x&iqDPpfx_LBO;lM<}@rYeOJ@vp0w=A0x
zheM`IPq3y^bm_TPE}LDiH+IjR;(~|l`;gISy9?!0$07jkbMW1`f?K{W~SgSFaE+=5A1T_t8Ses9PSW8NuXg51BftU^w5b2l
zX(jWONQ_wP72UozUv7!VI0Z)*G?;I45PrgwCxJ7srDVWM0TCjVW8O&sc_Htc%saH}
zS5jA5p9{XOt#JnxjAehIT1tRBz31qsjkC_hGScix`Mm8FaopaM`;Cx9T&VrLVr5K$
zz9K6-?32D>N6*NZ{s@X-t~jY;q1k_@b*JCy+&*r+_!(Ao~>24HatrMt!v%DA6#1kcF>KN)v&pd@X74~
zsTO~rmA3VbnDq#HN4@lDIGP`M`MO%KVfeU;M2z$$t4
z?PJ6HK<5rUoFPiQY&7(VCx>wO=B?wJtOXRxKs8$q5Q5L{C6YF9CKLmGZBPAat*I0X
z5TYDKSqT9}Qqyi#$ygS&6=m63;P*GWq^{B++e$RVN=_P@2cF9L06HZe!y0m^NG;V~
zpSPHYi@8XI(+5pe|EYXr$
zJV#>Pxsk1{)LyvcB@{oB0sSR5JCnE);=(9NXiZxqHPg#i?<^>&D(GQONlvR>A)Byg
zYG>1s7Xewpjs;*PDeY5$VzDRtX4^5xQr8IfkiQL3vpiA;SXJ|FN`bvr{5O6xk?Si-0pd=wVoBwmwd0+!X$=Ic;UaTYm4q70vsm
zz~F^u;Crh2xhUXNSyH(3Wc=}}90^^n9qk7MjXWSF{XnXQ(9hu*ZjnnGxhw5o$GM)5
zB8L)M%zkH`mEg)@Y}S1@2S-;!80R@~YrE^|2K~06A?!@OkSLAbsp-nREOjiLa-2UBY&C!
zZ8rg(l(3z>cURxix^gR3EK=B1A|re7oe}@x8L}B~Z6G#>s*UgJ44A
zdEMWbDZKQ1RLJx7)kw3G3fChNRtw|+B$jZewZDATh^BwX^X+Yrcj+L!`KbxC87~Bf
z;n2V}kyy=u+F-gxyjd;GJ@4LFw$T!O`ME!-)gWq>z
z02%rot&zdDq*#M8_~mzgI`DlAR$~Q5)$`e|<4q$zTiG?K2L}mvj@%j+bqTTZ)}DIW
z{RX~aeJN{?*fVU^0Qy_BcbTD&?^;r*G*`>x0=?!gnwoi6d+CTVu2Z*Y2&VBt}p|l`!=6Ah92ICo~yhTF{U%Ln~
zX7xa@0toSl<$;0Xc^fLx^O>!u6#c$J)u-;ZU37!yGZgko-7h~uW;N%^^34K1I>YS@
zg=R81D)=2J5Ve7UG2;5KRW8h)?r1A_%z|YABS9^)F5ZGYXTi%@bh|#vox%gZb&5+u
z;_~p3(g6VK50^AFB17M9VAYH%GdU`DLH7$n4s$NFiu8#S6+1o-fzgAqri?Im_{9f6
zEI+uhaV+1TVj~`>)dZZ4E*8>{Zkx<6*!03Vo3=N3_~^+%Z4Cq3J$$%e@$nrqLaS9XA*T&z8CoXl(*5z9o1aboLo?Xa8rvF37E!o5?KlOha0U
zcAMG7C3mjvm<0;Wu0kE;*Z+ysQjS<>d{X#*?!SO@Uy&q_Kq*Z7^1i}VbetjEkV-r0
zG6j008MdX(oYA^m&af}Zd!A=Q>|!T%s;Co1TAypurWd!?A6UC5^HANNHJ&2nzxn*_
z)wLKc)co7Q(XQh;fu^p)Mr6HHR|LqC=#nW1
z=?c@ZSWE5T+#{P>VnDhXuOMB2P=1V&Sf3+!No1cfV==pqd7wGr&5x^`+hq@T5@bu$
z?ponrPi%Vc&YF36h0B~jpcmm{jY5oO{tbh}gJ%(}{*pAF=4F2~SIrX3yVdp*Qb*Fb
za?aTYWG*qhM$t8r-R#|gM;1Ff_ei}n{y)}RJu`MW8Te6w=Tuh3eA}~NBuH6sM_Ic;
zuMAwVVAcd#HT1Uo58PUO&yQ#f+}lgoy7o6t%5Tn3ii_|z11}{vUUSX>xd71FKfy%}
zfEyr}_q{u7%V+n&pOVST?GSpw7b(CIYhM>6utTgo7?E3_DF-D;@X=j>MB=08Rkff%@jEi8ar4j8f9@s!ok@pFZPNrr
zD|d`R<1KJil=4&V4dVZeCMBKd0<)_dSP6T3>fPES?#|J
zpnos30tOVQ)uRnA9qsq0fgSsYr}Xb-*T6(-Wbgb%Q-E6IekphV|CvZ67Vu|gY<;fS$Tjl+0R^3k
AQ2+n{
literal 0
HcmV?d00001
diff --git a/docs/04_cv32a65x/design/source/cv32a6_execute.rst b/docs/04_cv32a65x/design/source/cv32a6_execute.rst
index c411d44eda..57d4899342 100644
--- a/docs/04_cv32a65x/design/source/cv32a6_execute.rst
+++ b/docs/04_cv32a65x/design/source/cv32a6_execute.rst
@@ -139,16 +139,27 @@ Furthermore, the store_unit module provides information to the load_unit to know
load_unit
---------
-The load_unit module manages the data load operations.
+The load unit module manages the data load operations.
Before issuing a load, the load unit needs to check the store buffer for potential aliasing.
-It inserts stalls until it can satisfy the current request. This means:
+It stalls until it can satisfy the current request. This means:
* Two loads to the same address are allowed.
* Two stores to the same address are allowed.
-* A store followed by a load to the same address can only be satisfied if the store has already been committed (marked as committed in the store buffer).
+* A store after a load to the same address is allowed.
+* A load after a store to the same address can only be processed if the store has already been sent to the cache i.e there is no fowarding.
-.. TO_BE_COMPLETED, But once the store is committed, do we do forwarding without waiting for the store to actually be finished? Or do we authorize the outcome of the load, which will be carried out in memory/cache?
+After the check of the store buffer, a read request is sent to the D$ with the index field of the address (1).
+The load unit stalls until the D$ acknowledges this request (2).
+In the next cycle, the tag field of the address is sent to the D$ (3).
+If the load request address is non-idempotent, it stalls until the write buffer of the D$ is empty of non-idempotent requests and the store buffer is empty.
+It also stalls until the incoming load instruction is the next instruction to be committed.
+When the D$ allows the read of the data, the data is sent to the load unit and the load instruction can be committed (4).
+
+.. figure:: ../images/schema_fsm_load_control.png
+ :align: center
+
+ Load unit's interactions
.. include:: port_load_unit.rst
@@ -157,7 +168,7 @@ It inserts stalls until it can satisfy the current request. This means:
lsu_bypass
----------
-TO BE COMPLETED
+The LSU bypass is a FIFO which keeps instructions from the issue stage when the store unit or the load unit are not available immediately.
.. include:: port_lsu_bypass.rst
diff --git a/docs/04_cv32a65x/design/source/port_load_unit.rst b/docs/04_cv32a65x/design/source/port_load_unit.rst
index 9461f65e5d..99a2ff7d13 100644
--- a/docs/04_cv32a65x/design/source/port_load_unit.rst
+++ b/docs/04_cv32a65x/design/source/port_load_unit.rst
@@ -32,98 +32,98 @@
* - ``flush_i``
- in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
+ - Flush signal
+ - CONTROLLER
- logic
* - ``valid_i``
- in
- - Load unit input port
- - TO_BE_COMPLETED
+ - Load request is valid
+ - LSU_BYPASS
- logic
* - ``lsu_ctrl_i``
- in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
+ - Load request input
+ - LSU_BYPASS
- lsu_ctrl_t
* - ``pop_ld_o``
- out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
+ - Pop the load request from the LSU bypass FIFO
+ - LSU_BYPASS
- logic
* - ``valid_o``
- out
- Load unit result is valid
- - TO_BE_COMPLETED
+ - ISSUE_STAGE
- logic
* - ``trans_id_o``
- out
- Load transaction ID
- - TO_BE_COMPLETED
+ - ISSUE_STAGE
- logic[CVA6Cfg.TRANS_ID_BITS-1:0]
* - ``result_o``
- out
- Load result
- - TO_BE_COMPLETED
+ - ISSUE_STAGE
- logic[CVA6Cfg.XLEN-1:0]
* - ``ex_o``
- out
- Load exception
- - TO_BE_COMPLETED
+ - ISSUE_STAGE
- exception_t
* - ``translation_req_o``
- out
- Request address translation
- - TO_BE_COMPLETED
+ - MMU
- logic
* - ``vaddr_o``
- out
- Virtual address
- - TO_BE_COMPLETED
+ - MMU
- logic[CVA6Cfg.VLEN-1:0]
* - ``paddr_i``
- in
- Physical address
- - TO_BE_COMPLETED
+ - MMU
- logic[CVA6Cfg.PLEN-1:0]
* - ``ex_i``
- in
- Excepted which appears before load
- - TO_BE_COMPLETED
+ - MMU
- exception_t
* - ``page_offset_o``
- out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
+ - Page offset for address checking
+ - STORE_UNIT
- logic[11:0]
* - ``page_offset_matches_i``
- in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
+ - Indicates if the page offset matches a store unit entry
+ - STORE_UNIT
- logic
* - ``store_buffer_empty_i``
- in
- Store buffer is empty
- - TO_BE_COMPLETED
+ - STORE_UNIT
- logic
* - ``commit_tran_id_i``
- in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
+ - Transaction ID of the committing instruction
+ - COMMIT_STAGE
- logic[CVA6Cfg.TRANS_ID_BITS-1:0]
* - ``req_port_i``
@@ -140,8 +140,8 @@
* - ``dcache_wbuffer_not_ni_i``
- in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
+ - Presence of non-idempotent operations in the D$ write buffer
+ - CACHES
- logic
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
From 0cbd894a7a03677e005813ab1b831a7a88e03743 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me?= <124148386+cathales@users.noreply.github.com>
Date: Fri, 12 Jul 2024 17:00:36 +0200
Subject: [PATCH 010/183] update port and config docs (#2363)
---
core/include/config_pkg.sv | 4 +-
.../01_cva6_user/Parameters_Configuration.rst | 61 +---
docs/01_cva6_user/user_cfg_doc.rst | 321 ++++++++++++++++++
.../design/source/parameters_cv32a65x.rst | 36 +-
.../design/source/port_branch_unit.rst | 6 -
.../design/source/port_commit_stage.rst | 6 +
.../design/source/port_ex_stage.rst | 30 +-
.../design/source/port_frontend.rst | 6 +-
.../design/source/port_id_stage.rst | 16 +-
.../design/source/port_instr_queue.rst | 6 +-
.../source/port_issue_read_operands.rst | 50 +--
.../design/source/port_issue_stage.rst | 40 ++-
.../design/source/port_load_store_unit.rst | 4 +-
.../design/source/port_scoreboard.rst | 38 ++-
docs/scripts/spec_builder.py | 52 ++-
15 files changed, 514 insertions(+), 162 deletions(-)
create mode 100644 docs/01_cva6_user/user_cfg_doc.rst
diff --git a/core/include/config_pkg.sv b/core/include/config_pkg.sv
index 4186f91210..927078d622 100644
--- a/core/include/config_pkg.sv
+++ b/core/include/config_pkg.sv
@@ -170,7 +170,7 @@ package config_pkg;
bit FpgaEn;
// Is Techno Cut instanciated
bit TechnoCut;
- // Enable superscalar with 2 issue ports and 2 commit ports
+ // Enable superscalar* with 2 issue ports and 2 commit ports.
bit SuperscalarEn;
// Number of commit ports. Forced to 2 if SuperscalarEn.
int unsigned NrCommitPorts;
@@ -366,6 +366,8 @@ package config_pkg;
assert (Cfg.NrExecuteRegionRules <= NrMaxRules);
assert (Cfg.NrCachedRegionRules <= NrMaxRules);
assert (Cfg.NrPMPEntries <= 64);
+ assert (!(Cfg.SuperscalarEn && Cfg.RVF));
+ assert (!(Cfg.SuperscalarEn && Cfg.RVZCMP));
`endif
// pragma translate_on
endfunction
diff --git a/docs/01_cva6_user/Parameters_Configuration.rst b/docs/01_cva6_user/Parameters_Configuration.rst
index fc8a001127..b3117a6b8a 100644
--- a/docs/01_cva6_user/Parameters_Configuration.rst
+++ b/docs/01_cva6_user/Parameters_Configuration.rst
@@ -27,58 +27,15 @@ Main contributor: Jean-Roch Coulon - Thales
Parameters
----------
-.. csv-table::
- :widths: auto
- :align: left
- :header: "Parameter", "Category", "Description"
-
- "``Cva6MArchID``", "Archi", "Cva6 architecture ID"
- "``Xlen``", "Variant", "Data length"
- "``CExtEn``", "Variant", "C extension enable"
- "``AExtEn``", "Variant", "A extension enable"
- "``BMExtEn``", "Variant", "Bit Manipulation extension enable"
- "``FpuEn``", "Variant", "FPU enable"
- "``F16En``", "Variant", "FPU 16bits enable"
- "``F16AltEn``", "Variant", "FPU Alt 16bits enable"
- "``F8En``", "Variant", "FPU 8bits enable"
- "``FVecEn``", "Variant", "Vector FPU enable"
- "``MMUEn``", "Memory", "MMU Present"
- "``InstrTlbEntries``", "Memory", "Instruction TLB entry number"
- "``DataTlbEntries``", "Memory", "Data TLB entry number"
- "``RASDepth``", "Memory", "Depth of Return Address Stack"
- "``BTBEntries``", "Memory", "BTB entry number"
- "``BHTEntries``", "Memory", "BHT entry number"
- "``NrNonIdempotentRules``", "Memory", "Number of non idempotent region"
- "``NonIdempotentAddrBase``", "Memory", "Base address of non idempotent region"
- "``NonIdempotentLength``", "Memory", "Length of non idempotent region"
- "``NrExecuteRegionRules``", "Memory", "Number of excution regions"
- "``ExecuteRegionAddrBase``", "Memory", "Execution region of base address (DRAM, Boot ROM and Debug Module)"
- "``ExecuteRegionLength``", "Memory", "Length of execution region"
- "``NrCachedRegionRules``", "Memory", "Number of cached region"
- "``CachedRegionAddrBase``", "Memory", "Base address of cached region"
- "``CachedRegionLength``", "Memory", "Length of cached regions"
- "``NrPMPEntries``", "Memory", "Number of PMP entries"
- "``DmBaseAddress``", "Debug", "Base address of debug"
- "``CvxifEn``", "Ports", "CV-X-IF interface enable"
- "``RVFI_TRACE (define)``", "Ports", "RVFI interface enable"
- "``FIRESIM_TRACE (define)``", "Ports", "FIRESIM interface enable"
- "``PITON_ARIANE (define)``", "Ports", "Piton interface enable, and AXI interface disable"
- "``WT_CACHE (define)``", "Caches", "Write through cache enable, write back cache disable"
- "``DepthStoreBuffer``", "Caches", "Depth of store buffer"
- "``IcacheSetAssoc``", "Caches", "Instruction cache way number"
- "``DcacheSetAssoc``", "Caches", "Data cache way number"
- "``NrLoadPipeRegs``", "Caches", "Number of stall on load operation"
- "``NrStorePipeRegs``", "Caches", "Number of stall on store operation"
- "``AxiCompliant``", "Caches", "Cache configuration: AXI or XXXX"
- "``SwapEndianess``", "Caches", "Endianess of cache: XXXX"
- "``FetchUserEn``", "Users", "Fetch AXI user bit enable"
- "``FetchUserWidth``", "Users", "Fetch user bit number when enabled"
- "``DataUserEn``", "Users", "Data AXI user bit enable"
- "``DataUserWidth``", "Users", "Data user bit number when enabled"
- "``RenameEn``", "Pipeline", "Register renaming feature enable"
- "``NrCommitPorts``", "Pipeline", "Commit port number"
- "``NrScoreboardEntries``", "Pipeline", "Scoreboard entry number"
- "``FpgaEn``", "Technology", "FPGA optimization enable"
+.. include:: user_cfg_doc.rst
+
+\*: Some parameters are incompatible with others:
+
+- ``SuperscalarEn``:
+
+ - Not compatible with floating point (``RVF``, ``RVD``, ``XF16``, ``XF16ALT``, ``XF8``, ``XFVec``) yet.
+ - Not compatible with macro instructions (``RVZCMP``) yet.
+ - Recommended to set ``NrScoreboardEntries`` to at least 8 for performance.
Configurations
diff --git a/docs/01_cva6_user/user_cfg_doc.rst b/docs/01_cva6_user/user_cfg_doc.rst
new file mode 100644
index 0000000000..d0e52b1a1b
--- /dev/null
+++ b/docs/01_cva6_user/user_cfg_doc.rst
@@ -0,0 +1,321 @@
+..
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+
+.. _cva6_user_cfg_doc:
+
+.. list-table:: ``cva6_user_cfg_t`` parameters
+ :header-rows: 1
+
+ * - Name
+ - Type
+ - Description
+
+ * - ``XLEN``
+ - ``int unsigned``
+ - General Purpose Register Size (in bits)
+
+ * - ``RVA``
+ - ``bit``
+ - Atomic RISC-V extension
+
+ * - ``RVB``
+ - ``bit``
+ - Bit manipulation RISC-V extension
+
+ * - ``RVV``
+ - ``bit``
+ - Vector RISC-V extension
+
+ * - ``RVC``
+ - ``bit``
+ - Compress RISC-V extension
+
+ * - ``RVH``
+ - ``bit``
+ - Hypervisor RISC-V extension
+
+ * - ``RVZCB``
+ - ``bit``
+ - Zcb RISC-V extension
+
+ * - ``RVZCMP``
+ - ``bit``
+ - Zcmp RISC-V extension
+
+ * - ``RVZiCond``
+ - ``bit``
+ - Zicond RISC-V extension
+
+ * - ``RVZicntr``
+ - ``bit``
+ - Zicntr RISC-V extension
+
+ * - ``RVZihpm``
+ - ``bit``
+ - Zihpm RISC-V extension
+
+ * - ``RVF``
+ - ``bit``
+ - Floating Point
+
+ * - ``RVD``
+ - ``bit``
+ - Floating Point
+
+ * - ``XF16``
+ - ``bit``
+ - Non standard 16bits Floating Point extension
+
+ * - ``XF16ALT``
+ - ``bit``
+ - Non standard 16bits Floating Point Alt extension
+
+ * - ``XF8``
+ - ``bit``
+ - Non standard 8bits Floating Point extension
+
+ * - ``XFVec``
+ - ``bit``
+ - Non standard Vector Floating Point extension
+
+ * - ``PerfCounterEn``
+ - ``bit``
+ - Perf counters
+
+ * - ``MmuPresent``
+ - ``bit``
+ - MMU
+
+ * - ``RVS``
+ - ``bit``
+ - Supervisor mode
+
+ * - ``RVU``
+ - ``bit``
+ - User mode
+
+ * - ``DebugEn``
+ - ``bit``
+ - Debug support
+
+ * - ``DmBaseAddress``
+ - ``logic [63:0]``
+ - Base address of the debug module
+
+ * - ``HaltAddress``
+ - ``logic [63:0]``
+ - Address to jump when halt request
+
+ * - ``ExceptionAddress``
+ - ``logic [63:0]``
+ - Address to jump when exception
+
+ * - ``TvalEn``
+ - ``bit``
+ - Tval Support Enable
+
+ * - ``DirectVecOnly``
+ - ``bit``
+ - MTVEC CSR supports only direct mode
+
+ * - ``NrPMPEntries``
+ - ``int unsigned``
+ - PMP entries number
+
+ * - ``PMPCfgRstVal``
+ - ``logic [63:0][63:0]``
+ - PMP CSR configuration reset values
+
+ * - ``PMPAddrRstVal``
+ - ``logic [63:0][63:0]``
+ - PMP CSR address reset values
+
+ * - ``PMPEntryReadOnly``
+ - ``bit [63:0]``
+ - PMP CSR read-only bits
+
+ * - ``NrNonIdempotentRules``
+ - ``int unsigned``
+ - PMA non idempotent rules number
+
+ * - ``NonIdempotentAddrBase``
+ - ``logic [NrMaxRules-1:0][63:0]``
+ - PMA NonIdempotent region base address
+
+ * - ``NonIdempotentLength``
+ - ``logic [NrMaxRules-1:0][63:0]``
+ - PMA NonIdempotent region length
+
+ * - ``NrExecuteRegionRules``
+ - ``int unsigned``
+ - PMA regions with execute rules number
+
+ * - ``ExecuteRegionAddrBase``
+ - ``logic [NrMaxRules-1:0][63:0]``
+ - PMA Execute region base address
+
+ * - ``ExecuteRegionLength``
+ - ``logic [NrMaxRules-1:0][63:0]``
+ - PMA Execute region address base
+
+ * - ``NrCachedRegionRules``
+ - ``int unsigned``
+ - PMA regions with cache rules number
+
+ * - ``CachedRegionAddrBase``
+ - ``logic [NrMaxRules-1:0][63:0]``
+ - PMA cache region base address
+
+ * - ``CachedRegionLength``
+ - ``logic [NrMaxRules-1:0][63:0]``
+ - PMA cache region rules
+
+ * - ``CvxifEn``
+ - ``bit``
+ - CV-X-IF coprocessor interface enable
+
+ * - ``NOCType``
+ - ``noc_type_e``
+ - NOC bus type
+
+ * - ``AxiAddrWidth``
+ - ``int unsigned``
+ - AXI address width
+
+ * - ``AxiDataWidth``
+ - ``int unsigned``
+ - AXI data width
+
+ * - ``AxiIdWidth``
+ - ``int unsigned``
+ - AXI ID width
+
+ * - ``AxiUserWidth``
+ - ``int unsigned``
+ - AXI User width
+
+ * - ``AxiBurstWriteEn``
+ - ``bit``
+ - AXI burst in write
+
+ * - ``MemTidWidth``
+ - ``int unsigned``
+ - TODO
+
+ * - ``IcacheByteSize``
+ - ``int unsigned``
+ - Instruction cache size (in bytes)
+
+ * - ``IcacheSetAssoc``
+ - ``int unsigned``
+ - Instruction cache associativity (number of ways)
+
+ * - ``IcacheLineWidth``
+ - ``int unsigned``
+ - Instruction cache line width
+
+ * - ``DCacheType``
+ - ``cache_type_t``
+ - Cache Type
+
+ * - ``DcacheIdWidth``
+ - ``int unsigned``
+ - Data cache ID
+
+ * - ``DcacheByteSize``
+ - ``int unsigned``
+ - Data cache size (in bytes)
+
+ * - ``DcacheSetAssoc``
+ - ``int unsigned``
+ - Data cache associativity (number of ways)
+
+ * - ``DcacheLineWidth``
+ - ``int unsigned``
+ - Data cache line width
+
+ * - ``DataUserEn``
+ - ``int unsigned``
+ - User field on data bus enable
+
+ * - ``WtDcacheWbufDepth``
+ - ``int unsigned``
+ - Write-through data cache write buffer depth
+
+ * - ``FetchUserEn``
+ - ``int unsigned``
+ - User field on fetch bus enable
+
+ * - ``FetchUserWidth``
+ - ``int unsigned``
+ - Width of fetch user field
+
+ * - ``FpgaEn``
+ - ``bit``
+ - Is FPGA optimization of CV32A6
+
+ * - ``TechnoCut``
+ - ``bit``
+ - Is Techno Cut instanciated
+
+ * - ``SuperscalarEn``
+ - ``bit``
+ - Enable superscalar* with 2 issue ports and 2 commit ports.
+
+ * - ``NrCommitPorts``
+ - ``int unsigned``
+ - Number of commit ports. Forced to 2 if SuperscalarEn.
+
+ * - ``NrLoadPipeRegs``
+ - ``int unsigned``
+ - Load cycle latency number
+
+ * - ``NrStorePipeRegs``
+ - ``int unsigned``
+ - Store cycle latency number
+
+ * - ``NrScoreboardEntries``
+ - ``int unsigned``
+ - Scoreboard length
+
+ * - ``NrLoadBufEntries``
+ - ``int unsigned``
+ - Load buffer entry buffer
+
+ * - ``MaxOutstandingStores``
+ - ``int unsigned``
+ - Maximum number of outstanding stores
+
+ * - ``RASDepth``
+ - ``int unsigned``
+ - Return address stack depth
+
+ * - ``BTBEntries``
+ - ``int unsigned``
+ - Branch target buffer entries
+
+ * - ``BHTEntries``
+ - ``int unsigned``
+ - Branch history entries
+
+ * - ``InstrTlbEntries``
+ - ``int unsigned``
+ - MMU instruction TLB entries
+
+ * - ``DataTlbEntries``
+ - ``int unsigned``
+ - MMU data TLB entries
+
+ * - ``UseSharedTlb``
+ - ``bit unsigned``
+ - MMU option to use shared TLB
+
+ * - ``SharedTlbDepth``
+ - ``int unsigned``
+ - MMU depth of shared TLB
diff --git a/docs/04_cv32a65x/design/source/parameters_cv32a65x.rst b/docs/04_cv32a65x/design/source/parameters_cv32a65x.rst
index 91c64d617b..7ca2918dd3 100644
--- a/docs/04_cv32a65x/design/source/parameters_cv32a65x.rst
+++ b/docs/04_cv32a65x/design/source/parameters_cv32a65x.rst
@@ -52,6 +52,14 @@
- Zicond RISC-V extension
- False
+ * - RVZicntr
+ - Zicntr RISC-V extension
+ - False
+
+ * - RVZihpm
+ - Zihpm RISC-V extension
+ - False
+
* - RVF
- Floating Point
- False
@@ -112,17 +120,21 @@
- Tval Support Enable
- False
+ * - DirectVecOnly
+ - MTVEC CSR supports only direct mode
+ - True
+
* - NrPMPEntries
- PMP entries number
- 8
* - PMPCfgRstVal
- PMP CSR configuration reset values
- - [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]
+ - [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]
* - PMPAddrRstVal
- PMP CSR address reset values
- - [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]
+ - [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]
* - PMPEntryReadOnly
- PMP CSR read-only bits
@@ -218,11 +230,11 @@
* - DcacheByteSize
- Data cache size (in bytes)
- - 32768
+ - 2028
* - DcacheSetAssoc
- Data cache associativity (number of ways)
- - 8
+ - 2
* - DcacheLineWidth
- Data cache line width
@@ -230,7 +242,7 @@
* - DataUserEn
- User field on data bus enable
- - 0
+ - 1
* - WtDcacheWbufDepth
- Write-through data cache write buffer depth
@@ -238,7 +250,7 @@
* - FetchUserEn
- User field on fetch bus enable
- - 0
+ - 1
* - FetchUserWidth
- Width of fetch user field
@@ -248,8 +260,16 @@
- Is FPGA optimization of CV32A6
- False
+ * - TechnoCut
+ - Is Techno Cut instanciated
+ - True
+
+ * - SuperscalarEn
+ - Enable superscalar* with 2 issue ports and 2 commit ports.
+ - True
+
* - NrCommitPorts
- - Number of commit ports
+ - Number of commit ports. Forced to 2 if SuperscalarEn.
- 1
* - NrLoadPipeRegs
@@ -262,7 +282,7 @@
* - NrScoreboardEntries
- Scoreboard length
- - 4
+ - 8
* - NrLoadBufEntries
- Load buffer entry buffer
diff --git a/docs/04_cv32a65x/design/source/port_branch_unit.rst b/docs/04_cv32a65x/design/source/port_branch_unit.rst
index f8ba461865..e9eb72fb75 100644
--- a/docs/04_cv32a65x/design/source/port_branch_unit.rst
+++ b/docs/04_cv32a65x/design/source/port_branch_unit.rst
@@ -48,12 +48,6 @@
- ISSUE_STAGE
- logic
- * - ``fu_valid_i``
- - in
- - any functional unit is valid, check that there is no accidental mis-predict
- - TO_BE_COMPLETED
- - logic
-
* - ``branch_valid_i``
- in
- Branch unit instruction is valid
diff --git a/docs/04_cv32a65x/design/source/port_commit_stage.rst b/docs/04_cv32a65x/design/source/port_commit_stage.rst
index d710b605ec..8625513436 100644
--- a/docs/04_cv32a65x/design/source/port_commit_stage.rst
+++ b/docs/04_cv32a65x/design/source/port_commit_stage.rst
@@ -54,6 +54,12 @@
- ISSUE_STAGE
- scoreboard_entry_t[CVA6Cfg.NrCommitPorts-1:0]
+ * - ``commit_drop_i``
+ - in
+ - The instruction is cancelled
+ - ISSUE_STAGE
+ - logic[CVA6Cfg.NrCommitPorts-1:0]
+
* - ``commit_ack_o``
- out
- Acknowledge that we are indeed committing
diff --git a/docs/04_cv32a65x/design/source/port_ex_stage.rst b/docs/04_cv32a65x/design/source/port_ex_stage.rst
index 91d59791a9..18a84056f5 100644
--- a/docs/04_cv32a65x/design/source/port_ex_stage.rst
+++ b/docs/04_cv32a65x/design/source/port_ex_stage.rst
@@ -40,19 +40,19 @@
- in
- rs1 forwarding
- ISSUE_STAGE
- - logic[CVA6Cfg.VLEN-1:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0]
* - ``rs2_forwarding_i``
- in
- rs2 forwarding
- ISSUE_STAGE
- - logic[CVA6Cfg.VLEN-1:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0]
* - ``fu_data_i``
- in
- FU data useful to execute instruction
- ISSUE_STAGE
- - fu_data_t
+ - fu_data_t[CVA6Cfg.NrIssuePorts-1:0]
* - ``pc_i``
- in
@@ -62,7 +62,7 @@
* - ``is_compressed_instr_i``
- in
- - Report whether isntruction is compressed
+ - Report whether instruction is compressed
- ISSUE_STAGE
- logic
@@ -100,13 +100,13 @@
- in
- ALU instruction is valid
- ISSUE_STAGE
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``branch_valid_i``
- in
- Branch unit instruction is valid
- ISSUE_STAGE
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``branch_predict_i``
- in
@@ -130,7 +130,7 @@
- in
- CSR instruction is valid
- ISSUE_STAGE
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``csr_addr_o``
- out
@@ -148,7 +148,7 @@
- in
- MULT instruction is valid
- ISSUE_STAGE
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``lsu_ready_o``
- out
@@ -160,7 +160,7 @@
- in
- LSU instruction is valid
- ISSUE_STAGE
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``load_valid_o``
- out
@@ -234,11 +234,17 @@
- COMMIT_STAGE
- logic
+ * - ``alu2_valid_i``
+ - in
+ - ALU2 instruction is valid
+ - ISSUE_STAGE
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
+
* - ``x_valid_i``
- in
- CVXIF instruction is valid
- ISSUE_STAGE
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``x_ready_o``
- out
@@ -334,13 +340,13 @@
- in
- Report the PMP configuration
- CSR_REGFILE
- - riscv::pmpcfg_t[15:0]
+ - riscv::pmpcfg_t[CVA6Cfg.NrPMPEntries:0]
* - ``pmpaddr_i``
- in
- Report the PMP addresses
- CSR_REGFILE
- - logic[15:0][CVA6Cfg.PLEN-3:0]
+ - logic[CVA6Cfg.NrPMPEntries:0][CVA6Cfg.PLEN-3:0]
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
diff --git a/docs/04_cv32a65x/design/source/port_frontend.rst b/docs/04_cv32a65x/design/source/port_frontend.rst
index f92b71fdb9..2f715e294d 100644
--- a/docs/04_cv32a65x/design/source/port_frontend.rst
+++ b/docs/04_cv32a65x/design/source/port_frontend.rst
@@ -106,19 +106,19 @@
- out
- Handshake's data between fetch and decode
- ID_STAGE
- - fetch_entry_t[ariane_pkg::SUPERSCALAR:0]
+ - fetch_entry_t[CVA6Cfg.NrIssuePorts-1:0]
* - ``fetch_entry_valid_o``
- out
- Handshake's valid between fetch and decode
- ID_STAGE
- - logic[ariane_pkg::SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``fetch_entry_ready_i``
- in
- Handshake's ready between fetch and decode
- ID_STAGE
- - logic[ariane_pkg::SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
diff --git a/docs/04_cv32a65x/design/source/port_id_stage.rst b/docs/04_cv32a65x/design/source/port_id_stage.rst
index 687850512a..f7a4b0c799 100644
--- a/docs/04_cv32a65x/design/source/port_id_stage.rst
+++ b/docs/04_cv32a65x/design/source/port_id_stage.rst
@@ -40,49 +40,49 @@
- in
- Handshake's data between fetch and decode
- FRONTEND
- - fetch_entry_t[ariane_pkg::SUPERSCALAR:0]
+ - fetch_entry_t[CVA6Cfg.NrIssuePorts-1:0]
* - ``fetch_entry_valid_i``
- in
- Handshake's valid between fetch and decode
- FRONTEND
- - logic[ariane_pkg::SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``fetch_entry_ready_o``
- out
- Handshake's ready between fetch and decode
- FRONTEND
- - logic[ariane_pkg::SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``issue_entry_o``
- out
- Handshake's data between decode and issue
- ISSUE
- - scoreboard_entry_t[ariane_pkg::SUPERSCALAR:0]
+ - scoreboard_entry_t[CVA6Cfg.NrIssuePorts-1:0]
* - ``orig_instr_o``
- out
- Instruction value
- ISSUE
- - logic[ariane_pkg::SUPERSCALAR:0][31:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
* - ``issue_entry_valid_o``
- out
- Handshake's valid between decode and issue
- ISSUE
- - logic[ariane_pkg::SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``is_ctrl_flow_o``
- out
- Report if instruction is a control flow instruction
- ISSUE
- - logic[ariane_pkg::SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``issue_instr_ack_i``
- in
- Handshake's acknowlege between decode and issue
- ISSUE
- - logic[ariane_pkg::SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``irq_i``
- in
diff --git a/docs/04_cv32a65x/design/source/port_instr_queue.rst b/docs/04_cv32a65x/design/source/port_instr_queue.rst
index b5a73da1a3..5217fcd227 100644
--- a/docs/04_cv32a65x/design/source/port_instr_queue.rst
+++ b/docs/04_cv32a65x/design/source/port_instr_queue.rst
@@ -106,19 +106,19 @@
- out
- Handshake’s data with ID_STAGE
- ID_STAGE
- - fetch_entry_t[ariane_pkg::SUPERSCALAR:0]
+ - fetch_entry_t[CVA6Cfg.NrIssuePorts-1:0]
* - ``fetch_entry_valid_o``
- out
- Handshake’s valid with ID_STAGE
- ID_STAGE
- - logic[ariane_pkg::SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``fetch_entry_ready_i``
- in
- Handshake’s ready with ID_STAGE
- ID_STAGE
- - logic[ariane_pkg::SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
diff --git a/docs/04_cv32a65x/design/source/port_issue_read_operands.rst b/docs/04_cv32a65x/design/source/port_issue_read_operands.rst
index d8f742ff93..946bdf1b8d 100644
--- a/docs/04_cv32a65x/design/source/port_issue_read_operands.rst
+++ b/docs/04_cv32a65x/design/source/port_issue_read_operands.rst
@@ -40,79 +40,79 @@
- in
- TO_BE_COMPLETED
- TO_BE_COMPLETED
- - scoreboard_entry_t
+ - scoreboard_entry_t[CVA6Cfg.NrIssuePorts-1:0]
* - ``orig_instr_i``
- in
- TO_BE_COMPLETED
- TO_BE_COMPLETED
- - logic[31:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
* - ``issue_instr_valid_i``
- in
- TO_BE_COMPLETED
- TO_BE_COMPLETED
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``issue_ack_o``
- out
- Issue stage acknowledge
- TO_BE_COMPLETED
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``rs1_o``
- out
- rs1 operand address
- scoreboard
- - logic[REG_ADDR_SIZE-1:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][REG_ADDR_SIZE-1:0]
* - ``rs1_i``
- in
- rs1 operand
- scoreboard
- - logic[CVA6Cfg.XLEN-1:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
* - ``rs1_valid_i``
- in
- rs1 operand is valid
- scoreboard
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``rs2_o``
- out
- rs2 operand address
- scoreboard
- - logic[REG_ADDR_SIZE-1:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][REG_ADDR_SIZE-1:0]
* - ``rs2_i``
- in
- rs2 operand
- scoreboard
- - logic[CVA6Cfg.XLEN-1:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
* - ``rs2_valid_i``
- in
- rs2 operand is valid
- scoreboard
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``rs3_o``
- out
- rs3 operand address
- scoreboard
- - logic[REG_ADDR_SIZE-1:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][REG_ADDR_SIZE-1:0]
* - ``rs3_i``
- in
- rs3 operand
- scoreboard
- - rs3_len_t
+ - rs3_len_t[CVA6Cfg.NrIssuePorts-1:0]
* - ``rs3_valid_i``
- in
- rs3 operand is valid
- scoreboard
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``rd_clobber_gpr_i``
- in
@@ -130,19 +130,19 @@
- out
- TO_BE_COMPLETED
- TO_BE_COMPLETED
- - fu_data_t
+ - fu_data_t[CVA6Cfg.NrIssuePorts-1:0]
* - ``rs1_forwarding_o``
- out
- Unregistered version of fu_data_o.operanda
- TO_BE_COMPLETED
- - logic[CVA6Cfg.XLEN-1:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
* - ``rs2_forwarding_o``
- out
- Unregistered version of fu_data_o.operandb
- TO_BE_COMPLETED
- - logic[CVA6Cfg.XLEN-1:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
* - ``pc_o``
- out
@@ -166,13 +166,13 @@
- out
- ALU output is valid
- TO_BE_COMPLETED
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``branch_valid_o``
- out
- Branch instruction is valid
- TO_BE_COMPLETED
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``branch_predict_o``
- out
@@ -190,25 +190,31 @@
- out
- Load Store Unit result is valid
- TO_BE_COMPLETED
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``mult_valid_o``
- out
- Mult result is valid
- TO_BE_COMPLETED
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
+
+ * - ``alu2_valid_o``
+ - out
+ - ALU output is valid
+ - TO_BE_COMPLETED
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``csr_valid_o``
- out
- CSR result is valid
- TO_BE_COMPLETED
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``cvxif_valid_o``
- out
- CVXIF result is valid
- TO_BE_COMPLETED
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``cvxif_ready_i``
- in
diff --git a/docs/04_cv32a65x/design/source/port_issue_stage.rst b/docs/04_cv32a65x/design/source/port_issue_stage.rst
index 0fa740fd3c..7e5b9b27e2 100644
--- a/docs/04_cv32a65x/design/source/port_issue_stage.rst
+++ b/docs/04_cv32a65x/design/source/port_issue_stage.rst
@@ -46,49 +46,49 @@
- in
- Handshake's data with decode stage
- ID_STAGE
- - scoreboard_entry_t[SUPERSCALAR:0]
+ - scoreboard_entry_t[CVA6Cfg.NrIssuePorts-1:0]
* - ``orig_instr_i``
- in
- instruction value
- ID_STAGE
- - logic[SUPERSCALAR:0][31:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
* - ``decoded_instr_valid_i``
- in
- Handshake's valid with decode stage
- ID_STAGE
- - logic[SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``is_ctrl_flow_i``
- in
- Is instruction a control flow instruction
- ID_STAGE
- - logic[SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``decoded_instr_ack_o``
- out
- Handshake's acknowlege with decode stage
- ID_STAGE
- - logic[SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``rs1_forwarding_o``
- out
- rs1 forwarding
- EX_STAGE
- - [CVA6Cfg.VLEN-1:0]
+ - [CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0]
* - ``rs2_forwarding_o``
- out
- rs2 forwarding
- EX_STAGE
- - [CVA6Cfg.VLEN-1:0]
+ - [CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0]
* - ``fu_data_o``
- out
- FU data useful to execute instruction
- EX_STAGE
- - fu_data_t
+ - fu_data_t[CVA6Cfg.NrIssuePorts-1:0]
* - ``pc_o``
- out
@@ -112,7 +112,7 @@
- out
- ALU FU is valid
- EX_STAGE
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``resolve_branch_i``
- in
@@ -130,13 +130,13 @@
- out
- Load store unit FU is valid
- EX_STAGE
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``branch_valid_o``
- out
- Branch unit is valid
- EX_STAGE
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``branch_predict_o``
- out
@@ -148,19 +148,25 @@
- out
- Mult FU is valid
- EX_STAGE
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
+
+ * - ``alu2_valid_o``
+ - out
+ - ALU2 FU is valid
+ - EX_STAGE
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``csr_valid_o``
- out
- CSR is valid
- EX_STAGE
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``x_issue_valid_o``
- out
- CVXIF FU is valid
- EX_STAGE
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``x_issue_ready_i``
- in
@@ -234,6 +240,12 @@
- COMMIT_STAGE
- scoreboard_entry_t[CVA6Cfg.NrCommitPorts-1:0]
+ * - ``commit_drop_o``
+ - out
+ - Instruction is cancelled
+ - COMMIT_STAGE
+ - logic[CVA6Cfg.NrCommitPorts-1:0]
+
* - ``commit_ack_i``
- in
- Commit acknowledge
diff --git a/docs/04_cv32a65x/design/source/port_load_store_unit.rst b/docs/04_cv32a65x/design/source/port_load_store_unit.rst
index ea49497f4c..8f3c1fe798 100644
--- a/docs/04_cv32a65x/design/source/port_load_store_unit.rst
+++ b/docs/04_cv32a65x/design/source/port_load_store_unit.rst
@@ -172,13 +172,13 @@
- in
- PMP configuration
- CSR_REGFILE
- - riscv::pmpcfg_t[15:0]
+ - riscv::pmpcfg_t[CVA6Cfg.NrPMPEntries:0]
* - ``pmpaddr_i``
- in
- PMP address
- CSR_REGFILE
- - logic[15:0][CVA6Cfg.PLEN-3:0]
+ - logic[CVA6Cfg.NrPMPEntries:0][CVA6Cfg.PLEN-3:0]
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
diff --git a/docs/04_cv32a65x/design/source/port_scoreboard.rst b/docs/04_cv32a65x/design/source/port_scoreboard.rst
index aa3b2bf472..ad5afa9757 100644
--- a/docs/04_cv32a65x/design/source/port_scoreboard.rst
+++ b/docs/04_cv32a65x/design/source/port_scoreboard.rst
@@ -64,55 +64,55 @@
- in
- rs1 operand address
- issue_read_operands
- - logic[ariane_pkg::REG_ADDR_SIZE-1:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0]
* - ``rs1_o``
- out
- rs1 operand
- issue_read_operands
- - logic[CVA6Cfg.XLEN-1:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
* - ``rs1_valid_o``
- out
- rs1 operand is valid
- issue_read_operands
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``rs2_i``
- in
- rs2 operand address
- issue_read_operands
- - logic[ariane_pkg::REG_ADDR_SIZE-1:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0]
* - ``rs2_o``
- out
- rs2 operand
- issue_read_operands
- - logic[CVA6Cfg.XLEN-1:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
* - ``rs2_valid_o``
- out
- rs2 operand is valid
- issue_read_operands
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``rs3_i``
- in
- rs3 operand address
- issue_read_operands
- - logic[ariane_pkg::REG_ADDR_SIZE-1:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0]
* - ``rs3_o``
- out
- rs3 operand
- issue_read_operands
- - rs3_len_t
+ - rs3_len_t[CVA6Cfg.NrIssuePorts-1:0]
* - ``rs3_valid_o``
- out
- rs3 operand is valid
- issue_read_operands
- - logic
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``commit_instr_o``
- out
@@ -120,6 +120,12 @@
- TO_BE_COMPLETED
- scoreboard_entry_t[CVA6Cfg.NrCommitPorts-1:0]
+ * - ``commit_drop_o``
+ - out
+ - TO_BE_COMPLETED
+ - TO_BE_COMPLETED
+ - logic[CVA6Cfg.NrCommitPorts-1:0]
+
* - ``commit_ack_i``
- in
- TO_BE_COMPLETED
@@ -130,43 +136,43 @@
- in
- TO_BE_COMPLETED
- TO_BE_COMPLETED
- - scoreboard_entry_t[ariane_pkg::SUPERSCALAR:0]
+ - scoreboard_entry_t[CVA6Cfg.NrIssuePorts-1:0]
* - ``orig_instr_i``
- in
- TO_BE_COMPLETED
- TO_BE_COMPLETED
- - logic[ariane_pkg::SUPERSCALAR:0][31:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
* - ``decoded_instr_valid_i``
- in
- TO_BE_COMPLETED
- TO_BE_COMPLETED
- - logic[ariane_pkg::SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``decoded_instr_ack_o``
- out
- TO_BE_COMPLETED
- TO_BE_COMPLETED
- - logic[ariane_pkg::SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``orig_instr_o``
- out
- TO_BE_COMPLETED
- TO_BE_COMPLETED
- - logic[ariane_pkg::SUPERSCALAR:0][31:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
* - ``issue_instr_valid_o``
- out
- TO_BE_COMPLETED
- TO_BE_COMPLETED
- - logic[ariane_pkg::SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``issue_ack_i``
- in
- TO_BE_COMPLETED
- TO_BE_COMPLETED
- - logic[ariane_pkg::SUPERSCALAR:0]
+ - logic[CVA6Cfg.NrIssuePorts-1:0]
* - ``resolved_branch_i``
- in
diff --git a/docs/scripts/spec_builder.py b/docs/scripts/spec_builder.py
index 64c7348e7f..edf103582c 100755
--- a/docs/scripts/spec_builder.py
+++ b/docs/scripts/spec_builder.py
@@ -18,8 +18,7 @@
from parameters_extractor import writeout_parameter_table
-if __name__ == "__main__":
-
+def main():
PATH = "04_cv32a65x"
[spec_number, target] = PATH.split("_")
@@ -29,6 +28,7 @@
pathout = f"./{spec_number}_{target}/design/source"
fileout = f"{pathout}/parameters_{target}.rst"
writeout_parameter_table(fileout, parameters, target)
+ export_user_cfg_doc("01_cva6_user/user_cfg_doc.rst", parameters)
file = []
file.append("../core/cva6.sv")
@@ -127,19 +127,7 @@
connexion = "none"
with open(fileout, "w", encoding="utf-8") as fout:
- fout.write("..\n")
- fout.write(" Copyright 2024 Thales DIS France SAS\n")
- fout.write(
- ' Licensed under the Solderpad Hardware License, Version 2.1 (the "License");\n'
- )
- fout.write(
- " you may not use this file except in compliance with the License.\n"
- )
- fout.write(" SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1\n")
- fout.write(
- " You may obtain a copy of the License at https://solderpad.org/licenses/\n\n"
- )
- fout.write(" Original Author: Jean-Roch COULON - Thales\n\n")
+ fout.write(HEADER)
fout.write(f".. _CVA6_{module}_ports:\n\n")
fout.write(f".. list-table:: **{module} module** IO ports\n")
fout.write(" :header-rows: 1\n")
@@ -165,3 +153,37 @@
for comment in comments:
fout.write(f"| {comment[0]},\n| {comment[1]}\n")
fout.write("\n")
+
+HEADER = """\
+..
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+
+"""
+
+def export_user_cfg_doc(out_path, params):
+ with open(out_path, "w", encoding="utf-8") as f:
+ f.write(HEADER)
+ f.write("""\
+.. _cva6_user_cfg_doc:
+
+.. list-table:: ``cva6_user_cfg_t`` parameters
+ :header-rows: 1
+
+ * - Name
+ - Type
+ - Description
+""")
+ for name, param in params.items():
+ f.write("\n")
+ f.write(f" * - ``{name}``\n")
+ f.write(f" - ``{param.datatype.strip()}``\n")
+ f.write(f" - {param.description}\n")
+
+if __name__ == "__main__":
+ main()
From c4b421698106bf796025c7608fe283046db53981 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Qu=C3=A9vremont?=
Date: Fri, 12 Jul 2024 18:14:26 +0200
Subject: [PATCH 011/183] Update cva6_requirements_specification.rst (#2364)
Specify CV-X-IF version supported: 1.0.0.
Mention of B extension (with includes the Zb* extensions, already in the specification).
Make FENCE.T as a "should" instead of "shall" as we do not have plans to integrate it yet.
---
.../cva6_requirements_specification.rst | 27 ++++++-------------
1 file changed, 8 insertions(+), 19 deletions(-)
diff --git a/docs/02_cva6_requirements/cva6_requirements_specification.rst b/docs/02_cva6_requirements/cva6_requirements_specification.rst
index d0170bb583..da5605efbb 100644
--- a/docs/02_cva6_requirements/cva6_requirements_specification.rst
+++ b/docs/02_cva6_requirements/cva6_requirements_specification.rst
@@ -204,8 +204,7 @@ https://github.com/riscv-non-isa/riscv-arch-test.
[AXI] AXI Specification,
https://developer.arm.com/documentation/ihi0022/hc.
-[CV-X-IF] Placeholder for the CV-X-IF coprocessor interface currently
-prepared at OpenHW Group; current version in
+[CV-X-IF] “OpenHW Group Specification: Core-V eXtension interface (CV-X-IF)”, version 1.0.0,
https://docs.openhwgroup.org/projects/openhw-group-core-v-xif/.
[OpenPiton] “OpenPiton Microarchitecture Specification”, Princeton
@@ -304,9 +303,11 @@ independent requirements.
| | 2.0. |
+-----------------------------------+-----------------------------------+
| ISA-120 | CVA6 should support as an |
-| | **option** the **Zba**, **Zbb**, |
-| | **Zbc** and **Zbs** extensions |
+| | **option** the **B** extension |
| | (bit manipulation), version 1.0. |
+| | The **B** extension comprises the |
+| | **Zba**, **Zbb**, **Zbc** |
+| | and **Zbs** extensions. |
+-----------------------------------+-----------------------------------+
| ISA-130 | CVA6 should support as an |
| | **option** the **Zicond** |
@@ -614,15 +615,15 @@ work. If a RISC-V specification is ratified, the CVA6 specification will
likely switch to it.
+-----------------------------------+-----------------------------------+
-| FET‑10 | CVA6 shall support the |
+| FET‑10 | CVA6 should support the |
| | ``FENCE.T`` instruction that |
| | ensures that the execution time |
| | of subsequent instructions is |
| | unrelated with predecessor |
| | instructions. |
+-----------------------------------+-----------------------------------+
-| FET‑20 | ``FENCE.T`` shall be available in |
-| | all privilege modes (machine, |
+| FET‑20 | ``FENCE.T`` should be available |
+| | in all privilege modes (machine, |
| | supervisor, user and hypervisor |
| | if present). |
+-----------------------------------+-----------------------------------+
@@ -637,11 +638,6 @@ used to select a subset of microarchitecture features that will be
cleared. The list of arguments, if any, will be detailed in the user’s
guide.
-Anticipation of verification: It can be cumbersome to prove the timing
-decorrelation as expressed in the requirement with digital simulations.
-We can simulate the microarchitecture features and explain how they
-satisfy the requirement as Nils Wistoff’s work demonstrated.
-
.. _ppa_targets:
PPA targets
@@ -752,13 +748,6 @@ Coprocessor interface
| | [CV-X-IF] specification. |
+-----------------------------------+-----------------------------------+
-The goal is to have a compatible interface between CORE-V cores (CVA6,
-CV32E40X…). The feasibility still needs to be confirmed; including the
-speculative execution.
-
-CVA6 can interface with several coprocessors simultaneously through a
-specific external feature implemented on the CV-X-IF interface.
-
.. _multi_core_interface:
Multi-core interface
From 8aa0f634f6bf5f388a78ac8a2b1d72a8b4600d0a Mon Sep 17 00:00:00 2001
From: Asmaa Kassimi <163407779+Asmaa-Kassimi@users.noreply.github.com>
Date: Sat, 13 Jul 2024 08:32:51 +0100
Subject: [PATCH 012/183] condition load and store modules (#2349)
---
core/load_unit.sv | 2 +-
core/store_unit.sv | 20 +++++++++++++-------
2 files changed, 14 insertions(+), 8 deletions(-)
diff --git a/core/load_unit.sv b/core/load_unit.sv
index cea27c6b27..2109b08ded 100644
--- a/core/load_unit.sv
+++ b/core/load_unit.sv
@@ -505,7 +505,7 @@ module load_unit
// select correct sign bit in parallel to result shifter above
// pull to 0 if unsigned
- assign rdata_sign_bit = rdata_is_signed & rdata_sign_bits[rdata_offset] | rdata_is_fp_signed;
+ assign rdata_sign_bit = rdata_is_signed & rdata_sign_bits[rdata_offset] | (CVA6Cfg.FpPresent && rdata_is_fp_signed);
// result mux
always_comb begin
diff --git a/core/store_unit.sv b/core/store_unit.sv
index f6c373bc1b..9b85180f68 100644
--- a/core/store_unit.sv
+++ b/core/store_unit.sv
@@ -89,7 +89,7 @@ module store_unit
// align data to address e.g.: shift data to be naturally 64
function automatic [CVA6Cfg.XLEN-1:0] data_align(logic [2:0] addr, logic [63:0] data);
// Set addr[2] to 1'b0 when 32bits
- logic [ 2:0] addr_tmp = {(addr[2] && CVA6Cfg.IS_XLEN64), addr[1:0]};
+ logic [2:0] addr_tmp = {(addr[2] && CVA6Cfg.IS_XLEN64), addr[1:0]};
logic [63:0] data_tmp = {64{1'b0}};
case (addr_tmp)
3'b000: data_tmp[CVA6Cfg.XLEN-1:0] = {data[CVA6Cfg.XLEN-1:0]};
@@ -99,10 +99,16 @@ module store_unit
data_tmp[CVA6Cfg.XLEN-1:0] = {data[CVA6Cfg.XLEN-17:0], data[CVA6Cfg.XLEN-1:CVA6Cfg.XLEN-16]};
3'b011:
data_tmp[CVA6Cfg.XLEN-1:0] = {data[CVA6Cfg.XLEN-25:0], data[CVA6Cfg.XLEN-1:CVA6Cfg.XLEN-24]};
- 3'b100: data_tmp = {data[31:0], data[63:32]};
- 3'b101: data_tmp = {data[23:0], data[63:24]};
- 3'b110: data_tmp = {data[15:0], data[63:16]};
- 3'b111: data_tmp = {data[7:0], data[63:8]};
+ default:
+ if (CVA6Cfg.IS_XLEN64) begin
+ case (addr_tmp)
+ 3'b100: data_tmp = {data[31:0], data[63:32]};
+ 3'b101: data_tmp = {data[23:0], data[63:24]};
+ 3'b110: data_tmp = {data[15:0], data[63:16]};
+ 3'b111: data_tmp = {data[7:0], data[63:8]};
+ default: data_tmp = {data[63:0]};
+ endcase
+ end
endcase
return data_tmp[CVA6Cfg.XLEN-1:0];
endfunction
@@ -273,8 +279,8 @@ module store_unit
logic store_buffer_ready, amo_buffer_ready;
// multiplex between store unit and amo buffer
- assign store_buffer_valid = st_valid & (amo_op_q == AMO_NONE);
- assign amo_buffer_valid = st_valid & (amo_op_q != AMO_NONE);
+ assign store_buffer_valid = st_valid & (!CVA6Cfg.RVA || (amo_op_q == AMO_NONE));
+ assign amo_buffer_valid = st_valid & (CVA6Cfg.RVA && (amo_op_q != AMO_NONE));
assign st_ready = store_buffer_ready & amo_buffer_ready;
From 6c0e3f82c52d4852879d96a7e275ba5d2bef9991 Mon Sep 17 00:00:00 2001
From: Jalali <110232072+AyoubJalali@users.noreply.github.com>
Date: Mon, 15 Jul 2024 12:39:52 +0000
Subject: [PATCH 013/183] Verif: Add load hazard instructions (#2354)
---
verif/tests/custom/isacov/load_reg_hazard.S | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/verif/tests/custom/isacov/load_reg_hazard.S b/verif/tests/custom/isacov/load_reg_hazard.S
index 15c1c3eece..2b63b4d9b5 100644
--- a/verif/tests/custom/isacov/load_reg_hazard.S
+++ b/verif/tests/custom/isacov/load_reg_hazard.S
@@ -384,6 +384,27 @@ main:
c.lhu a4, 0(a4)
c.lhu a5, 0(a5)
+ li s0, 0x80000000
+ li s1, 0x80000000
+ li a0, 0x80000000
+ li a1, 0x80000000
+ li a2, 0x80000000
+ li a3, 0x80000000
+ li a4, 0x80000000
+ li a5, 0x80000000
+
+ c.lw s0, 0(s0)
+ c.lw s1, 0(s1)
+ c.lw a0, 0(a0)
+ c.lw a1, 0(a1)
+ c.lw a2, 0(a2)
+ c.lw a3, 0(a3)
+ c.lw a4, 0(a4)
+ c.lw a5, 0(a5)
+
+ li sp, 0x80000000
+ c.lwsp sp, 0(sp)
+
#End of test
j test_pass
From 8c709767599a12acd7c02976a42cc3dcc9f4604e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Andr=C3=A9=20Sintzoff?=
<61976467+ASintzoff@users.noreply.github.com>
Date: Mon, 15 Jul 2024 14:42:07 +0200
Subject: [PATCH 014/183] docs: use correct commit for riscv-isa-manual
submodule (#2368)
fix after 8fa590b5c
---
docs/riscv-isa/riscv-isa-manual | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/riscv-isa/riscv-isa-manual b/docs/riscv-isa/riscv-isa-manual
index c8c8075a6a..ebf2e3a0b4 160000
--- a/docs/riscv-isa/riscv-isa-manual
+++ b/docs/riscv-isa/riscv-isa-manual
@@ -1 +1 @@
-Subproject commit c8c8075a6a71be67ac723528070e3e50ff7586b2
+Subproject commit ebf2e3a0b402cd56fd4b571b705b31f3be62c2cc
From 5f8605838ec0c465a4d9724878754521aeea4bf8 Mon Sep 17 00:00:00 2001
From: AbdessamiiOukalrazqou
<163409352+AbdessamiiOukalrazqou@users.noreply.github.com>
Date: Sun, 21 Jul 2024 22:39:50 +0200
Subject: [PATCH 015/183] [gen_from_riscv_config] fix access issues for PMP
registers, improve Factorization algorithm , improve csr_updater.yaml, add
spike support (#2372)
---
.../cv32a65x/csr/csr.rst | 110 +-
.../cv32a65x/spike/spike.yaml | 45 +-
.../scripts/libs/csr_factorizer.py | 28 +-
.../scripts/libs/csr_updater.py | 20 +-
.../scripts/libs/utils.py | 298 +++-
.../updaters/cv32a65x/csr_updater.yaml | 1229 ++++++++++++++++-
6 files changed, 1593 insertions(+), 137 deletions(-)
diff --git a/config/gen_from_riscv_config/cv32a65x/csr/csr.rst b/config/gen_from_riscv_config/cv32a65x/csr/csr.rst
index ad95398249..6083081e1c 100644
--- a/config/gen_from_riscv_config/cv32a65x/csr/csr.rst
+++ b/config/gen_from_riscv_config/cv32a65x/csr/csr.rst
@@ -65,9 +65,13 @@ Register Summary
+-------------+---------------------------------------------+-------------+----------------------------------------------------------------------------------------------------+
| 0x344 | `MIP <#MIP>`_ | MRW | The mip register is an MXLEN-bit read/write register containing information on pending interrupts. |
+-------------+---------------------------------------------+-------------+----------------------------------------------------------------------------------------------------+
-| 0x3a0-0x3a3 | `PMPCFG[0-3] <#PMPCFG[0-3]>`_ | MRW | PMP configuration register |
+| 0x3a0-0x3a1 | `PMPCFG[0-1] <#PMPCFG[0-1]>`_ | MRW | PMP configuration register |
+-------------+---------------------------------------------+-------------+----------------------------------------------------------------------------------------------------+
-| 0x3b0-0x3bf | `PMPADDR[0-15] <#PMPADDR[0-15]>`_ | MRW | Physical memory protection address register |
+| 0x3a2-0x3af | `PMPCFG[2-15] <#PMPCFG[2-15]>`_ | MRW | PMP configuration register |
++-------------+---------------------------------------------+-------------+----------------------------------------------------------------------------------------------------+
+| 0x3b0-0x3b7 | `PMPADDR[0-7] <#PMPADDR[0-7]>`_ | MRW | Physical memory protection address register |
++-------------+---------------------------------------------+-------------+----------------------------------------------------------------------------------------------------+
+| 0x3b8-0x3ef | `PMPADDR[8-63] <#PMPADDR[8-63]>`_ | MRW | Physical memory protection address register |
+-------------+---------------------------------------------+-------------+----------------------------------------------------------------------------------------------------+
| 0x7c0 | `ICACHE <#ICACHE>`_ | MRW | the register controls the operation of the i-cache unit. |
+-------------+---------------------------------------------+-------------+----------------------------------------------------------------------------------------------------+
@@ -206,7 +210,7 @@ MIE
+---------+--------------+---------------+--------+----------------+---------------------------------------+
| 6 | VSTIE | 0x0 | ROCST | 0x0 | VS-level Timer Interrupt enable. |
+---------+--------------+---------------+--------+----------------+---------------------------------------+
-| 7 | MTIE | 0x0 | ROVAR | 0x0 - 0x1 | Machine Timer Interrupt enable. |
+| 7 | MTIE | 0x0 | WLRL | 0x0 - 0x1 | Machine Timer Interrupt enable. |
+---------+--------------+---------------+--------+----------------+---------------------------------------+
| 8 | UEIE | 0x0 | ROCST | 0x0 | User External Interrupt enable. |
+---------+--------------+---------------+--------+----------------+---------------------------------------+
@@ -214,7 +218,7 @@ MIE
+---------+--------------+---------------+--------+----------------+---------------------------------------+
| 10 | VSEIE | 0x0 | ROCST | 0x0 | VS-level External Interrupt enable. |
+---------+--------------+---------------+--------+----------------+---------------------------------------+
-| 11 | MEIE | 0x0 | ROVAR | 0x0 - 0x1 | Machine External Interrupt enable. |
+| 11 | MEIE | 0x0 | WLRL | 0x0 - 0x1 | Machine External Interrupt enable. |
+---------+--------------+---------------+--------+----------------+---------------------------------------+
| 12 | SGEIE | 0x0 | ROCST | 0x0 | HS-level External Interrupt enable. |
+---------+--------------+---------------+--------+----------------+---------------------------------------+
@@ -285,7 +289,7 @@ MHPMEVENT[3-31]
+--------+--------------+---------------+--------+----------------+--------------------------------------------------------------------------+
| Bits | Field Name | Reset Value | Type | Legal Values | Description |
+========+==============+===============+========+================+==========================================================================+
-| [31:0] | MHPMEVENT[I] | 0x00000000 | ROCST | 0x00000000 | The mhpmevent is a MXLEN-bit event register which controls mhpmcounter3. |
+| [31:0] | MHPMEVENT[I] | 0x00000000 | ROCST | 0x0 | The mhpmevent is a MXLEN-bit event register which controls mhpmcounter3. |
+--------+--------------+---------------+--------+----------------+--------------------------------------------------------------------------+
@@ -336,7 +340,7 @@ MCAUSE
+--------+----------------+---------------+--------+----------------+-----------------------------------------------------+
| Bits | Field Name | Reset Value | Type | Legal Values | Description |
+========+================+===============+========+================+=====================================================+
-| [30:0] | EXCEPTION_CODE | 0x0 | WLRL | 0 - 15 | Encodes the exception code. |
+| [30:0] | EXCEPTION_CODE | 0x0 | WLRL | 0x0 - 0x8, 0xb | Encodes the exception code. |
+--------+----------------+---------------+--------+----------------+-----------------------------------------------------+
| 31 | INTERRUPT | 0x0 | WLRL | 0x0 - 0x1 | Indicates whether the trap was due to an interrupt. |
+--------+----------------+---------------+--------+----------------+-----------------------------------------------------+
@@ -355,7 +359,7 @@ MTVAL
+--------+--------------+---------------+--------+----------------+----------------------------------------------------------------------------------------------------+
| Bits | Field Name | Reset Value | Type | Legal Values | Description |
+========+==============+===============+========+================+====================================================================================================+
-| [31:0] | MTVAL | 0x00000000 | ROCST | 0x00000000 | The mtval is a warl register that holds the address of the instruction which caused the exception. |
+| [31:0] | MTVAL | 0x00000000 | ROCST | 0x0 | The mtval is a warl register that holds the address of the instruction which caused the exception. |
+--------+--------------+---------------+--------+----------------+----------------------------------------------------------------------------------------------------+
@@ -402,33 +406,55 @@ MIP
+---------+--------------+---------------+--------+----------------+----------------------------------------+
-.. .. _PMPCFG[0-3]:::
-PMPCFG[0-3]
+.. .. _PMPCFG[0-1]:::
+PMPCFG[0-1]
~~~~~~~~~~~
-:Address: 0x3a0-0x3af
+:Address: 0x3a0-0x3a1
:Reset Value: 0x00000000
:Privilege: MRW
:Description: PMP configuration register
-+---------+-----------------+---------------+--------+----------------+------------------------+
-| Bits | Field Name | Reset Value | Type | Legal Values | Description |
-+=========+=================+===============+========+================+========================+
-| [7:0] | PMP[I*4 + 0]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits |
-+---------+-----------------+---------------+--------+----------------+------------------------+
-| [15:8] | PMP[I*4 + 1]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits |
-+---------+-----------------+---------------+--------+----------------+------------------------+
-| [23:16] | PMP[I*4 + 2]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits |
-+---------+-----------------+---------------+--------+----------------+------------------------+
-| [31:24] | PMP[I*4 + 3]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits |
-+---------+-----------------+---------------+--------+----------------+------------------------+
-
-
-.. .. _PMPADDR[0-15]:::
-PMPADDR[0-15]
-~~~~~~~~~~~~~
++---------+----------------+---------------+--------+----------------+------------------------+
+| Bits | Field Name | Reset Value | Type | Legal Values | Description |
++=========+================+===============+========+================+========================+
+| [7:0] | PMP[I*4 +0]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits |
++---------+----------------+---------------+--------+----------------+------------------------+
+| [15:8] | PMP[I*4 +1]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits |
++---------+----------------+---------------+--------+----------------+------------------------+
+| [23:16] | PMP[I*4 +2]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits |
++---------+----------------+---------------+--------+----------------+------------------------+
+| [31:24] | PMP[I*4 +3]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits |
++---------+----------------+---------------+--------+----------------+------------------------+
+
+
+.. .. _PMPCFG[2-15]:::
+PMPCFG[2-15]
+~~~~~~~~~~~~
+
+:Address: 0x3a2-0x3af
+:Reset Value: 0x00000000
+:Privilege: MRW
+:Description: PMP configuration register
+
++---------+----------------+---------------+--------+----------------+------------------------+
+| Bits | Field Name | Reset Value | Type | Legal Values | Description |
++=========+================+===============+========+================+========================+
+| [7:0] | PMP[I*4 +0]CFG | 0x0 | ROCST | 0x0 | pmp configuration bits |
++---------+----------------+---------------+--------+----------------+------------------------+
+| [15:8] | PMP[I*4 +1]CFG | 0x0 | ROCST | 0x0 | pmp configuration bits |
++---------+----------------+---------------+--------+----------------+------------------------+
+| [23:16] | PMP[I*4 +2]CFG | 0x0 | ROCST | 0x0 | pmp configuration bits |
++---------+----------------+---------------+--------+----------------+------------------------+
+| [31:24] | PMP[I*4 +3]CFG | 0x0 | ROCST | 0x0 | pmp configuration bits |
++---------+----------------+---------------+--------+----------------+------------------------+
-:Address: 0x3b0-0x3ef
+
+.. .. _PMPADDR[0-7]:::
+PMPADDR[0-7]
+~~~~~~~~~~~~
+
+:Address: 0x3b0-0x3b7
:Reset Value: 0x00000000
:Privilege: MRW
:Description: Physical memory protection address register
@@ -440,6 +466,22 @@ PMPADDR[0-15]
+--------+--------------+---------------+--------+-------------------------+---------------------------------------------+
+.. .. _PMPADDR[8-63]:::
+PMPADDR[8-63]
+~~~~~~~~~~~~~
+
+:Address: 0x3b8-0x3ef
+:Reset Value: 0x00000000
+:Privilege: MRW
+:Description: Physical memory protection address register
+
++--------+--------------+---------------+--------+----------------+---------------------------------------------+
+| Bits | Field Name | Reset Value | Type | Legal Values | Description |
++========+==============+===============+========+================+=============================================+
+| [31:0] | PMPADDR[I] | 0x00000000 | ROCST | 0x0 | Physical memory protection address register |
++--------+--------------+---------------+--------+----------------+---------------------------------------------+
+
+
.. .. _ICACHE:::
ICACHE
~~~~~~
@@ -523,7 +565,7 @@ MHPMCOUNTER[3-31]
+--------+----------------+---------------+--------+----------------+---------------------------------------------------------------------------+
| Bits | Field Name | Reset Value | Type | Legal Values | Description |
+========+================+===============+========+================+===========================================================================+
-| [31:0] | MHPMCOUNTER[I] | 0x00000000 | ROCST | 0x00000000 | The mhpmcounter is a 64-bit counter. Returns lower 32 bits in RV32I mode. |
+| [31:0] | MHPMCOUNTER[I] | 0x00000000 | ROCST | 0x0 | The mhpmcounter is a 64-bit counter. Returns lower 32 bits in RV32I mode. |
+--------+----------------+---------------+--------+----------------+---------------------------------------------------------------------------+
@@ -572,7 +614,7 @@ MHPMCOUNTER[3-31]H
+--------+-----------------+---------------+--------+----------------+----------------------------------------------------------------+
| Bits | Field Name | Reset Value | Type | Legal Values | Description |
+========+=================+===============+========+================+================================================================+
-| [31:0] | MHPMCOUNTER[I]H | 0x00000000 | ROCST | 0x00000000 | The mhpmcounterh returns the upper half word in RV32I systems. |
+| [31:0] | MHPMCOUNTER[I]H | 0x00000000 | ROCST | 0x0 | The mhpmcounterh returns the upper half word in RV32I systems. |
+--------+-----------------+---------------+--------+----------------+----------------------------------------------------------------+
@@ -589,7 +631,7 @@ MVENDORID
+--------+--------------+---------------+--------+----------------+--------------------------------------------------------------------------------------------+
| Bits | Field Name | Reset Value | Type | Legal Values | Description |
+========+==============+===============+========+================+============================================================================================+
-| [31:0] | MVENDORID | 0x00000602 | ROCST | 0x00000602 | 32-bit read-only register providing the JEDEC manufacturer ID of the provider of the core. |
+| [31:0] | MVENDORID | 0x00000602 | ROCST | 0x602 | 32-bit read-only register providing the JEDEC manufacturer ID of the provider of the core. |
+--------+--------------+---------------+--------+----------------+--------------------------------------------------------------------------------------------+
@@ -606,7 +648,7 @@ MARCHID
+--------+--------------+---------------+--------+----------------+-------------------------------------------------------------------------------+
| Bits | Field Name | Reset Value | Type | Legal Values | Description |
+========+==============+===============+========+================+===============================================================================+
-| [31:0] | MARCHID | 0x00000003 | ROCST | 0x00000003 | MXLEN-bit read-only register encoding the base microarchitecture of the hart. |
+| [31:0] | MARCHID | 0x00000003 | ROCST | 0x3 | MXLEN-bit read-only register encoding the base microarchitecture of the hart. |
+--------+--------------+---------------+--------+----------------+-------------------------------------------------------------------------------+
@@ -623,7 +665,7 @@ MIMPID
+--------+--------------+---------------+--------+----------------+----------------------------------------------------------------------------+
| Bits | Field Name | Reset Value | Type | Legal Values | Description |
+========+==============+===============+========+================+============================================================================+
-| [31:0] | MIMPID | 0x00000000 | ROCST | 0x00000000 | Provides a unique encoding of the version of the processor implementation. |
+| [31:0] | MIMPID | 0x00000000 | ROCST | 0x0 | Provides a unique encoding of the version of the processor implementation. |
+--------+--------------+---------------+--------+----------------+----------------------------------------------------------------------------+
@@ -640,7 +682,7 @@ MHARTID
+--------+--------------+---------------+--------+----------------+-------------------------------------------------------------------------------------------------+
| Bits | Field Name | Reset Value | Type | Legal Values | Description |
+========+==============+===============+========+================+=================================================================================================+
-| [31:0] | MHARTID | 0x00000000 | ROCST | 0x00000000 | MXLEN-bit read-only register containing the integer ID of the hardware thread running the code. |
+| [31:0] | MHARTID | 0x00000000 | ROCST | 0x0 | MXLEN-bit read-only register containing the integer ID of the hardware thread running the code. |
+--------+--------------+---------------+--------+----------------+-------------------------------------------------------------------------------------------------+
@@ -657,6 +699,6 @@ MCONFIGPTR
+--------+--------------+---------------+--------+----------------+-------------------------------------------------------------------------------------------------+
| Bits | Field Name | Reset Value | Type | Legal Values | Description |
+========+==============+===============+========+================+=================================================================================================+
-| [31:0] | MCONFIGPTR | 0x00000000 | ROCST | 0x00000000 | MXLEN-bit read-only register that holds the physical address of a configuration data structure. |
+| [31:0] | MCONFIGPTR | 0x00000000 | ROCST | 0x0 | MXLEN-bit read-only register that holds the physical address of a configuration data structure. |
+--------+--------------+---------------+--------+----------------+-------------------------------------------------------------------------------------------------+
diff --git a/config/gen_from_riscv_config/cv32a65x/spike/spike.yaml b/config/gen_from_riscv_config/cv32a65x/spike/spike.yaml
index 08fb6f2af2..1185689fec 100644
--- a/config/gen_from_riscv_config/cv32a65x/spike/spike.yaml
+++ b/config/gen_from_riscv_config/cv32a65x/spike/spike.yaml
@@ -1,30 +1,31 @@
spike_param_tree:
bootrom: true
- bootrom_base: 0x10000
- bootrom_size: 0x1000
+ bootrom_base: 65536
+ bootrom_size: 4096
dram: true
- dram_base: 0x80000000
- dram_size: 0x40000000
+ dram_base: 2147483648
+ dram_size: 1073741824
generic_core_config: false
max_steps: 200000
max_steps_enabled: false
- isa: rv32imc_zba_zbb_zbs_zbc_zicsr_zifencei
+ isa: rv32imczicsr_zicntr_zifencei_zcb_zba_zbb_zbc_zbs
priv: M
cores:
- - isa: rv32imc_zba_zbb_zbs_zbc_zicsr_zifencei
- boot_addr: 0x80000000
- marchid: 0x3
- misa_we: false
- misa_we_enable: true
- misaligned: false
- mmu_mode: sv39
- mvendorid: 0x00000602
- pmpaddr0: 0x0
- pmpcfg0: 0x0
- pmpregions: 0x0
- priv: M
- misa_we: false
- mstatus_write_mask: 0x00000088
- mstatus_override_mask: 0x00001800
- mtval_write_mask: 0x00000000
- unified_traps: true
+ - isa: rv32imc_zba_zbb_zbs_zbc_zicsr_zifencei
+ boot_addr: 2147483648
+ marchid: 3
+ misa_we: false
+ misa_we_enable: true
+ pmpaddr0: 0
+ pmpcfg0: 0
+ pmpregions: 64
+ usable_pmpregions: 8
+ priv: M
+ status_fs_field_we: false
+ status_fs_field_we_enable: false
+ status_vs_field_we: false
+ status_vs_field_we_enable: false
+ mstatus_write_mask: 136
+ mstatus_override_mask: 6144
+ mtval_write_mask: 0
+ unified_traps: true
diff --git a/config/gen_from_riscv_config/scripts/libs/csr_factorizer.py b/config/gen_from_riscv_config/scripts/libs/csr_factorizer.py
index c4a2f079eb..e291f6303e 100644
--- a/config/gen_from_riscv_config/scripts/libs/csr_factorizer.py
+++ b/config/gen_from_riscv_config/scripts/libs/csr_factorizer.py
@@ -24,6 +24,7 @@ def address_to_key(address):
def factorizer(yaml_data):
privname = None
+ legalname= None
fieldname = []
regname = []
regdescr = []
@@ -37,9 +38,9 @@ def factorizer(yaml_data):
suffix_address = []
suffix_number = []
key_to_remove = []
- for key, value in yaml_data["hart0"].items():
+ for key, value in yaml_data.items():
if isinstance(value, dict):
- regelement = yaml_data["hart0"].get(key, {})
+ regelement = yaml_data.get(key, {})
if regelement.get("address", None):
regaddress = hex(regelement.get("address", None))
else:
@@ -49,11 +50,16 @@ def factorizer(yaml_data):
else:
desc = ""
if regelement.get("rv32", "")["accessible"]:
+ fields = regelement.get("rv32", "").get("fields", [])
+ if not fields :
+ legal = regelement.get("rv32", "").get("type", None).keys() if regelement.get("rv32", "").get("type", None) is not None else None
+ else :
+ legal = [regelement.get("rv32", "").get(item, {}).get("type").keys()for item in fields if not isinstance(item, list) and regelement.get("rv32", "").get(item, {}).get("type") is not None]
pattern = r"(\D+)(\d+)(.*)"
match = re.search(pattern, key)
if match:
key_to_remove.append(key)
- if privname and match.group(1) == privname.group(1):
+ if privname and match.group(1) == privname.group(1) and legalname == legal:
if len(match.group(3)) > 0:
suffix_name.append(match.group(0))
field_suffix.append(match.group(1))
@@ -75,7 +81,7 @@ def factorizer(yaml_data):
start_address = hex(int(regadress[0], 16))
desc = str(regdescr[0])
desc = re.sub(str(regname[0]), fieldname[0], desc)
- modified_data = yaml_data["hart0"][regname[0]].copy()
+ modified_data = yaml_data[regname[0]].copy()
modified_data["address"] = (
f"{str(start_address)}-{str(regadress[-1])}"
)
@@ -98,13 +104,14 @@ def factorizer(yaml_data):
suffix_address = sorted(suffix_address, key=address_to_key)
desc = str(suffix_descr[0])
desc = re.sub(str(suffix_name[0]), field_suffix[0], desc)
- modified_data = yaml_data["hart0"][suffix_name[0]].copy()
+ modified_data = yaml_data[suffix_name[0]].copy()
modified_data["address"] = (
f"{str(suffix_address[0])}-{str(suffix_address[-1])}"
)
new_regname.append(
f"{field_suffix[0]}[{suffix_number[0]}-{suffix_number[-1]}]h"
)
+ print(new_regname)
data.append(modified_data)
suffix_name = []
field_suffix = []
@@ -112,12 +119,13 @@ def factorizer(yaml_data):
suffix_number = [match.group(2)]
suffix_address = []
privname = match
+ legalname = legal
if regname:
start_address = hex(int(regadress[0], 16))
end_address = str(regadress[-1])
desc = str(regdescr[0])
desc = re.sub(str(regname[0]), fieldname[0], desc)
- modified_data = yaml_data["hart0"][regname[0]].copy()
+ modified_data = yaml_data[regname[0]].copy()
modified_data["description"] = desc
modified_data["address"] = f"{str(start_address)}-{str(end_address)}"
new_regname.append(f"{fieldname[0]}[{reg_number[0]}-{reg_number[-1]}]")
@@ -129,7 +137,7 @@ def factorizer(yaml_data):
if suffix_name:
desc = str(suffix_descr[0])
desc = re.sub(str(suffix_name[0]), field_suffix[0], desc)
- modified_data = yaml_data["hart0"][suffix_name[0]].copy()
+ modified_data = yaml_data[suffix_name[0]].copy()
modified_data["description"] = desc
modified_data["address"] = (
f"{str(hex(int(suffix_address[0],16)))}-{str(suffix_address[-1])}"
@@ -143,7 +151,7 @@ def factorizer(yaml_data):
regdescr = []
regadress = []
for index, reg in enumerate(new_regname):
- yaml_data["hart0"][reg] = data[index]
+ yaml_data[reg] = data[index]
for key in key_to_remove:
- del yaml_data["hart0"][key]
- return yaml_data["hart0"]
+ del yaml_data[key]
+ return yaml_data
diff --git a/config/gen_from_riscv_config/scripts/libs/csr_updater.py b/config/gen_from_riscv_config/scripts/libs/csr_updater.py
index 5a0b212996..af76b67b28 100644
--- a/config/gen_from_riscv_config/scripts/libs/csr_updater.py
+++ b/config/gen_from_riscv_config/scripts/libs/csr_updater.py
@@ -5,23 +5,20 @@
def csr_recursive_update(original_dict, csr_update):
"""
Gets the data of the RISC-V Config Yaml file and
- updates the value of sub key in the RISC-V Config Yaml file
- (ex: reset-val, shadow_type)
- :param original_dict: parsed data of the RISC-V Config Yaml file
- :param csr_update: parsed data of the CSR updater
+ update the value of sub key in RISC-V Config Yaml file
+ (ex: reset-val , address)
+ :param original_dict : parsed data of RISC-V Config Yaml file
+ csr_update : parsed data of CSR updater
:return: data of RISC-V Config Yaml file updated
"""
for key, value in csr_update.items():
if key in original_dict:
if isinstance(value, dict) and isinstance(original_dict[key], dict):
- # If both are dicts, recurse
- if key == "type":
- # Replace the entire type dictionary
+ if key == "rv32":
original_dict[key] = value
else:
csr_recursive_update(original_dict[key], value)
else:
- # Replace the original value with the update value
original_dict[key] = value
@@ -31,9 +28,9 @@ def csr_formatter(srcfile, customfile, modifile):
original_dict = yaml.safe_load(file)
with open(customfile, "r", encoding="utf-8") as file:
custom_dict = yaml.safe_load(file)
-
+
isa_data = original_dict.copy()
- isa_data['hart0'].update(custom_dict["hart0"])
+ isa_data["hart0"].update(custom_dict["hart0"])
updated_values = {}
if modifile is not None:
with open(modifile, "r", encoding="utf-8") as file:
@@ -41,7 +38,6 @@ def csr_formatter(srcfile, customfile, modifile):
# Update original_dict with values from updated_values recursively
csr_recursive_update(isa_data["hart0"], updated_values)
-
# Identify and remove keys within the range specified for each register
keys_to_remove = []
for key, value in updated_values.items():
@@ -83,4 +79,4 @@ def remove_keys_recursive(dictionary):
# Remove keys from original_dict
for k in keys_to_remove:
isa_data.pop(k, None)
- return isa_data
+ return isa_data["hart0"]
diff --git a/config/gen_from_riscv_config/scripts/libs/utils.py b/config/gen_from_riscv_config/scripts/libs/utils.py
index 8348cd2777..6bfbc2c99c 100644
--- a/config/gen_from_riscv_config/scripts/libs/utils.py
+++ b/config/gen_from_riscv_config/scripts/libs/utils.py
@@ -20,22 +20,25 @@
import os
import re
import yaml
+from yaml import BaseLoader
import rstcloth
+import json
+from mako.template import Template
import libs.isa_updater
import libs.csr_updater
+import libs.spike_updater
import libs.csr_factorizer
from rstcloth import RstCloth
from mdutils.mdutils import MdUtils
from libs.isa_updater import isa_filter
from libs.csr_updater import csr_formatter
+from libs.spike_updater import spike_formatter
from libs.csr_factorizer import factorizer
-pattern_warl = (
- r"\b(?:warl|wlrl|ro_constant|ro_variable|rw|ro)\b" # pattern to detect warl in field
-)
+pattern_warl = r"\b(?:warl|wlrl|ro_constant|ro_variable|rw|ro)\b" # pattern to detect warl in field
pattern_legal_dict = r"\[(0x[0-9A-Fa-f]+)(.*?(0x[0-9A-Fa-f]+))?\]" # pattern to detect if warl field is dict
pattern_legal_list = r"\[(0x[0-9A-Fa-f]+)(.*?(0x[0-9A-Fa-f]+))?\]" # pattern to detect if warl field is a list
-Factorizer_pattern = r".*(\d).*" # pattern to detect factorized fields
+Factorizer_pattern = r"\d+" # pattern to detect factorized fields
class DocumentClass:
@@ -131,16 +134,32 @@ class Render:
"""Collection of general rendering methods which can be overridden if needed
for a specific output format."""
+ @staticmethod
+ def is_decimal(value):
+ """return a bool checking if value is decimal"""
+ try:
+ int(
+ value
+ ) # Alternatively, use float(value) if you want to check for floating point numbers
+ return True
+ except ValueError:
+ return False
+
@staticmethod
def range(start, end):
"""Return a string representing the range START..END, inclusive.
START and END are strings representing numerical values."""
+ if Render.is_decimal(start):
+ start = hex(int(start))
+ if Render.is_decimal(end):
+ end = hex(int(end))
return f"{start} - {end}"
@staticmethod
def value_set(values):
"""Return a string representing the set of values in VALUES.
VALUES is a list of strings."""
+ # values = [hex(int(value, 16)) if '0x' in value and '-' not in value else value for value in values]
return ", ".join(values)
@staticmethod
@@ -162,6 +181,72 @@ def fieldtype(typ):
return upcased
+class CoreConfig:
+ def __init__(
+ self,
+ isa,
+ marchid,
+ misa_we,
+ misa_we_enable,
+ misaligned,
+ mmu_mode,
+ mvendorid,
+ pmpaddr0,
+ pmpcfg0,
+ pmpregions,
+ priv,
+ status_fs_field_we,
+ status_fs_field_we_enable,
+ status_vs_field_we,
+ status_vs_field_we_enable,
+ ):
+ self.isa = isa
+ self.marchid = marchid
+ self.misa_we = misa_we
+ self.misa_we_enable = misa_we_enable
+ self.misaligned = misaligned
+ self.mmu_mode = mmu_mode
+ self.mvendorid = mvendorid
+ self.pmpaddr0 = pmpaddr0
+ self.pmpcfg0 = pmpcfg0
+ self.pmpregions = pmpregions
+ self.priv = priv
+ self.status_fs_field_we = status_fs_field_we
+ self.status_fs_field_we_enable = status_fs_field_we_enable
+ self.status_vs_field_we = status_vs_field_we
+ self.status_vs_field_we_enable = status_vs_field_we_enable
+
+
+class Spike:
+ def __init__(
+ self,
+ bootrom,
+ bootrom_base,
+ bootrom_size,
+ dram,
+ dram_base,
+ dram_size,
+ generic_core_config,
+ max_steps,
+ max_steps_enabled,
+ isa,
+ priv,
+ core_configs,
+ ):
+ self.bootrom = bootrom
+ self.bootrom_base = bootrom_base
+ self.bootrom_size = bootrom_size
+ self.dram = dram
+ self.dram_base = dram_base
+ self.dram_size = dram_size
+ self.generic_core_config = generic_core_config
+ self.max_steps = max_steps
+ self.max_steps_enabled = max_steps_enabled
+ self.isa = isa
+ self.priv = priv
+ self.core_configs = core_configs
+
+
# --------------------------------------------------------------#
class ISAdocumentClass:
"""ISA document class"""
@@ -175,7 +260,7 @@ def addInstructionMapBlock(self, InstructionMap):
class InstructionMapClass:
- """ISA instruction map class"""
+ """ISA instruction map c.2n lass"""
def __init__(self, name):
self.name = name
@@ -672,7 +757,7 @@ def returnMdRegDesc(self, name, address, resetValue, desc, access):
class CsrParser:
"""parse CSR RISC-V config yaml file"""
- def __init__(self, srcFile,customFile, target, modiFile=None):
+ def __init__(self, srcFile, customFile, target, modiFile=None):
self.srcFile = srcFile
self.customFile = customFile
self.modiFile = modiFile
@@ -772,16 +857,30 @@ def returnRegister(
legal_value = matches.group(3)
bitlegal = legal_value
elif isinstance(legal_2, list):
- pattern = r"\s*((?:0x)?[0-9A-Fa-f]+)\s*(.)\s*((?:0x)?[0-9A-Fa-f]+)\s*"
- matches = re.search(pattern, legal_2[0])
- if matches:
- legal_value = (
- Render.range(
- matches.group(1), matches.group(3)
- )
- if matches.group(2) == ":"
- else Render.value_set(legal_2[0].split(","))
- )
+ pattern = r"\s*((?:0x)?[0-9A-Fa-f]+)\s*(:|,?)\s*((?:0x)?[0-9A-Fa-f]+)?"
+ for value in legal_2:
+ value_list = value.split(",")
+ processed_values = []
+ for val in value_list:
+ matches = re.search(pattern, val)
+ if matches:
+ first_value = matches.group(1)
+ separator = matches.group(2)
+ second_value = (
+ matches.group(3)
+ if matches.group(3)
+ else first_value
+ )
+ if separator == ":":
+ processed_value = Render.range(
+ first_value, second_value
+ )
+ else:
+ processed_value = hex(
+ int(first_value)
+ )
+ processed_values.append(processed_value)
+ legal_value = Render.value_set(processed_values)
bitlegal = legal_value
else:
legal_value = hex(legal_2)
@@ -791,9 +890,13 @@ def returnRegister(
if match:
match_field = re.search(Factorizer_pattern, str(item))
if match_field:
+ if match_field.group(0) not in {"0", "1", "2", "3"}:
+ field_number = int(match_field.group(0)) - 8
+ else:
+ field_number = match_field.group(0)
fieldName = re.sub(
- match_field.group(1),
- f"[i*4 + {match_field.group(1)}]",
+ Factorizer_pattern,
+ f"[i*4 +{field_number}]",
item,
)
else:
@@ -910,18 +1013,32 @@ def returnRegister(
legal_value = matches.group(3)
bitlegal = legal_value
elif isinstance(legal_2, list):
- pattern = r"\s*((?:0x)?[0-9A-Fa-f]+)\s*(.)\s*((?:0x)?[0-9A-Fa-f]+)\s*"
- matches = re.search(pattern, legal_2[0])
- if matches:
- legal_value = (
- Render.range(matches.group(1), matches.group(3))
- if matches.group(2) == ":"
- else Render.value_set(legal_2[0].split(","))
- )
+ pattern = r"\s*((?:0x)?[0-9A-Fa-f]+)\s*(:|,?)\s*((?:0x)?[0-9A-Fa-f]+)?"
+ for value in legal_2:
+ value_list = value.split(",")
+ processed_values = []
+ for val in value_list:
+ matches = re.search(pattern, val)
+ if matches:
+ first_value = matches.group(1)
+ separator = matches.group(2)
+ second_value = (
+ matches.group(3)
+ if matches.group(3)
+ else first_value
+ )
+ if separator == ":":
+ processed_value = Render.range(
+ first_value, second_value
+ )
+ else:
+ processed_value = hex(int(first_value))
+ processed_values.append(processed_value)
+ legal_value = Render.value_set(processed_values)
bitlegal = legal_value
else:
- bitmask = 0
- bitlegal = "0x" + hex(legal_2)[2:].zfill(int(size / 4))
+ legal_value = hex(legal_2)
+ bitlegal = legal_value
fieldDesc = regDesc
fieldreset = "0x" + hex(int(resetValue, 16))[2:].zfill(int(size / 4))
if bitlsb is None:
@@ -950,9 +1067,12 @@ def returnRegister(
def returnDocument(self):
with open(self.srcFile, "r", encoding="utf-8") as f:
data = yaml.safe_load(f)
- data = csr_formatter(self.srcFile,self.customFile, self.modiFile)
- Registers = factorizer(data)
docName = data["hart0"]
+ size = int(
+ data["hart0"].get("supported_xlen", "")[0]
+ ) # depends on architecture
+ data = csr_formatter(self.srcFile, self.customFile, self.modiFile)
+ Registers = factorizer(data)
d = DocumentClass(docName)
m = MemoryMapClass(docName)
a = AddressBlockClass("csr")
@@ -966,7 +1086,7 @@ def returnDocument(self):
else hex(RegElement.get("address", None))
)
reset = hex(RegElement.get("reset-val", ""))
- size = int(data["hart0"].get("supported_xlen", "")[0])
+
access = RegElement.get("priv_mode", "")
if Registers.get(register, {}).get("description", "") is not None:
desc = Registers.get(register, {}).get("description", "")
@@ -1082,6 +1202,96 @@ def returnRegister(self, key, Extension_Name, Descr, instructions_data):
return Inst
+class SpikeParser:
+ """A class to parse data related to Spike."""
+
+ def __init__(self, srcFile, target):
+ self.srcFile = srcFile
+ self.target = target
+
+ def returnDocument(self):
+ with open(self.srcFile, "r", encoding="utf-8") as f:
+ data = yaml.safe_load(f)
+ core_configs = []
+ pattern = r"pmpaddr(\d+)"
+ index = 0
+ bitWidth = 32
+ isa = ""
+ for entry in data["hart_ids"]:
+ M = (
+ "M"
+ if data[f"hart{entry}"]
+ .get("mstatus", {})
+ .get("rv32", "")
+ .get("accessible", [])
+ else ""
+ )
+ S = (
+ "S"
+ if data[f"hart{entry}"]
+ .get("sstatus", {})
+ .get("rv32", "")
+ .get("accessible", [])
+ else ""
+ )
+ U = (
+ "U"
+ if data[f"hart{entry}"]
+ .get("ustatus", {})
+ .get("rv32", "")
+ .get("accessible", [])
+ else ""
+ )
+ for k in data[f"hart{entry}"].keys():
+ match = re.search(pattern, str(k))
+ if match:
+ index += int(match.group(1))
+ isa = data[f"hart{entry}"]["ISA"].lower()
+ core_config = CoreConfig(
+ isa=data[f"hart{entry}"]["ISA"].lower(),
+ marchid=data[f"hart{entry}"].get("marchid", {}).get("reset-val", ""),
+ misa_we=False,
+ misa_we_enable=True,
+ misaligned=data[f"hart{entry}"].get("hw_data_misaligned_support", ""),
+ mmu_mode=(
+ "bare"
+ if not (
+ (int(data[f"hart{entry}"].get("satp", {}).get("reset-val", "")))
+ >> 31
+ )
+ else "sv32"
+ ),
+ mvendorid=data[f"hart{entry}"]
+ .get("mvendorid", {})
+ .get("reset-val", ""),
+ pmpaddr0=data[f"hart{entry}"].get("pmpaddr0", {}).get("reset-val", ""),
+ pmpcfg0=data[f"hart{entry}"].get("pmpcfg0", {}).get("reset-val", ""),
+ pmpregions=index,
+ priv=f"{M}{S}{U}".format(M, S, U),
+ status_fs_field_we=False,
+ status_fs_field_we_enable=False,
+ status_vs_field_we=False,
+ status_vs_field_we_enable=False,
+ )
+ core_configs.append(core_config)
+ S = Spike(
+ bootrom=True,
+ bootrom_base=0x10000,
+ bootrom_size=0x1000,
+ dram=True,
+ dram_base=0x80000000,
+ dram_size=0x40000000,
+ generic_core_config=False,
+ max_steps=200000,
+ max_steps_enabled=False,
+ isa=isa,
+ priv=f"{M}{S}{U}".format(M, S, U),
+ core_configs=core_configs,
+ )
+
+ return S
+
+
class IsaGenerator:
"""generate isa folder with isa docs"""
@@ -1121,7 +1331,6 @@ def __init__(self, target):
def write(self, file_name, string):
path = f"./{self.target}/csr/"
- print(path)
if not os.path.exists(path):
os.makedirs(path)
_dest = os.path.join(path, file_name)
@@ -1141,3 +1350,28 @@ def generateCSR(self, generatorClass, document):
s = block.returnAsString()
file_name = blockName + block.suffix
self.write(file_name, s)
+
+
+class SpikeGenerator:
+ """Generate spike folder with spike docs"""
+
+ def __init__(self, target, temp, modiFile=None):
+ self.target = target
+ self.temp = temp
+ self.modiFile = modiFile
+
+ def write(self, file_name, string):
+ path = f"./{self.target}/spike/"
+ if not os.path.exists(path):
+ os.makedirs(path)
+ _dest = os.path.join(path, file_name)
+ print("writing file " + _dest)
+ with open(_dest, "w", encoding="utf-8") as f:
+ yaml.dump(string, f, default_flow_style=False, sort_keys=False)
+
+ def generateSpike(self, document):
+ template = Template(filename=self.temp)
+ s = template.render(spike=document)
+ data = spike_formatter(yaml.load(s, Loader=BaseLoader), self.modiFile)
+ file_name = "spike.yaml"
+ self.write(file_name, data)
diff --git a/config/gen_from_riscv_config/updaters/cv32a65x/csr_updater.yaml b/config/gen_from_riscv_config/updaters/cv32a65x/csr_updater.yaml
index 129ab53171..7070c4d87e 100644
--- a/config/gen_from_riscv_config/updaters/cv32a65x/csr_updater.yaml
+++ b/config/gen_from_riscv_config/updaters/cv32a65x/csr_updater.yaml
@@ -3,36 +3,1209 @@
# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
# Author: Abdessamii Oukalrazqou
-mip:
- rv32:
- meip:
- type:
- ro_variable:
- - 0x0:0x1
- mtip:
- type:
- ro_variable:
- - 0x0:0x1
-mie:
- rv32:
- meie:
- type:
- ro_variable:
- - 0x0:0x1
- mtie:
- type:
- ro_variable:
- - 0x0:0x1
-mstatus :
- rv32 :
- mie :
- type :
+mcause:
+ rv32:
+ accessible: true
+ interrupt:
+ implemented: true
+ description: Indicates whether the trap was due to an interrupt.
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 31
+ type:
wlrl:
- 0x0:0x1
- mpie :
- type:
+ exception_code:
+ implemented: true
+ description: Encodes the exception code.
+ shadow:
+ shadow_type: rw
+ msb: 30
+ lsb: 0
+ type:
wlrl:
- - 0x0:0x1
+ - 0:8 , 11
+ fields:
+ - exception_code
+ - interrupt
+mip:
+ rv32:
+ accessible: true
+ usip:
+ implemented: false
+ description: User Software Interrupt Pending.
+ shadow:
+ shadow_type: rw
+ msb: 0
+ lsb: 0
+ ssip:
+ implemented: false
+ description: Supervisor Software Interrupt Pending.
+ shadow:
+ shadow_type: rw
+ msb: 1
+ lsb: 1
+ msip:
+ implemented: false
+ description: Machine Software Interrupt Pending.
+ shadow:
+ shadow_type: rw
+ msb: 3
+ lsb: 3
+ utip:
+ implemented: false
+ description: User Timer Interrupt Pending.
+ shadow:
+ shadow_type: rw
+ msb: 4
+ lsb: 4
+ stip:
+ implemented: false
+ description: Supervisor Timer Interrupt Pending.
+ shadow:
+ shadow_type: rw
+ msb: 5
+ lsb: 5
+ mtip:
+ implemented: true
+ description: Machine Timer Interrupt Pending.
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 7
+ type:
+ ro_variable: [0:1]
+ ueip:
+ implemented: false
+ description: User External Interrupt Pending.
+ shadow:
+ shadow_type: rw
+ msb: 8
+ lsb: 8
+ seip:
+ implemented: false
+ description: Supervisor External Interrupt Pending.
+ shadow:
+ shadow_type: rw
+ msb: 9
+ lsb: 9
+ meip:
+ implemented: true
+ description: Machine External Interrupt Pending.
+ shadow:
+ shadow_type: rw
+ msb: 11
+ lsb: 11
+ type:
+ ro_variable: [0:1]
+ fields:
+ - usip
+ - ssip
+ - vssip
+ - msip
+ - utip
+ - stip
+ - vstip
+ - mtip
+ - ueip
+ - seip
+ - vseip
+ - meip
+ - sgeip
+ -
+ -
+ - 13
+ - 31
+ vssip:
+ implemented: false
+ description: VS-level Software Interrupt Pending.
+ shadow:
+ shadow_type: rw
+ msb: 2
+ lsb: 2
+ vstip:
+ implemented: false
+ description: VS-level Timer Interrupt Pending.
+ shadow:
+ shadow_type: rw
+ msb: 6
+ lsb: 6
+ vseip:
+ implemented: false
+ description: VS-level External Interrupt Pending.
+ shadow:
+ shadow_type: rw
+ msb: 10
+ lsb: 10
+ sgeip:
+ implemented: false
+ description: HS-level External Interrupt Pending.
+ shadow:
+ shadow_type: rw
+ msb: 12
+ lsb: 12
+pmpcfg2:
+ rv32:
+ accessible: true
+ pmp8cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp9cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp10cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp11cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp8cfg
+ - pmp9cfg
+ - pmp10cfg
+ - pmp11cfg
+pmpcfg3:
+ rv32:
+ accessible: true
+ pmp12cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp13cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp14cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp15cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp12cfg
+ - pmp13cfg
+ - pmp14cfg
+ - pmp15cfg
+
+pmpcfg5:
+ rv32:
+ accessible: true
+ pmp20cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp21cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp22cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp23cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp20cfg
+ - pmp21cfg
+ - pmp22cfg
+ - pmp23cfg
+
+pmpcfg6:
+ rv32:
+ accessible: true
+ pmp24cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp25cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp26cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp27cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp24cfg
+ - pmp25cfg
+ - pmp26cfg
+ - pmp27cfg
+
+pmpcfg7:
+ rv32:
+ accessible: true
+ pmp28cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp29cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp30cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp31cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp28cfg
+ - pmp29cfg
+ - pmp30cfg
+ - pmp31cfg
+pmpcfg8:
+ rv32:
+ accessible: true
+ pmp32cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp33cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp34cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp35cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp32cfg
+ - pmp33cfg
+ - pmp34cfg
+ - pmp35cfg
+pmpcfg9:
+ rv32:
+ accessible: true
+ pmp36cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp37cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp38cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp39cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp36cfg
+ - pmp37cfg
+ - pmp38cfg
+ - pmp39cfg
+pmpcfg10:
+ rv32:
+ accessible: true
+ pmp40cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp41cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp42cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp43cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp40cfg
+ - pmp41cfg
+ - pmp42cfg
+ - pmp43cfg
+pmpcfg11:
+ rv32:
+ accessible: true
+ pmp44cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp45cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp46cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp47cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp44cfg
+ - pmp45cfg
+ - pmp46cfg
+ - pmp47cfg
+pmpcfg12:
+ rv32:
+ accessible: true
+ pmp48cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp49cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp50cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp51cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp48cfg
+ - pmp49cfg
+ - pmp50cfg
+ - pmp51cfg
+pmpcfg13:
+ rv32:
+ accessible: true
+ pmp52cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp53cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp54cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp55cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp52cfg
+ - pmp53cfg
+ - pmp54cfg
+ - pmp55cfg
+pmpcfg14:
+ rv32:
+ accessible: true
+ pmp56cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp57cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp58cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp59cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp56cfg
+ - pmp57cfg
+ - pmp58cfg
+ - pmp59cfg
+pmpcfg15:
+ rv32:
+ accessible: true
+ pmp60cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp61cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp62cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp63cfg:
+ implemented: true
+ type:
+ ro_constant : 0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp60cfg
+ - pmp61cfg
+ - pmp62cfg
+ - pmp63cfg
+
+#Adjust PMPADDR NUMBER FROM 15 TO 64
+pmpaddr16:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+pmpaddr17:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+pmpaddr18:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+
+pmpaddr19:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+
+pmpaddr20:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+
+pmpaddr21:
+ rv32:
+ accessible: true
+ type:
+
+ ro_constant: 0
+
+pmpaddr22:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr23:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+pmpaddr24:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+pmpaddr25:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr26:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+
+pmpaddr27:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+pmpaddr28:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+pmpaddr29:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+pmpaddr30:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+
+
+pmpaddr31:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr32:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+pmpaddr33:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr34:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr35:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+ rv64:
+ accessible: false
+ reset-val: 0
+ description: Physical memory protection address register
+ address: 0x3D3
+ priv_mode: M
+pmpaddr36:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+pmpaddr37:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+pmpaddr38:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr39:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr40:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+pmpaddr41:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+pmpaddr42:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr43:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+pmpaddr44:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr45:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr46:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr47:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr48:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr49:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+
+pmpaddr50:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr51:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr52:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr53:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr54:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr55:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr56:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr57:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr58:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr59:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr60:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr61:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr62:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
+pmpaddr63:
+ rv32:
+ accessible: true
+ type:
+ ro_constant: 0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
# Exclude mode
exclude :
key : priv_mode
@@ -40,3 +1213,5 @@ exclude :
exclude :
key : priv_mode
cond : U
+
+
From 95049c4a3d3394da47f1fd8bc7fa64ea5ae33b77 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 22 Jul 2024 10:23:52 +0200
Subject: [PATCH 016/183] Bump verif/core-v-verif from `66cd091` to `20c2d30`
(#2367)
---
verif/core-v-verif | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/verif/core-v-verif b/verif/core-v-verif
index 66cd091b84..20c2d30a33 160000
--- a/verif/core-v-verif
+++ b/verif/core-v-verif
@@ -1 +1 @@
-Subproject commit 66cd091b84489d855dc0542b0d7f8337e82e2ef3
+Subproject commit 20c2d30a333afa8ee54b51b0d9c13785ec6f51e1
From 8d413b7c549f66a002d507243f276248b6aa4ec9 Mon Sep 17 00:00:00 2001
From: JeanRochCoulon
Date: Mon, 22 Jul 2024 13:15:06 +0200
Subject: [PATCH 017/183] doc PMA: cv32a65x is always idempotent and without
caches (#2377)
---
docs/04_cv32a65x/riscv/priv-isa-cv32a65x.html | 69 +++----------------
.../riscv/priv-isa-cv64a6_mmu.html | 69 +++----------------
docs/riscv-isa/src/machine.adoc | 45 +++++-------
3 files changed, 34 insertions(+), 149 deletions(-)
diff --git a/docs/04_cv32a65x/riscv/priv-isa-cv32a65x.html b/docs/04_cv32a65x/riscv/priv-isa-cv32a65x.html
index 13d9d4fc3a..e7861f8092 100644
--- a/docs/04_cv32a65x/riscv/priv-isa-cv32a65x.html
+++ b/docs/04_cv32a65x/riscv/priv-isa-cv32a65x.html
@@ -4256,34 +4256,13 @@
3.6. Physical Memory Attributes
systems implement and check PMAs.
-
[CV32A65X] PMAs are inherent properties of the underlying hardware. The PMAs of
-some memory regions are fixed at chip design time.
-
-
-
[CV32A65X] Some PMAs are dynamically
-checked in hardware later in the execution pipeline after the physical
-address is known, as some operations will not be supported at all
-physical memory addresses, and some operations require knowing the
-setting of a PMA attribute.
-
-
-
[CV32A65X] For RISC-V, we separate out specification and checking of PMAs into a
-separate hardware structure, the PMA checker. In CV32A65X, the
-attributes are known at system design time for each physical address
-region, and are hardwired into the PMA checker.
-PMAs are checked for any access to physical memory, including accesses
-that have undergone virtual to physical memory translation. To aid in
-system debugging, we strongly recommend that, where possible, RISC-V
-processors precisely trap physical memory accesses that fail PMA checks.
-Precisely trapped PMA violations manifest as instruction, load, or store
-access-fault exceptions, distinct from virtual-memory page-fault
-exceptions. Precise PMA traps might not always be possible, for example,
-when probing a legacy bus architecture that uses access failures as part
-of the discovery mechanism. In this case, error responses from
-peripheral devices will be reported as imprecise bus-error interrupts.
-
-
-
[CV32A65X] PMAs are not readable by software.
+
[CV32A65X] PMA is not implemented by CV32A65X but information
+is sent outside the processor to be able to check PMA outside processor.
+These checkers are based on the following information contained in the
+memory accesses requested by the processor.
+- The information which indicates whether memory access is read, write or
+execution,
+- The access length information to check the subword and subblock access rights.
3.6.1. Main Memory versus I/O Regions
@@ -4367,44 +4346,14 @@
3.6.5. Memory-Ordering PMAs
3.6.6. Coherence and Cacheability PMAs
-
[CV32A65X] Write accesses are not cached. No cache-coherence scheme
+
[CV32A65X] Caches are not implemented. No cache-coherence scheme
is implemented.
-
-
If a PMA indicates non-cacheability, then accesses to that region must
-be satisfied by the memory itself, not by any caches.
-
3.6.7. Idempotency PMAs
-
Idempotency PMAs describe whether reads and writes to an address region
-are idempotent. Main memory regions are assumed to be idempotent. For
-I/O regions, idempotency on reads and writes can be specified separately
-(e.g., reads are idempotent but writes are not). If accesses are
-non-idempotent, i.e., there is potentially a side effect on any read or
-write access, then speculative or redundant accesses must be avoided.
-
-
-
For the purposes of defining the idempotency PMAs, changes in observed
-memory ordering created by redundant accesses are not considered a side
-effect.
-
-
-
For non-idempotent regions, implicit reads and writes must not be
-performed early or speculatively, with the following exceptions. When a
-non-speculative implicit read is performed, an implementation is
-permitted to additionally read any of the bytes within a naturally
-aligned power-of-2 region containing the address of the non-speculative
-implicit read. Furthermore, when a non-speculative instruction fetch is
-performed, an implementation is permitted to additionally read any of
-the bytes within the next naturally aligned power-of-2 region of the
-same size (with the address of the region taken modulo
-2XLEN. The results of these additional reads
-may be used to satisfy subsequent early or speculative implicit reads.
-The size of these naturally aligned power-of-2 regions is
-implementation-defined, but, for systems with page-based virtual memory,
-must not exceed the smallest supported page size.
[CV64A6_MMU] PMAs are inherent properties of the underlying hardware. The PMAs of
-some memory regions are fixed at chip design time.
-
-
-
[CV64A6_MMU] Some PMAs are dynamically
-checked in hardware later in the execution pipeline after the physical
-address is known, as some operations will not be supported at all
-physical memory addresses, and some operations require knowing the
-setting of a PMA attribute.
-
-
-
[CV64A6_MMU] For RISC-V, we separate out specification and checking of PMAs into a
-separate hardware structure, the PMA checker. In CV64A6_MMU, the
-attributes are known at system design time for each physical address
-region, and are hardwired into the PMA checker.
-PMAs are checked for any access to physical memory, including accesses
-that have undergone virtual to physical memory translation. To aid in
-system debugging, we strongly recommend that, where possible, RISC-V
-processors precisely trap physical memory accesses that fail PMA checks.
-Precisely trapped PMA violations manifest as instruction, load, or store
-access-fault exceptions, distinct from virtual-memory page-fault
-exceptions. Precise PMA traps might not always be possible, for example,
-when probing a legacy bus architecture that uses access failures as part
-of the discovery mechanism. In this case, error responses from
-peripheral devices will be reported as imprecise bus-error interrupts.
-
-
-
[CV64A6_MMU] PMAs are not readable by software.
+
[CV64A6_MMU] PMA is not implemented by CV64A6_MMU but information
+is sent outside the processor to be able to check PMA outside processor.
+These checkers are based on the following information contained in the
+memory accesses requested by the processor.
+- The information which indicates whether memory access is read, write or
+execution,
+- The access length information to check the subword and subblock access rights.
3.6.1. Main Memory versus I/O Regions
@@ -4609,44 +4588,14 @@
3.6.5. Memory-Ordering PMAs
3.6.6. Coherence and Cacheability PMAs
-
[CV64A6_MMU] Write accesses are not cached. No cache-coherence scheme
+
[CV64A6_MMU] Caches are not implemented. No cache-coherence scheme
is implemented.
-
-
If a PMA indicates non-cacheability, then accesses to that region must
-be satisfied by the memory itself, not by any caches.
-
3.6.7. Idempotency PMAs
-
Idempotency PMAs describe whether reads and writes to an address region
-are idempotent. Main memory regions are assumed to be idempotent. For
-I/O regions, idempotency on reads and writes can be specified separately
-(e.g., reads are idempotent but writes are not). If accesses are
-non-idempotent, i.e., there is potentially a side effect on any read or
-write access, then speculative or redundant accesses must be avoided.
-
-
-
For the purposes of defining the idempotency PMAs, changes in observed
-memory ordering created by redundant accesses are not considered a side
-effect.
-
-
-
For non-idempotent regions, implicit reads and writes must not be
-performed early or speculatively, with the following exceptions. When a
-non-speculative implicit read is performed, an implementation is
-permitted to additionally read any of the bytes within a naturally
-aligned power-of-2 region containing the address of the non-speculative
-implicit read. Furthermore, when a non-speculative instruction fetch is
-performed, an implementation is permitted to additionally read any of
-the bytes within the next naturally aligned power-of-2 region of the
-same size (with the address of the region taken modulo
-2XLEN. The results of these additional reads
-may be used to satisfy subsequent early or speculative implicit reads.
-The size of these naturally aligned power-of-2 regions is
-implementation-defined, but, for systems with page-based virtual memory,
-must not exceed the smallest supported page size.
The OpenHW Group uses semantic versioning to
+describe the release status of its IP. This document describes the
+CV32A65X configuration version of CVA6. This intends to be the first
+formal release of CVA6.
+
+
+
CVA6 is a 6-stage in-order and single issue processor core which
+implements the RISC-V instruction set. CVA6 can be configured as a 32-
+or 64-bit core (RV32 or RV64), called CV32A6 or CV64A6.
+
+
+
The objective of this document is to provide enough information to allow
+the RTL modification (by designers) and the RTL verification (by
+verificators). This document is not dedicated to CVA6 users looking for
+information to develop software like instructions or registers.
+
+
+
The CVA6 architecture is illustrated in the following figure.
+
+
+
+
+
+
1.1. License
+
+
Copyright 2022 Thales
+Copyright 2018 ETH Zürich and University of Bologna
+SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file except in compliance with the License, or, at your option, the Apache License version 2.0. You may obtain a copy of the License at https://solderpad.org/licenses/SHL-2.1/.
+Unless required by applicable law or agreed to in writing, any work distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+
+
+
+
1.2. Standards Compliance
+
+
To ease the reading, the reference to these specifications can be
+implicit in the requirements below. For the sake of precision, the
+requirements identify the versions of RISC-V extensions from these
+specifications.
[RVunpriv] “The RISC-V Instruction Set Manual, Volume I: User-Level
+ISA, Document Version 20191213”, Editors Andrew Waterman and Krste
+Asanović, RISC-V Foundation, December 13, 2019.
+
+
+
[RVpriv] “The RISC-V Instruction Set Manual, Volume II: Privileged
+Architecture, Document Version 20211203”, Editors Andrew Waterman, Krste
+Asanović and John Hauser, RISC-V Foundation, December 4, 2021.
+
+
+
[RVdbg] “RISC-V External Debug Support, Document Version 0.13.2”,
+Editors Tim Newsome and Megan Wachs, RISC-V Foundation, March 22, 2019.
CV32A6 is a standards-compliant 32-bit processor fully compliant with
+RISC-V specifications: [RVunpriv], [RVpriv] and [RVdbg] and passes
+[RVcompat] compatibility tests, as requested by [GEN-10] in [CVA6req].
+
+
+
+
1.3. Documentation framework
+
+
The framework of this document is inspired by the Common Criteria. The
+Common Criteria for Information Technology Security Evaluation (referred
+to as Common Criteria or CC) is an international standard (ISO/IEC
+15408) for computer security certification.
+
+
+
Description of the framework:
+
+
+
+
+
Processor is split into module corresponding to the main modules of
+the design
+
+
+
Modules can contain several modules
+
+
+
Each module is described in a chapter, which contains the following
+subchapters: Description, Functionalities, Architecture and
+Modules and Registers (if any)
+
+
+
The subchapter Description describes the main features of the
+submodule, the interconnections between the current module and the
+others and the inputs/outputs interface.
+
+
+
The subchapter Functionality lists in details the module
+functionalities. Please avoid using the RTL signal names to explain the
+functionalities.
+
+
+
The subchapter Architecture and Modules provides a drawing to
+present the module hierarchy, then the functionalities covered by the
+module
+
+
+
The subchapter Registers specifies the module registers if any
The CVA6 is a subsystem composed of the modules and protocol interfaces
+as illustrated The processor is a Harvard-based modern architecture.
+Instructions are issued in-order through the DECODE stage and executed
+out-of-order but committed in-order. The processor is Single issue, that
+means that at maximum one instruction per cycle can be issued to the
+EXECUTE stage.
+
+
+
The CVA6 implements a 6-stage pipeline composed of PC Generation,
+Instruction Fetch, Instruction Decode, Issue stage, Execute stage and
+Commit stage. At least 6 cycles are needed to execute one instruction.
+
+
+
+
2.2. Connection with other sub-systems
+
+
The submodule is connected to :
+
+
+
+
+
NOC interconnect provides memory content
+
+
+
COPROCESSOR connects through CV-X-IF coprocessor interface protocol
Enable superscalar* with 2 issue ports and 2 commit ports.
+
True
+
+
+
NrCommitPorts
+
Number of commit ports. Forced to 2 if SuperscalarEn.
+
1
+
+
+
NrLoadPipeRegs
+
Load cycle latency number
+
0
+
+
+
NrStorePipeRegs
+
Store cycle latency number
+
0
+
+
+
NrScoreboardEntries
+
Scoreboard length
+
8
+
+
+
NrLoadBufEntries
+
Load buffer entry buffer
+
2
+
+
+
MaxOutstandingStores
+
Maximum number of outstanding stores
+
7
+
+
+
RASDepth
+
Return address stack depth
+
2
+
+
+
BTBEntries
+
Branch target buffer entries
+
0
+
+
+
BHTEntries
+
Branch history entries
+
32
+
+
+
InstrTlbEntries
+
MMU instruction TLB entries
+
2
+
+
+
DataTlbEntries
+
MMU data TLB entries
+
2
+
+
+
UseSharedTlb
+
MMU option to use shared TLB
+
True
+
+
+
SharedTlbDepth
+
MMU depth of shared TLB
+
64
+
+
+
+
+
+
2.4. IO ports
+
+
Table 2. cva6 module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
boot_addr_i
+
in
+
Reset boot address
+
SUBSYSTEM
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
hart_id_i
+
in
+
Hard ID reflected as CSR
+
SUBSYSTEM
+
logic[CVA6Cfg.XLEN-1:0]
+
+
+
irq_i
+
in
+
Level sensitive (async) interrupts
+
SUBSYSTEM
+
logic[1:0]
+
+
+
ipi_i
+
in
+
Inter-processor (async) interrupt
+
SUBSYSTEM
+
logic
+
+
+
time_irq_i
+
in
+
Timer (async) interrupt
+
SUBSYSTEM
+
logic
+
+
+
cvxif_req_o
+
out
+
CVXIF request
+
SUBSYSTEM
+
cvxif_req_t
+
+
+
cvxif_resp_i
+
in
+
CVXIF response
+
SUBSYSTEM
+
cvxif_resp_t
+
+
+
noc_req_o
+
out
+
noc request, can be AXI or OpenPiton
+
SUBSYSTEM
+
noc_req_t
+
+
+
noc_resp_i
+
in
+
noc response, can be AXI or OpenPiton
+
SUBSYSTEM
+
noc_resp_t
+
+
+
+
+
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+
+
+
As DebugEn = False,
+
+
+
+
+
debug_req_i input is tied to 0
+
+
+
+
+
As IsRVFI = 0,
+
+
+
+
+
rvfi_probes_o output is tied to 0
+
+
+
+
+
+
+
+
+
+
+
3. Functionality
+
+
+
3.1. Instructions
+
+
The next subchapter lists the extensions implemented in CV32A65X. By
+configuration, we can enable/disable the extensions. CV32A65X supports
+the extensions described in the next subchapters.
+
+
+
+
3.2. isa
+
+
3.2.1. Instructions
+
+
+
+
+
+
+
+
+
Subset Name
+
Name
+
Description
+
+
+
+
+
I
+
RV32I Base Integer Instructions
+
the base integer instruction set, also known as the 'RV32I' or 'RV64I' instruction set , depending on the address space size, provides the core functionality required for general-purpose computing .it includes instructions for arithmetic, logical, and control operations, as well as memory accessand manipulation
+
+
+
M
+
RV32M Multiplication and Division Instructions
+
the standard integer multiplication and division instruction extension, which is named “M” and contains instructions that multiply or divide values held in two integer registers.
+
+
+
C
+
RV32C Compressed Instructions
+
RVC uses a simple compression scheme that offers shorter 16-bit versions of common 32-bit RISC-V instructions when: the immediate or address offset is small; one of the registers is the zero register (x0), the ABI link register (x1), or the ABI stack pointer (x2); the destination register and the first source register are identical; the registers used are the 8 most popular ones.The C extension is compatible with all other standard instruction extensions. The C extension allows 16-bit instructions to be freely intermixed with 32-bit instructions, with the latter now able to start on any 16-bit boundary. With the addition of the C extension, JAL and JALR instructions will no longer raise an instruction misaligned exception
+
+
+
Zicsr
+
RV32Zicsr Control and Status Register Instructions
+
All CSR instructions atomically read-modify-write a single CSR, whose CSR specifier is encoded in the 12-bit csr field of the instruction held in bits 31–20. The immediate forms use a 5-bit zero-extended immediate encoded in the rs1 field.
+
+
+
Zifencei
+
RVZifencei Instruction Fetch Fence
+
FENCE.I instruction that provides explicit synchronization between writes to instruction memory and instruction fetches on the same hart.Currently, this instruction is the only standard mechanism to ensure that stores visible to a hart will also be visible to it instruction fetches.
+
+
+
Zcb
+
RV32Zcb Code Size Reduction Instructions
+
Zcb belongs to the group of extensions called RISC-V Code Size Reduction Extension (Zc*). Zc* has become the superset of the Standard C extension adding more 16-bit instructions to the ISA. Zcb includes the 16-bit version of additional Integer (I), Multiply (M), and Bit-Manipulation (Zbb) Instructions. All the Zcb instructions require at least standard C extension support as a prerequisite, along with M and Zbb extensions for the 16-bit version of the respective instructions.
+
+
+
Zba
+
RVZba Address generation instructions
+
The Zba instructions can be used to accelerate the generation of addresses that index into arrays of basic types (halfword, word, doubleword) using both unsigned word-sized and XLEN-sized indices: a shifted index is added to a base address. The shift and add instructions do a left shift of 1, 2, or 3 because these are commonly found in real-world code and because they can be implemented with a minimal amount of additional hardware beyond that of the simple adder. This avoids lengthening the critical path in implementations. While the shift and add instructions are limited to a maximum left shift of 3, the slli instruction (from the base ISA) can be used to perform similar shifts for indexing into arrays of wider elements. The slli.uw added in this extension can be used when the index is to be interpreted as an unsigned word.
+
+
+
Zbb
+
RVZbb Basic bit-manipulation
+
The bit-manipulation (bitmanip) extension collection is comprised of several component extensions to the base RISC-V architecture that are intended to provide some combination of code size reduction, performance improvement, and energy reduction. While the instructions are intended to have general use, some instructions are more useful in some domains than others. Hence, several smaller bitmanip extensions are provided. Each of these smaller extensions is grouped by common function and use case, and each has its own Zb*-extension name.
+
+
+
Zbc
+
RVZbc Carry-less multiplication
+
Carry-less multiplication is the multiplication in the polynomial ring over GF(2).clmul produces the lower half of the carry-less product and clmulh produces the upper half of the 2✕XLEN carry-less product.clmulr produces bits 2✕XLEN−2:XLEN-1 of the 2✕XLEN carry-less product.
+
+
+
Zbs
+
RVZbs Single bit Instructions
+
The single-bit instructions provide a mechanism to set, clear, invert, or extract a single bit in a register. The bit is specified by its index.
+
+
+
Zicntr
+
Zicntr
+
No info found yet for extension Zicntr
+
+
+
+
+
+
3.2.2. RV32I Base Integer Instructions
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
Format
+
Pseudocode
+
Invalid_values
+
Exception_raised
+
Description
+
Op Name
+
+
+
+
+
ADDI
+
addi rd, rs1, imm[11:0]
+
x[rd] = x[rs1] + sext(imm[11:0])
+
NONE
+
NONE
+
add sign-extended 12-bit immediate to register rs1, and store the result in register rd.
+
Integer_Register_Immediate_Operations
+
+
+
ANDI
+
andi rd, rs1, imm[11:0]
+
x[rd] = x[rs1] & sext(imm[11:0])
+
NONE
+
NONE
+
perform bitwise AND on register rs1 and the sign-extended 12-bit immediate and place the result in rd.
+
Integer_Register_Immediate_Operations
+
+
+
ORI
+
ori rd, rs1, imm[11:0]
+
x[rd] = x[rs1] | sext(imm[11:0])
+
NONE
+
NONE
+
perform bitwise OR on register rs1 and the sign-extended 12-bit immediate and place the result in rd.
+
Integer_Register_Immediate_Operations
+
+
+
XORI
+
xori rd, rs1, imm[11:0]
+
x[rd] = x[rs1] ^ sext(imm[11:0])
+
NONE
+
NONE
+
perform bitwise XOR on register rs1 and the sign-extended 12-bit immediate and place the result in rd.
set register rd to 1 if register rs1 is less than the sign extended immediate when both are treated as unsigned numbers, else 0 is written to rd."
+
Integer_Register_Immediate_Operations
+
+
+
SLLI
+
slli rd, rs1, imm[4:0]
+
x[rd] = x[rs1] << imm[4:0]
+
NONE
+
NONE
+
logical left shift (zeros are shifted into the lower bits).
+
Integer_Register_Immediate_Operations
+
+
+
SRLI
+
srli rd, rs1, imm[4:0]
+
x[rd] = x[rs1] >> imm[4:0]
+
NONE
+
NONE
+
logical right shift (zeros are shifted into the upper bits).
+
Integer_Register_Immediate_Operations
+
+
+
SRAI
+
srai rd, rs1, imm[4:0]
+
x[rd] = x[rs1] >>s imm[4:0]
+
NONE
+
NONE
+
arithmetic right shift (the original sign bit is copied into the vacated upper bits).
+
Integer_Register_Immediate_Operations
+
+
+
LUI
+
lui rd, imm[19:0]
+
x[rd] = sext(imm[31:12] << 12)
+
NONE
+
NONE
+
place the immediate value in the top 20 bits of the destination register rd, filling in the lowest 12 bits with zeros.
+
Integer_Register_Immediate_Operations
+
+
+
AUIPC
+
auipc rd, imm[19:0]
+
x[rd] = pc + sext(immediate[31:12] << 12)
+
NONE
+
NONE
+
form a 32-bit offset from the 20-bit immediate, filling in the lowest 12 bits with zeros, adds this offset to the pc, then place the result in register rd.
+
Integer_Register_Immediate_Operations
+
+
+
ADD
+
add rd, rs1, rs2
+
x[rd] = x[rs1] + x[rs2]
+
NONE
+
NONE
+
add rs2 to register rs1, and store the result in register rd.
+
Integer_Register_Register_Operations
+
+
+
SUB
+
sub rd, rs1, rs2
+
x[rd] = x[rs1] - x[rs2]
+
NONE
+
NONE
+
subtract rs2 from register rs1, and store the result in register rd.
+
Integer_Register_Register_Operations
+
+
+
AND
+
and rd, rs1, rs2
+
x[rd] = x[rs1] & x[rs2]
+
NONE
+
NONE
+
perform bitwise AND on register rs1 and rs2 and place the result in rd.
+
Integer_Register_Register_Operations
+
+
+
OR
+
or rd, rs1, rs2
+
x[rd] = x[rs1] | x[rs2]
+
NONE
+
NONE
+
perform bitwise OR on register rs1 and rs2 and place the result in rd.
+
Integer_Register_Register_Operations
+
+
+
XOR
+
xor rd, rs1, rs2
+
x[rd] = x[rs1] ^ x[rs2]
+
NONE
+
NONE
+
perform bitwise XOR on register rs1 and rs2 and place the result in rd.
+
Integer_Register_Register_Operations
+
+
+
SLT
+
slt rd, rs1, rs2
+
if (x[rs1] < x[rs2]) x[rd] = 1 else x[rd] = 0
+
NONE
+
NONE
+
set register rd to 1 if register rs1 is less than rs2 when both are treated as signed numbers, else 0 is written to rd.
+
Integer_Register_Register_Operations
+
+
+
SLTU
+
sltu rd, rs1, rs2
+
if (x[rs1] <u x[rs2]) x[rd] = 1 else x[rd] = 0
+
NONE
+
NONE
+
set register rd to 1 if register rs1 is less than rs2 when both are treated as unsigned numbers, else 0 is written to rd.
+
Integer_Register_Register_Operations
+
+
+
SLL
+
sll rd, rs1, rs2
+
x[rd] = x[rs1] << x[rs2]
+
NONE
+
NONE
+
logical left shift (zeros are shifted into the lower bits).
+
Integer_Register_Register_Operations
+
+
+
SRL
+
srl rd, rs1, rs2
+
x[rd] = x[rs1] >> x[rs2]
+
NONE
+
NONE
+
logical right shift (zeros are shifted into the upper bits).
+
Integer_Register_Register_Operations
+
+
+
SRA
+
sra rd, rs1, rs2
+
x[rd] = x[rs1] >>s x[rs2]
+
NONE
+
NONE
+
arithmetic right shift (the original sign bit is copied into the vacated upper bits).
+
Integer_Register_Register_Operations
+
+
+
JAL
+
jal rd, imm[20:1]
+
x[rd] = pc+4; pc += sext(imm[20:1])
+
NONE
+
jumps to an unaligned address (4-byte or 2-byte boundary) will usually raise an exception.
+
offset is sign-extended and added to the pc to form the jump target address (pc is calculated using signed arithmetic), then setting the least-significant bit of the result to zero, and store the address of instruction following the jump (pc+4) into register rd.
+
Control_Transfer_Operations-Unconditional_Jumps
+
+
+
JALR
+
jalr rd, rs1, imm[11:0]
+
t = pc+4; pc = (x[rs1]+sext(imm[11:0]))&∼1 ; x[rd] = t
+
NONE
+
jumps to an unaligned address (4-byte or 2-byte boundary) will usually raise an exception.
+
target address is obtained by adding the 12-bit signed immediate to the register rs1 (pc is calculated using signed arithmetic), then setting the least-significant bit of the result to zero, and store the address of instruction following the jump (pc+4) into register rd.
+
Control_Transfer_Operations-Unconditional_Jumps
+
+
+
BEQ
+
beq rs1, rs2, imm[12:1]
+
if (x[rs1] == x[rs2]) pc += sext({imm[12:1], 1’b0}) else pc += 4
+
NONE
+
no instruction fetch misaligned exception is generated for a conditional branch that is not taken. An Instruction address misaligned exception is raised if the target address is not aligned on 4-byte or 2-byte boundary, because the core supports compressed instructions.
+
takes the branch (pc is calculated using signed arithmetic) if registers rs1 and rs2 are equal.
+
Control_Transfer_Operations-Conditional_Branches
+
+
+
BNE
+
bne rs1, rs2, imm[12:1]
+
if (x[rs1] != x[rs2]) pc += sext({imm[12:1], 1’b0}) else pc += 4
+
NONE
+
no instruction fetch misaligned exception is generated for a conditional branch that is not taken. An Instruction address misaligned exception is raised if the target address is not aligned on 4-byte or 2-byte boundary, because the core supports compressed instructions.
+
takes the branch (pc is calculated using signed arithmetic) if registers rs1 and rs2 are not equal.
+
Control_Transfer_Operations-Conditional_Branches
+
+
+
BLT
+
blt rs1, rs2, imm[12:1]
+
if (x[rs1] < x[rs2]) pc += sext({imm[12:1], 1’b0}) else pc += 4
+
NONE
+
no instruction fetch misaligned exception is generated for a conditional branch that is not taken. An Instruction address misaligned exception is raised if the target address is not aligned on 4-byte or 2-byte boundary, because the core supports compressed instructions.
+
takes the branch (pc is calculated using signed arithmetic) if registers rs1 less than rs2 (using signed comparison).
+
Control_Transfer_Operations-Conditional_Branches
+
+
+
BLTU
+
bltu rs1, rs2, imm[12:1]
+
if (x[rs1] <u x[rs2]) pc += sext({imm[12:1], 1’b0}) else pc += 4
+
NONE
+
no instruction fetch misaligned exception is generated for a conditional branch that is not taken. An Instruction address misaligned exception is raised if the target address is not aligned on 4-byte or 2-byte boundary, because the core supports compressed instructions.
+
takes the branch (pc is calculated using signed arithmetic) if registers rs1 less than rs2 (using unsigned comparison).
+
Control_Transfer_Operations-Conditional_Branches
+
+
+
BGE
+
bge rs1, rs2, imm[12:1]
+
if (x[rs1] >= x[rs2]) pc += sext({imm[12:1], 1’b0}) else pc += 4
+
NONE
+
no instruction fetch misaligned exception is generated for a conditional branch that is not taken. An Instruction address misaligned exception is raised if the target address is not aligned on 4-byte or 2-byte boundary, because the core supports compressed instructions.
+
takes the branch (pc is calculated using signed arithmetic) if registers rs1 is greater than or equal rs2 (using signed comparison).
+
Control_Transfer_Operations-Conditional_Branches
+
+
+
BGEU
+
bgeu rs1, rs2, imm[12:1]
+
if (x[rs1] >=u x[rs2]) pc += sext({imm[12:1], 1’b0}) else pc += 4
+
NONE
+
no instruction fetch misaligned exception is generated for a conditional branch that is not taken. An Instruction address misaligned exception is raised if the target address is not aligned on 4-byte or 2-byte boundary, because the core supports compressed instructions.
+
takes the branch (pc is calculated using signed arithmetic) if registers rs1 is greater than or equal rs2 (using unsigned comparison).
+
Control_Transfer_Operations-Conditional_Branches
+
+
+
LB
+
lb rd, imm(rs1)
+
x[rd] = sext(M[x[rs1] + sext(imm[11:0])][7:0])
+
NONE
+
loads with a destination of x0 must still raise any exceptions and action any other side effects even though the load value is discarded.
+
loads a 8-bit value from memory, then sign-extends to 32-bit before storing in rd (rd is calculated using signed arithmetic), the effective address is obtained by adding register rs1 to the sign-extended 12-bit offset.
+
Load_and_Store_Instructions
+
+
+
LH
+
lh rd, imm(rs1)
+
x[rd] = sext(M[x[rs1] + sext(imm[11:0])][15:0])
+
NONE
+
loads with a destination of x0 must still raise any exceptions and action any other side effects even though the load value is discarded, also an exception is raised if the memory address isn’t aligned (2-byte boundary).
+
loads a 16-bit value from memory, then sign-extends to 32-bit before storing in rd (rd is calculated using signed arithmetic), the effective address is obtained by adding register rs1 to the sign-extended 12-bit offset.
+
Load_and_Store_Instructions
+
+
+
LW
+
lw rd, imm(rs1)
+
x[rd] = sext(M[x[rs1] + sext(imm[11:0])][31:0])
+
NONE
+
loads with a destination of x0 must still raise any exceptions and action any other side effects even though the load value is discarded, also an exception is raised if the memory address isn’t aligned (4-byte boundary).
+
loads a 32-bit value from memory, then storing in rd (rd is calculated using signed arithmetic). The effective address is obtained by adding register rs1 to the sign-extended 12-bit offset.
+
Load_and_Store_Instructions
+
+
+
LBU
+
lbu rd, imm(rs1)
+
x[rd] = zext(M[x[rs1] + sext(imm[11:0])][7:0])
+
NONE
+
loads with a destination of x0 must still raise any exceptions and action any other side effects even though the load value is discarded.
+
loads a 8-bit value from memory, then zero-extends to 32-bit before storing in rd (rd is calculated using unsigned arithmetic), the effective address is obtained by adding register rs1 to the sign-extended 12-bit offset.
+
Load_and_Store_Instructions
+
+
+
LHU
+
lhu rd, imm(rs1)
+
x[rd] = zext(M[x[rs1] + sext(imm[11:0])][15:0])
+
NONE
+
loads with a destination of x0 must still raise any exceptions and action any other side effects even though the load value is discarded, also an exception is raised if the memory address isn’t aligned (2-byte boundary).
+
loads a 16-bit value from memory, then zero-extends to 32-bit before storing in rd (rd is calculated using unsigned arithmetic), the effective address is obtained by adding register rs1 to the sign-extended 12-bit offset.
+
Load_and_Store_Instructions
+
+
+
SB
+
sb rs2, imm(rs1)
+
M[x[rs1] + sext(imm[11:0])][7:0] = x[rs2][7:0]
+
NONE
+
NONE
+
stores a 8-bit value from the low bits of register rs2 to memory, the effective address is obtained by adding register rs1 to the sign-extended 12-bit offset.
+
Load_and_Store_Instructions
+
+
+
SH
+
sh rs2, imm(rs1)
+
M[x[rs1] + sext(imm[11:0])][15:0] = x[rs2][15:0]
+
NONE
+
an exception is raised if the memory address isn’t aligned (2-byte boundary).
+
stores a 16-bit value from the low bits of register rs2 to memory, the effective address is obtained by adding register rs1 to the sign-extended 12-bit offset.
+
Load_and_Store_Instructions
+
+
+
SW
+
sw rs2, imm(rs1)
+
M[x[rs1] + sext(imm[11:0])][31:0] = x[rs2][31:0]
+
NONE
+
an exception is raised if the memory address isn’t aligned (4-byte boundary).
+
stores a 32-bit value from register rs2 to memory, the effective address is obtained by adding register rs1 to the sign-extended 12-bit offset.
+
Load_and_Store_Instructions
+
+
+
FENCE
+
fence pre, succ
+
No operation (nop)
+
NONE
+
NONE
+
order device I/O and memory accesses as viewed by other RISC-V harts and external devices or coprocessors. Any combination of device input (I), device output (O), memory reads ®, and memory writes (W) may be ordered with respect to any combination of the same. Informally, no other RISC-V hart or external device can observe any operation in the successor set following a FENCE before any operation in the predecessor set preceding the FENCE, as the core support 1 hart, the fence instruction has no effect so we can considerate it as a nop instruction.
+
Memory_Ordering
+
+
+
ECALL
+
ecall
+
RaiseException(EnvironmentCall)
+
NONE
+
Raise an Environment Call exception.
+
make a request to the supporting execution environment, which is usually an operating system. The ABI for the system will define how parameters for the environment request are passed, but usually these will be in defined locations in the integer register file.
+
Environment_Call_and_Breakpoints
+
+
+
EBREAK
+
ebreak
+
x[8 + rd'] = sext(x[8 + rd'][7:0])
+
NONE
+
NONE
+
This instruction takes a single source/destination operand. It sign-extends the least-significant byte in the operand by copying the most-significant bit in the byte (i.e., bit 7) to all of the more-significant bits. It also requires Bit-Manipulation (Zbb) extension support.
+
Environment_Call_and_Breakpoints
+
+
+
+
+
+
3.2.3. RV32M Multiplication and Division Instructions
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
Format
+
Pseudocode
+
Invalid_values
+
Exception_raised
+
Description
+
Op Name
+
+
+
+
+
MUL
+
mul rd, rs1, rs2
+
x[rd] = x[rs1] * x[rs2]
+
NONE
+
NONE
+
performs a 32-bit × 32-bit multiplication and places the lower 32 bits in the destination register (Both rs1 and rs2 treated as signed numbers).
+
Multiplication Operations
+
+
+
MULH
+
mulh rd, rs1, rs2
+
x[rd] = (x[rs1] s*s x[rs2]) >>s 32
+
NONE
+
NONE
+
performs a 32-bit × 32-bit multiplication and places the upper 32 bits in the destination register of the 64-bit product (Both rs1 and rs2 treated as signed numbers).
+
Multiplication Operations
+
+
+
MULHU
+
mulhu rd, rs1, rs2
+
x[rd] = (x[rs1] u*u x[rs2]) >>u 32
+
NONE
+
NONE
+
performs a 32-bit × 32-bit multiplication and places the upper 32 bits in the destination register of the 64-bit product (Both rs1 and rs2 treated as unsigned numbers).
+
Multiplication Operations
+
+
+
MULHSU
+
mulhsu rd, rs1, rs2
+
x[rd] = (x[rs1] s*u x[rs2]) >>s 32
+
NONE
+
NONE
+
performs a 32-bit × 32-bit multiplication and places the upper 32 bits in the destination register of the 64-bit product (rs1 treated as signed number, rs2 treated as unsigned number).
+
Multiplication Operations
+
+
+
DIV
+
div rd, rs1, rs2
+
x[rd] = x[rs1] /s x[rs2]
+
NONE
+
NONE
+
perform signed integer division of 32 bits by 32 bits (rounding towards zero).
+
Division Operations
+
+
+
DIVU
+
divu rd, rs1, rs2
+
x[rd] = x[rs1] /u x[rs2]
+
NONE
+
NONE
+
perform unsigned integer division of 32 bits by 32 bits (rounding towards zero).
+
Division Operations
+
+
+
REM
+
rem rd, rs1, rs2
+
x[rd] = x[rs1] %s x[rs2]
+
NONE
+
NONE
+
provide the remainder of the corresponding division operation DIV (the sign of rd equals the sign of rs1).
+
Division Operations
+
+
+
REMU
+
rem rd, rs1, rs2
+
x[rd] = x[rs1] %u x[rs2]
+
NONE
+
NONE
+
provide the remainder of the corresponding division operation DIVU.
+
Division Operations
+
+
+
+
+
+
3.2.4. RV32C Compressed Instructions
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
Format
+
Pseudocode
+
Invalid_values
+
Exception_raised
+
Description
+
Op Name
+
+
+
+
+
C.LI
+
c.li rd, imm[5:0]
+
x[rd] = sext(imm[5:0])
+
rd = x0
+
NONE
+
loads the sign-extended 6-bit immediate, imm, into register rd.
+
Integer Computational Instructions
+
+
+
C.LUI
+
c.lui rd, nzimm[17:12]
+
x[rd] = sext(nzimm[17:12] << 12)
+
rd = x0 & rd = x2 & nzimm = 0
+
NONE
+
loads the non-zero 6-bit immediate field into bits 17–12 of the destination register, clears the bottom 12 bits, and sign-extends bit 17 into all higher bits of the destination.
+
Integer Computational Instructions
+
+
+
C.ADDI
+
c.addi rd, nzimm[5:0]
+
x[rd] = x[rd] + sext(nzimm[5:0])
+
rd = x0 & nzimm = 0
+
NONE
+
adds the non-zero sign-extended 6-bit immediate to the value in register rd then writes the result to rd.
+
Integer Computational Instructions
+
+
+
C.ADDI16SP
+
c.addi16sp nzimm[9:4]
+
x[2] = x[2] + sext(nzimm[9:4])
+
rd != x2 & nzimm = 0
+
NONE
+
adds the non-zero sign-extended 6-bit immediate to the value in the stack pointer (sp=x2), where the immediate is scaled to represent multiples of 16 in the range (-512,496). C.ADDI16SP is used to adjust the stack pointer in procedure prologues and epilogues. C.ADDI16SP shares the opcode with C.LUI, but has a destination field of x2.
+
Integer Computational Instructions
+
+
+
C.ADDI4SPN
+
c.addi4spn rd', nzimm[9:2]
+
x[8 + rd'] = x[2] + zext(nzimm[9:2])
+
nzimm = 0
+
NONE
+
adds a zero-extended non-zero immediate, scaled by 4, to the stack pointer, x2, and writes the result to rd'. This instruction is used to generate pointers to stack-allocated variables.
+
Integer Computational Instructions
+
+
+
C.SLLI
+
c.slli rd, uimm[5:0]
+
x[rd] = x[rd] << uimm[5:0]
+
rd = x0 & uimm[5] = 0
+
NONE
+
performs a logical left shift (zeros are shifted into the lower bits).
+
Integer Computational Instructions
+
+
+
C.SRLI
+
c.srli rd', uimm[5:0]
+
x[8 + rd'] = x[8 + rd'] >> uimm[5:0]
+
uimm[5] = 0
+
NONE
+
performs a logical right shift (zeros are shifted into the upper bits).
+
Integer Computational Instructions
+
+
+
C.SRAI
+
c.srai rd', uimm[5:0]
+
x[8 + rd'] = x[8 + rd'] >>s uimm[5:0]
+
uimm[5] = 0
+
NONE
+
performs an arithmetic right shift (sign bits are shifted into the upper bits).
+
Integer Computational Instructions
+
+
+
C.ANDI
+
c.andi rd', imm[5:0]
+
x[8 + rd'] = x[8 + rd'] & sext(imm[5:0])
+
NONE
+
NONE
+
computes the bitwise AND of the value in register rd', and the sign-extended 6-bit immediate, then writes the result to rd'.
+
Integer Computational Instructions
+
+
+
C.ADD
+
c.add rd, rs2
+
x[rd] = x[rd] + x[rs2]
+
rd = x0 & rs2 = x0
+
NONE
+
adds the values in registers rd and rs2 and writes the result to register rd.
+
Integer Computational Instructions
+
+
+
C.MV
+
c.mv rd, rs2
+
x[rd] = x[rs2]
+
rd = x0 & rs2 = x0
+
NONE
+
copies the value in register rs2 into register rd.
+
Integer Computational Instructions
+
+
+
C.AND
+
c.and rd', rs2'
+
x[8 + rd'] = x[8 + rd'] & x[8 + rs2']
+
NONE
+
NONE
+
computes the bitwise AND of of the value in register rd', and register rs2', then writes the result to rd'.
+
Integer Computational Instructions
+
+
+
C.OR
+
c.or rd', rs2'
+
x[8 + rd'] = x[8 + rd'] | x[8 + rs2']
+
NONE
+
NONE
+
computes the bitwise OR of of the value in register rd', and register rs2', then writes the result to rd'.
+
Integer Computational Instructions
+
+
+
C.XOR
+
c.and rd', rs2'
+
x[8 + rd'] = x[8 + rd'] ^ x[8 + rs2']
+
NONE
+
NONE
+
computes the bitwise XOR of of the value in register rd', and register rs2', then writes the result to rd'.
+
Integer Computational Instructions
+
+
+
C.SUB
+
c.sub rd', rs2'
+
x[8 + rd'] = x[8 + rd'] - x[8 + rs2']
+
NONE
+
NONE
+
subtracts the value in registers rs2' from value in rd' and writes the result to register rd'.
+
Integer Computational Instructions
+
+
+
C.EBREAK
+
c.ebreak
+
RaiseException(Breakpoint)
+
NONE
+
Raise a Breakpoint exception.
+
cause control to be transferred back to the debugging environment.
+
Integer Computational Instructions
+
+
+
C.J
+
c.j imm[11:1]
+
pc += sext(imm[11:1])
+
NONE
+
jumps to an unaligned address (4-byte or 2-byte boundary) will usually raise an exception.
+
performs an unconditional control transfer. The offset is sign-extended and added to the pc to form the jump target address.
+
Control Transfer Instructions
+
+
+
C.JAL
+
c.jal imm[11:1]
+
x[1] = pc+2; pc += sext(imm[11:1])
+
NONE
+
jumps to an unaligned address (4-byte or 2-byte boundary) will usually raise an exception.
+
performs the same operation as C.J, but additionally writes the address of the instruction following the jump (pc+2) to the link register, x1.
+
Control Transfer Instructions
+
+
+
C.JR
+
c.jr rs1
+
pc = x[rs1]
+
rs1 = x0
+
jumps to an unaligned address (4-byte or 2-byte boundary) will usually raise an exception.
+
performs an unconditional control transfer to the address in register rs1.
+
Control Transfer Instructions
+
+
+
C.JALR
+
c.jalr rs1
+
t = pc+2; pc = x[rs1]; x[1] = t
+
rs1 = x0
+
jumps to an unaligned address (4-byte or 2-byte boundary) will usually raise an exception.
+
performs the same operation as C.JR, but additionally writes the address of the instruction following the jump (pc+2) to the link register, x1.
+
Control Transfer Instructions
+
+
+
C.BEQZ
+
c.beqz rs1', imm[8:1]
+
if (x[8+rs1'] == 0) pc += sext(imm[8:1])
+
NONE
+
no instruction fetch misaligned exception is generated for a conditional branch that is not taken. An Instruction address misaligned exception is raised if the target address is not aligned on 4-byte or 2-byte boundary, because the core supports compressed instructions.
+
performs conditional control transfers. The offset is sign-extended and added to the pc to form the branch target address. C.BEQZ takes the branch if the value in register rs1' is zero.
+
Control Transfer Instructions
+
+
+
C.BNEZ
+
c.bnez rs1', imm[8:1]
+
if (x[8+rs1'] != 0) pc += sext(imm[8:1])
+
NONE
+
no instruction fetch misaligned exception is generated for a conditional branch that is not taken. An Instruction address misaligned exception is raised if the target address is not aligned on 4-byte or 2-byte boundary, because the core supports compressed instructions.
+
performs conditional control transfers. The offset is sign-extended and added to the pc to form the branch target address. C.BEQZ takes the branch if the value in register rs1' isn’t zero.
+
Control Transfer Instructions
+
+
+
C.LWSP
+
c.lwsp rd, uimm(x2)
+
x[rd] = M[x[2] + zext(uimm[7:2])][31:0]
+
rd = x0
+
loads with a destination of x0 must still raise any exceptions, also an exception if the memory address isn’t aligned (4-byte boundary).
+
loads a 32-bit value from memory into register rd. It computes an effective address by adding the zero-extended offset, scaled by 4, to the stack pointer, x2.
+
Load and Store Instructions
+
+
+
C.SWSP
+
c.swsp rd, uimm(x2)
+
M[x[2] + zext(uimm[7:2])][31:0] = x[rs2]
+
NONE
+
an exception raised if the memory address isn’t aligned (4-byte boundary).
+
stores a 32-bit value in register rs2 to memory. It computes an effective address by adding the zero-extended offset, scaled by 4, to the stack pointer, x2.
+
Load and Store Instructions
+
+
+
C.LW
+
c.lw rd', uimm(rs1')
+
x[8+rd'] = M[x[8+rs1'] + zext(uimm[6:2])][31:0])
+
NONE
+
an exception raised if the memory address isn’t aligned (4-byte boundary).
+
loads a 32-bit value from memory into register rd'. It computes an effective address by adding the zero-extended offset, scaled by 4, to the base address in register rs1'.
+
Load and Store Instructions
+
+
+
C.SW
+
c.sw rs2', uimm(rs1')
+
M[x[8+rs1'] + zext(uimm[6:2])][31:0] = x[8+rs2']
+
NONE
+
an exception raised if the memory address isn’t aligned (4-byte boundary).
+
stores a 32-bit value from memory into register rd'. It computes an effective address by adding the zero-extended offset, scaled by 4, to the base address in register rs1'.
+
Load and Store Instructions
+
+
+
+
+
+
3.2.5. RV32Zicsr Control and Status Register Instructions
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
Format
+
Pseudocode
+
Invalid_values
+
Exception_raised
+
Description
+
Op Name
+
+
+
+
+
CSRRW
+
csrrw rd, csr, rs1
+
t = CSRs[csr]; CSRs[csr] = x[rs1]; x[rd] = t
+
NONE
+
Attempts to access a non-existent CSR raise an illegal instruction exception. Attempts to access a CSR without appropriate privilege level or to write a read-only register also raise illegal instruction exceptions.
+
Reads the old value of the CSR, zero-extends the value to 32 bits, then writes it to integer register rd. The initial value in rs1 is written to the CSR. If rd=x0, then the instruction shall not read the CSR and shall not cause any of the side-effects that might occur on a CSR read.
+
Control and Status Register Operations
+
+
+
CSRRS
+
csrrs rd, csr, rs1
+
t = CSRs[csr]; CSRs[csr] = t | x[rs1]; x[rd] = t
+
NONE
+
Attempts to access a non-existent CSR raise an illegal instruction exception. Attempts to access a CSR without appropriate privilege level or to write a read-only register also raise illegal instruction exceptions.
+
Reads the value of the CSR, zero-extends the value to 32 bits, and writes it to integer register rd. The initial value in integer register rs1 is treated as a bit mask that specifies bit positions to be set in the CSR. Any bit that is high in rs1 will cause the corresponding bit to be set in the CSR, if that CSR bit is writable. Other bits in the CSR are unaffected (though CSRs might have side effects when written). If rs1=x0, then the instruction will not write to the CSR at all, and so shall not cause any of the side effects that might otherwise occur on a CSR write, such as raising illegal instruction exceptions on accesses to read-only CSRs.
+
Control and Status Register Operations
+
+
+
CSRRC
+
csrrc rd, csr, rs1
+
t = CSRs[csr]; CSRs[csr] = t & ∼x[rs1]; x[rd] = t
+
NONE
+
Attempts to access a non-existent CSR raise an illegal instruction exception. Attempts to access a CSR without appropriate privilege level or to write a read-only register also raise illegal instruction exceptions.
+
Reads the value of the CSR, zero-extends the value to 32 bits, and writes it to integer register rd. The initial value in integer register rs1 is treated as a bit mask that specifies bit positions to be cleared in the CSR. Any bit that is high in rs1 will cause the corresponding bit to be set in the CSR, if that CSR bit is writable. Other bits in the CSR are unaffected (though CSRs might have side effects when written). If rs1=x0, then the instruction will not write to the CSR at all, and so shall not cause any of the side effects that might otherwise occur on a CSR write, such as raising illegal instruction exceptions on accesses to read-only CSRs.
+
Control and Status Register Operations
+
+
+
CSRRWI
+
csrrwi rd, csr, uimm[4:0]
+
x[rd] = CSRs[csr]; CSRs[csr] = zext(uimm[4:0])
+
NONE
+
Attempts to access a non-existent CSR raise an illegal instruction exception. Attempts to access a CSR without appropriate privilege level or to write a read-only register also raise illegal instruction exceptions.
+
Reads the old value of the CSR, zero-extends the value to 32 bits, then writes it to integer register rd. The zero-extends immediate is written to the CSR. If rd=x0, then the instruction shall not read the CSR and shall not cause any of the side-effects that might occur on a CSR read.
+
Control and Status Register Operations
+
+
+
CSRRSI
+
csrrsi rd, csr, uimm[4:0]
+
t = CSRs[csr]; CSRs[csr] = t | zext(uimm[4:0]); x[rd] = t
+
NONE
+
Attempts to access a non-existent CSR raise an illegal instruction exception. Attempts to access a CSR without appropriate privilege level or to write a read-only register also raise illegal instruction exceptions.
+
Reads the value of the CSR, zero-extends the value to 32 bits, and writes it to integer register rd. The zero-extends immediate value is treated as a bit mask that specifies bit positions to be set in the CSR. Any bit that is high in zero-extends immediate will cause the corresponding bit to be set in the CSR, if that CSR bit is writable. Other bits in the CSR are unaffected (though CSRs might have side effects when written). If the uimm[4:0] field is zero, then these instructions will not write to the CSR, and shall not cause any of the side effects that might otherwise occur on a CSR write.
+
Control and Status Register Operations
+
+
+
CSRRCI
+
csrrci rd, csr, uimm[4:0]
+
t = CSRs[csr]; CSRs[csr] = t & ∼zext(uimm[4:0]); x[rd] = t
+
NONE
+
Attempts to access a non-existent CSR raise an illegal instruction exception. Attempts to access a CSR without appropriate privilege level or to write a read-only register also raise illegal instruction exceptions.
+
Reads the value of the CSR, zero-extends the value to 32 bits, and writes it to integer register rd. The zero-extends immediate value is treated as a bit mask that specifies bit positions to be cleared in the CSR. Any bit that is high in zero-extends immediate will cause the corresponding bit to be set in the CSR, if that CSR bit is writable. Other bits in the CSR are unaffected (though CSRs might have side effects when written). If the uimm[4:0] field is zero, then these instructions will not write to the CSR, and shall not cause any of the side effects that might otherwise occur on a CSR write.
+
Control and Status Register Operations
+
+
+
+
+
+
3.2.6. RVZifencei Instruction Fetch Fence
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
Format
+
Pseudocode
+
Invalid_values
+
Exception_raised
+
Description
+
Op Name
+
+
+
+
+
FENCE.I
+
fence.i
+
Fence(Store, Fetch)
+
NONE
+
NONE
+
The FENCE.I instruction is used to synchronize the instruction and data streams. RISC-V does not guarantee that stores to instruction memory will be made visible to instruction fetches on the same RISC-V hart until a FENCE.I instruction is executed. A FENCE.I instruction only ensures that a subsequent instruction fetch on a RISC-V hart will see any previous data stores already visible to the same RISC-V hart.
+
Fetch Fence Operations
+
+
+
+
+
+
3.2.7. RV32Zcb Code Size Reduction Instructions
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
Format
+
Pseudocode
+
Invalid_values
+
Exception_raised
+
Description
+
Op Name
+
+
+
+
+
C.ZEXT.B
+
c.zext.b rd'
+
x[8 + rd'] = zext(x[8 + rd'][7:0])
+
NONE
+
NONE
+
This instruction takes a single source/destination operand. It zero-extends the least-significant byte of the operand by inserting zeros into all of the bits more significant than 7.
+
Code Size Reduction Operations
+
+
+
C.SEXT.B
+
c.sext.b rd'
+
x[8 + rd'] = sext(x[8 + rd'][7:0])
+
NONE
+
NONE
+
This instruction takes a single source/destination operand. It sign-extends the least-significant byte in the operand by copying the most-significant bit in the byte (i.e., bit 7) to all of the more-significant bits. It also requires Bit-Manipulation (Zbb) extension support.
+
Code Size Reduction Operations
+
+
+
C.ZEXT.H
+
c.zext.h rd'
+
x[8 + rd'] = zext(x[8 + rd'][15:0])
+
NONE
+
NONE
+
This instruction takes a single source/destination operand. It zero-extends the least-significant halfword of the operand by inserting zeros into all of the bits more significant than 15. It also requires Bit-Manipulation (Zbb) extension support.
+
Code Size Reduction Operations
+
+
+
C.SEXT.H
+
c.sext.h rd'
+
x[8 + rd'] = sext(x[8 + rd'][15:0])
+
NONE
+
NONE
+
This instruction takes a single source/destination operand. It sign-extends the least-significant halfword in the operand by copying the most-significant bit in the halfword (i.e., bit 15) to all of the more-significant bits. It also requires Bit-Manipulation (Zbb) extension support.
+
Code Size Reduction Operations
+
+
+
C.NOT
+
c.not rd'
+
x[8 + rd'] = x[8 + rd'] ^ -1
+
NONE
+
NONE
+
This instruction takes the one’s complement of rd'/rs1' and writes the result to the same register.
+
Code Size Reduction Operations
+
+
+
C.MUL
+
c.mul rd', rs2'
+
x[8 + rd'] = (x[8 + rd'] * x[8 + rs2'])[31:0]
+
NONE
+
NONE
+
performs a 32-bit × 32-bit multiplication and places the lower 32 bits in the destination register (Both rd' and rs2' treated as signed numbers). It also requires M extension support.
an exception raised if the memory address isn’t aligned (2-byte boundary).
+
This instruction loads a halfword from the memory address formed by adding rs1' to the zero extended immediate uimm. The resulting halfword is zero extended and is written to rd'.
an exception raised if the memory address isn’t aligned (2-byte boundary).
+
This instruction loads a halfword from the memory address formed by adding rs1' to the zero extended immediate uimm. The resulting halfword is sign extended and is written to rd'.
This instruction loads a byte from the memory address formed by adding rs1' to the zero extended immediate uimm. The resulting byte is zero extended and is written to rd'.
+
Code Size Reduction Operations
+
+
+
C.SH
+
c.sh rs2', uimm(rs1')
+
M[x[8+rs1'] + zext(uimm[1])][15:0] = x[8+rs2']
+
NONE
+
an exception raised if the memory address isn’t aligned (2-byte boundary).
+
This instruction stores the least significant halfword of rs2' to the memory address formed by adding rs1' to the zero extended immediate uimm.
+
Code Size Reduction Operations
+
+
+
C.SB
+
c.sb rs2', uimm(rs1')
+
M[x[8+rs1'] + zext(uimm[1:0])][7:0] = x[8+rs2']
+
NONE
+
NONE
+
This instruction stores the least significant byte of rs2' to the memory address formed by adding rs1' to the zero extended immediate uimm.
+
Code Size Reduction Operations
+
+
+
+
+
+
3.2.8. RVZba Address generation instructions
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
Format
+
Pseudocode
+
Invalid_values
+
Exception_raised
+
Description
+
Op Name
+
+
+
+
+
ADD.UW
+
add.uw rd, rs1, rs2
+
X(rd) = rs2 + EXTZ(X(rs1)[31..0])
+
NONE
+
NONE
+
This instruction performs an XLEN-wide addition between rs2 and the zero-extended least-significant word of rs1.
+
Address generation instructions
+
+
+
SH1ADD
+
sh1add rd, rs1, rs2
+
X(rd) = X(rs2) + (X(rs1) << 1)
+
NONE
+
NONE
+
This instruction shifts rs1 to the left by 1 bit and adds it to rs2.
+
Address generation instructions
+
+
+
SH1ADD.UW
+
sh1add.uw rd, rs1, rs2
+
X(rd) = rs2 + (EXTZ(X(rs1)[31..0]) << 1)
+
NONE
+
NONE
+
This instruction performs an XLEN-wide addition of two addends. The first addend is rs2. The second addend is the unsigned value formed by extracting the least-significant word of rs1 and shifting it left by 1 place.
+
Address generation instructions
+
+
+
SH2ADD
+
sh2add rd, rs1, rs2
+
X(rd) = X(rs2) + (X(rs1) << 2)
+
NONE
+
NONE
+
This instruction shifts rs1 to the left by 2 bit and adds it to rs2.
+
Address generation instructions
+
+
+
SH2ADD.UW
+
sh2add.uw rd, rs1, rs2
+
X(rd) = rs2 + (EXTZ(X(rs1)[31..0]) << 2)
+
NONE
+
NONE
+
This instruction performs an XLEN-wide addition of two addends. The first addend is rs2. The second addend is the unsigned value formed by extracting the least-significant word of rs1 and shifting it left by 2 places.
+
Address generation instructions
+
+
+
SH3ADD
+
sh3add rd, rs1, rs2
+
X(rd) = X(rs2) + (X(rs1) << 3)
+
NONE
+
NONE
+
This instruction shifts rs1 to the left by 3 bit and adds it to rs2.
+
Address generation instructions
+
+
+
SH3ADD.UW
+
sh3add.uw rd, rs1, rs2
+
X(rd) = rs2 + (EXTZ(X(rs1)[31..0]) << 3)
+
NONE
+
NONE
+
This instruction performs an XLEN-wide addition of two addends. The first addend is rs2. The second addend is the unsigned value formed by extracting the least-significant word of rs1 and shifting it left by 3 places.
+
Address generation instructions
+
+
+
SLLI.UW
+
slli.uw rd, rs1, imm
+
X(rd) = (EXTZ(X(rs)[31..0]) << imm)
+
NONE
+
NONE
+
This instruction takes the least-significant word of rs1, zero-extends it, and shifts it left by the immediate.
+
Address generation instructions
+
+
+
+
+
+
3.2.9. RVZbb Basic bit-manipulation
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
Format
+
Pseudocode
+
Invalid_values
+
Exception_raised
+
Description
+
Op Name
+
+
+
+
+
ANDN
+
andn rd, rs1, rs2
+
X(rd) = X(rs1) & ~X(rs2)
+
NONE
+
NONE
+
Performs bitwise AND operation between rs1 and bitwise inversion of rs2.
+
Logical_with_negate
+
+
+
ORN
+
orn rd, rs1, rs2
+
X(rd) = X(rs1) | ~X(rs2)
+
NONE
+
NONE
+
Performs bitwise OR operation between rs1 and bitwise inversion of rs2.
+
Logical_with_negate
+
+
+
XNOR
+
xnor rd, rs1, rs2
+
X(rd) = ~(X(rs1) ^ X(rs2))
+
NONE
+
NONE
+
Performs bitwise XOR operation between rs1 and rs2, then complements the result.
+
Logical_with_negate
+
+
+
CLZ
+
clz rd, rs
+
if [x[i]] == 1 then return(i) else return -1
+
NONE
+
NONE
+
Counts leading zero bits in rs.
+
Count_leading_trailing_zero_bits
+
+
+
CTZ
+
ctz rd, rs
+
if [x[i]] == 1 then return(i) else return xlen;
+
NONE
+
NONE
+
Counts trailing zero bits in rs.
+
Count_leading_trailing_zero_bits
+
+
+
CLZW
+
clzw rd, rs
+
if [x[i]] == 1 then return(i) else return -1
+
NONE
+
NONE
+
Counts leading zero bits in the least-significant word of rs.
+
Count_leading_trailing_zero_bits
+
+
+
CTZW
+
ctzw rd, rs
+
if [x[i]] == 1 then return(i) else return 32;
+
NONE
+
NONE
+
Counts trailing zero bits in the least-significant word of rs.
+
Count_leading_trailing_zero_bits
+
+
+
CPOP
+
cpop rd, rs
+
if rs[i] == 1 then bitcount = bitcount + 1 else ()
+
NONE
+
NONE
+
Counts set bits in rs.
+
Count_population
+
+
+
CPOPW
+
cpopw rd, rs
+
if rs[i] == 0b1 then bitcount = bitcount + 1 else ()
+
NONE
+
NONE
+
Counts set bits in the least-significant word of rs.
+
Count_population
+
+
+
MAX
+
max rd, rs1, rs2
+
if rs1_val <_s rs2_val then rs2_val else rs1_val
+
NONE
+
NONE
+
Returns the larger of two signed integers.
+
Integer_minimum_maximum
+
+
+
MAXU
+
maxu rd, rs1, rs2
+
if rs1_val <_u rs2_val then rs2_val else rs1_val
+
NONE
+
NONE
+
Returns the larger of two unsigned integers.
+
Integer_minimum_maximum
+
+
+
MIN
+
min rd, rs1, rs2
+
if rs1_val <_s rs2_val then rs1_val else rs2_val
+
NONE
+
NONE
+
Returns the smaller of two signed integers.
+
Integer_minimum_maximum
+
+
+
MINU
+
minu rd, rs1, rs2
+
if rs1_val <_u rs2_val then rs1_val else rs2_val
+
NONE
+
NONE
+
Returns the smaller of two unsigned integers.
+
Integer_minimum_maximum
+
+
+
SEXT.B
+
sext.b rd, rs
+
X(rd) = EXTS(X(rs)[7..0])
+
NONE
+
NONE
+
Sign-extends the least-significant byte in the source to XLEN.
+
Sign_and_zero_extension
+
+
+
SEXT.H
+
sext.h rd, rs
+
X(rd) = EXTS(X(rs)[15..0])
+
NONE
+
NONE
+
Sign-extends the least-significant halfword in rs to XLEN.
+
Sign_and_zero_extension
+
+
+
ZEXT.H
+
zext.h rd, rs
+
X(rd) = EXTZ(X(rs)[15..0])
+
NONE
+
NONE
+
Zero-extends the least-significant halfword of the source to XLEN.
Performs a rotate right on the least-significant word of rs1 by the amount in least-significant 5 bits of rs2.
+
Bitwise_rotation
+
+
+
ORC.b
+
orc.b rd, rs
+
if { input[(i + 7)..i] == 0 then 0b00000000 else 0b11111111
+
NONE
+
NONE
+
Sets the bits of each byte in rd to all zeros if no bit within the respective byte of rs is set, or to all ones if any bit within the respective byte of rs is set.
+
OR_Combine
+
+
+
REV8
+
rev8 rd, rs
+
output[i..(i + 7)] = input[(j - 7)..j]
+
NONE
+
NONE
+
Reverses the order of the bytes in rs.
+
Byte_reverse
+
+
+
+
+
+
3.2.10. RVZbc Carry-less multiplication
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
Format
+
Pseudocode
+
Invalid_values
+
Exception_raised
+
Description
+
Op Name
+
+
+
+
+
CLMUL
+
clmul rd, rs1, rs2
+
foreach (i from 1 to xlen by 1) { output = if ((rs2 >> i) & 1) then output ^ (rs1 << i); else output;}
+
NONE
+
NONE
+
clmul produces the lower half of the 2.XLEN carry-less product.
+
Carry-less multiplication Operations
+
+
+
CLMULH
+
clmulh rd, rs1, rs2
+
foreach (i from 1 to xlen by 1) { output = if rs2_val else output}
+
NONE
+
NONE
+
clmulh produces the upper half of the 2.XLEN carry-less product.
+
Carry-less multiplication Operations
+
+
+
CLMULR
+
clmulr rd, rs1, rs2
+
foreach (i from 0 to (xlen - 1) by 1) { output = if rs2_val else output}
+
NONE
+
NONE
+
clmulr produces bits 2.XLEN-2:XLEN-1 of the 2.XLEN carry-less product.
+
Carry-less multiplication Operations
+
+
+
+
+
+
3.2.11. RVZbs Single bit Instructions
+
+
+
+
+
+
+
+
+
+
+
+
+
Name
+
Format
+
Pseudocode
+
Invalid_values
+
Exception_raised
+
Description
+
Op Name
+
+
+
+
+
BCLR
+
bclr rd, rs1, rs2
+
X(rd) = X(rs1) & ~(1 << (X(rs2) & (XLEN - 1)))
+
NONE
+
NONE
+
This instruction returns rs1 with a single bit cleared at the index specified in rs2. The index is read from the lower log2(XLEN) bits of rs2.
+
Single_bit_Operations
+
+
+
BCLRI
+
bclri rd, rs1, shamt
+
X(rd) = X(rs1) & ~(1 << (shamt & (XLEN - 1)))
+
NONE
+
NONE
+
This instruction returns rs1 with a single bit cleared at the index specified in shamt. The index is read from the lower log2(XLEN) bits of shamt. For RV32, the encodings corresponding to shamt[5]=1 are reserved.
+
Single_bit_Operations
+
+
+
BEXT
+
bext rd, rs1, rs2
+
X(rd) = (X(rs1) >> (X(rs2) & (XLEN - 1))) & 1
+
NONE
+
NONE
+
This instruction returns a single bit extracted from rs1 at the index specified in rs2. The index is read from the lower log2(XLEN) bits of rs2.
+
Single_bit_Operations
+
+
+
BEXTI
+
bexti rd, rs1, shamt
+
X(rd) = (X(rs1) >> (shamt & (XLEN - 1))) & 1
+
NONE
+
NONE
+
This instruction returns a single bit extracted from rs1 at the index specified in rs2. The index is read from the lower log2(XLEN) bits of shamt. For RV32, the encodings corresponding to shamt[5]=1 are reserved.
+
Single_bit_Operations
+
+
+
BINV
+
binv rd, rs1, rs2
+
X(rd) = X(rs1) ^ (1 << (X(rs2) & (XLEN - 1)))
+
NONE
+
NONE
+
This instruction returns rs1 with a single bit inverted at the index specified in rs2. The index is read from the lower log2(XLEN) bits of rs2.
+
Single_bit_Operations
+
+
+
BINVI
+
binvi rd, rs1, shamt
+
X(rd) = X(rs1) ^ (1 << (shamt & (XLEN - 1)))
+
NONE
+
NONE
+
This instruction returns rs1 with a single bit inverted at the index specified in shamt. The index is read from the lower log2(XLEN) bits of shamt. For RV32, the encodings corresponding to shamt[5]=1 are reserved.
+
Single_bit_Operations
+
+
+
BSET
+
bset rd, rs1, rs2
+
X(rd) = X(rs1) | (1 << (X(rs2) & (XLEN - 1)))
+
NONE
+
NONE
+
This instruction returns rs1 with a single bit set at the index specified in rs2. The index is read from the lower log2(XLEN) bits of rs2.
+
Single_bit_Operations
+
+
+
BSETI
+
bseti rd, rs1, shamt
+
X(rd) = X(rs1) | (1 << (shamt & (XLEN - 1)))
+
NONE
+
NONE
+
This instruction returns rs1 with a single bit set at the index specified in shamt. The index is read from the lower log2(XLEN) bits of shamt. For RV32, the encodings corresponding to shamt[5]=1 are reserved.
+
Single_bit_Operations
+
+
+
+
+
+
+
3.3. Traps, Interrupts, Exceptions
+
+
Traps are composed of interrupts and exceptions.
+Interrupts are asynchronous events whereas exceptions are synchronous ones.
+On one hand, interrupts are occuring independently of the instructions
+(mainly raised by peripherals or debug module).
+On the other hand, an instruction may raise exceptions synchronously.
+
+
+
3.3.1. Raising Traps
+
+
When a trap is raised, the behaviour of the CVA6 core depends on
+several CSRs and some CSRs are modified.
+
+
+
3.3.1.1. Configuration CSRs
+
+
CSRs having an effect on the core behaviour when a trap occurs are:
+
+
+
+
+
mstatus and sstatus: several fields control the core behaviour like interrupt enable (MIE, SIE)
+
+
+
mtvec and stvec: specifies the address of trap handler.
+
+
+
medeleg: specifies which exceptions can be handled by a lower privileged mode (S-mode)
+
+
+
mideleg: specifies which interrupts can be handled by a lower privileged mode (S-mode)
+
+
+
+
+
+
3.3.1.2. Modified CSRs
+
+
CSRs (or fields) updated by the core when a trap occurs are:
+
+
+
+
+
mstatus or sstatus: several fields are updated like previous privilege mode (MPP, SPP), previous interrupt enabled (MPIE, SPIE``)
+
+
+
mepc or sepc: updated with the virtual address of the interrupted instruction or the instruction raising the exception.
+
+
+
mcause or scause: updated with a code indicating the event causing the trap.
+
+
+
mtval or stval: updated with exception specific information like the faulting virtual address
+
+
+
+
+
+
3.3.1.3. Supported exceptions
+
+
The following exceptions are supported by the CVA6:
+
+
+
+
+
instruction address misaligned
+
+
+
+
control flow instruction with misaligned target
+
+
+
+
+
+
instruction access fault
+
+
+
+
access to PMP region without execute permissions
+
+
+
+
+
+
illegal instruction:
+
+
+
+
unimplemented CSRs
+
+
+
unsupported extensions
+
+
+
+
+
+
breakpoint (EBREAK)
+
+
+
load address misaligned:
+
+
+
+
LH at 2n+1 address
+
+
+
LW at 4n+1, 4n+2, 4n+3 address
+
+
+
+
+
+
load access fault
+
+
+
+
access to PMP region without read permissions
+
+
+
+
+
+
store/AMO address misaligned
+
+
+
+
SH at 2n+1 address
+
+
+
SW at 4n+1, 4n+2, 4n+3 address
+
+
+
+
+
+
store/AMO access fault
+
+
+
+
access to PMP region without write permissions
+
+
+
+
+
+
environment call (ECALL) from U-mode
+
+
+
environment call (ECALL) from S-mode
+
+
+
environment call (ECALL) from M-mode
+
+
+
instruction page fault
+
+
+
load page fault
+
+
+
+
access to effective address without read permissions
+
+
+
+
+
+
store/AMO page fault
+
+
+
+
access to effective address without write permissions
+
+
+
+
+
+
debug request (custom) via debug interface
+
+
+
+
+
Note: all exceptions are supported except the ones linked to the hypervisor extension
+
+
+
+
+
3.3.2. Trap return
+
+
Trap handler ends with trap return instruction (MRET, SRET). The behaviour of the CVA6 core depends on several CSRs.
+
+
+
3.3.2.1. Configuration CSRs
+
+
CSRs having an effect on the core behaviour when returning from a trap are:
+
+
+
+
+
mstatus: several fields control the core behaviour like previous privilege mode (MPP, SPP), previous interrupt enabled (MPIE, SPIE)
+
+
+
+
+
+
3.3.2.2. Modified CSRs
+
+
CSRs (or fields) updated by the core when returning from a trap are:
+
+
+
+
+
mstatus: several fields are updated like interrupt enable (MIE, SIE), modify privilege (MPRV)
+
+
+
+
+
+
+
3.3.3. Interrupts
+
+
+
+
external interrupt: irq_i signal
+
+
+
software interrupt (inter-processor interrupt): ipi_i signal
+
+
+
timer interrupt: time_irq_i signal
+
+
+
debug interrupt: debug_req_i signal
+
+
+
+
+
These signals are level sensitive. It means the interrupt is raised until it is cleared.
+
+
+
The exception code field (mcause CSR) depends on the interrupt source.
+
+
+
+
3.3.4. Wait for Interrupt
+
+
+
+
CVA6 implementation: WFI stalls the core. The instruction is not available in U-mode (raise illegal instruction exception). Such exception is also raised when TW=1 in mstatus.
+
+
+
+
+
+
+
3.4. csr
+
+
3.4.1. Conventions
+
+
In the subsequent sections, register fields are labeled with one of the following abbreviations:
+
+
+
+
+
WPRI (Writes Preserve Values, Reads Ignore Values): read/write field reserved
+for future use. For forward compatibility, implementations that do not
+furnish these fields must make them read-only zero.
+
+
+
WLRL (Write/Read Only Legal Values): read/write CSR field that specifies
+behavior for only a subset of possible bit encodings, with other bit encodings
+reserved.
+
+
+
WARL (Write Any Values, Reads Legal Values): read/write CSR fields which are
+only defined for a subset of bit encodings, but allow any value to be written
+while guaranteeing to return a legal value whenever read.
+
+
+
ROCST (Read-Only Constant): A special case of WARL field which admits only one
+legal value, and therefore, behaves as a constant field that silently ignores
+writes.
+
+
+
ROVAR (Read-Only Variable): A special case of WARL field which can take
+multiple legal values but cannot be modified by software and depends only on
+the architectural state of the hart.
+
+
+
+
+
In particular, a register that is not internally divided
+into multiple fields can be considered as containing a single field of XLEN bits.
+This allows to clearly represent read-write registers holding a single legal value
+(typically zero).
The mhpmevent is a MXLEN-bit event register which controls mhpmcounter3.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MHPMEVENT[I]
+
0x00000000
+
ROCST
+
0x00000000
+
The mhpmevent is a MXLEN-bit event register which controls mhpmcounter3.
+
+
+
+
+
+
3.4.3.7. MSCRATCH
+
+
+
Address
+
+
0x340
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRW
+
+
Description
+
+
The mscratch register is an MXLEN-bit read/write register dedicated for use by machine mode.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MSCRATCH
+
0x00000000
+
WARL
+
0x00000000 - 0xFFFFFFFF
+
The mscratch register is an MXLEN-bit read/write register dedicated for use by machine mode.
+
+
+
+
+
+
3.4.3.8. MEPC
+
+
+
Address
+
+
0x341
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRW
+
+
Description
+
+
The mepc is a warl register that must be able to hold all valid physical and virtual addresses.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MEPC
+
0x00000000
+
WARL
+
0x00000000 - 0xFFFFFFFF
+
The mepc is a warl register that must be able to hold all valid physical and virtual addresses.
+
+
+
+
+
+
3.4.3.9. MCAUSE
+
+
+
Address
+
+
0x342
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRW
+
+
Description
+
+
The mcause register stores the information regarding the trap.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[30:0]
+
EXCEPTION_CODE
+
0x0
+
WLRL
+
0 - 15
+
Encodes the exception code.
+
+
+
31
+
INTERRUPT
+
0x0
+
WLRL
+
0x0 - 0x1
+
Indicates whether the trap was due to an interrupt.
+
+
+
+
+
+
3.4.3.10. MTVAL
+
+
+
Address
+
+
0x343
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRW
+
+
Description
+
+
The mtval is a warl register that holds the address of the instruction which caused the exception.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MTVAL
+
0x00000000
+
ROCST
+
0x00000000
+
The mtval is a warl register that holds the address of the instruction which caused the exception.
+
+
+
+
+
+
3.4.3.11. MIP
+
+
+
Address
+
+
0x344
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRW
+
+
Description
+
+
The mip register is an MXLEN-bit read/write register containing information on pending interrupts.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
0
+
USIP
+
0x0
+
ROCST
+
0x0
+
User Software Interrupt Pending.
+
+
+
1
+
SSIP
+
0x0
+
ROCST
+
0x0
+
Supervisor Software Interrupt Pending.
+
+
+
2
+
VSSIP
+
0x0
+
ROCST
+
0x0
+
VS-level Software Interrupt Pending.
+
+
+
3
+
MSIP
+
0x0
+
ROCST
+
0x0
+
Machine Software Interrupt Pending.
+
+
+
4
+
UTIP
+
0x0
+
ROCST
+
0x0
+
User Timer Interrupt Pending.
+
+
+
5
+
STIP
+
0x0
+
ROCST
+
0x0
+
Supervisor Timer Interrupt Pending.
+
+
+
6
+
VSTIP
+
0x0
+
ROCST
+
0x0
+
VS-level Timer Interrupt Pending.
+
+
+
7
+
MTIP
+
0x0
+
ROVAR
+
0x1
+
Machine Timer Interrupt Pending.
+
+
+
8
+
UEIP
+
0x0
+
ROCST
+
0x0
+
User External Interrupt Pending.
+
+
+
9
+
SEIP
+
0x0
+
ROCST
+
0x0
+
Supervisor External Interrupt Pending.
+
+
+
10
+
VSEIP
+
0x0
+
ROCST
+
0x0
+
VS-level External Interrupt Pending.
+
+
+
11
+
MEIP
+
0x0
+
ROVAR
+
0x1
+
Machine External Interrupt Pending.
+
+
+
12
+
SGEIP
+
0x0
+
ROCST
+
0x0
+
HS-level External Interrupt Pending.
+
+
+
[31:13]
+
RESERVED_13
+
0x0
+
WPRI
+
+
Reserved
+
+
+
+
+
+
3.4.3.12. PMPCFG[0-3]
+
+
+
Address
+
+
0x3a0-0x3a3
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRW
+
+
Description
+
+
PMP configuration register
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[7:0]
+
PMP[I*4 + 0]CFG
+
0x0
+
WARL
+
0x00 - 0xFF
+
pmp configuration bits
+
+
+
[15:8]
+
PMP[I*4 + 1]CFG
+
0x0
+
WARL
+
0x00 - 0xFF
+
pmp configuration bits
+
+
+
[23:16]
+
PMP[I*4 + 2]CFG
+
0x0
+
WARL
+
0x00 - 0xFF
+
pmp configuration bits
+
+
+
[31:24]
+
PMP[I*4 + 3]CFG
+
0x0
+
WARL
+
0x00 - 0xFF
+
pmp configuration bits
+
+
+
+
+
+
3.4.3.13. PMPADDR[0-15]
+
+
+
Address
+
+
0x3b0-0x3bf
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRW
+
+
Description
+
+
Physical memory protection address register
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
PMPADDR[I]
+
0x00000000
+
WARL
+
0x00000000 - 0xFFFFFFFF
+
Physical memory protection address register
+
+
+
+
+
+
3.4.3.14. ICACHE
+
+
+
Address
+
+
0x7c0
+
+
Reset Value
+
+
0x00000001
+
+
Privilege
+
+
MRW
+
+
Description
+
+
the register controls the operation of the i-cache unit.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
0
+
ICACHE
+
0x1
+
RW
+
0x1
+
bit for cache-enable of instruction cache
+
+
+
[31:1]
+
RESERVED_1
+
0x0
+
WPRI
+
+
Reserved
+
+
+
+
+
+
3.4.3.15. DCACHE
+
+
+
Address
+
+
0x7c1
+
+
Reset Value
+
+
0x00000001
+
+
Privilege
+
+
MRW
+
+
Description
+
+
the register controls the operation of the d-cache unit.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
0
+
DCACHE
+
0x1
+
RW
+
0x1
+
bit for cache-enable of data cache
+
+
+
[31:1]
+
RESERVED_1
+
0x0
+
WPRI
+
+
Reserved
+
+
+
+
+
+
3.4.3.16. MCYCLE
+
+
+
Address
+
+
0xb00
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRW
+
+
Description
+
+
Counts the number of clock cycles executed from an arbitrary point in time.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MCYCLE
+
0x00000000
+
WARL
+
0x00000000 - 0xFFFFFFFF
+
Counts the number of clock cycles executed from an arbitrary point in time.
+
+
+
+
+
+
3.4.3.17. MINSTRET
+
+
+
Address
+
+
0xb02
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRW
+
+
Description
+
+
Counts the number of instructions completed from an arbitrary point in time.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MINSTRET
+
0x00000000
+
WARL
+
0x00000000 - 0xFFFFFFFF
+
Counts the number of instructions completed from an arbitrary point in time.
+
+
+
+
+
+
3.4.3.18. MHPMCOUNTER[3-31]
+
+
+
Address
+
+
0xb03-0xb1f
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRW
+
+
Description
+
+
The mhpmcounter is a 64-bit counter. Returns lower 32 bits in RV32I mode.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MHPMCOUNTER[I]
+
0x00000000
+
ROCST
+
0x00000000
+
The mhpmcounter is a 64-bit counter. Returns lower 32 bits in RV32I mode.
+
+
+
+
+
+
3.4.3.19. MCYCLEH
+
+
+
Address
+
+
0xb80
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRW
+
+
Description
+
+
upper 32 bits of mcycle
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MCYCLEH
+
0x00000000
+
WARL
+
0x00000000 - 0xFFFFFFFF
+
upper 32 bits of mcycle
+
+
+
+
+
+
3.4.3.20. MINSTRETH
+
+
+
Address
+
+
0xb82
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRW
+
+
Description
+
+
Upper 32 bits of minstret.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MINSTRETH
+
0x00000000
+
WARL
+
0x00000000 - 0xFFFFFFFF
+
Upper 32 bits of minstret.
+
+
+
+
+
+
3.4.3.21. MHPMCOUNTER[3-31]H
+
+
+
Address
+
+
0xb83-0xb9f
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRW
+
+
Description
+
+
The mhpmcounterh returns the upper half word in RV32I systems.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MHPMCOUNTER[I]H
+
0x00000000
+
ROCST
+
0x00000000
+
The mhpmcounterh returns the upper half word in RV32I systems.
+
+
+
+
+
+
3.4.3.22. MVENDORID
+
+
+
Address
+
+
0xf11
+
+
Reset Value
+
+
0x00000602
+
+
Privilege
+
+
MRO
+
+
Description
+
+
32-bit read-only register providing the JEDEC manufacturer ID of the provider of the core.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MVENDORID
+
0x00000602
+
ROCST
+
0x00000602
+
32-bit read-only register providing the JEDEC manufacturer ID of the provider of the core.
+
+
+
+
+
+
3.4.3.23. MARCHID
+
+
+
Address
+
+
0xf12
+
+
Reset Value
+
+
0x00000003
+
+
Privilege
+
+
MRO
+
+
Description
+
+
MXLEN-bit read-only register encoding the base microarchitecture of the hart.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MARCHID
+
0x00000003
+
ROCST
+
0x00000003
+
MXLEN-bit read-only register encoding the base microarchitecture of the hart.
+
+
+
+
+
+
3.4.3.24. MIMPID
+
+
+
Address
+
+
0xf13
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRO
+
+
Description
+
+
Provides a unique encoding of the version of the processor implementation.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MIMPID
+
0x00000000
+
ROCST
+
0x00000000
+
Provides a unique encoding of the version of the processor implementation.
+
+
+
+
+
+
3.4.3.25. MHARTID
+
+
+
Address
+
+
0xf14
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRO
+
+
Description
+
+
MXLEN-bit read-only register containing the integer ID of the hardware thread running the code.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MHARTID
+
0x00000000
+
ROCST
+
0x00000000
+
MXLEN-bit read-only register containing the integer ID of the hardware thread running the code.
+
+
+
+
+
+
3.4.3.26. MCONFIGPTR
+
+
+
Address
+
+
0xf15
+
+
Reset Value
+
+
0x00000000
+
+
Privilege
+
+
MRO
+
+
Description
+
+
MXLEN-bit read-only register that holds the physical address of a configuration data structure.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Bits
+
Field Name
+
Reset Value
+
Type
+
Legal Values
+
Description
+
+
+
+
+
[31:0]
+
MCONFIGPTR
+
0x00000000
+
ROCST
+
0x00000000
+
MXLEN-bit read-only register that holds the physical address of a configuration data structure.
+
+
+
+
+
+
+
+
3.5. AXI
+
+
3.5.1. Introduction
+
+
In this chapter, we describe in detail the restriction that apply to the supported features.
+
+
+
In order to understand how the AXI memory interface behaves in CVA6, it is necessary to read the AMBA AXI and ACE Protocol Specification (https://developer.arm.com/documentation/ihi0022/hc) and this chapter.
+
+
+
Applicability of this chapter to configurations:
+
+
+
+
+
+
+
+
+
Configuration
+
Implementation
+
+
+
+
+
CV32A60AX
+
AXI included
+
+
+
CV32A60X
+
AXI included
+
+
+
+
+
3.5.1.1. About the AXI4 protocol
+
+
The AMBA AXI protocol supports high-performance, high-frequency system designs for communication between Manager and Subordinate components.
+
+
+
The AXI protocol features are:
+
+
+
+
+
It is suitable for high-bandwidth and low-latency designs.
+
+
+
High-frequency operation is provided, without using complex bridges.
+
+
+
The protocol meets the interface requirements of a wide range of components.
+
+
+
It is suitable for memory controllers with high initial access latency.
+
+
+
Flexibility in the implementation of interconnect architectures is provided.
+
+
+
It is backward-compatible with AHB and APB interfaces.
+
+
+
+
+
The key features of the AXI protocol are:
+
+
+
+
+
Separate address/control and data phases.
+
+
+
Support for unaligned data transfers, using byte strobes.
+
+
+
Uses burst-based transactions with only the start address issued.
+
+
+
Separate read and write data channels, that can provide low-cost Direct Memory Access (DMA).
+
+
+
Support for issuing multiple outstanding addresses.
+
+
+
Support for out-of-order transaction completion.
+
+
+
Permits easy addition of register stages to provide timing closure.
The AXI bus protocol is used with the CVA6 processor as a memory interface. Since the processor is the one that initiates the connection with the memory, it will have a manager interface to send requests to the subordinate, which will be the memory.
+
+
+
Features supported by CVA6 are the ones in the AMBA AXI4 specification and the Atomic Operation feature from AXI5. With restriction that apply to some features.
+
+
+
This doesn’t mean that all the full set of signals available on an AXI interface are supported by the CVA6. Nevertheless, all required AXI signals are implemented.
+
+
+
Supported AXI4 features are defined in AXI Protocol Specification sections: A3, A4, A5, A6 and A7.
+
+
+
Supported AXI5 feature are defined in AXI Protocol Specification section: E1.1.
+
+
+
+
+
3.5.2. Signal Description (Section A2)
+
+
This section introduces the AXI memory interface signals of CVA6. Most of the signals are supported by CVA6, the tables summarizing the signals identify the exceptions.
+
+
+
In the following tables, the Src column tells whether the signal is driven by Manager ou Subordinate.
+
+
+
The AXI required and optional signals, and the default signals values that apply when an optional signal is not implemented are defined in AXI Protocol Specification section A9.3.
+
+
+
3.5.2.1. Global signals (Section A2.1)
+
+
Table 2.1 shows the global AXI memory interface signals.
+
+
+
+
+
+
+
+
+
+
Signal
+
Src
+
Description
+
+
+
+
+
ACLK
+
Clock source
+
+
Global clock signal. Synchronous signals are sampled on the
+rising edge of the global clock.
Table 2.2 shows the AXI memory interface write address channel signals. Unless the description indicates otherwise, a signal can take any parameter if is supported.
+
+
+
+
+
+
+
+
+
+
+
Signal
+
Src
+
Support
+
Description
+
+
+
+
+
AWID
+
M
+
+
Yes
+(optional)
+
+
+
Identification tag for a write transaction.
+CVA6 gives the id depending on the type of transaction.
+See transaction_identifiers_label.
+
+
+
+
AWADDR
+
M
+
Yes
+
+
The address of the first transfer in a write transaction.
+
+
+
+
AWLEN
+
M
+
+
Yes
+(optional)
+
+
+
Length, the exact number of data transfers in a write
+transaction. This information determines the number of
+data transfers associated with the address.
+All write transactions performed by CVA6 are of length 1.
+(AWLEN = 0b00000000)
+
+
+
+
AWSIZE
+
M
+
+
Yes
+(optional)
+
+
+
Size, the number of bytes in each data transfer in a write
+transaction
+See address_structure_label.
+
+
+
+
AWBURST
+
M
+
+
Yes
+(optional)
+
+
+
Burst type, indicates how address changes between each
+transfer in a write transaction.
+All write transactions performed by CVA6 are of burst type
+INCR. (AWBURST = 0b01)
+
+
+
+
AWLOCK
+
M
+
+
Yes
+(optional)
+
+
+
Provides information about the atomic characteristics of a
+write transaction.
+
+
+
+
AWCACHE
+
M
+
+
Yes
+(optional)
+
+
+
Indicates how a write transaction is required to progress
+through a system.
+The subordinate is always of type Normal Non-cacheable Non-bufferable.
+(AWCACHE = 0b0010)
+
+
+
+
AWPROT
+
M
+
Yes
+
+
Protection attributes of a write transaction:
+privilege, security level, and access type.
+The value of AWPROT is always 0b000.
+
+
+
+
AWQOS
+
M
+
+
No
+(optional)
+
+
+
Quality of Service identifier for a write transaction.
+AWQOS = 0b0000
+
+
+
+
AWREGION
+
M
+
+
No
+(optional)
+
+
+
Region indicator for a write transaction.
+AWREGION = 0b0000
+
+
+
+
AWUSER
+
M
+
+
No
+(optional)
+
+
+
User-defined extension for the write address channel.
+AWUSER = 0b00
+
+
+
+
AWATOP
+
M
+
+
Yes
+(optional)
+
+
+
AWATOP indicates the Properties of the Atomic Operation
+used for a write transaction.
+See atomic_transactions_label.
+
+
+
+
AWVALID
+
M
+
Yes
+
+
Indicates that the write address channel signals are valid.
+
+
+
+
AWREADY
+
S
+
Yes
+
+
Indicates that a transfer on the write address channel
+can be accepted.
+
+
+
+
+
+
+
3.5.2.3. Write data channel signals (Section A2.3)
+
+
Table 2.3 shows the AXI write data channel signals. Unless the description indicates otherwise, a signal can take any parameter if is supported.
+
+
+
+
+
+
+
+
+
+
+
Signal
+
Src
+
Support
+
Description
+
+
+
+
+
WDATA
+
M
+
Yes
+
+
Write data.
+
+
+
+
WSTRB
+
M
+
+
Yes
+(optional)
+
+
+
Write strobes, indicate which byte lanes hold valid data
+See data_read_and_write_structure_label.
+
+
+
+
WLAST
+
M
+
Yes
+
+
Indicates whether this is the last data transfer in a write
+transaction.
+
+
+
+
WUSER
+
M
+
+
Yes
+(optional)
+
+
+
User-defined extension for the write data channel.
+
+
+
+
WVALID
+
M
+
Yes
+
+
Indicates that the write data channel signals are valid.
+
+
+
+
WREADY
+
S
+
Yes
+
+
Indicates that a transfer on the write data channel can be
+accepted.
Table 2.5 shows the AXI read address channel signals. Unless the description indicates otherwise, a signal can take any parameter if is supported.
+
+
+
+
+
+
+
+
+
+
+
Signal
+
Src
+
Support
+
Description
+
+
+
+
+
ARID
+
M
+
+
Yes
+(optional)
+
+
+
Identification tag for a read transaction.
+CVA6 gives the id depending on the type of transaction.
+See transaction_identifiers_label.
+
+
+
+
ARADDR
+
M
+
+
Yes
+
+
+
The address of the first transfer in a read transaction.
+
+
+
+
ARLEN
+
M
+
+
Yes
+(optional)
+
+
+
Length, the exact number of data transfers in a read
+transaction. This information determines the number of data
+transfers associated with the address.
+All read transactions performed by CVA6 have a length equal to 0,
+ICACHE_LINE_WIDTH/64 or DCACHE_LINE_WIDTH/64.
+
+
+
+
ARSIZE
+
M
+
+
Yes
+(optional)
+
+
+
Size, the number of bytes in each data transfer in a read
+transaction
+See address_structure_label.
+
+
+
+
ARBURST
+
M
+
+
Yes
+(optional)
+
+
+
Burst type, indicates how address changes between each
+transfer in a read transaction.
+All Read transactions performed by CVA6 are of burst type INCR.
+(ARBURST = 0b01)
+
+
+
+
ARLOCK
+
M
+
+
Yes
+(optional)
+
+
+
Provides information about the atomic characteristics of
+a read transaction.
+
+
+
+
ARCACHE
+
M
+
+
Yes
+(optional)
+
+
+
Indicates how a read transaction is required to progress
+through a system.
+The memory is always of type Normal Non-cacheable Non-bufferable.
+(ARCACHE = 0b0010)
+
+
+
+
ARPROT
+
M
+
+
Yes
+
+
+
Protection attributes of a read transaction:
+privilege, security level, and access type.
+The value of ARPROT is always 0b000.
+
+
+
+
ARQOS
+
M
+
+
No
+(optional)
+
+
+
Quality of Service identifier for a read transaction.
+ARQOS= 0b00
+
+
+
+
ARREGION
+
M
+
+
No
+(optional)
+
+
+
Region indicator for a read transaction.
+ARREGION= 0b00
+
+
+
+
ARUSER
+
M
+
+
No
+(optional)
+
+
+
User-defined extension for the read address channel.
+ARUSER= 0b00
+
+
+
+
ARVALID
+
M
+
+
Yes
+(optional)
+
+
+
Indicates that the read address channel signals are valid.
+
+
+
+
ARREADY
+
S
+
+
Yes
+(optional)
+
+
+
Indicates that a transfer on the read address channel can be
+accepted.
+
+
+
+
+
+
+
3.5.2.6. Read data channel signals (Section A2.6)
+
+
Table 2.6 shows the AXI read data channel signals. Unless the description indicates otherwise, a signal can take any parameter if is supported.
+
+
+
+
+
+
+
+
+
+
+
Signal
+
Src
+
Support
+
Description
+
+
+
+
+
RID
+
S
+
+
Yes
+(optional)
+
+
+
The ID tag of the read data transfer.
+CVA6 gives the id depending on the type of transaction.
+See transaction_identifiers_label.
+
+
+
+
RDATA
+
S
+
Yes
+
+
Read data.
+
+
+
+
RLAST
+
S
+
Yes
+
+
Indicates whether this is the last data transfer in a read
+transaction.
+
+
+
+
RUSER
+
S
+
+
Yes
+(optional)
+
+
+
User-defined extension for the read data channel.
+Not supported.
+
+
+
+
RVALID
+
S
+
Yes
+
+
Indicates that the read data channel signals are valid.
+
+
+
+
RREADY
+
M
+
Yes
+
+
Indicates that a transfer on the read data channel can be accepted.
+
+
+
+
+
+
+
+
3.5.3. Single Interface Requirements: Transaction structure (Section A3.4)
+
+
This section describes the structure of transactions. The following sections define the address, data, and response
+structures
+
+
+
3.5.3.1. Address structure (Section A3.4.1)
+
+
The AXI protocol is burst-based. The Manager begins each burst by driving control information and the address of the first byte in the transaction to the Subordinate. As the burst progresses, the Subordinate must calculate the addresses of subsequent transfers in the burst.
+
+
+
Burst length
+
+
+
The burst length is specified by:
+
+
+
+
+
ARLEN[7:0], for read transfers
+
+
+
AWLEN[7:0], for write transfers
+
+
+
+
+
The burst length for AXI4 is defined as: Burst_Length = AxLEN[3:0] + 1.
+
+
+
CVA6 has some limitation governing the use of bursts:
+
+
+
+
+
All read transactions performed by CVA6 are of burst length equal to 0, ICACHE_LINE_WIDTH/64 or DCACHE_LINE_WIDTH/64.
+
+
+
All write transactions performed by CVA6 are of burst length equal to 1.
+
+
+
+
+
Burst size
+
+
+
The maximum number of bytes to transfer in each data transfer, or beat, in a burst, is specified by:
+
+
+
+
+
ARSIZE[2:0], for read transfers
+
+
+
AWSIZE[2:0], for write transfers
+
+
+
+
+
The maximum value can be taking by AxSIZE is log2(AXI DATA WIDTH/8) (8 bytes by transfer).
+If(RV32) AWSIZE < 3 (The maximum store size is 4 bytes)
+
+
+
Burst type
+
+
+
The AXI protocol defines three burst types:
+
+
+
+
+
FIXED
+
+
+
INCR
+
+
+
WRAP
+
+
+
+
+
The burst type is specified by:
+
+
+
+
+
ARBURST[1:0], for read transfers
+
+
+
AWBURST[1:0], for write transfers
+
+
+
+
+
All transactions performed by CVA6 are of burst type INCR. (AxBURST = 0b01)
+
+
+
+
3.5.3.2. Data read and write structure: (Section A3.4.4)
+
+
Write strobes
+
+
+
The WSTRB[n:0] signals when HIGH, specify the byte lanes of the data bus that contain valid information. There is one write strobe
+for each 8 bits of the write data bus, therefore WSTRB[n] corresponds to WDATA[(8n)+7: (8n)].
+
+
+
Write Strobe width is equal to (AXI_DATA_WIDTH/8) (n = (AXI_DATA_WIDTH/8)-1).
+
+
+
The size of transactions performed by cva6 is equal to the number of data byte lanes containing valid information.
+This means 1, 2, 4, … or (AXI_DATA_WIDTH/8) byte lanes containing valid information.
+CVA6 doesn’t perform unaligned memory acces, therefore the WSTRB take only combination of aligned access
+If(RV32) WSTRB < 255 (Since AWSIZE lower than 3, so the data bus cannot have more than 4 valid byte lanes)
+
+
+
Unaligned transfers
+
+
+
For any burst that is made up of data transfers wider than 1 byte, the first bytes accessed might be unaligned with the natural
+address boundary. For example, a 32-bit data packet that starts at a byte address of 0x1002 is not aligned to the natural 32-bit
+transfer size.
+
+
+
CVA6 does not perform Unaligned transfers.
+
+
+
+
3.5.3.3. Read and write response structure (Section A3.4.5)
+
+
The AXI protocol provides response signaling for both read and write transactions:
+
+
+
+
+
For read transactions, the response information from the Subordinate is signaled on the read data channel.
+
+
+
For write transactions, the response information is signaled on the write response channel.
+
+
+
+
+
CVA6 does not consider the responses sent by the memory except in the exclusive Access ( XRESP[1:0] = 0b01 ).
This section describes the attributes that determine how a transaction should be treated by the AXI subordinate that is connected to the CVA6.
+
+
+
AxCACHE always takeq 0b0010. The subordinate should be a Normal Non-cacheable Non-bufferable.
+
+
+
The required behavior for Normal Non-cacheable Non-bufferable memory is:
+
+
+
+
+
The write response must be obtained from the final destination.
+
+
+
Read data must be obtained from the final destination.
+
+
+
Transactions are modifiable.
+
+
+
Writes can be merged.
+
+
+
+
+
+
3.5.5. Transaction Identifiers (Section A5)
+
+
The AXI protocol includes AXI ID transaction identifiers. A Manager can use these to identify separate transactions that must be returned in order.
+
+
+
The CVA6 identify each type of transaction with a specific ID:
+
+
+
+
+
For read transaction, id can be 0 or 1. (0 for instruction fetch and 1 for data)
+
+
+
For write transaction, id = 1.
+
+
+
For Atomic operation, id = 3. This ID must be sent in the write channels and also in the read channel if the transaction performed requires response data.
+
+
+
For Exclusive transaction, id = 3.
+
+
+
+
+
+
3.5.6. AXI Ordering Model (Section A6)
+
+
3.5.6.1. AXI ordering model overview (Section A6.1)
+
+
The AXI ordering model is based on the use of the transaction identifier, which is signaled on ARID or AWID.
+
+
+
Transaction requests on the same channel, with the same ID and destination are guaranteed to remain in order.
+
+
+
Transaction responses with the same ID are returned in the same order as the requests were issued.
+
+
+
Write transaction requests, with the same destination are guaranteed to remain in order. Because all write transaction performed by CVA6 have the same ID.
+
+
+
CVA6 can perform multiple outstanding write address transactions.
+
+
+
CVA6 cannot perform a Read transaction and a Write one at the same time. Therefore there no ordering problems between Read and write transactions.
+
+
+
The ordering model does not give any ordering guarantees between:
+
+
+
+
+
Transactions from different Managers
+
+
+
Read Transactions with different IDs
+
+
+
Transactions to different Memory locations
+
+
+
+
+
If the CVA6 requires ordering between transactions that have no ordering guarantee, the Manager must wait to receive a response to the first transaction before issuing the second transaction.
+
+
+
+
3.5.6.2. Memory locations and Peripheral regions (Section A6.2)
+
+
The address map in AMBA is made up of Memory locations and Peripheral regions. But the AXI is associated to the memory interface of CVA6.
+
+
+
A Memory location has all of the following properties:
+
+
+
+
+
A read of a byte from a Memory location returns the last value that was written to that byte location.
+
+
+
A write to a byte of a Memory location updates the value at that location to a new value that is obtained by a subsequent read of that location.
+
+
+
Reading or writing to a Memory location has no side-effects on any other Memory location.
+
+
+
Observation guarantees for Memory are given for each location.
+
+
+
The size of a Memory location is equal to the single-copy atomicity size for that component.
+
+
+
+
+
+
3.5.6.3. Transactions and ordering (Section A6.3)
+
+
A transaction is a read or a write to one or more address locations. The locations are determined by AxADDR and any relevant qualifiers such as the Non-secure bit in AxPROT.
+
+
+
+
+
Ordering guarantees are given only between accesses to the same Memory location or Peripheral region.
+
+
+
A transaction to a Peripheral region must be entirely contained within that region.
+
+
+
A transaction that spans multiple Memory locations has multiple ordering guarantees.
+
+
+
+
+
Transaction performed by CVA6 is of type Normal, because AxCACHE[1] is asserted.
+
+
+
Normal transactions are used to access Memory locations and are not expected to be used to access Peripheral regions.
+
+
+
A Normal access to a Peripheral region must complete in a protocol-compliant manner, but the result is IMPLEMENTATION DEFINED.
+
+
+
A write transaction performed by CVA6 is Non-bufferable (It is not possible to send an early response before the transaction reach the final destination), because AxCACHE[0] is deasserted.
+
+
+
+
3.5.6.4. Ordered write observation (Section A6.8)
+
+
To improve compatibility with interface protocols that support a different ordering model, a Subordinate interface can give stronger ordering guarantees for write transactions. A stronger ordering guarantee is known as Ordered Write Observation.
+
+
+
The CVA6 AXI interface exhibits Ordered Write Observation, so the Ordered_Write_Observation property is True.
+
+
+
An interface that exhibits Ordered Write Observation gives guarantees for write transactions that are not dependent on the destination or address:
+
+
+
+
+
A write W1 is guaranteed to be observed by a write W2, where W2 is issued after W1, from the same Manager, with the same ID.
+
+
+
+
+
+
+
3.5.7. Atomic transactions (Section E1.1)
+
+
AMBA 5 introduces Atomic transactions, which perform more than just a single access and have an operation that is associated with the transaction. Atomic transactions enable sending the operation to the data, permitting the operation to be performed closer to where the data is located. Atomic transactions are suited to situations where the data is located a significant distance from the agent that must perform the operation.
+
+
+
If(RVA) AWATOP = 0 (If AMO instructions are not supported, CVA6 cannot perform Atomic transaction)
+
+
+
CVA6 supports just the AtomicLoad and AtomicSwap transaction. So AWATOP[5:4] can be 00, 10 or 11.
+
+
+
CVA6 performs only little-endian operation. So AWATOP[3] = 0.
+
+
+
For AtomicLoad, CVA6 supports all arithmetic operations encoded on the lower-order AWATOP[2:0] signals.
+
+
+
+
3.5.8. CVA6 Constraints
+
+
This section describes cross-cases between several features that are not supported by CVA6.
+
+
+
+
+
ARID = 0 && ARSIZE = log(AXI_DATA_WIDTH/8), CVA6 always requests max number of words in case of read transaction with ID 0 (instruction fetch)
+
+
+
if(RV32) ARSIZE != 3 && ARLEN = 0 && ARID = 1, the maximum load instruction size is 4 bytes
+
+
+
if(!RVA) AxLOCK = 0, if AMO instructions are not supported, CVA6 cannot perform exclusive transaction
+
+
+
if(RVA) AxLOCK = 1 ⇒ AxSIZE > 1, CVA6 doesn’t perform exclusive transaction with size lower than 4 bytes
+
+
+
+
+
+
+
3.6. CV-X-IF Interface and Coprocessor
+
+
The CV-X-IF interface of CVA6 allows to extend its supported instruction
+set with external coprocessors.
+
+
+
Applicability of this chapter to configurations:
+
+
+
+
+
+
+
+
+
Configuration
+
Implementation
+
+
+
+
+
CV32A60AX
+
CV-X-IF included
+
+
+
CV32A60X
+
CV-X-IF included
+
+
+
CV64A6_MMU
+
CV-X-IF included
+
+
+
+
+
3.6.1. CV-X-IF interface specification
+
+
3.6.1.1. Description
+
+
This design specification presents global functionalities of
+Core-V-eXtension-Interface (XIF, CVXIF, CV-X-IF, X-interface) in the CVA6 core.
+
+
+
+
The CORE-V X-Interface is a RISC-V eXtension interface that provides a
+generalized framework suitable to implement custom coprocessors and ISA
+extensions for existing RISC-V processors.
+
+--core-v-xif Readme, https://github.com/openhwgroup/core-v-xif
+
+
+
+
The specification of the CV-X-IF bus protocol can be found at [CV-X-IF].
+
+
+
CV-X-IF aims to:
+
+
+
+
+
Create interfaces to connect a coprocessor to the CVA6 to execute instructions.
+
+
+
Offload CVA6 illegal instrutions to the coprocessor to be executed.
+
+
+
Get the results of offloaded instructions from the coprocessor so they are written back into the CVA6 register file.
+
+
+
Add standard RISC-V instructions unsupported by CVA6 or custom instructions and implement them in a coprocessor.
+
+
+
Kill offloaded instructions to allow speculative execution in the coprocessor. (Unsupported in CVA6 yet)
+
+
+
Connect the coprocessor to memory via the CVA6 Load and Store Unit. (Unsupported in CVA6 yet)
+
+
+
+
+
The coprocessor operates like another functional unit so it is connected
+to the CVA6 in the execute stage.
+
+
+
Only the 3 mandatory interfaces from the CV-X-IF specification (issue, commit and result
+) have been implemented.
+Compressed interface, Memory Interface and Memory result interface are not yet
+implemented in the CVA6.
+
+
+
+
3.6.1.2. Supported Parameters
+
+
The following table presents CVXIF parameters supported by CVA6.
+
+
+
+
+
+
+
+
+
+
Signal
+
Value
+
Description
+
+
+
+
+
X_NUM_RS
+
int: 2 or 3 (configurable)
+
+
Number of register file read ports that can
+be used by the eXtension interface
+
+
+
+
+
X_ID_WIDTH
+
int: 3
+
+
+
+
Identification width for the eXtension
+interface
+
+
+
X_MEM_WIDTH
+
+
+
n/a (feature not supported)
+
+
Memory access width for loads/stores via the
+eXtension interface
+
+
+
+
+
X_RFR_WIDTH
+
int: XLEN (32 or 64)
+
+
Register file read access width for the
+eXtension interface
+
+
+
+
+
X_RFW_WIDTH
+
int: XLEN (32 or 64)
+
+
+
+
Register file write access width for the
+eXtension interface
+
+
+
X_MISA
+
+
+
logic[31:0]: 0x0000_0000
+
+
MISA extensions implemented on the eXtension
+interface
+
+
+
+
+
+
+
+
3.6.1.3. CV-X-IF Enabling
+
+
CV-X-IF can be enabled or disabled via the CVA6ConfigCvxifEn parameter in the SystemVerilog source code.
+
+
+
+
3.6.1.4. Illegal instruction decoding
+
+
The CVA6 decoder module detects illegal instructions for the CVA6, prepares exception field
+with relevant information (exception code "ILLEGAL INSTRUCTION", instruction value).
+
+
+
The exception valid flag is raised in CVA6 decoder when CV-X-IF is disabled. Otherwise
+it is not raised at this stage because the decision belongs to the coprocessor
+after the offload process.
+
+
+
+
3.6.1.5. RS3 support
+
+
The number of source registers used by the CV-X-IF coprocessor is configurable with 2 or
+3 source registers.
+
+
+
If CV-X-IF is enabled and configured with 3 source registers,
+a third read port is added to the CVA6 general purpose register file.
+
+
+
+
3.6.1.6. Description of interface connections between CVA6 and Coprocessor
+
+
In CVA6 execute stage, there is a new functional unit dedicated to drive the CV-X-IF interfaces.
+Here is how and to what CV-X-IF interfaces are connected to the CVA6.
+
+
+
+
+
Issue interface::
+
+
+
+
Request;;
+
+
+
+
[verse] — Operands are connected to issue_req.rs signals —
+
+
+
[verse] — Scoreboard transaction id is connected to issue_req.id signal.
+Therefore scoreboard ids and offloaded instruction ids are linked
+together (equal in this implementation). It allows the CVA6 to do out
+of order execution with the coprocessor in the same way as other
+functional units. —
+
+
+
[verse] — Undecoded instruction is connected to issue_req.instruction —
+
+
+
[verse] — Valid signal for CVXIF functional unit is connected to
+issue_req.valid —
+
+
+
[verse] — All issue_req.rs_valid signals are set to 1. The validity of source
+registers is assured by the validity of valid signal sent from issue stage. —
+
+
+
+
+
+
Response;;
+
+
+
+
[verse] — If issue_resp.accept is set during a transaction (i.e. issue valid
+and ready are set), the offloaded instruction is accepted by the coprocessor
+and a result transaction will happen. —
+
+
+
[verse] — If issue_resp.accept is not set during a transaction, the offloaded
+instruction is illegal and an illegal instruction exception will be
+raised as soon as no result transaction are written on the writeback bus. —
+
+
+
+
+
+
+
+
+
Commit interface::
+
+
+
+
[verse] — Valid signal of commit interface is connected to the valid signal of
+issue interface. —
+
+
+
[verse] — Id signal of commit interface is connected to issue interface id signal
+(i.e. scoreboard id). —
+
+
+
[verse] — Killing of offload instruction is never set. (Unsupported feature) —
+
+
+
[verse] — Therefore all accepted offloaded instructions are commited to their
+execution and no killing of instruction is possible in this implementation. —
+
+
+
+
+
+
Result interface::
+
+
+
+
Request;;
+
+
+
+
[verse] — Ready signal of result interface is always set as CVA6 is always ready
+to take a result from coprocessor for an accepted offloaded instruction. —
+
+
+
+
+
+
Response;;
+
+
+
+
[verse] — Result response is directly connected to writeback bus of the CV-X-IF
+functionnal unit. —
+
+
+
[verse] — Valid signal of result interface is connected to valid signal of
+writeback bus. —
+
+
+
[verse] — Id signal of result interface is connected to scoreboard id of
+writeback bus. —
+
+
+
[verse] — Write enable signal of result interface is connected to a dedicated CV-X-IF WE
+signal in CVA6 which signals scoreboard if a writeback should happen
+or not to the CVA6 register file. —
+
+
+
[verse] — exccode and exc signal of result interface are connected to exception
+signals of writeback bus. Exception from coprocessor does not write
+the tval field in exception signal of writeback bus. —
+
+
+
[verse] — Three registers are added to hold illegal instruction information in
+case a result transaction and a non-accepted issue transaction happen
+in the same cycle. Result transactions will be written to the writeback
+bus in this case having priority over the non-accepted instruction due
+to being linked to an older offloaded instruction. Once the writeback
+bus is free, an illegal instruction exception will be raised thanks to
+information held in these three registers. —
+
+
+
+
+
+
+
+
+
+
+
+
+
3.6.2. Coprocessor recommendations for use with CVA6’s CV-X-IF
+
+
CVA6 supports all coprocessors supporting the CV-X-IF specification with the exception of :
+
+
+
+
+
Coprocessor requiring the Memory interface and Memory result interface (not implemented in CVA6 yet).::
+
+
+
+
All memory transaction should happen via the Issue interface, i.e. Load into CVA6 register file
+then initialize an issue transaction.
+
+
+
+
+
+
Coprocessor requiring the Compressed interface (not implemented in CVA6 yet).::
+
+
+
+
RISC-V Compressed extension (RVC) is already implemented in CVA6 User Space for custom compressed instruction
+is not big enough to have RVC and a custom compressed extension.
+
+
+
+
+
+
Stateful coprocessors.::
+
+
+
+
CVA6 will commit on the Commit interface all its issue transactions. Speculation
+informations are only kept in the CVA6 and speculation process is only done in CVA6.
+The coprocessor shall be stateless otherwise it will not be able to revert its state if CVA6 kills an
+in-flight instruction (in case of mispredict or flush).
+
+
+
+
+
+
+
+
+
3.6.3. How to use CVA6 without CV-X-IF interface
+
+
Select a configuration with CVA6ConfigCvxifEn parameter disabled or change it for your configuration.
+
+
+
Never let the CV-X-IF interface unconnected with the CVA6ConfigCvxifEn parameter enabled.
+
+
+
+
3.6.4. How to design a coprocessor for the CV-X-IF interface
+
+
The team is looking for a contributor to write this section.
+
+
+
+
3.6.5. How to program a CV-X-IF coprocessor
+
+
The team is looking for a contributor to write this section.
+
+
+
+
+
+
+
4. Architecture and Modules
+
+
+
The CV32A65X is fully synthesizable. It has been designed mainly for ASIC designs, but FPGA synthesis is supported as well.
+
+
+
For ASIC synthesis, the whole design is completely synchronous and uses positive-edge triggered flip-flops. The core occupies an area of about 80 kGE. The clock frequency can be more than 1GHz depending of technology.
+
+
+
The CV32A65X subsystem is composed of 8 modules.
+
+
+
+
+
+
Connections between modules are illustrated in the following block diagram. FRONTEND, DECODE, ISSUE, EXECUTE, COMMIT and CONTROLLER are part of the pipeline. And CACHES implements the instruction and data caches and CSRFILE contains registers.
+
+
+
+
+
+
4.1. FRONTEND Module
+
+
4.1.1. Description
+
+
The FRONTEND module implements two first stages of the cva6 pipeline,
+PC gen and Fetch stages.
+
+
+
PC gen stage is responsible for generating the next program counter.
+It hosts a Branch Target Buffer (BTB), a Branch History Table (BHT) and a Return Address Stack (RAS) to speculate on control flow instructions.
+
+
+
Fetch stage requests data to the CACHE module, realigns the data to store them in instruction queue and transmits the instructions to the DECODE module.
+FRONTEND can fetch up to 2 instructions per cycles when C extension instructions is enabled, but DECODE module decodes up to one instruction per cycles.
+
+
+
The module is connected to:
+
+
+
+
+
CACHES module provides fethed instructions to FRONTEND.
+
+
+
DECODE module receives instructions from FRONTEND.
+
+
+
CONTROLLER module can order to flush and to halt FRONTEND PC gen stage
+
+
+
EXECUTE, CONTROLLER, CSR and COMMIT modules trigger PC jumping due to
+a branch misprediction, an exception, a return from an exception, a
+debug entry or a pipeline flush. They provides the PC next value.
+
+
+
CSR module states about debug mode.
+
+
+
+
+
Table 3. frontend module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
boot_addr_i
+
in
+
Next PC when reset
+
SUBSYSTEM
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
flush_i
+
in
+
Flush requested by FENCE, mis-predict and exception
+
CONTROLLER
+
logic
+
+
+
halt_i
+
in
+
Halt requested by WFI and Accelerate port
+
CONTROLLER
+
logic
+
+
+
set_pc_commit_i
+
in
+
Set COMMIT PC as next PC requested by FENCE, CSR side-effect and Accelerate port
+
CONTROLLER
+
logic
+
+
+
pc_commit_i
+
in
+
COMMIT PC
+
COMMIT
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
ex_valid_i
+
in
+
Exception event
+
COMMIT
+
logic
+
+
+
resolved_branch_i
+
in
+
Mispredict event and next PC
+
EXECUTE
+
bp_resolve_t
+
+
+
eret_i
+
in
+
Return from exception event
+
CSR
+
logic
+
+
+
epc_i
+
in
+
Next PC when returning from exception
+
CSR
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
trap_vector_base_i
+
in
+
Next PC when jumping into exception
+
CSR
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
icache_dreq_o
+
out
+
Handshake between CACHE and FRONTEND (fetch)
+
CACHES
+
icache_dreq_t
+
+
+
icache_dreq_i
+
in
+
Handshake between CACHE and FRONTEND (fetch)
+
CACHES
+
icache_drsp_t
+
+
+
fetch_entry_o
+
out
+
Handshake’s data between fetch and decode
+
ID_STAGE
+
fetch_entry_t[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
fetch_entry_valid_o
+
out
+
Handshake’s valid between fetch and decode
+
ID_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
fetch_entry_ready_i
+
in
+
Handshake’s ready between fetch and decode
+
ID_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
+
+
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+
+
+
For any HW configuration,
+
+
+
+
+
flush_bp_i input is tied to 0
+
+
+
+
+
As DebugEn = False,
+
+
+
+
+
set_debug_pc_i input is tied to 0
+
+
+
debug_mode_i input is tied to 0
+
+
+
+
+
+
+
+
+
4.1.2. Functionality
+
+
+
+
4.1.3. PC Generation stage
+
+
PC gen generates the next program counter. The next PC can originate from the following sources (listed in order of precedence):
+
+
+
+
+
Reset state: At reset, the PC is assigned to the boot address.
+
+
+
Branch Prediction: The fetched instruction is predecoded by the
+instr_scan submodule. When the instruction is a control flow, three
+cases are considered:
+
+
+
+
+
+
When the instruction is a JALR which corresponds to a return (rs1 = x1 or rs1 = x5).
+RAS provides next PC as a prediction.
+
+
+
When the instruction is a JALR which does not correspond to areturn.
+If BTB (Branch Target Buffer) returns a valid address, then BTBpredicts next PC.
+Else JALR is not considered as a control flow instruction, which will generate a mispredict.
+
+
+
When the instruction is a conditional branch.
+If BHT (Branch History table) returns a valid address, then BHT predicts next PC.
+Else the prediction depends on the PC relative jump offset sign: if sign is negative the prediction is taken, otherwise the prediction is not taken.
+
+
+
+
+
+
+
Then the PC gen informs the Fetch stage that it performed a prediction on the PC.
+
+
+
+
Default: The next 32-bit block is fetched.
+PC Gen fetches word boundary 32-bits block from CACHES module. And the fetch stage identifies the instructions from the 32-bits blocks.
+
+
+
Mispredict: Misprediction are feedbacked by EX_STAGE module.
+In any case we need to correct our action and start fetching from the correct address.
+
+
+
Replay instruction fetch: When the instruction queue is full, the instr_queue submodule asks the fetch replay and provides the address to be replayed.
+
+
+
Return from environment call: When CSR requests a return from an environment call, next PC takes the value of the PC of the instruction after the one pointed to by the mepc CSR.
+
+
+
Exception/Interrupt: If an exception is triggered by CSR_REGISTER, next PC takes the value of the trap vector base address CSR.
+
+
+
Pipeline starting fetching from COMMIT PC: When the commit stage is halted by a WFI instruction or when the pipeline has been flushed due to CSR change, next PC takes the value of the PC coming from the COMMIT submodule.
+As CSR instructions do not exist in a compressed form, PC is unconditionally incremented by 4.
+
+
+
+
+
All program counters are logical addressed.
+
+
+
+
4.1.4. Fetch Stage
+
+
Fetch stage controls the CACHE module by a handshaking protocol.
+Fetched data is a 32-bit block with a word-aligned address.
+A granted fetch is processed by the instr_realign submodule to produce instructions.
+Then instructions are pushed into an internal instruction FIFO called instruction queue (instr_queue submodule).
+This submodule stores the instructions and sends them to the DECODE module.
+
+
+
Memory can feedback potential exceptions which can be bus errors, invalid accesses or instruction page faults.
+The FRONTEND transmits the exception from CACHES to DECODE.
+
+
+
+
4.1.5. Submodules
+
+
+
+
+
+
+
+
4.1.5.1. Instr_realign submodule
+
+
The 32-bit aligned block coming from the CACHE module enters the instr_realign submodule.
+This submodule extracts the instructions from the 32-bit blocks.
+It is possible to fetch up to two instructions per cycle when C extension is used.
+An not-compressed instruction can be misaligned on the block size, interleaved with two cache blocks.
+In that case, two cache accesses are needed to get the whole instruction.
+The instr_realign submodule provides at maximum two instructions per cycle when compressed extension is enabled, else one instruction per cycle.
+Incomplete instruction is stored in instr_realign submodule until its second half is fetched.
The instr_queue receives mutliple instructions from instr_realign submodule to create a valid stream of instructions to be decoded (by DECODE), to be issued (by ISSUE) and executed (by EXECUTE).
+FRONTEND pushes in FIFO to store the instructions and related information needed in case of mispredict or exception: instructions, instruction control flow type, exception, exception address and predicted address.
+DECODE pops them when decode stage is ready and indicates to the FRONTEND the instruction has been consummed.
+
+
+
The instruction queue contains max 4 instructions.
+If the instruction queue is full, a replay request is sent to inform the fetch mechanism to replay the fetch.
+
+
+
The instruction queue can be flushed by CONTROLLER.
Indicates instructions consummed, or popped by ID_STAGE
+
FRONTEND
+
logic[CVA6Cfg.INSTR_PER_FETCH-1:0]
+
+
+
exception_i
+
in
+
Exception (which is page-table fault)
+
CACHE
+
ariane_pkg::frontend_exception_t
+
+
+
exception_addr_i
+
in
+
Exception address
+
CACHE
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
predict_address_i
+
in
+
Branch predict
+
FRONTEND
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
cf_type_i
+
in
+
Instruction predict address
+
FRONTEND
+
ariane_pkg::cf_t[CVA6Cfg.INSTR_PER_FETCH-1:0]
+
+
+
replay_o
+
out
+
Replay instruction because one of the FIFO was full
+
FRONTEND
+
logic
+
+
+
replay_addr_o
+
out
+
Address at which to replay the fetch
+
FRONTEND
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
fetch_entry_o
+
out
+
Handshake’s data with ID_STAGE
+
ID_STAGE
+
fetch_entry_t[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
fetch_entry_valid_o
+
out
+
Handshake’s valid with ID_STAGE
+
ID_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
fetch_entry_ready_i
+
in
+
Handshake’s ready with ID_STAGE
+
ID_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
+
+
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+
+
+
As RVH = False,
+
+
+
+
+
exception_gpaddr_i input is tied to 0
+
+
+
exception_tinst_i input is tied to 0
+
+
+
exception_gva_i input is tied to 0
+
+
+
+
+
+
+
+
+
4.1.5.3. instr_scan submodule
+
+
As compressed extension is enabled, two instr_scan are instantiated to handle up to two instructions per cycle.
+
+
+
Each instr_scan submodule pre-decodes the fetched instructions coming from the instr_realign module, instructions could be compressed or not.
+The instr_scan submodule is a flox controler which provides the intruction type: branch, jump, return, jalr, imm, call or others.
+These outputs are used by the branch prediction feature.
+
+
+
Table 6. instr_scan module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
instr_i
+
in
+
Instruction to be predecoded
+
instr_realign
+
logic[31:0]
+
+
+
rvi_return_o
+
out
+
Return instruction
+
FRONTEND
+
logic
+
+
+
rvi_call_o
+
out
+
JAL instruction
+
FRONTEND
+
logic
+
+
+
rvi_branch_o
+
out
+
Branch instruction
+
FRONTEND
+
logic
+
+
+
rvi_jalr_o
+
out
+
JALR instruction
+
FRONTEND
+
logic
+
+
+
rvi_jump_o
+
out
+
Unconditional jump instruction
+
FRONTEND
+
logic
+
+
+
rvi_imm_o
+
out
+
Instruction immediat
+
FRONTEND
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
rvc_branch_o
+
out
+
Branch compressed instruction
+
FRONTEND
+
logic
+
+
+
rvc_jump_o
+
out
+
Unconditional jump compressed instruction
+
FRONTEND
+
logic
+
+
+
rvc_jr_o
+
out
+
JR compressed instruction
+
FRONTEND
+
logic
+
+
+
rvc_return_o
+
out
+
Return compressed instruction
+
FRONTEND
+
logic
+
+
+
rvc_jalr_o
+
out
+
JALR compressed instruction
+
FRONTEND
+
logic
+
+
+
rvc_call_o
+
out
+
JAL compressed instruction
+
FRONTEND
+
logic
+
+
+
rvc_imm_o
+
out
+
Instruction compressed immediat
+
FRONTEND
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
+
+
+
4.1.5.4. BHT (Branch History Table) submodule
+
+
BHT is implemented as a memory which is composed of BHTDepth configuration parameter entries. The lower address bits of the virtual address point to the memory entry.
+
+
+
When a branch instruction is resolved by the EX_STAGE module, the branch PC and the taken (or not taken) status information is stored in the Branch History Table.
+
+
+
The Branch History Table is a table of two-bit saturating counters that takes the virtual address of the current fetched instruction by the CACHE.
+It states whether the current branch request should be taken or not.
+The two bit counter is updated by the successive execution of the instructions as shown in the following figure.
+
+
+
+
+
+
When a branch instruction is pre-decoded by instr_scan submodule, the BHT valids whether the PC address is in the BHT and provides the taken or not prediction.
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+
+
+
For any HW configuration,
+
+
+
+
+
flush_bp_i input is tied to 0
+
+
+
+
+
As DebugEn = False,
+
+
+
+
+
debug_mode_i input is tied to 0
+
+
+
+
+
+
+
+
+
4.1.5.5. BTB (Branch Target Buffer) submodule
+
+
BTB is implemented as an array which is composed of BTBDepth configuration parameter entries.
+The lower address bits of the virtual address point to the memory entry.
+
+
+
When an JALR instruction is found mispredicted by the EX_STAGE module, the JALR PC and the target address are stored into the BTB.
+
+
+
When a JALR instruction is pre-decoded by instr_scan submodule, the BTB informs whether the input PC address is in the BTB.
+In this case, the BTB provides the predicted target address.
+
+
+
The BTB is never flushed.
+
+
+
Table 8. btb module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
vpc_i
+
in
+
Virtual PC
+
CACHE
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
btb_update_i
+
in
+
Update BTB with resolved address
+
EXECUTE
+
btb_update_t
+
+
+
btb_prediction_o
+
out
+
BTB Prediction
+
FRONTEND
+
btb_prediction_t[CVA6Cfg.INSTR_PER_FETCH-1:0]
+
+
+
+
+
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+
+
+
For any HW configuration,
+
+
+
+
+
flush_bp_i input is tied to 0
+
+
+
+
+
As DebugEn = False,
+
+
+
+
+
debug_mode_i input is tied to 0
+
+
+
+
+
+
+
+
+
4.1.5.6. RAS (Return Address Stack) submodule
+
+
RAS is implemented as a LIFO which is composed of RASDepth configuration parameter entries.
+
+
+
When a JAL instruction is pre-decoded by the instr_scan, the PC of the instruction following JAL instruction is pushed into the RAS when the JAL instruction is added to the instruction queue.
+
+
+
When a JALR instruction which corresponds to a return (rs1 = x1 or rs1 = x5) is pre-decoded by the instr_scan, the predicted return address is popped from the RAS when the JALR instruction is added to the instruction queue.
+If the predicted return address is wrong due for instance to speculation or RAS depth limitation, a mis-repdiction will be generated.
+
+
+
The RAS is never flushed.
+
+
+
Table 9. ras module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
push_i
+
in
+
Push address in RAS
+
FRONTEND
+
logic
+
+
+
pop_i
+
in
+
Pop address from RAS
+
FRONTEND
+
logic
+
+
+
data_i
+
in
+
Data to be pushed
+
FRONTEND
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
data_o
+
out
+
Popped data
+
FRONTEND
+
ras_t
+
+
+
+
+
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+
+
+
For any HW configuration,
+
+
+
+
+
flush_bp_i input is tied to 0
+
+
+
+
+
+
+
+
+
+
+
4.2. ID_STAGE Module
+
+
4.2.1. Description
+
+
The ID_STAGE module implements the decode stage of the pipeline. Its
+main purpose is to decode RISC-V instructions coming from FRONTEND
+module (fetch stage) and send them to the ISSUE_STAGE module (issue
+stage).
+
+
+
The compressed_decoder module checks whether the incoming instruction is
+compressed and output the corresponding uncompressed instruction. Then
+the decoder module decodes the instruction and send it to the issue
+stage.
+
+
+
The module is connected to:
+
+
+
+
+
CONTROLLER module can flush ID_STAGE decode stage
+
+
+
FRONTEND module sends instrution to ID_STAGE module
+
+
+
ISSUE module receives the decoded instruction from ID_STAGE module
+
+
+
CSR_REGFILE module sends status information about privilege mode,
+traps, extension support.
+
+
+
+
+
Table 10. id_stage module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
flush_i
+
in
+
Fetch flush request
+
CONTROLLER
+
logic
+
+
+
fetch_entry_i
+
in
+
Handshake’s data between fetch and decode
+
FRONTEND
+
fetch_entry_t[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
fetch_entry_valid_i
+
in
+
Handshake’s valid between fetch and decode
+
FRONTEND
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
fetch_entry_ready_o
+
out
+
Handshake’s ready between fetch and decode
+
FRONTEND
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
issue_entry_o
+
out
+
Handshake’s data between decode and issue
+
ISSUE
+
scoreboard_entry_t[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
orig_instr_o
+
out
+
Instruction value
+
ISSUE
+
logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
+
+
+
issue_entry_valid_o
+
out
+
Handshake’s valid between decode and issue
+
ISSUE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
is_ctrl_flow_o
+
out
+
Report if instruction is a control flow instruction
+
ISSUE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
issue_instr_ack_i
+
in
+
Handshake’s acknowlege between decode and issue
+
ISSUE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
irq_i
+
in
+
Level sensitive (async) interrupts
+
SUBSYSTEM
+
logic[1:0]
+
+
+
irq_ctrl_i
+
in
+
Interrupt control status
+
CSR_REGFILE
+
irq_ctrl_t
+
+
+
hart_id_i
+
in
+
none
+
none
+
logic[CVA6Cfg.XLEN-1:0]
+
+
+
compressed_ready_i
+
in
+
none
+
none
+
logic
+
+
+
compressed_resp_i
+
in
+
none
+
none
+
x_compressed_resp_t
+
+
+
compressed_valid_o
+
out
+
none
+
none
+
logic
+
+
+
compressed_req_o
+
out
+
none
+
none
+
x_compressed_req_t
+
+
+
+
+
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+
+
+
As DebugEn = False,
+
+
+
+
+
debug_req_i input is tied to 0
+
+
+
debug_mode_i input is tied to 0
+
+
+
+
+
As IsRVFI = 0,
+
+
+
+
+
rvfi_is_compressed_o output is tied to 0
+
+
+
+
+
As PRIV = MachineOnly,
+
+
+
+
+
priv_lvl_i input is tied to MachineMode
+
+
+
tvm_i input is tied to 0
+
+
+
tw_i input is tied to 0
+
+
+
tsr_i input is tied to 0
+
+
+
+
+
As RVH = False,
+
+
+
+
+
v_i input is tied to 0
+
+
+
vfs_i input is tied to 0
+
+
+
vtw_i input is tied to 0
+
+
+
hu_i input is tied to 0
+
+
+
+
+
As RVF = 0,
+
+
+
+
+
fs_i input is tied to 0
+
+
+
frm_i input is tied to 0
+
+
+
+
+
As RVV = False,
+
+
+
+
+
vs_i input is tied to 0
+
+
+
+
+
+
+
+
+
4.2.2. Functionality
+
+
TO BE COMPLETED
+
+
+
+
4.2.3. Submodules
+
+
+
+
+
4.2.3.1. Compressed_decoder
+
+
The compressed_decoder module decompresses all the compressed
+instructions taking a 16-bit compressed instruction and expanding it to
+its 32-bit equivalent. All compressed instructions have a 32-bit
+equivalent.
+
+
+
Table 11. compressed_decoder module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
instr_i
+
in
+
Input instruction coming from fetch stage
+
FRONTEND
+
logic[31:0]
+
+
+
instr_o
+
out
+
Output instruction in uncompressed format
+
decoder
+
logic[31:0]
+
+
+
illegal_instr_o
+
out
+
Input instruction is illegal
+
decoder
+
logic
+
+
+
is_macro_instr_o
+
out
+
Output instruction is macro
+
decoder
+
logic
+
+
+
is_compressed_o
+
out
+
Output instruction is compressed
+
decoder
+
logic
+
+
+
+
+
+
4.2.3.2. Decoder
+
+
The decoder module takes the output of compressed_decoder module and
+decodes it. It transforms the instruction to the most fundamental
+control structure in pipeline, a scoreboard entry.
+
+
+
The scoreboard entry contains an exception entry which is composed of a
+valid field, a cause and a value called TVAL. As TVALEn configuration
+parameter is zero, the TVAL field is not implemented.
+
+
+
A potential illegal instruction exception can be detected during
+decoding. If no exception has happened previously in fetch stage, the
+decoder will valid the exception and add the cause and tval value to the
+scoreboard entry.
+
+
+
Table 12. decoder module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
pc_i
+
in
+
PC from fetch stage
+
FRONTEND
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
is_compressed_i
+
in
+
Is a compressed instruction
+
compressed_decoder
+
logic
+
+
+
compressed_instr_i
+
in
+
Compressed form of instruction
+
FRONTEND
+
logic[15:0]
+
+
+
is_illegal_i
+
in
+
Illegal compressed instruction
+
compressed_decoder
+
logic
+
+
+
instruction_i
+
in
+
Instruction from fetch stage
+
FRONTEND
+
logic[31:0]
+
+
+
is_macro_instr_i
+
in
+
Is a macro instruction
+
macro_decoder
+
logic
+
+
+
is_last_macro_instr_i
+
in
+
Is a last macro instruction
+
macro_decoder
+
logic
+
+
+
is_double_rd_macro_instr_i
+
in
+
Is mvsa01/mva01s macro instruction
+
macro_decoder
+
logic
+
+
+
branch_predict_i
+
in
+
Is a branch predict instruction
+
FRONTEND
+
branchpredict_sbe_t
+
+
+
ex_i
+
in
+
If an exception occured in fetch stage
+
FRONTEND
+
exception_t
+
+
+
irq_i
+
in
+
Level sensitive (async) interrupts
+
SUBSYSTEM
+
logic[1:0]
+
+
+
irq_ctrl_i
+
in
+
Interrupt control status
+
CSR_REGFILE
+
irq_ctrl_t
+
+
+
instruction_o
+
out
+
Instruction to be added to scoreboard entry
+
ISSUE_STAGE
+
scoreboard_entry_t
+
+
+
orig_instr_o
+
out
+
Instruction
+
ISSUE_STAGE
+
logic[31:0]
+
+
+
is_control_flow_instr_o
+
out
+
Is a control flow instruction
+
ISSUE_STAGE
+
logic
+
+
+
+
+
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+
+
+
As DebugEn = False,
+
+
+
+
+
debug_req_i input is tied to 0
+
+
+
debug_mode_i input is tied to 0
+
+
+
+
+
As PRIV = MachineOnly,
+
+
+
+
+
priv_lvl_i input is tied to MachineMode
+
+
+
tvm_i input is tied to 0
+
+
+
tw_i input is tied to 0
+
+
+
tsr_i input is tied to 0
+
+
+
+
+
As RVH = False,
+
+
+
+
+
v_i input is tied to 0
+
+
+
vfs_i input is tied to 0
+
+
+
vtw_i input is tied to 0
+
+
+
hu_i input is tied to 0
+
+
+
+
+
As RVF = 0,
+
+
+
+
+
fs_i input is tied to 0
+
+
+
frm_i input is tied to 0
+
+
+
+
+
As RVV = False,
+
+
+
+
+
vs_i input is tied to 0
+
+
+
+
+
+
+
+
+
+
+
4.3. ISSUE_STAGE Module
+
+
4.3.1. Description
+
+
The execution can be roughly divided into four parts: issue(1), read
+operands(2), execute(3) and write-back(4). The ISSUE_STAGE module
+handles step one, two and four. The ISSUE_STAGE module receives the
+decoded instructions and issues them to the various functional units.
+
+
+
A data structure called scoreboard is used to keep track of data related
+to the issue instruction: which functional unit and which destination
+register they are. The scoreboard handle the write-back data received
+from the COMMIT_STAGE module.
+
+
+
Furthermore it contains the CPU’s register file.
+
+
+
The module is connected to:
+
+
+
+
+
TO BE COMPLETED
+
+
+
+
+
Table 13. issue_stage module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
flush_unissued_instr_i
+
in
+
TO_BE_COMPLETED
+
CONTROLLER
+
logic
+
+
+
flush_i
+
in
+
TO_BE_COMPLETED
+
CONTROLLER
+
logic
+
+
+
decoded_instr_i
+
in
+
Handshake’s data with decode stage
+
ID_STAGE
+
scoreboard_entry_t[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
orig_instr_i
+
in
+
instruction value
+
ID_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
+
+
+
decoded_instr_valid_i
+
in
+
Handshake’s valid with decode stage
+
ID_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
is_ctrl_flow_i
+
in
+
Is instruction a control flow instruction
+
ID_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
decoded_instr_ack_o
+
out
+
Handshake’s acknowlege with decode stage
+
ID_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
rs1_forwarding_o
+
out
+
rs1 forwarding
+
EX_STAGE
+
[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0]
+
+
+
rs2_forwarding_o
+
out
+
rs2 forwarding
+
EX_STAGE
+
[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0]
+
+
+
fu_data_o
+
out
+
FU data useful to execute instruction
+
EX_STAGE
+
fu_data_t[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
pc_o
+
out
+
Program Counter
+
EX_STAGE
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
is_compressed_instr_o
+
out
+
Is compressed instruction
+
EX_STAGE
+
logic
+
+
+
flu_ready_i
+
in
+
Fixed Latency Unit is ready
+
EX_STAGE
+
logic
+
+
+
alu_valid_o
+
out
+
ALU FU is valid
+
EX_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
resolve_branch_i
+
in
+
Signaling that we resolved the branch
+
EX_STAGE
+
logic
+
+
+
lsu_ready_i
+
in
+
Load store unit FU is ready
+
EX_STAGE
+
logic
+
+
+
lsu_valid_o
+
out
+
Load store unit FU is valid
+
EX_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
branch_valid_o
+
out
+
Branch unit is valid
+
EX_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
branch_predict_o
+
out
+
Information of branch prediction
+
EX_STAGE
+
branchpredict_sbe_t
+
+
+
mult_valid_o
+
out
+
Mult FU is valid
+
EX_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
alu2_valid_o
+
out
+
ALU2 FU is valid
+
EX_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
csr_valid_o
+
out
+
CSR is valid
+
EX_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
xfu_valid_o
+
out
+
CVXIF FU is valid
+
EX_STAGE
+
logic[CVA6Cfg.NrIssuePorts-1:0]
+
+
+
xfu_ready_i
+
in
+
CVXIF is FU ready
+
EX_STAGE
+
logic
+
+
+
x_off_instr_o
+
out
+
CVXIF offloader instruction value
+
EX_STAGE
+
logic[31:0]
+
+
+
hart_id_i
+
in
+
CVA6 Hart ID
+
SUBSYSTEM
+
logic[CVA6Cfg.XLEN-1:0]
+
+
+
x_issue_ready_i
+
in
+
none
+
none
+
logic
+
+
+
x_issue_resp_i
+
in
+
none
+
none
+
x_issue_resp_t
+
+
+
x_issue_valid_o
+
out
+
none
+
none
+
logic
+
+
+
x_issue_req_o
+
out
+
none
+
none
+
x_issue_req_t
+
+
+
x_register_ready_i
+
in
+
none
+
none
+
logic
+
+
+
x_register_valid_o
+
out
+
none
+
none
+
logic
+
+
+
x_register_o
+
out
+
none
+
none
+
x_register_t
+
+
+
x_commit_valid_o
+
out
+
none
+
none
+
logic
+
+
+
x_commit_o
+
out
+
none
+
none
+
x_commit_t
+
+
+
x_transaction_rejected_o
+
out
+
CVXIF Transaction rejected → instruction is illegal
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+
+
+
As PerfCounterEn = 0,
+
+
+
+
+
sb_full_o output is tied to 0
+
+
+
stall_issue_o output is tied to 0
+
+
+
+
+
As EnableAccelerator = 0,
+
+
+
+
+
stall_i input is tied to 0
+
+
+
issue_instr_o output is tied to 0
+
+
+
issue_instr_hs_o output is tied to 0
+
+
+
+
+
As RVH = False,
+
+
+
+
+
tinst_o output is tied to 0
+
+
+
+
+
As RVF = 0,
+
+
+
+
+
fpu_ready_i input is tied to 0
+
+
+
fpu_valid_o output is tied to 0
+
+
+
fpu_fmt_o output is tied to 0
+
+
+
fpu_rm_o output is tied to 0
+
+
+
we_fpr_i input is tied to 0
+
+
+
+
+
As IsRVFI = 0,
+
+
+
+
+
rvfi_issue_pointer_o output is tied to 0
+
+
+
rvfi_commit_pointer_o output is tied to 0
+
+
+
+
+
+
+
+
+
4.3.2. Functionality
+
+
TO BE COMPLETED
+
+
+
+
4.3.3. Submodules
+
+
+
+
+
4.3.3.1. Scoreboard
+
+
The scoreboard contains a FIFO to store the decoded instructions. Issued
+instruction is pushed to the FIFO if it is not full. It indicates which
+registers are going to be clobbered by a previously issued instruction.
Stall signal, we do not want to fetch any more entries
+
TO_BE_COMPLETED
+
logic
+
+
+
+
+
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+
+
+
As EnableAccelerator = 0,
+
+
+
+
+
stall_i input is tied to 0
+
+
+
+
+
As RVH = False,
+
+
+
+
+
tinst_o output is tied to 0
+
+
+
+
+
As RVF = 0,
+
+
+
+
+
fpu_ready_i input is tied to 0
+
+
+
fpu_valid_o output is tied to 0
+
+
+
fpu_fmt_o output is tied to 0
+
+
+
fpu_rm_o output is tied to 0
+
+
+
we_fpr_i input is tied to 0
+
+
+
+
+
+
+
+
+
+
+
4.4. EX_STAGE Module
+
+
4.4.1. Description
+
+
The EX_STAGE module is a logical stage which implements the execute stage.
+It encapsulates the following functional units: ALU, Branch Unit, CSR buffer, Mult, load and store and CVXIF.
+
+
+
The module is connected to:
+
+
+
+
+
ID_STAGE module provides scoreboard entry.
+*
+
+
+
+
+
+
4.4.2. Functionality
+
+
TO BE COMPLETED
+
+
+
+
4.4.3. Submodules
+
+
+
+
+
4.4.3.1. alu
+
+
The arithmetic logic unit (ALU) is a small piece of hardware which performs 32 and 64-bit arithmetic and bitwise operations: subtraction, addition, shifts, comparisons…
+It always completes its operation in a single cycle.
+
+
+
Table 16. alu module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
fu_data_i
+
in
+
FU data needed to execute instruction
+
ISSUE_STAGE
+
fu_data_t
+
+
+
result_o
+
out
+
ALU result
+
ISSUE_STAGE
+
logic[CVA6Cfg.XLEN-1:0]
+
+
+
alu_branch_res_o
+
out
+
ALU branch compare result
+
branch_unit
+
logic
+
+
+
+
+
+
4.4.3.2. branch_unit
+
+
The branch unit module manages all kinds of control flow changes i.e.: conditional and unconditional jumps.
+It calculates the target address and decides whether to take the branch or not.
+It also decides if a branch was mis-predicted or not and reports corrective actions to the pipeline stages.
+
+
+
Table 17. branch_unit module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
fu_data_i
+
in
+
FU data needed to execute instruction
+
ISSUE_STAGE
+
fu_data_t
+
+
+
pc_i
+
in
+
Instruction PC
+
ISSUE_STAGE
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
is_compressed_instr_i
+
in
+
Instruction is compressed
+
ISSUE_STAGE
+
logic
+
+
+
branch_valid_i
+
in
+
Branch unit instruction is valid
+
ISSUE_STAGE
+
logic
+
+
+
branch_comp_res_i
+
in
+
ALU branch compare result
+
ALU
+
logic
+
+
+
branch_result_o
+
out
+
Brach unit result
+
ISSUE_STAGE
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
branch_predict_i
+
in
+
Information of branch prediction
+
ISSUE_STAGE
+
branchpredict_sbe_t
+
+
+
resolved_branch_o
+
out
+
Signaling that we resolved the branch
+
ISSUE_STAGE
+
bp_resolve_t
+
+
+
resolve_branch_o
+
out
+
Branch is resolved, new entries can be accepted by scoreboard
+
ID_STAGE
+
logic
+
+
+
branch_exception_o
+
out
+
Branch exception out
+
TO_BE_COMPLETED
+
exception_t
+
+
+
+
+
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+
+
+
As RVH = False,
+
+
+
+
+
v_i input is tied to 0
+
+
+
+
+
As DebugEn = False,
+
+
+
+
+
debug_mode_i input is tied to 0
+
+
+
+
+
+
+
+
+
4.4.3.3. CSR_buffer
+
+
The CSR buffer module stores the CSR address at which the instruction is going to read/write.
+As the CSR instruction alters the processor architectural state, this instruction has to be buffered until the commit stage decides to execute the instruction.
+
+
+
Table 18. csr_buffer module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
flush_i
+
in
+
Flush CSR
+
CONTROLLER
+
logic
+
+
+
fu_data_i
+
in
+
FU data needed to execute instruction
+
ISSUE_STAGE
+
fu_data_t
+
+
+
csr_ready_o
+
out
+
CSR FU is ready
+
ISSUE_STAGE
+
logic
+
+
+
csr_valid_i
+
in
+
CSR instruction is valid
+
ISSUE_STAGE
+
logic
+
+
+
csr_result_o
+
out
+
CSR buffer result
+
ISSUE_STAGE
+
logic[CVA6Cfg.XLEN-1:0]
+
+
+
csr_commit_i
+
in
+
commit the pending CSR OP
+
TO_BE_COMPLETED
+
logic
+
+
+
csr_addr_o
+
out
+
CSR address to write
+
COMMIT_STAGE
+
logic[11:0]
+
+
+
+
+
+
4.4.3.4. mult
+
+
The multiplier module supports the division and multiplication operations.
+
+
+
+
+
+
Table 19. mult module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
flush_i
+
in
+
Flush
+
CONTROLLER
+
logic
+
+
+
fu_data_i
+
in
+
FU data needed to execute instruction
+
ISSUE_STAGE
+
fu_data_t
+
+
+
mult_valid_i
+
in
+
Mult instruction is valid
+
ISSUE_STAGE
+
logic
+
+
+
result_o
+
out
+
Mult result
+
ISSUE_STAGE
+
logic[CVA6Cfg.XLEN-1:0]
+
+
+
mult_valid_o
+
out
+
Mult result is valid
+
ISSUE_STAGE
+
logic
+
+
+
mult_ready_o
+
out
+
Mutl is ready
+
ISSUE_STAGE
+
logic
+
+
+
mult_trans_id_o
+
out
+
Mult transaction ID
+
ISSUE_STAGE
+
logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+
+
+
+
4.4.3.4.1. multiplier
+
+
Multiplication is performed in two cycles and is fully pipelined.
+
+
+
Table 20. multiplier module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
trans_id_i
+
in
+
Multiplier transaction ID
+
Mult
+
logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+
+
mult_valid_i
+
in
+
Multiplier instruction is valid
+
Mult
+
logic
+
+
+
operation_i
+
in
+
Multiplier operation
+
Mult
+
fu_op
+
+
+
operand_a_i
+
in
+
A operand
+
Mult
+
logic[CVA6Cfg.XLEN-1:0]
+
+
+
operand_b_i
+
in
+
B operand
+
Mult
+
logic[CVA6Cfg.XLEN-1:0]
+
+
+
result_o
+
out
+
Multiplier result
+
Mult
+
logic[CVA6Cfg.XLEN-1:0]
+
+
+
mult_valid_o
+
out
+
Mutliplier result is valid
+
Mult
+
logic
+
+
+
mult_ready_o
+
out
+
Multiplier FU is ready
+
Mult
+
logic
+
+
+
mult_trans_id_o
+
out
+
Multiplier transaction ID
+
Mult
+
logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+
+
+
+
+
4.4.3.4.2. serdiv
+
+
The division is a simple serial divider which needs 64 cycles in the worst case.
+
+
+
Table 21. serdiv module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
id_i
+
in
+
Serdiv translation ID
+
Mult
+
logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+
+
op_a_i
+
in
+
A operand
+
Mult
+
logic[WIDTH-1:0]
+
+
+
op_b_i
+
in
+
B operand
+
Mult
+
logic[WIDTH-1:0]
+
+
+
rem
+
in
+
Serdiv operation
+
Mult
+
logic[1:0]opcode_i,//0:udiv,2:urem,1:div,3:
+
+
+
in_vld_i
+
in
+
Serdiv instruction is valid
+
Mult
+
logic
+
+
+
in_rdy_o
+
out
+
Serdiv FU is ready
+
Mult
+
logic
+
+
+
flush_i
+
in
+
Flush
+
CONTROLLER
+
logic
+
+
+
out_vld_o
+
out
+
Serdiv result is valid
+
Mult
+
logic
+
+
+
out_rdy_i
+
in
+
Serdiv is ready
+
Mult
+
logic
+
+
+
id_o
+
out
+
Serdiv transaction ID
+
Mult
+
logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+
+
res_o
+
out
+
Serdiv result
+
Mult
+
logic[WIDTH-1:0]
+
+
+
+
+
+
+
4.4.3.5. load_store_unit (LSU)
+
+
The load store module interfaces with the data cache (D$) to manage the load and store operations.
+
+
+
The LSU does not handle misaligned accesses.
+Misaligned accesses are double word accesses which are not aligned to a 64-bit boundary, word accesses which are not aligned to a 32-bit boundary and half word accesses which are not aligned on 16-bit boundary.
+If the LSU encounters a misaligned load or store, it throws a misaligned exception.
+
+
+
+
+
+
Table 22. load_store_unit module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
flush_i
+
in
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
logic
+
+
+
stall_st_pending_i
+
in
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
logic
+
+
+
no_st_pending_o
+
out
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
logic
+
+
+
fu_data_i
+
in
+
FU data needed to execute instruction
+
ISSUE_STAGE
+
fu_data_t
+
+
+
lsu_ready_o
+
out
+
Load Store Unit is ready
+
ISSUE_STAGE
+
logic
+
+
+
lsu_valid_i
+
in
+
Load Store Unit instruction is valid
+
ISSUE_STAGE
+
logic
+
+
+
load_trans_id_o
+
out
+
Load transaction ID
+
ISSUE_STAGE
+
logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+
+
load_result_o
+
out
+
Load result
+
ISSUE_STAGE
+
logic[CVA6Cfg.XLEN-1:0]
+
+
+
load_valid_o
+
out
+
Load result is valid
+
ISSUE_STAGE
+
logic
+
+
+
load_exception_o
+
out
+
Load exception
+
ISSUE_STAGE
+
exception_t
+
+
+
store_trans_id_o
+
out
+
Store transaction ID
+
ISSUE_STAGE
+
logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+
+
store_result_o
+
out
+
Store result
+
ISSUE_STAGE
+
logic[CVA6Cfg.XLEN-1:0]
+
+
+
store_valid_o
+
out
+
Store result is valid
+
ISSUE_STAGE
+
logic
+
+
+
store_exception_o
+
out
+
Store exception
+
ISSUE_STAGE
+
exception_t
+
+
+
commit_i
+
in
+
Commit the first pending store
+
TO_BE_COMPLETED
+
logic
+
+
+
commit_ready_o
+
out
+
Commit queue is ready to accept another commit request
+
TO_BE_COMPLETED
+
logic
+
+
+
commit_tran_id_i
+
in
+
Commit transaction ID
+
TO_BE_COMPLETED
+
logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+
+
icache_areq_i
+
in
+
Instruction cache input request
+
CACHES
+
icache_arsp_t
+
+
+
icache_areq_o
+
out
+
Instruction cache output request
+
CACHES
+
icache_areq_t
+
+
+
dcache_req_ports_i
+
in
+
Data cache request output
+
CACHES
+
dcache_req_o_t[2:0]
+
+
+
dcache_req_ports_o
+
out
+
Data cache request input
+
CACHES
+
dcache_req_i_t[2:0]
+
+
+
dcache_wbuffer_empty_i
+
in
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
logic
+
+
+
dcache_wbuffer_not_ni_i
+
in
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
logic
+
+
+
pmpcfg_i
+
in
+
PMP configuration
+
CSR_REGFILE
+
riscv::pmpcfg_t[CVA6Cfg.NrPMPEntries:0]
+
+
+
pmpaddr_i
+
in
+
PMP address
+
CSR_REGFILE
+
logic[CVA6Cfg.NrPMPEntries:0][CVA6Cfg.PLEN-3:0]
+
+
+
+
+
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+
+
+
As RVA = False,
+
+
+
+
+
amo_valid_commit_i input is tied to 0
+
+
+
amo_req_o output is tied to 0
+
+
+
amo_resp_i input is tied to 0
+
+
+
+
+
As RVH = False,
+
+
+
+
+
tinst_i input is tied to 0
+
+
+
enable_g_translation_i input is tied to 0
+
+
+
en_ld_st_g_translation_i input is tied to 0
+
+
+
v_i input is tied to 0
+
+
+
ld_st_v_i input is tied to 0
+
+
+
csr_hs_ld_st_inst_o output is tied to 0
+
+
+
vs_sum_i input is tied to 0
+
+
+
vmxr_i input is tied to 0
+
+
+
vsatp_ppn_i input is tied to 0
+
+
+
vs_asid_i input is tied to 0
+
+
+
hgatp_ppn_i input is tied to 0
+
+
+
vmid_i input is tied to 0
+
+
+
vmid_to_be_flushed_i input is tied to 0
+
+
+
gpaddr_to_be_flushed_i input is tied to 0
+
+
+
flush_tlb_vvma_i input is tied to 0
+
+
+
flush_tlb_gvma_i input is tied to 0
+
+
+
+
+
As RVS = False,
+
+
+
+
+
enable_translation_i input is tied to 0
+
+
+
en_ld_st_translation_i input is tied to 0
+
+
+
sum_i input is tied to 0
+
+
+
mxr_i input is tied to 0
+
+
+
satp_ppn_i input is tied to 0
+
+
+
asid_i input is tied to 0
+
+
+
asid_to_be_flushed_i input is tied to 0
+
+
+
vaddr_to_be_flushed_i input is tied to 0
+
+
+
+
+
As PRIV = MachineOnly,
+
+
+
+
+
priv_lvl_i input is tied to MachineMode
+
+
+
ld_st_priv_lvl_i input is tied to MAchineMode
+
+
+
+
+
As MMUPresent = 0,
+
+
+
+
+
flush_tlb_i input is tied to 0
+
+
+
+
+
As PerfCounterEn = 0,
+
+
+
+
+
itlb_miss_o output is tied to 0
+
+
+
dtlb_miss_o output is tied to 0
+
+
+
+
+
As IsRVFI = 0,
+
+
+
+
+
rvfi_lsu_ctrl_o output is tied to 0
+
+
+
rvfi_mem_paddr_o output is tied to 0
+
+
+
+
+
+
+
+
4.4.3.5.1. store_unit
+
+
The store_unit module manages the data store operations.
+
+
+
As stores can be speculative, the store instructions need to be committed by ISSUE_STAGE module before possibily altering the processor state.
+Store buffer keeps track of store requests.
+Outstanding store instructions (which are speculative) are differentiated from committed stores.
+When ISSUE_STAGE module commits a store instruction, outstanding stores
+become committed.
+
+
+
When commit buffer is not empty, the buffer automatically tries to write the oldest store to the data cache.
+
+
+
Furthermore, the store_unit module provides information to the load_unit to know if an outstanding store matches addresses with a load.
+
+
+
Table 23. store_unit module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
flush_i
+
in
+
Flush
+
CONTROLLER
+
logic
+
+
+
stall_st_pending_i
+
in
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
logic
+
+
+
no_st_pending_o
+
out
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
logic
+
+
+
store_buffer_empty_o
+
out
+
Store buffer is empty
+
TO_BE_COMPLETED
+
logic
+
+
+
valid_i
+
in
+
Store instruction is valid
+
ISSUE_STAGE
+
logic
+
+
+
lsu_ctrl_i
+
in
+
Data input
+
ISSUE_STAGE
+
lsu_ctrl_t
+
+
+
pop_st_o
+
out
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
logic
+
+
+
commit_i
+
in
+
Instruction commit
+
TO_BE_COMPLETED
+
logic
+
+
+
commit_ready_o
+
out
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
logic
+
+
+
valid_o
+
out
+
Store result is valid
+
ISSUE_STAGE
+
logic
+
+
+
trans_id_o
+
out
+
Transaction ID
+
ISSUE_STAGE
+
logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+
+
result_o
+
out
+
Store result
+
ISSUE_STAGE
+
logic[CVA6Cfg.XLEN-1:0]
+
+
+
ex_o
+
out
+
Store exception output
+
TO_BE_COMPLETED
+
exception_t
+
+
+
translation_req_o
+
out
+
Address translation request
+
TO_BE_COMPLETED
+
logic
+
+
+
vaddr_o
+
out
+
Virtual address
+
TO_BE_COMPLETED
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
paddr_i
+
in
+
Physical address
+
TO_BE_COMPLETED
+
logic[CVA6Cfg.PLEN-1:0]
+
+
+
ex_i
+
in
+
Exception raised before store
+
TO_BE_COMPLETED
+
exception_t
+
+
+
page_offset_i
+
in
+
Address to be checked
+
load_unit
+
logic[11:0]
+
+
+
page_offset_matches_o
+
out
+
Address check result
+
load_unit
+
logic
+
+
+
req_port_i
+
in
+
Data cache request
+
CACHES
+
dcache_req_o_t
+
+
+
req_port_o
+
out
+
Data cache response
+
CACHES
+
dcache_req_i_t
+
+
+
+
+
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+
+
+
As RVA = False,
+
+
+
+
+
amo_valid_commit_i input is tied to 0
+
+
+
amo_req_o output is tied to 0
+
+
+
amo_resp_i input is tied to 0
+
+
+
+
+
As IsRVFI = 0,
+
+
+
+
+
rvfi_mem_paddr_o output is tied to 0
+
+
+
+
+
As RVH = False,
+
+
+
+
+
tinst_o output is tied to 0
+
+
+
hs_ld_st_inst_o output is tied to 0
+
+
+
hlvx_inst_o output is tied to 0
+
+
+
+
+
For any HW configuration,
+
+
+
+
+
dtlb_hit_i input is tied to 1
+
+
+
+
+
+
+
+
+
4.4.3.5.2. load_unit
+
+
The load unit module manages the data load operations.
+
+
+
Before issuing a load, the load unit needs to check the store buffer for potential aliasing.
+It stalls until it can satisfy the current request. This means:
+
+
+
+
+
Two loads to the same address are allowed.
+
+
+
Two stores to the same address are allowed.
+
+
+
A store after a load to the same address is allowed.
+
+
+
A load after a store to the same address can only be processed if the store has already been sent to the cache i.e there is no fowarding.
+
+
+
+
+
After the check of the store buffer, a read request is sent to the D$ with the index field of the address (1).
+The load unit stalls until the D$ acknowledges this request (2).
+In the next cycle, the tag field of the address is sent to the D$ (3).
+If the load request address is non-idempotent, it stalls until the write buffer of the D$ is empty of non-idempotent requests and the store buffer is empty.
+It also stalls until the incoming load instruction is the next instruction to be committed.
+When the D$ allows the read of the data, the data is sent to the load unit and the load instruction can be committed (4).
+
+
+
+
+
+
Table 24. load_unit module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
flush_i
+
in
+
Flush signal
+
CONTROLLER
+
logic
+
+
+
valid_i
+
in
+
Load request is valid
+
LSU_BYPASS
+
logic
+
+
+
lsu_ctrl_i
+
in
+
Load request input
+
LSU_BYPASS
+
lsu_ctrl_t
+
+
+
pop_ld_o
+
out
+
Pop the load request from the LSU bypass FIFO
+
LSU_BYPASS
+
logic
+
+
+
valid_o
+
out
+
Load unit result is valid
+
ISSUE_STAGE
+
logic
+
+
+
trans_id_o
+
out
+
Load transaction ID
+
ISSUE_STAGE
+
logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+
+
result_o
+
out
+
Load result
+
ISSUE_STAGE
+
logic[CVA6Cfg.XLEN-1:0]
+
+
+
ex_o
+
out
+
Load exception
+
ISSUE_STAGE
+
exception_t
+
+
+
translation_req_o
+
out
+
Request address translation
+
MMU
+
logic
+
+
+
vaddr_o
+
out
+
Virtual address
+
MMU
+
logic[CVA6Cfg.VLEN-1:0]
+
+
+
paddr_i
+
in
+
Physical address
+
MMU
+
logic[CVA6Cfg.PLEN-1:0]
+
+
+
ex_i
+
in
+
Excepted which appears before load
+
MMU
+
exception_t
+
+
+
page_offset_o
+
out
+
Page offset for address checking
+
STORE_UNIT
+
logic[11:0]
+
+
+
page_offset_matches_i
+
in
+
Indicates if the page offset matches a store unit entry
+
STORE_UNIT
+
logic
+
+
+
store_buffer_empty_i
+
in
+
Store buffer is empty
+
STORE_UNIT
+
logic
+
+
+
commit_tran_id_i
+
in
+
Transaction ID of the committing instruction
+
COMMIT_STAGE
+
logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+
+
req_port_i
+
in
+
Data cache request out
+
CACHES
+
dcache_req_o_t
+
+
+
req_port_o
+
out
+
Data cache request in
+
CACHES
+
dcache_req_i_t
+
+
+
dcache_wbuffer_not_ni_i
+
in
+
Presence of non-idempotent operations in the D$ write buffer
+
CACHES
+
logic
+
+
+
+
+
Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+
+
+
As RVH = False,
+
+
+
+
+
tinst_o output is tied to 0
+
+
+
hs_ld_st_inst_o output is tied to 0
+
+
+
hlvx_inst_o output is tied to 0
+
+
+
+
+
For any HW configuration,
+
+
+
+
+
dtlb_hit_i input is tied to 1
+
+
+
+
+
As MMUPresent = 0,
+
+
+
+
+
dtlb_ppn_i input is tied to 0
+
+
+
+
+
+
+
+
+
4.4.3.5.3. lsu_bypass
+
+
The LSU bypass is a FIFO which keeps instructions from the issue stage when the store unit or the load unit are not available immediately.
+
+
+
Table 25. lsu_bypass module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
flush_i
+
in
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
logic
+
+
+
lsu_req_i
+
in
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
lsu_ctrl_t
+
+
+
lsu_req_valid_i
+
in
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
logic
+
+
+
pop_ld_i
+
in
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
logic
+
+
+
pop_st_i
+
in
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
logic
+
+
+
lsu_ctrl_o
+
out
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
lsu_ctrl_t
+
+
+
ready_o
+
out
+
TO_BE_COMPLETED
+
TO_BE_COMPLETED
+
logic
+
+
+
+
+
+
+
4.4.3.6. CVXIF_fu
+
+
TO BE COMPLETED
+
+
+
Table 26. cvxif_fu module IO ports
+
+
+
+
+
+
+
+
+
+
Signal
+
IO
+
Description
+
connexion
+
Type
+
+
+
+
+
clk_i
+
in
+
Subsystem Clock
+
SUBSYSTEM
+
logic
+
+
+
rst_ni
+
in
+
Asynchronous reset active low
+
SUBSYSTEM
+
logic
+
+
+
x_valid_i
+
in
+
CVXIF instruction is valid
+
ISSUE_STAGE
+
logic
+
+
+
x_trans_id_i
+
in
+
Transaction ID
+
ISSUE_STAGE
+
logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+
+
x_illegal_i
+
in
+
Instruction is illegal, determined during CVXIF issue transaction
+
ISSUE_STAGE
+
logic
+
+
+
x_off_instr_i
+
in
+
Offloaded instruction
+
ISSUE_STAGE
+
logic[31:0]
+
+
+
x_ready_o
+
out
+
CVXIF is ready
+
ISSUE_STAGE
+
logic
+
+
+
x_trans_id_o
+
out
+
CVXIF result transaction ID
+
ISSUE_STAGE
+
logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+
+
x_exception_o
+
out
+
CVXIF exception
+
ISSUE_STAGE
+
exception_t
+
+
+
x_result_o
+
out
+
CVXIF FU result
+
ISSUE_STAGE
+
logic[CVA6Cfg.XLEN-1:0]
+
+
+
x_valid_o
+
out
+
CVXIF result valid
+
ISSUE_STAGE
+
logic
+
+
+
x_we_o
+
out
+
CVXIF write enable
+
ISSUE_STAGE
+
logic
+
+
+
x_rd_o
+
out
+
CVXIF destination register
+
ISSUE_STAGE
+
logic[4:0]
+
+
+
result_valid_i
+
in
+
none
+
none
+
logic
+
+
+
result_i
+
in
+
none
+
none
+
x_result_t
+
+
+
result_ready_o
+
out
+
none
+
none
+
logic
+
+
+
+
+
+
+
+
4.5. COMMIT_STAGE Module
+
+
4.5.1. Description
+
+
The COMMIT_STAGE module implements the commit stage, which is the last
+stage in the processor’s pipeline. For the instructions for which the
+execution is completed, it updates the architectural state: writing CSR
+registers, committing stores and writing back data to the register file.
+The commit stage controls the stalling and the flushing of the
+processor.
+
+
+
The commit stage also manages the exceptions. An exception can occur
+during the first four pipeline stages (PCgen cannot generate an
+exception) or happen in commit stage, coming from the CSR_REGFILE or
+from an interrupt. Exceptions are precise: they are considered during
+the commit only and associated with the related instruction.
+
+
+
\ No newline at end of file
diff --git a/docs/04_cv32a65x/design/source/traps.rst b/docs/04_cv32a65x/design/design.rst
similarity index 60%
rename from docs/04_cv32a65x/design/source/traps.rst
rename to docs/04_cv32a65x/design/design.rst
index 4f2988563c..082d32e3a1 100644
--- a/docs/04_cv32a65x/design/source/traps.rst
+++ b/docs/04_cv32a65x/design/design.rst
@@ -1,5 +1,5 @@
..
- Copyright 2023 Thales DIS France SAS
+ Copyright (c) 2024 Thales
Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
@@ -7,5 +7,16 @@
Original Author: Jean-Roch COULON - Thales
+CV32A65X DESIGN DOCUMENT
+========================
-.. include:: ../../../01_cva6_user/Traps_Interrupts_Exceptions.rst
+.. raw:: html
+
+
+
+.. raw:: html
+ :file: design-cv32a65x.html
diff --git a/docs/04_cv32a65x/design/make.bat b/docs/04_cv32a65x/design/make.bat
deleted file mode 100644
index 543c6b13b4..0000000000
--- a/docs/04_cv32a65x/design/make.bat
+++ /dev/null
@@ -1,35 +0,0 @@
-@ECHO OFF
-
-pushd %~dp0
-
-REM Command file for Sphinx documentation
-
-if "%SPHINXBUILD%" == "" (
- set SPHINXBUILD=sphinx-build
-)
-set SOURCEDIR=source
-set BUILDDIR=build
-
-if "%1" == "" goto help
-
-%SPHINXBUILD% >NUL 2>NUL
-if errorlevel 9009 (
- echo.
- echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
- echo.installed, then set the SPHINXBUILD environment variable to point
- echo.to the full path of the 'sphinx-build' executable. Alternatively you
- echo.may add the Sphinx directory to PATH.
- echo.
- echo.If you don't have Sphinx installed, grab it from
- echo.http://sphinx-doc.org/
- exit /b 1
-)
-
-%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
-goto end
-
-:help
-%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
-
-:end
-popd
diff --git a/docs/04_cv32a65x/design/requirements.txt b/docs/04_cv32a65x/design/requirements.txt
deleted file mode 100644
index ed9ee59efb..0000000000
--- a/docs/04_cv32a65x/design/requirements.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-sphinx
-sphinx-rtd-theme
-recommonmark
-sphinxcontrib-svg2pdfconverter
-sphinx_github_changelog
diff --git a/docs/04_cv32a65x/design/source/CSRs.rst b/docs/04_cv32a65x/design/source/CSRs.rst
deleted file mode 100644
index a3dd55d115..0000000000
--- a/docs/04_cv32a65x/design/source/CSRs.rst
+++ /dev/null
@@ -1 +0,0 @@
-.. include:: ../../../../config/gen_from_riscv_config/cv32a65x/csr/csr.rst
diff --git a/docs/04_cv32a65x/design/source/conf.py b/docs/04_cv32a65x/design/source/conf.py
deleted file mode 100644
index 976ee3774a..0000000000
--- a/docs/04_cv32a65x/design/source/conf.py
+++ /dev/null
@@ -1,214 +0,0 @@
-# -*- coding: utf-8 -*-
-#
-# Copyright (c) 2020 OpenHW Group
-#
-# Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# https://solderpad.org/licenses/
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
-#
-###############################################################################
-#
-# Configuration file for the Sphinx documentation builder.
-#
-# This file does only contain a selection of the most common options. For a
-# full list see the documentation:
-# http://www.sphinx-doc.org/en/master/config
-
-# -- Path setup --------------------------------------------------------------
-
-# If extensions (or modules to document with autodoc) are in another directory,
-# add these directories to sys.path here. If the directory is relative to the
-# documentation root, use os.path.abspath to make it absolute, like shown here.
-#
-# import os
-# import sys
-# sys.path.insert(0, os.path.abspath('.'))
-
-
-# -- Project information -----------------------------------------------------
-
-project = u'CORE-V CV32A6 v0.1.0 Design Document'
-copyright = u'2022, Thales Group'
-author = u'Thales and OpenHW Group'
-
-# The short X.Y version
-version = u''
-# The full version, including alpha/beta/rc tags
-release = u''
-
-
-# -- General configuration ---------------------------------------------------
-
-# If your documentation needs a minimal Sphinx version, state it here.
-#
-# needs_sphinx = '1.0'
-
-# Add any Sphinx extension module names here, as strings. They can be
-# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
-# ones.
-extensions = [
- 'sphinx.ext.autodoc',
- 'sphinx.ext.todo',
- 'recommonmark',
- 'sphinxcontrib.inkscapeconverter',
- 'sphinx_github_changelog',
-# 'sphinxcontrib.wavedrom',
-]
-#wavedrom_html_jsinline = False
-
-# Add any paths that contain templates here, relative to this directory.
-templates_path = ['ytemplates']
-
-# The suffix(es) of source filenames.
-# You can specify multiple suffix as a list of string:
-#
-# source_suffix = ['.rst', '.md']
-source_suffix = '.rst'
-
-# The master toctree document.
-master_doc = 'index'
-
-# The language for content autogenerated by Sphinx. Refer to documentation
-# for a list of supported languages.
-#
-# This is also used if you do content translation via gettext catalogs.
-# Usually you set "language" from the command line for these cases.
-language = 'en'
-
-# List of patterns, relative to source directory, that match files and
-# directories to ignore when looking for source files.
-# This pattern also affects html_static_path and html_extra_path.
-exclude_patterns = []
-
-# Numbering
-numfig=True
-numfig_format = {'figure': 'Figure %s', 'table': 'Table %s', 'code-block': 'Listing %s'}
-
-# The name of the Pygments (syntax highlighting) style to use.
-pygments_style = None
-
-
-# -- Options for HTML output -------------------------------------------------
-
-# The theme to use for HTML and HTML Help pages. See the documentation for
-# a list of builtin themes.
-#
-#html_theme = 'alabaster'
-html_theme = 'sphinx_rtd_theme'
-
-# Theme options are theme-specific and customize the look and feel of a theme
-# further. For a list of options available for each theme, see the
-# documentation.
-#
-html_theme_options = {'style_nav_header_background': '#DDDDDD'}
-html_logo = '../images/openhw-landscape.svg'
-
-# Add any paths that contain custom static files (such as style sheets) here,
-# relative to this directory. They are copied after the builtin static files,
-# so a file named "default.css" will overwrite the builtin "default.css".
-#html_static_path = ['ystatic']
-# Set html_static_path to null on the advice of RTDs:
-html_static_path = []
-
-# Custom sidebar templates, must be a dictionary that maps document names
-# to template names.
-#
-# The default sidebars (for documents that don't match any pattern) are
-# defined by theme itself. Builtin themes are using these templates by
-# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
-# 'searchbox.html']``.
-#
-# html_sidebars = {}
-
-
-# -- Options for HTMLHelp output ---------------------------------------------
-
-# Output file base name for HTML help builder.
-htmlhelp_basename = 'CORE-V_CV32A6_V0.1.0_DESIGN_DOC'
-
-
-# -- Options for LaTeX output ------------------------------------------------
-
-latex_elements = {
- # The paper size ('letterpaper' or 'a4paper').
- #
- # 'papersize': 'letterpaper',
-
- # The font size ('10pt', '11pt' or '12pt').
- #
- # 'pointsize': '10pt',
-
- # Additional stuff for the LaTeX preamble.
- #
- # 'preamble': '',
-
- # Latex figure (float) alignment
- #
- # 'figure_align': 'htbp',
-}
-
-# Grouping the document tree into LaTeX files. List of tuples
-# (source start file, target name, title,
-# author, documentclass [howto, manual, or own class]).
-latex_documents = [
- (master_doc, 'CV32A6-v0.1.0_Design_Spec.tex', u'CORE-V-Docs Documentation',
- u'Jean-Roch Coulon', 'manual'),
-]
-
-
-# -- Options for manual page output ------------------------------------------
-
-# One entry per manual page. List of tuples
-# (source start file, name, description, authors, manual section).
-man_pages = [
- (master_doc, 'CV32A6-v0.1.0_Design_Spec.tex', u'CORE-V-Docs Documentation',
- [author], 1)
-]
-
-
-# -- Options for Texinfo output ----------------------------------------------
-
-# Grouping the document tree into Texinfo files. List of tuples
-# (source start file, target name, title, author,
-# dir menu entry, description, category)
-texinfo_documents = [
- (master_doc, 'CV32A6-v0.1.0_Design_Spec.tex', u'CORE-V-Docs Documentation',
- author, 'UserManual', 'User Manual for CV32A6 v0.1.0 CORE-V processor core.',
- 'Miscellaneous'),
-]
-
-
-# -- Options for Epub output -------------------------------------------------
-
-# Bibliographic Dublin Core info.
-epub_title = project
-
-# The unique identifier of the text. This can be a ISBN number
-# or the project homepage.
-#
-# epub_identifier = ''
-
-# A unique identification for the text.
-#
-# epub_uid = ''
-
-# A list of files that should not be packed into the epub file.
-epub_exclude_files = ['search.html']
-
-
-# -- Extension configuration -------------------------------------------------
-
-# -- Options for todo extension ----------------------------------------------
-
-# If true, `todo` and `todoList` produce output, else they produce nothing.
-todo_include_todos = True
diff --git a/docs/04_cv32a65x/design/source/cv32a6_glossary.rst b/docs/04_cv32a65x/design/source/cv32a6_glossary.rst
deleted file mode 100644
index 247cf315cd..0000000000
--- a/docs/04_cv32a65x/design/source/cv32a6_glossary.rst
+++ /dev/null
@@ -1,71 +0,0 @@
-..
- Copyright (c) 2020 OpenHW Group
-
- Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- https://solderpad.org/licenses/
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
-
-.. _CV32A6_GLOSSARY:
-
-Glossary
-========
-
-* **ALU**: Arithmetic/Logic Unit
-* **APU**: Application Processing Unit
-* **ASIC**: Application-Specific Integrated Circuit
-* **AXI**: Advanced eXtensible Interface
-* **BHT**: Branch History Table
-* **BTB**: Branch Target Buffer
-* **Byte**: 8-bit data item
-* **CPU**: Central Processing Unit, processor
-* **CSR**: Control and Status Register
-* **Custom extension**: Non-Standard extension to the RISC-V base instruction set (RISC-V Instruction Set Manual, Volume I: User-Level ISA)
-* **CVA6**: Core-V Application class processor with a 6 stage pipeline
-* **D$**: Data Cache
-* **DPI**: Direct Programming Interface
-* **EX** or **EXE**: Instruction Execute
-* **FPGA**: Field Programmable Gate Array
-* **FPU**: Floating Point Unit
-* **Halfword**: 16-bit data item
-* **Halfword aligned address**: An address is halfword aligned if it is divisible by 2
-* **I$**: Instruction Cache
-* **ID**: Instruction Decode
-* **IF**: Instruction Fetch
-* **ISA**: Instruction Set Architecture
-* **KGE**: Kilo Gate Equivalents (NAND2)
-* **LSU**: Load Store Unit
-* **M-Mode**: Machine Mode (RISC-V Instruction Set Manual, Volume II: Privileged Architecture)
-* **MMU**: Memory Management Unit
-* **NC**: Not Cacheable
-* **OBI**: Open Bus Interface
-* **OoO**: Out Of Order
-* **PC**: Program Counter
-* **PMP**: Physical memory protection (RISC-V Instruction Set Manual, Volume II: Privileged Architecture)
-* **PTW**: Page Table Walker
-* **PULP platform**: Parallel Ultra Low Power Platform ()
-* **RAS**: Return Address Stack
-* **RV32C**: RISC-V Compressed (C extension)
-* **RV32F**: RISC-V Floating Point (F extension)
-* **S-Mode**: Supervisor Mode (RISC-V Instruction Set Manual, Volume II: Privileged Architecture)
-* **SIMD**: Single Instruction/Multiple Data
-* **Standard extension**: Standard extension to the RISC-V base instruction set (RISC-V Instruction Set Manual, Volume I: User-Level ISA)
-* **TLB**: Translation Lookaside Buffer
-* **U-Mode**: User Mode (RISC-V Instruction Set Manual, Volume II: Privileged Architecture)
-* **VLEN**: Virtual address length
-* **WARL**: Write Any Values, Reads Legal Values
-* **WB**: Write Back of instruction results
-* **WLRL**: Write/Read Only Legal Values
-* **Word**: 32-bit data item
-* **Word aligned address**: An address is word aligned if it is divisible by 4
-* **WPRI**: Reserved Writes Preserve Values, Reads Ignore Values
-* **XLEN**: RISC-V processor data length
diff --git a/docs/04_cv32a65x/design/source/cva6_commit_stage.rst b/docs/04_cv32a65x/design/source/cva6_commit_stage.rst
deleted file mode 100644
index b4dde9e917..0000000000
--- a/docs/04_cv32a65x/design/source/cva6_commit_stage.rst
+++ /dev/null
@@ -1,36 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_COMMIT_STAGE:
-
-COMMIT_STAGE Module
-===================
-
-Description
------------
-
-The COMMIT_STAGE module implements the commit stage, which is the last stage in the processor’s pipeline.
-For the instructions for which the execution is completed, it updates the architectural state: writing CSR registers, committing stores and writing back data to the register file.
-The commit stage controls the stalling and the flushing of the processor.
-
-The commit stage also manages the exceptions.
-An exception can occur during the first four pipeline stages (PCgen cannot generate an exception) or happen in commit stage, coming from the CSR_REGFILE or from an interrupt.
-Exceptions are precise: they are considered during the commit only and associated with the related instruction.
-
-The module is connected to:
-
-* TO BE COMPLETED
-
-.. include:: port_commit_stage.rst
-
-Functionality
--------------
-
-TO BE COMPLETED
-
diff --git a/docs/04_cv32a65x/design/source/cva6_issue_stage.rst b/docs/04_cv32a65x/design/source/cva6_issue_stage.rst
deleted file mode 100644
index a0d542d763..0000000000
--- a/docs/04_cv32a65x/design/source/cva6_issue_stage.rst
+++ /dev/null
@@ -1,64 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_ISSUE_STAGE:
-
-ISSUE_STAGE Module
-==================
-
-Description
------------
-
-The execution can be roughly divided into four parts: issue(1), read operands(2), execute(3) and write-back(4).
-The ISSUE_STAGE module handles step one, two and four.
-The ISSUE_STAGE module receives the decoded instructions and issues them to the various functional units.
-
-A data structure called scoreboard is used to keep track of data related to the issue instruction: which functional unit and which destination register they are.
-The scoreboard handle the write-back data received from the COMMIT_STAGE module.
-
-Furthermore it contains the CPU’s register file.
-
-
-The module is connected to:
-
-* TO BE COMPLETED
-
-.. include:: port_issue_stage.rst
-
-Functionality
--------------
-
-TO BE COMPLETED
-
-
-Submodules
-----------
-
-.. figure:: ../images/issue_stage_modules.png
- :name: ISSUE_STAGE submodules
- :align: center
- :alt:
-
- ISSUE_STAGE submodules
-
-Scoreboard
-~~~~~~~~~~
-
-The scoreboard contains a FIFO to store the decoded instructions.
-Issued instruction is pushed to the FIFO if it is not full.
-It indicates which registers are going to be clobbered by a previously issued instruction.
-
-.. include:: port_scoreboard.rst
-
-Issue_read_operands
-~~~~~~~~~~~~~~~~~~~
-
-TO BE COMPLETED
-
-.. include:: port_issue_read_operands.rst
diff --git a/docs/04_cv32a65x/design/images/CV32A65X_subsystems.png b/docs/04_cv32a65x/design/source/images/CV32A65X_subsystems.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/CV32A65X_subsystems.png
rename to docs/04_cv32a65x/design/source/images/CV32A65X_subsystems.png
diff --git a/docs/04_cv32a65x/design/source/index.rst b/docs/04_cv32a65x/design/source/index.rst
deleted file mode 100644
index f4efb056b4..0000000000
--- a/docs/04_cv32a65x/design/source/index.rst
+++ /dev/null
@@ -1,23 +0,0 @@
-..
- Copyright (c) 2022 Thales
- Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-
-Design Document
-===============
-Editor: **Jean Roch Coulon**
-
-.. toctree::
- :maxdepth: 4
- :caption: Contents:
-
- intro
- subsystem
- functionality
- architecture
- cv32a6_glossary
diff --git a/docs/04_cv32a65x/design/source/instructions.rst b/docs/04_cv32a65x/design/source/instructions.rst
deleted file mode 100644
index c4efe68443..0000000000
--- a/docs/04_cv32a65x/design/source/instructions.rst
+++ /dev/null
@@ -1,31 +0,0 @@
-..
- Copyright 2023 Thales DIS France SAS
- Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-Instructions
-============
-
-The next first subchapter lists the extensions implemented in CVA6.
-By configuration, we can enable/disable the extensions.
-CV32A65X supports the extensions described in the next subchapters.
-RVZicond, RV32A and RVZifencei extensions are not supported by CV32A65X.
-
-
-.. toctree::
- :maxdepth: 1
-
- ../../../01_cva6_user/RISCV_Instructions
- ../../../01_cva6_user/RISCV_Instructions_RV32I
- ../../../01_cva6_user/RISCV_Instructions_RV32M
- ../../../01_cva6_user/RISCV_Instructions_RV32C
- ../../../01_cva6_user/RISCV_Instructions_RV32ZCb
- ../../../01_cva6_user/RISCV_Instructions_RVZba
- ../../../01_cva6_user/RISCV_Instructions_RVZbb
- ../../../01_cva6_user/RISCV_Instructions_RVZbc
- ../../../01_cva6_user/RISCV_Instructions_RVZbs
- ../../../01_cva6_user/RISCV_Instructions_RVZicsr
diff --git a/docs/04_cv32a65x/design/source/intro.rst b/docs/04_cv32a65x/design/source/intro.rst
deleted file mode 100644
index 20e808b01f..0000000000
--- a/docs/04_cv32a65x/design/source/intro.rst
+++ /dev/null
@@ -1,95 +0,0 @@
-..
- Copyright 2022 Thales DIS design services SAS
- Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-
-
-Introduction
-============
-
-The OpenHW Group uses `semantic versioning `_ to describe the release status of its IP.
-This document describes the CV32A65X configuration version of CVA6.
-This intends to be the first formal release of CVA6.
-
-CVA6 is a 6-stage in-order and single issue processor core which implements the RISC-V instruction set.
-CVA6 can be configured as a 32- or 64-bit core (RV32 or RV64), called CV32A6 or CV64A6.
-
-The objective of this document is to provide enough information to allow the RTL modification (by designers) and the RTL verification (by verificators).
-This document is not dedicated to CVA6 users looking for information to develop software like instructions or registers.
-
-The CVA6 architecture is illustrated in the following figure.
-
-.. figure:: ../images/ariane_overview.drawio.png
- :name: CVA6 Architecute
- :align: center
- :alt:
-
- CVA6 Architecture
-
-
-License
--------
-
-| Copyright 2022 Thales
-| Copyright 2018 ETH Zürich and University of Bologna
-| SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
-| Licensed under the Solderpad Hardware License v 2.1 (the “License”);
- you may not use this file except in compliance with the License, or,
- at your option, the Apache License version 2.0. You may obtain a copy
- of the License at https://solderpad.org/licenses/SHL-2.1/.
-| Unless required by applicable law or agreed to in writing, any work
- distributed under the License is distributed on an “AS IS” BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied. See the License for the specific language governing
- permissions and limitations under the License.
-
-
-Standards Compliance
---------------------
-
-To ease the reading, the reference to these specifications can be implicit in the requirements below. For the sake of precision, the requirements identify the versions of RISC-V extensions from these specifications.
-
-* **[CVA6req]** “CVA6 requirement specification”, https://github.com/openhwgroup/cva6/blob/master/docs/specifications/cva6_requirement_specification.rst, HASH#767c465.
-* **[RVunpriv]** “The RISC-V Instruction Set Manual, Volume I: User-Level ISA, Document Version 20191213”, Editors Andrew Waterman and Krste Asanović, RISC-V Foundation, December 13, 2019.
-* **[RVpriv]** “The RISC-V Instruction Set Manual, Volume II: Privileged Architecture, Document Version 20211203”, Editors Andrew Waterman, Krste Asanović and John Hauser, RISC-V Foundation, December 4, 2021.
-* **[RVdbg]** “RISC-V External Debug Support, Document Version 0.13.2”, Editors Tim Newsome and Megan Wachs, RISC-V Foundation, March 22, 2019.
-* **[RVcompat]** “RISC-V Architectural Compatibility Test Framework”, https://github.com/riscv-non-isa/riscv-arch-test.
-* **[AXI]** AXI Specification, https://developer.arm.com/documentation/ihi0022/hc.
-* **[CV-X-IF]** Placeholder for the CV-X-IF coprocessor interface currently prepared at OpenHW Group; current version in https://docs.openhwgroup.org/projects/openhw-group-core-v-xif/.
-* **[OpenPiton]** “OpenPiton Microarchitecture Specification”, Princeton University, https://parallel.princeton.edu/openpiton/docs/micro_arch.pdf.
-
-CV32A6 is a standards-compliant 32-bit processor fully compliant with RISC-V specifications: [RVunpriv], [RVpriv] and [RVdbg] and passes [RVcompat] compatibility tests, as requested by [GEN-10] in [CVA6req].
-
-
-Documentation framework
------------------------
-
-The framework of this document is inspired by the Common Criteria. The Common Criteria for Information Technology Security Evaluation (referred to as Common Criteria or CC) is an international standard (ISO/IEC 15408) for computer security certification.
-
-Description of the framework:
-
-* Processor is split into module corresponding to the main modules of the design
-* Modules can contain several modules
-* Each module is described in a chapter, which contains the following subchapters: *Description*, *Functionalities*, *Architecture and Modules* and *Registers* (if any)
-* The subchapter *Description* describes the main features of the submodule, the interconnections between the current module and the others and the inputs/outputs interface.
-* The subchapter *Functionality* lists in details the module functionalities. Please avoid using the RTL signal names to explain the functionalities.
-* The subchapter *Architecture and Modules* provides a drawing to present the module hierarchy, then the functionalities covered by the module
-* The subchapter *Registers* specifies the module registers if any
-
-
-Contributors
-------------
-
-| Jean-Roch Coulon - Thales
-| Ayoub Jalali
- (`ayoub.jalali@external.thalesgroup.com `__)
-| Alae Eddine Ezzejjari
- (`alae-eddine.ez-zejjari@external.thalesgroup.com `__)
-
-[TO BE COMPLETED]
-
diff --git a/docs/04_cv32a65x/design/source/mmu.rst b/docs/04_cv32a65x/design/source/mmu.rst
deleted file mode 100644
index 1f5493f0e9..0000000000
--- a/docs/04_cv32a65x/design/source/mmu.rst
+++ /dev/null
@@ -1,1587 +0,0 @@
-.. _CVA6_MMU:
-
-
-----------------------
-Memory Management Unit
-----------------------
-
-The Memory Management Unit (MMU) SV32 module is a crucial component in the RISC-V-based processor, serving as the backbone for virtual memory management and address translation.
-
-.. figure:: ../images/mmu_in_out.png
- :name: **Figure 1:** Inputs and Outputs of CVA6 MMU SV32
- :align: center
- :width: 70%
- :alt: mmu_in_out
-
- **Figure 1:** Inputs and Outputs of CVA6 MMU SV32
-
-At its core, the MMU SV32 plays a pivotal role in translating virtual addresses into their corresponding physical counterparts.
-This translation process is paramount for providing memory protection, isolation, and efficient memory management in modern computer systems.
-Importantly, it handles both instruction and data accesses, ensuring a seamless interaction between the processor and virtual memory.
-Within the MMU, several major blocks play pivotal roles in this address translation process. These includes:
-
-* Instruction TLB (ITLB)
-* Data TLB (DTLB)
-* Shared TLB
-* Page Table Walker (PTW)
-
-.. figure:: ../images/mmu_major_blocks.png
- :name: **Figure 2:** Major Blocks in CVA6 MMU SV32
- :align: center
- :width: 60%
- :alt: mmu_major_blocks
-
- **Figure 2:** Major Blocks in CVA6 MMU SV32
-
-The MMU SV32 manages privilege levels and access control, enforcing permissions for user and supervisor modes while handling access exceptions.
-It employs Translation Lookaside Buffers (TLBs) for efficient address translation, reducing the need for page table access.
-TLB hits yield quick translations, but on misses, the shared TLB is consulted, and if necessary, the Page Table Walker (PTW) performs page table walks, updating TLBs and managing exceptions during the process.
-
-In addition to these functionalities, the MMU SV32 seamlessly integrates support for Physical Memory Protection (PMP), enabling it to enforce access permissions and memory protection configurations as specified by the PMP settings.
-This additional layer of security and control enhances the management of memory accesses
-
-.. raw:: html
-
- Instruction and Data Interfaces
-
-The MMU SV32 maintains interfaces with the instruction cache (ICache) and the load-store unit (LSU).
-It receives virtual addresses from these components and proceeds to translate them into physical addresses, a fundamental task for ensuring proper program execution and memory access.
-
-.. raw:: html
-
- Signal Description of MMU
-
-.. raw:: html
-
-
Table 1: CVA6 MMU SV32 Input Output Signals
-
-.. list-table::
- :header-rows: 1
-
- * - Signal
- - IO
- - Connection Type
- - Type
- - Description
-
- * - ``clk_i``
- - in
- - Subsystem
- - logic
- - Subsystem Clock
-
- * - ``rst_ni``
- - in
- - Subsystem
- - logic
- - Asynchronous reset active low
-
- * - ``flush_i``
- - in
- - Controller
- - logic
- - Sfence Committed
-
- * - ``enable_translation_i``
- - in
- - CSR RegFile
- - logic
- - Indicate address translation request for instruction
-
- * - ``en_ld_st_translation_i``
- - in
- - CSR RegFile
- - logic
- - Indicate address translation request for load or store
-
- * - ``icache_areq_i``
- - in
- - Cache Subsystem
- - icache_arsp_t
- - Icache Response
-
- * - ``icache_areq_o``
- - out
- - Cache Subsystem
- - icache_areq_t
- - Icache Request
-
- * - ``misaligned_ex_i``
- - in
- - Load Store Unit
- - exception_t
- - Indicate misaligned exception
-
- * - ``lsu_req_i``
- - in
- - Load Store Unit
- - logic
- - Request address translation
-
- * - ``lsu_vaddr_i``
- - in
- - Load Store Unit
- - logic [riscv::VLEN-1:0]
- - Virtual Address In
-
- * - ``lsu_is_store_i``
- - in
- - Store Unit
- - logic
- - Translation is requested by a store
-
- * - ``lsu_dtlb_hit_o``
- - out
- - Store / Load Unit
- - logic
- - Indicate a DTLB hit
-
- * - ``lsu_dtlb_ppn_o``
- - out
- - Load Unit
- - logic [riscv::PPNW-1:0]
- - Send PNN to LSU
-
- * - ``lsu_valid_o``
- - out
- - Load Store Unit
- - logic
- - Indicate a valid translation
-
- * - ``lsu_paddr_o``
- - out
- - Store / Load Unit
- - logic [riscv::PLEN-1:0]
- - Translated Address
-
- * - ``lsu_exception_o``
- - out
- - Store / Load Unit
- - exception_t
- - Address Translation threw an exception
-
- * - ``priv_lvl_i``
- - in
- - CSR RegFile
- - riscv::priv_lvl_t
- - Privilege level for instruction fetch interface
-
- * - ``ld_st_priv_lvl_i``
- - in
- - CSR RegFile
- - riscv::priv_lvl_t
- - Privilege Level for Data Interface
-
- * - ``sum_i``
- - in
- - CSR RegFile
- - logic
- - Supervisor User Memory Access bit in xSTATUS CSR register
-
- * - ``mxr_i``
- - in
- - CSR RegFile
- - logic
- - Make Executable Readable bit in xSTATUS CSR register
-
- * - ``satp_ppn_I``
- - in
- - CSR RegFile
- - logic [riscv::PPNW-1:0]
- - PPN of top level page table from SATP register
-
- * - ``asid_i``
- - in
- - CSR RegFile
- - logic [ASID_WIDTH-1:0]
- - ASID to for the lookup
-
- * - ``asid_to_be_flushed``
- - in
- - Execute Stage
- - logic [ASID_WIDTH-1:0]
- - ASID of the entry to be flushed.
-
- * - ``vaddr_to_be_flushed_i``
- - in
- - Execute Stage
- - logic [riscv::VLEN-1:0]
- - Virtual address of the entry to be flushed.
-
- * - ``flush_tlb_i``
- - in
- - Controller
- - logic
- - SFENCE.VMA committed
-
- * - ``itlb_miss_o``
- - out
- - Performance Counter
- - logic
- - Indicate an ITLB miss
-
- * - ``dtlb_miss_o``
- - out
- - Performance Counter
- - logic
- - Indicate a DTLB miss
-
- * - ``req_port_i``
- - in
- - Cache Subsystem
- - dcache_req_o_t
- - D Cache Data Requests
-
- * - ``req_port_o``
- - out
- - Cache Subsystem
- - dcache_req_i_t
- - D Cache Data Response
-
- * - ``pmpcfg_i``
- - in
- - CSR RegFile
- - riscv::pmpcfg_t [15:0]
- - PMP configurations
-
- * - ``pmpaddr_i``
- - in
- - CSR RegFile
- - logic [15:0][riscv::PLEN-3:0]
- - PMP Address
-
-.. raw:: html
-
- Struct Description
-
-.. raw:: html
-
-
-
-.. list-table::
- :header-rows: 1
-
- * - Signal
- - Type
- - Description
-
- * - ``cause``
- - riscv::xlen_t
- - Cause of exception
-
- * - ``tval``
- - riscv::xlen_t
- - Additional information of causing exception (e.g. instruction causing it), address of LD/ST fault
-
- * - ``valid``
- - logic
- - Indicate that exception is valid
-
-.. raw:: html
-
-
Table 5: PMP Configuration Struct (pmpcfg_t)
-
-.. list-table::
- :header-rows: 1
-
- * - Signal
- - Type
- - Description
-
- * - ``locked``
- - logic
- - Lock this configuration
-
- * - ``reserved``
- - logic[1:0]
- - Reserved bits in pmpcfg CSR
-
- * - ``addr_mode``
- - pmp_addr_mode_t
- - Addressing Modes: OFF, TOR, NA4, NAPOT
-
- * - ``access_type``
- - pmpcfg_access_t
- - None, read, write, execute
-
-.. raw:: html
-
- Control Flow in MMU SV32 Module
-
-.. figure:: ../images/mmu_control_flow.png
- :name: **Figure 3:** Control Flow in CVA6 MMU SV32
- :align: center
- :width: 95%
- :alt: mmu_control_flow
-
- **Figure 3:** Control Flow in CVA6 MMU SV32
-
-.. raw:: html
-
- Exception Sources with Address Translation Enabled
-
-Two potential exception sources exist:
-
-* Hardware Page Table Walker (HPTW) throwing an exception, signifying a page fault exception.
-* Access error due to insufficient permissions of PMP, known as an access exception.
-
-.. raw:: html
-
- Instruction Fetch Interface
-
-The IF stage initiates a request to retrieve memory content at a specific virtual address. When the MMU is disabled, the instruction fetch request is directly passed to the I$ without modifications.
-
-.. raw:: html
-
- Address Translation in Instruction Interface
-
-If virtual memory translation is enabled for instruction fetches, the following operations are performed in the instruction interface:
-
-* Compatibility of requested virtual address with selected page based address translation scheme is checked.
-* For 4K page translation, the module determines the fetch physical address by combining the physical page number (PPN) from ITLB content and the offset from the virtual address.
-* In the case of Mega page translation, if the ITLB indicates a 4M page, the VPN0 from the fetch virtual address is written to the PPN0 of the fetch physical address to ensure alignment for superpage translation.
-* If the Instruction TLB (ITLB) lookup hits, the fetch valid signal (which indicates a valid physical address) is activated in response to the input fetch request. Memory region accessibility is checked from the perspective of the fetch operation, potentially triggering a page fault exception in case of an access error or insufficient PMP permission.
-* In case of an ITLB miss, if the page table walker (PTW) is active (only active if there is a shared TLB miss) and handling instruction fetches, the fetch valid signal is determined based on PTW errors or access exceptions.
-
-If the fetch physical address doesn't match any execute region, an Instruction Access Fault is raised. When not translating, PMPs are immediately checked against the physical address for access verification.
-
-.. raw:: html
-
- Data Interface
-
-.. raw:: html
-
- Address Translation in Data Interface
-
-If address translation is enabled for load or store, and no misaligned exception has occurred, the following operations are performed in the data interface:
-
-* Initially, translation is assumed to be invalid, signified by the MMU to LSU.
-* The translated physical address is formed by combining the PPN from the Page Table Entry (PTE) and the offset from the virtual address requiring translation. This send one cycle later due to the additional bank of registers which delayed the MMU’s answer. The PPN from the PTE is also shared separately with LSU in the same cycle as the hit.
-* In the case of superpage translation, as in SV32, known as the 4M page, PPN0 of the translated physical address and the separately shared PPN are updated with the VPN0 of the virtual address.
-
-If a Data TLB (DTLB) hit occurs, it indicates a valid translation, and various fault checks are performed depending on whether it's a load or store request.
-
-* For store requests, if the page is not writable, the dirty flag isn't set, or privileges are violated, it results in a page fault corresponding to the store access. If PMPs are also violated, it leads to an access fault corresponding to the store access. Page faults take precedence over access faults.
-* For load requests, a page fault is triggered if there are insufficient access privileges. PMPs are checked again during load access, resulting in an access fault corresponding to load access if PMPs are violated.
-
-In case of a DTLB miss, potential exceptions are monitored during the page table walk. If the PTW indicates a page fault, the corresponding page fault related to the requested type is signaled. If the PTW indicates an access exception, the load access fault is indicated through address translation because the page table walker can only throw load access faults.
-
-.. raw:: html
-
- Address Translation is Disabled
-
-When address translation is not enabled, the physical address is immediately checked against Physical Memory Protections (PMPs). If there is a request from LSU, no misaligned exception, and PMPs are violated, it results in an access fault corresponding to the request being indicated.
-
-----------------------------
-Translation Lookaside Buffer
-----------------------------
-
-Page tables are accessed for translating virtual memory addresses to physical memory addresses. This translation needs to be carried out for every load and store instruction and also for every instruction fetch. Since page tables are resident in physical memory, accessing these tables in all these situations has a significant impact on performance. Page table accesses occur in patterns that are closely related in time. Furthermore, the spatial and temporal locality of data accesses or instruction fetches mean that the same page is referenced repeatedly. Taking advantage of these access patterns the processor keeps the information of recent address translations, to enable fast retrieval, in a small cache called the Translation Lookaside Buffer (TLB) or an address-translation cache.
-
-The CVA6 TLB is structured as a fully associative cache, where the virtual address that needs to be translated is compared against all the individual TLB entries. Given a virtual address, the processor examines the TLB (TLB lookup) to determine if the virtual page number (VPN) of the page being accessed is in the TLB. When a TLB entry is found (TLB hit), the TLB returns the corresponding physical page number (PPN) which is used to calculate the target physical address. If no TLB entry is found (TLB miss) the processor has to read individual page table entries from memory (Table walk). In CVA6 table walking is supported by dedicated hardware. Once the processor finishes the table walk it has the Physical Page Number (PPN) corresponding to the Virtual Page Number (VPN) That needs to be translated. The processor adds an entry for this address translation to the TLB so future translations of that virtual address will happen quickly through the TLB. During the table walk the processor may find out that the corresponding physical page is not resident in memory. At this stage a page table exception (Page Fault) is generated which gets handled by the operating system. The operating system places the appropriate page in memory, updates the appropriate page tables and returns execution to the instruction which generated the exception.
-
-The inputs and output signals of the TLB are shown in the following two figures.
-
-.. figure:: ../images/in_out_tlb.png
- :name: **Figure 4:** Inputs and Outputs of CVA6 TLB
- :align: center
- :width: 65%
- :alt: in_out_tlb
-
- **Figure 4:** Inputs and Outputs of CVA6 TLB
-
-.. raw:: html
-
- Signal Description of TLB
-
-.. raw:: html
-
-
Table 6: CVA6 TLB Input Output Signals
-
-.. list-table::
- :header-rows: 1
-
- * - Signal
- - IO
- - connection
- - Type
- - Description
-
- * - ``clk_i``
- - in
- - SUBSYSTEM
- - logic
- - Subsystem Clock
-
- * - ``rst_ni``
- - in
- - SUBSYSTEM
- - logic
- - Asynchronous reset active low
-
- * - ``flush_i``
- - in
- - Controller
- - logic
- - Asynchronous reset active low
-
- * - ``update_i``
- - in
- - Shared TLB
- - tlb_update_sv32_t
- - Updated tag and content of TLB
-
- * - ``lu_access_i``
- - in
- - Cache Subsystem
- - logic
- - Signal indicating a lookup access is being requested
-
- * - ``lu_asid_i``
- - in
- - CSR RegFile
- - logic[ASID_WIDTH-1:0]
- - ASID (Address Space Identifier) for the lookup
-
- * - ``lu_vaddr_i``
- - in
- - Cache Subsystem
- - logic[riscv::VLEN-1:0]
- - Virtual address for the lookup
-
- * - ``lu_content_o``
- - out
- - MMU SV32
- - riscv::pte_sv32_t
- - Output for the content of the TLB entry
-
- * - ``asid_to_be_flushed_i``
- - in
- - Execute Stage
- - logic[ASID_WIDTH-1:0]
- - ASID of the entry to be flushed
-
- * - ``vaddr_to_be_flushed_i``
- - in
- - Execute Stage
- - logic[riscv::VLEN-1:0]
- - Virtual address of the entry to be flushed
-
- * - ``lu_is_4M_o``
- - out
- - MMU SV32
- - logic
- - Output indicating whether the TLB entry corresponds to a 4MB page
-
- * - ``lu_hit_o``
- - out
- - MMU SV32
- - logic
- - Output indicating whether the lookup resulted in a hit or miss
-
-.. raw:: html
-
- Struct Description
-
-.. raw:: html
-
-
-
-.. list-table::
- :header-rows: 1
-
- * - Signal
- - Type
- - Description
-
- * - ``valid``
- - logic
- - Indicates whether the TLB update entry is valid or not
-
- * - ``is_4M``
- - logic
- - Indicates if the TLB entry corresponds to a 4MB page
-
- * - ``vpn``
- - logic[19:0]
- - Virtual Page Number (VPN) used for updating the TLB, consisting of 20 bits
-
- * - ``asid``
- - logic[8:0]
- - Address Space Identifier (ASID) used for updating the TLB, with a length of 9 bits for Sv32 MMU
-
- * - ``content``
- - riscv::pte_sv32_t
- - Content of the TLB update entry, defined by the structure
-
-.. raw:: html
-
-
Table 8: SV32 PTE Struct (riscv::pte_sv32_t)
-
-.. list-table::
- :header-rows: 1
-
- * - Signal
- - Type
- - Description
-
- * - ``ppn``
- - logic[21:0]
- - 22 bit Physical Page Number (PPN)
-
- * - ``rsw``
- - logic[1:0]
- - Reserved for use by supervisor software
-
- * - ``d``
- - logic
- - | Dirty bit indicating whether the page has been modified (dirty) or not
- | 0: Page is clean i.e., has not been written
- | 1: Page is dirty i.e., has been written
-
- * - ``a``
- - logic
- - | Accessed bit indicating whether the page has been accessed
- | 0: Virtual page has not been accessed since the last time A bit was cleared
- | 1: Virtual page has been read, written, or fetched from since the last time the A bit was cleared
-
- * - ``g``
- - logic
- - | Global bit marking a page as part of a global address space valid for all ASIDs
- | 0: Translation is valid for specific ASID
- | 1: Translation is valid for all ASIDs
-
- * - ``u``
- - logic
- - | User bit indicating privilege level of the page
- | 0: Page is not accessible in user mode but in supervisor mode
- | 1: Page is accessible in user mode but not in supervisor mode
-
- * - ``x``
- - logic
- - | Execute bit which allows execution of code from the page
- | 0: Code execution is not allowed
- | 1: Code execution is permitted
-
- * - ``w``
- - logic
- - | Write bit allows the page to be written
- | 0: Write operations are not allowed
- | 1: Write operations are permitted
-
- * - ``r``
- - logic
- - | Read bit allows read access to the page
- | 0: Read operations are not allowed
- | 1: Read operations are permitted
-
- * - ``v``
- - logic
- - | Valid bit indicating the page table entry is valid
- | 0: Page is invalid i.e. page is not in DRAM, translation is not valid
- | 1: Page is valid i.e. page resides in the DRAM, translation is valid
-
-.. raw:: html
-
- TLB Entry Fields
-
-The number of TLB entries can be changed via a design parameter. In 32-bit configurations of CVA6 only 2 TLB entries are instantiated. Each TLB entry is made up of two fields: Tag and Content. The Tag field holds the virtual page number (VPN1, VPN0), ASID, page size (is_4M) along with a valid bit (VALID) indicating that the entry is valid. The SV32 virtual page number, which is supported by CV32A6X, is further split into two separate virtual page numbers VPN1 and VPN0. The Content field contains two physical page numbers (PPN1, PPN0) along with a number of bits which specify various attributes of the physical page. Note that the V bit in the Content field is the V bit which is present in the page table in memory. It is copied from the page table, as is, and the VALID bit in the Tag is set based on its value.The TLB entry fields are shown in **Figure 2**.
-
-.. figure:: ../images/cva6_tlb_entry.png
- :name: **Figure 5:** Fields in CVA6 TLB entry
- :align: center
- :width: 80%
- :alt: cva6_tlb_entry
-
- **Figure 5:** Fields in CVA6 TLB entry
-
-.. raw:: html
-
- CVA6 TLB Management / Implementation
-
-The CVA6 TLB implements the following three functions:
-
-* **Translation:** This function implements the address lookup and match logic.
-* **Update and Flush:** This function implements the update and flush logic.
-* **Pseudo Least Recently Used Replacement Policy:** This function implements the replacement policy for TLB entries.
-
-.. raw:: html
-
- Translation
-
-This function takes in the virtual address and certain other fields, examines the TLB to determine if the virtual page number of the page being accessed is in the TLB or not. If a TLB entry is found (TLB hit), the TLB returns the corresponding physical page number (PPN) which is then used to calculate the target physical address. The following checks are done as part of this lookup function to find a match in the TLB:
-
-* **Validity Check:** For a TLB hit, the associated TLB entry must be valid .
-* **ASID and Global Flag Check:** The TLB entry's ASID must match the given ASID (ASID associated with the Virtual address). If the TLB entry’s Global bit (G) bit is set then this check is not done. This ensures that the translation is either specific to the provided ASID or it is globally applicable.
-* **Level 1 VPN match:** SV32 implements a two-level page table. As such the virtual address is broken up into three parts which are the virtual page number 1, virtual page number 0 and displacement. So the condition that is checked next is that the virtual page number 1 of the virtual address matches the virtual page number 1(VPN1) of the TLB entry.
-* **Level 0 VPN match or 4-Mega Page:** The last condition to be checked, for a TLB hit, is that the virtual page number 0 of the virtual address matches the virtual page number 0 of the TLB entry (VPN0). This match is ignored if the is_4M bit in the Tag is set which implies a super 4M page.
-
-All the conditions listed above are checked against every TLB entry. If there is a TLB hit then the corresponding bit in the hit array is set. **Figure 3** Illustrates the TLB hit/miss process listed above.
-
-.. figure:: ../images/cva6_tlb_hit.png
- :name: **Figure 6:** Block diagram of CVA6 TLB hit or miss
- :align: center
- :width: 75%
- :alt: cva6_tlb_hit
-
- **Figure 6:** Block diagram of CVA6 TLB hit or miss
-
-.. raw:: html
-
- Flushing TLB entries
-
-The SFENCE.VMA instruction can be used with certain specific source register specifiers (rs1 & rs2) to flush a specific TLB entry, some set of TLB entries or all TLB entries. Like all instructions this action only takes place when the SFENCE.VMA instruction is committed (shown via the commit_sfence signal in the following figures.) The behavior of the instruction is as follows:
-
-* **If rs1 is not equal to x0 and rs2 is not equal to x0:** Invalidate all TLB entries which contain leaf page table entries corresponding to the virtual address in rs1 (shown below as Virtual Address to be flushed) and that match the address space identifier as specified by integer register rs2 (shown below as asid_to_be_flushed_i), except for entries containing global mappings. This is referred to as the “SFENCE.VMA vaddr asid” case.
-
-.. figure:: ../images/sfence_vaddr_asid.png
- :name: **Figure 7:** Invalidate TLB entry if ASID and virtual address match
- :align: center
- :width: 75%
- :alt: sfence_vaddr_asid
-
- **Figure 7:** Invalidate TLB entry if ASID and virtual address match
-
-* **If rs1 is equal to x0 and rs2 is equal to x0:** Invalidate all TLB entries for all address spaces. This is referred to as the "SFENCE.VMA x0 x0" case.
-
-.. figure:: ../images/sfence_x0_x0.png
- :name: **Figure 8:** Invalidate all TLB entries if both source register specifiers are x0
- :align: center
- :width: 62%
- :alt: sfence_x0_x0
-
- **Figure 8:** Invalidate all TLB entries if both source register specifiers are x0
-
-* **If rs1 is not equal to x0 and rs2 is equal to x0:** invalidate all TLB entries that contain leaf page table entries corresponding to the virtual address in rs1, for all address spaces. This is referred to as the “SFENCE.VMA vaddr x0” case.
-
-.. figure:: ../images/sfence_vaddr_x0.png
- :name: **Figure 9:** Invalidate TLB entry with matching virtual address for all address spaces
- :align: center
- :width: 75%
- :alt: sfence_vaddr_x0
-
- **Figure 9:** Invalidate TLB entry with matching virtual address for all address spaces
-
-* **If rs1 is equal to x0 and rs2 is not equal to x0:** Invalidate all TLB entries matching the address space identified by integer register rs2, except for entries containing global mappings. This is referred to as the “SFENCE.VMA 0 asid” case.
-
-.. figure:: ../images/sfence_x0_asid.png
- :name: **Figure 10:** Invalidate TLB entry for matching ASIDs
- :align: center
- :width: 75%
- :alt: sfence_x0_asid
-
- **Figure 10:** Invalidate TLB entry for matching ASIDs
-
-.. raw:: html
-
- Updating TLB
-
-When a TLB valid update request is signaled by the shared TLB, and the replacement policy select the update of a specific TLB entry, the corresponding entry's tag is updated with the new tag, and its associated content is refreshed with the information from the update request. This ensures that the TLB entry accurately reflects the new translation information.
-
-.. raw:: html
-
- Pseudo Least Recently Used Replacement Policy
-
-Cache replacement algorithms are used to determine which TLB entry should be replaced, because it is not likely to be used in the near future. The Pseudo-Least-Recently-Used (PLRU) is a cache entry replacement algorithm, derived from Least-Recently-Used (LRU) cache entry replacement algorithm, used by the TLB. Instead of precisely tracking recent usage as the LRU algorithm does, PLRU employs an approximate measure to determine which entry in the cache has not been recently used and as such can be replaced.
-
-CVA6 implements the PLRU algorithm via the Tree-PLRU method which implements a binary tree. The TLB entries are the leaf nodes of the tree. Each internal node, of the tree, consists of a single bit, referred to as the state bit or plru bit, indicating which subtree contains the (pseudo) least recently used entry (the PLRU); 0 for the left hand tree and 1 for the right hand tree. Following this traversal, the leaf node reached, corresponds to the PLRU entry which can be replaced. Having accessed an entry (so as to replace it) we need to promote that entry to be the Most Recently Used (MRU) entry. This is done by updating the value of each node along the access path to point away from that entry. If the accessed entry is a right child i.e., its parent node value is 1, it is set to 0, and if the parent is the left child of its parent (the grandparent of the accessed node) then its node value is set to 1 and so on all the way up to the root node.
-
-The PLRU binary tree is implemented as an array of node values. Nodes are organized in the array based on levels, with those from lower levels appearing before higher ones. Furthermore those on the left side of a node appear before those on the right side of a node. The figure below shows a tree and the corresponding array.
-
-.. figure:: ../images/plru_tree_indexing.png
- :name: **Figure 11:** PLRU Tree Indexing
- :align: center
- :width: 60%
- :alt: plru_tree_indexing
-
- **Figure 11:** PLRU Tree Indexing
-
-For n-way associative, we require n - 1 internal nodes in the tree. With those nodes, two operations need to be performed efficiently.
-
-* Promote the accessed entry to be MRU
-* Identify which entry to replace (i.e. the PLRU entry)
-
-.. raw:: html
-
- Updating the PLRU-Tree
-
-For a TLB entry which is accessed, the following steps are taken to make it the MRU:
-
-1. Iterate through each level of the binary tree.
-2. Calculate the index of the leftmost child within the current level. Let us call that index the index base.
-3. Calculate the shift amount to identify the relevant node based on the level and TLB entry index.
-4. Calculate the new value that the node should have in order to make the accessed entry the Most Recently Used (MRU). The new value of the root node is the opposite of the TLB entry index, MSB at the root node, MSB - 1 at node at next level and so on.
-5. Assign this new value to the relevant node, ensuring that the hit entry becomes the MRU within the binary tree structure.
-
-At level 0, no bit of the TLB entry’s index determines the offset from the index base because it’s a root node. At level 1, MSB of entry’s index determines the amount of offset from index base at that level. At level 2, the first two bits of the entry's index from MSB side determine the offset from the index base because there are 4 nodes at the level 2 and so on.
-
-.. figure:: ../images/update_tree.png
- :name: **Figure 12:** Promote Entry to be MRU
- :align: center
- :width: 82%
- :alt: update_tree
-
- **Figure 12:** Promote Entry to be MRU
-
-In the above figure entry at index 5, is accessed. To make it MRU entry, every node along the access path should point away from it. Entry 5 is a right child, therefore, its parent plru bit set to 0, its parent is a left child, its grand parent’s plru bit set to 1, and great grandparent’s plru bit set to 0.
-
-.. raw:: html
-
- Entry Selection for Replacement
-
-Every TLB entry is checked for the replacement entry. The following steps are taken:
-
-1. Iterate through each level of the binary tree.
-2. Calculate the index of the leftmost child within the current level. Let us call that index the index base.
-3. Calculate the shift amount to identify the relevant node based on the level and TLB entry index.
-4. If the corresponding bit of the entry's index matches the value of the node being traversed at the current level, keep the replacement signal high for that entry; otherwise, set the replacement signal to low.
-
-.. figure:: ../images/replacement_entry.png
- :name: **Figure 13:** Possible path traverse for entry selection for replacement
- :align: center
- :width: 65%
- :alt: replacement_entry
-
- **Figure 13:** Possible path traverse for entry selection for replacement
-
-Figure shows every possible path that traverses to find out the PLRU entry. If the plru bit at each level matches with the corresponding bit of the entry's index, that’s the next entry to replace. Below Table shows the entry selection for replacement.
-
-.. raw:: html
-
-
Table 9: Entry Selection for Reaplacement
-
-+-------------------+---------------+----------------------+
-| **Path Traverse** | **PLRU Bits** | **Entry to replace** |
-+-------------------+---------------+----------------------+
-| 0 -> 1 -> 3 | 000 | 0 |
-| +---------------+----------------------+
-| | 001 | 1 |
-+-------------------+---------------+----------------------+
-| 0 -> 1 -> 4 | 010 | 2 |
-| +---------------+----------------------+
-| | 011 | 3 |
-+-------------------+---------------+----------------------+
-| 0 -> 2 -> 5 | 100 | 4 |
-| +---------------+----------------------+
-| | 101 | 5 |
-+-------------------+---------------+----------------------+
-| 0 -> 2 -> 6 | 110 | 6 |
-| +---------------+----------------------+
-| | 111 | 7 |
-+-------------------+---------------+----------------------+
-
------------------------------------
-Shared Translation Lookaside Buffer
------------------------------------
-
-The CVA6 shared TLB is structured as a 2-way associative cache, where the virtual address requiring translation is compared with the set indicated by the virtual page number. The shared TLB is looked up in case of an Instruction TLB (ITLB) or data TLB (DTLB) miss, signaled by these TLBs. If the entry is found in the shared TLB set, the respective TLB, whose translation is being requested, is updated. If the entry is not found in the shared TLB, then the processor has to perform a page table walk. Once the processor obtains a PPN corresponding to the VPN, the shared TLB is updated with this information. If the physical page is not found in the page table, it results in a page fault, which is handled by the operating system. The operating system will then place the corresponding physical page in memory.
-
-The inputs and output signals of the shared TLB are shown in the following two figures.
-
-.. figure:: ../images/shared_tlb_in_out.png
- :name: **Figure 14:** Inputs and outputs of CVA6 shared TLB
- :align: center
- :width: 60%
- :alt: shared_tlb_in_out
-
- **Figure 14:** Inputs and outputs of CVA6 shared TLB
-
-.. raw:: html
-
- Signal Description
-
-.. raw:: html
-
-
Table 10: Signal Description of CVA6 shared TLB
-
-.. list-table::
- :header-rows: 1
-
- * - Signal
- - IO
- - Connection
- - Type
- - Description
-
- * - ``clk_i``
- - in
- - Subsystem
- - logic
- - Subsystem Clock
-
- * - ``rst_ni``
- - in
- - Subsystem
- - logic
- - Asynchronous reset active low
-
- * - ``flush_i``
- - in
- - Controller
- - logic
- - TLB flush request
-
- * - ``enable_translation_i``
- - in
- - CSR Regfile
- - logic
- - CSRs indicate to enable Sv32
-
- * - ``en_ld_st_translation_i``
- - in
- - CSR Regfile
- - logic
- - Enable virtual memory translation for load/stores
-
- * - ``asid_i``
- - in
- - CSR Regfile
- - logic
- - ASID for the lookup
-
- * - ``itlb_access_i``
- - in
- - Cache Subsystem
- - logic
- - Signal indicating a lookup access in ITLB is being requested.
-
- * - ``itlb_hit_i``
- - in
- - ITLB
- - logic
- - Signal indicating an ITLB hit
-
- * - ``itlb_vaddr_i``
- - in
- - Cache Subsystem
- - logic[31:0]
- - Virtual address lookup in ITLB
-
- * - ``dtlb_access_i``
- - in
- - Load/Store Unit
- - logic
- - Signal indicating a lookup access in DTLB is being requested.
-
- * - ``dtlb_hit_i``
- - in
- - DTLB
- - logic
- - Signal indicating a DTLB hit
-
- * - ``dtlb_vaddr_i``
- - in
- - Load/Store Unit
- - logic[31:0]
- - Virtual address lookup in DTLB
-
- * - ``itlb_update_o``
- - out
- - ITLB
- - tlb_update_sv32_t
- - Tag and content to update ITLB
-
- * - ``dtlb_update_o``
- - out
- - DTLB
- - tlb_update_sv32_t
- - Tag and content to update DTLB
-
- * - ``itlb_miss_o``
- - out
- - Performance Counter
- - logic
- - Signal indicating an ITLB miss
-
- * - ``dtlb_miss_o``
- - out
- - Performance Counter
- - logic
- - Signal indicating a DTLB miss
-
- * - ``shared_tlb_access_o``
- - out
- - PTW
- - logic
- - Signal indicating a lookup access in shared TLB is being requested
-
- * - ``shared_tlb_hit_o``
- - out
- - PTW
- - logic
- - Signal indicating a shared TLB hit
-
- * - ``shared_tlb_vadd_o``
- - out
- - PTW
- - logic[31:0]
- - Virtual address lookup in shared TLB
-
- * - ``itlb_req_o``
- - out
- - PTW
- - logic
- - ITLB Request Output
-
- * - ``shared_tlb_update_i``
- - in
- - PTW
- - tlb_update_sv32_t
- - Updated tag and content of shared TLB
-
-.. raw:: html
-
- Struct Description
-
-.. raw:: html
-
-
Table 11: Shared TLB Update Struct (shared_tag_t)
-
-.. list-table::
- :header-rows: 1
-
- * - Signal
- - Type
- - Description
-
- * - ``is_4M``
- - logic
- - Indicates if the shared TLB entry corresponds to a 4MB page.
-
- * - ``vpn1``
- - logic[9:0]
- - Virtual Page Number (VPN) represents the index of PTE in the page table level 1.
-
- * - ``vpn0``
- - logic[9:0]
- - Virtual Page Number (VPN) represents the index of PTE in the page table level 0.
-
- * - ``asid``
- - logic
- - Address Space Identifier (ASID) used to identify different address spaces
-
-.. raw:: html
-
- Shared TLB Entry Structure
-
-Shared TLB is 2-way associative, with a depth of 64. A single entry in the set contains the valid bit, tag and the content. The Tag segment stores details such as the virtual page number (VPN1, VPN0), ASID, and page size (is_4M). The Content field contains two physical page numbers (PPN1, PPN0) along with a number of bits which specify various attributes of the physical page.
-
-.. figure:: ../images/shared_tlb.png
- :name: **Figure 15:** CVA6 Shared TLB Structure
- :align: center
- :width: 60%
- :alt: shared_tlb
-
- **Figure 15:** CVA6 Shared TLB Structure
-
-.. raw:: html
-
- Shared TLB Implementation in CVA6
-
-The implementation of a shared TLB in CVA6 is described in the following sections:
-
-* **ITLB and DTLB Miss:** Prepare a shared TLB lookup if the entry is not found in ITLB or DTLB.
-* **Tag Comparison:** Look up the provided virtual address in the shared TLB.
-* **Update and Flush:** Flush the shared TLB or update it.
-* **Replacement Policies:** First non-valid entry and random replacement policy.
-
-.. raw:: html
-
- ITLB and DTLB Miss
-
-Consider a scenario where an entry is found in the ITLB or DTLB. In this case, there is no need to perform a lookup in the shared TLB since the entry has already been found. Next, there are two scenarios: an ITLB miss or a DTLB miss.
-
-To identify an ITLB miss, the following conditions need to be fulfilled:
-
-* Address translation must be enabled.
-* There must be an access request to the ITLB.
-* The ITLB should indicate an ITLB miss.
-* There should be no access request to the DTLB.
-
-During an ITLB miss, access is granted to read the tag and content of the shared TLB from their respective sram. The address for reading the tag and content of the shared TLB entry is calculated using the virtual address for which translation is not found in the ITLB. The ITLB miss is also explicitly indicated by the shared TLB. A request for shared TLB access is initiated.
-
-To identify the DTLB miss, the following conditions need to be fulfilled:
-
-* Address translation for load and stores must be enabled.
-* There must be an access request to the DTLB.
-* The DTLB should indicate a DTLB miss.
-
-In the case of a DTLB miss, the same logic is employed as described for an ITLB miss.
-
-.. raw:: html
-
- Tag Comparison
-
-Shared TLB lookup for a hit occurs under the same conditions as described for the TLB modules used as ITLB and DTLB. However, there are some distinctions. In both the ITLB and DTLB, the virtual address requiring translation is compared against all TLB entries. In contrast, the shared TLB only compares the tag and content of the set indicated by the provided virtual page number. The index of the set is extracted from VPN0 of the requested virtual address. Given that the shared TLB is 2-way associative, each set contains two entries. Consequently, both of these entries are compared. Below figure illustrates how the set is opted for the lookup.
-
-.. figure:: ../images/shared_tlb_set.png
- :name: **Figure 16:** Set opted for lookup in shared TLB
- :align: center
- :width: 60%
- :alt: shared_tlb_set
-
- **Figure 16:** Set opted for lookup in shared TLB
-
-.. raw:: html
-
- Update and Flush
-
-Differing from the ITLB and DTLB, a specific virtual address or addressing space cannot be flushed in the shared TLB. When SFENCE.VMA is committed, all entries in the shared TLB are invalidated. (Cases of SFENCE.VMA should also be added in shared TLB)
-
-.. raw:: html
-
- Updating Shared TLB
-
-When the Page Table Walker signals a valid update request, the shared TLB is updated by selecting an entry through the replacement policy and marking it as valid. This also triggers the writing of the new tag and content to the respective SRAM.
-
-.. raw:: html
-
- Replacement Policy Implemented in CVA6 Shared TLB
-
-In CVA6's shared TLB, two replacement policies are employed for replacements based on a specific condition. These replacement policies select the entry within the set indicated by the virtual page number. The two policies are:
-
-* First non-valid encounter replacement policy
-* Random replacement policy
-
-First replacement policy failed if all ways are valid. Therefore, a random replacement policy is opted for.
-
-.. raw:: html
-
- First non-valid encounter replacement policy
-
-The module implemented in CVA6 to find the first non-valid entry in the shared TLB is the Leading Zero Counter (LZC). It takes three parameters as input:
-
-1. **WIDTH:** The width of the input vector.
-2. **MODE:** Mode selection - 0 for trailing zero, 1 for leading zero.
-3. **CNT WIDTH:** Width of the output signal containing the zero count.
-
-The input signal is the vector to be counted, and the output represents the count of trailing/leading zeros. If all bits in the input vector are zero, it will also be indicated.
-
-When initializing the module, the width of the input vector is set to the number of shared TLB ways. The trailing zero counter mode is selected. The vector of valid bits is set as the input vector, but with negation. This is because we want the index of the first non-valid entry, and LZC returns the count of trailing zeros, which actually corresponds to the index of the first occurrence of 1 from the least significant bit (LSB). if there is at least one non-valid entry, that entry is opted for the replacement, and If not then this is signaled by LZC.
-
-.. figure:: ../images/LZC.png
- :name: **Figure 17:** Replacement of First invalid entry.
- :align: center
- :width: 60%
- :alt: LZC
-
- **Figure 17:** Replacement of First invalid entry.
-
-.. raw:: html
-
- Random replacement policy
-
-If all ways are valid, a random replacement policy is employed for the replacement process. The Linear Feedback Shift Register (LFSR) is utilized to select the replacement entry randomly. LFSR is commonly used in generating sequences of pseudo-random numbers. When the enable signal is active, the current state of the LFSR undergoes a transformation. Specifically, the state is shifted right by one bit, and the result is combined with a predetermined masking pattern. This masking pattern is derived from the predefined “Masks” array, introducing a non-linear behavior to the sequence generation of the LFSR. The masking process involves XOR operations between the shifted state bits and specific pattern bits, contributing to the complexity and unpredictability of the generated sequence.
-
-.. figure:: ../images/RR.png
- :name: **Figure 18:** Entry selection for replacement using LFSR
- :align: center
- :width: 95%
- :alt: RR
-
- **Figure 18:** Entry selection for replacement using LFSR
-
------------------
-Page Table Walker
------------------
-
-The "CVA6 Page Table Walker (PTW) for MMU Sv32" is a hardware module developed for the CV32A6 processor architecture, designed to facilitate the translation of virtual addresses into physical addresses, a crucial task in memory access management.
-
-.. figure:: ../images/ptw_in_out.png
- :name: **Figure 19:** Input and Outputs of Page Table Walker
- :align: center
- :width: 60%
- :alt: ptw_in_out
-
- **Figure 19:** Input and Outputs of Page Table Walker
-
-.. raw:: html
-
- Operation of PTW Module
-
-The PTW module operates through various states, each with its specific function, such as handling memory access requests, validating page table entries, and responding to errors.
-
-.. raw:: html
-
- Key Features and Capabilities
-
-Key features of this PTW module include support for two levels of page tables (LVL1 and LVL2) in the Sv32 standard, accommodating instruction and data page table walks. It rigorously validates and verifies page table entries (PTEs) to ensure translation accuracy and adherence to access permissions. This module seamlessly integrates with the CV32A6 processor's memory management unit (MMU), which governs memory access control. It also takes into account global mapping, access flags, and privilege levels during the translation process, ensuring that memory access adheres to the processor's security and privilege settings.
-
-.. raw:: html
-
- Exception Handling
-
-In addition to its translation capabilities, the PTW module is equipped to detect and manage errors, including page-fault exceptions and access exceptions, contributing to the robustness of the memory access system. It works harmoniously with physical memory protection (PMP) configurations, a critical aspect of modern processors' memory security. Moreover, the module efficiently processes virtual addresses, generating corresponding physical addresses, all while maintaining speculative translation, a feature essential for preserving processor performance during memory access operations.
-
-.. raw:: html
-
- Signal Description
-
-.. raw:: html
-
-
Table 12: Signal Description of PTW
-
-.. list-table::
- :header-rows: 1
-
- * - Signal
- - IO
- - Connection
- - Type
- - Description
-
- * - ``clk_i``
- - in
- - Subsystem
- - logic
- - Subsystem Clock
-
- * - ``rst_ni``
- - in
- - Subsystem
- - logic
- - Asynchronous reset active low
-
- * - ``flush_i``
- - in
- - Controller
- - logic
- - Sfence Committed
-
- * - ``ptw_active_o``
- - out
- - MMU
- - logic
- - Output signal indicating whether the Page Table Walker (PTW) is currently active
-
- * - ``walking_instr_o``
- - out
- - MMU
- - logic
- - Indicating it's an instruction page table walk or not
-
- * - ``ptw_error_o``
- - out
- - MMU
- - logic
- - Output signal indicating that an error occurred during PTW operation
-
- * - ``ptw_access_exception_o``
- - out
- - MMU
- - logic
- - Output signal indicating that a PMP (Physical Memory Protection) access exception occurred during PTW operation.
-
- * - ``lsu_is_store_i``
- - in
- - Store Unit
- - logic
- - Input signal indicating whether the translation was triggered by a store operation.
-
- * - ``req_port_i``
- - in
- - Cache Subsystem
- - dcache_req_o_t
- - D Cache Data Requests
-
- * - ``req_port_o``
- - out
- - Cache Subsystem / Perf Counter
- - dcache_req_u_t
- - D Cache Data Response
-
- * - ``shared_tlb_update_o``
- - out
- - Shared TLB
- - tlb_update_sv32_t
- - Updated tag and content of shared TLB
-
- * - ``update_vaddr_o``
- - out
- - MMU
- - logic[riscv::VLEN-1:0]
- - Updated VADDR from shared TLB
-
- * - ``asid_i``
- - in
- - CSR RegFile
- - logic[ASID_WIDTH-1:0]
- - ASID for the lookup
-
- * - ``shared_tlb_access_i``
- - in
- - Shared TLB
- - logic
- - Access request of shared TLB
-
- * - ``shared_tlb_hit_i``
- - in
- - Shared TLB
- - logic
- - Indicate shared TLB hit
-
- * - ``shared_tlb_vaddr_i``
- - in
- - Shared TLB
- - logic[riscv::VLEN-1:0]
- - Virtual Address from shared TLB
-
- * - ``itlb_req_i``
- - in
- - Shared TLB
- - logic
- - Indicate request to ITLB
-
- * - ``satp_ppn_i``
- - in
- - CSR RegFile
- - logic[riscv::PPNW-1:0]
- - PPN of top level page table from SATP register
-
- * - ``mxr_i``
- - in
- - CSR RegFile
- - logic
- - Make Executable Readable bit in xSTATUS CSR register
-
- * - ``shared_tlb_miss_o``
- - out
- - OPEN
- - logic
- - Indicate a shared TLB miss
-
- * - ``pmpcfg_i``
- - in
- - CSR RegFile
- - riscv::pmpcfg_t[15:0]
- - PMP configuration
-
- * - ``pmpaddr_i``
- - in
- - CSR RegFile
- - logic[15:0][riscv::PLEN-3:0]
- - PMP Address
-
- * - ``bad_paddr_o``
- - out
- - MMU
- - logic[riscv::PLEN-1:0]
- - Bad Physical Address in case of access exception
-
-.. raw:: html
-
- Struct Description
-
-.. raw:: html
-
-
Table 13: D Cache Response Struct (dcache_req_i_t)
-
-.. list-table::
- :header-rows: 1
-
- * - Signal
- - Type
- - Description
-
- * - ``address_index``
- - logic [DCACHE_INDEX_WIDTH-1:0]
- - Index of the Dcache Line
-
- * - ``address_tag``
- - logic [DCACHE_TAG_WIDTH-1:0]
- - Tag of the Dcache Line
-
- * - ``data_wdata``
- - riscv::xlen_t
- - Data to write in the Dcache
-
- * - ``data_wuser``
- - logic [DCACHE_USER_WIDTH-1:0]
- - data_wuser
-
- * - ``data_req``
- - logic
- - Data Request
-
- * - ``data_we``
- - logic
- - Data Write enabled
-
- * - ``data_be``
- - logic [(riscv::XLEN/8)-1:0]
- - Data Byte enable
-
- * - ``data_size``
- - logic [1:0]
- - Size of data
-
- * - ``data_id``
- - logic [DCACHE_TID_WIDTH-1:0]
- - Data ID
-
- * - ``kill_req``
- - logic
- - Kill the D cache request
-
- * - ``tag_valid``
- - logic
- - Indicate that teh tag is valid
-
-.. raw:: html
-
-
Table 14: D Cache Request Struct (dcache_req_o_t)
-
-.. list-table::
- :header-rows: 1
-
- * - Signal
- - Type
- - Description
-
- * - ``data_gnt``
- - logic
- - Grant of data is given in response to the data request
-
- * - ``data_rvalid``
- - logic
- - Indicate that data is valid which is sent by D cache
-
- * - ``data_rid``
- - logic [DCACHE_TID_WIDTH-1:0]
- - Requested data ID
-
- * - ``data_rdata``
- - riscv::xlen_t
- - Data from D cache
-
- * - ``data_ruser``
- - logic [DCACHE_USER_WIDTH-1:0]
- - Requested data user
-
-.. raw:: html
-
- PTW State Machine
-
-Page Table Walker is implemented as a finite state machine. It listens to shared TLB for incoming translation requests. If there is a shared TLB miss, it saves the virtual address and starts the page table walk. Page table walker transition between 7 states in CVA6.
-
-* **IDLE:** The initial state where the PTW is awaiting a trigger, often a Shared TLB miss, to initiate a memory access request.
-* **WAIT_GRANT:** Request memory access and wait for data grant
-* **PTE_LOOKUP:** Once granted access, the PTW examines the valid Page Table Entry (PTE), checking attributes to determine the appropriate course of action.
-* **PROPOGATE_ERROR:** If the PTE is invalid, this state handles the propagation of an error, often leading to a page-fault exception due to non-compliance with access conditions
-* **PROPOGATE_ACCESS_ERROR:** Propagate access fault if access is not allowed from a PMP perspective
-* **WAIT_RVALID:** After processing a PTE, the PTW waits for a valid data signal, indicating that relevant data is ready for further processing.
-* **LATENCY:** Introduces a delay to account for synchronization or timing requirements between states.
-
-.. figure:: ../images/ptw_state_diagram.png
- :name: **Figure 20:** State Machine Diagram of CVA6 PTW
- :align: center
- :width: 95%
- :alt: ptw_state_diagram
-
- **Figure 20:** State Machine Diagram of CVA6 PTW
-
-.. raw:: html
-
- IDLE state
-
-In the IDLE state of the Page Table Walker (PTW) finite state machine, the system awaits a trigger to initiate the page table walk process. This trigger is often prompted by a Shared Translation Lookaside Buffer (TLB) miss, indicating that the required translation is not present in the shared TLB cache. The PTW's behavior in this state is explained as follows:
-
-1. The top-most page table is selected for the page table walk. In the case of SV32, which implements a two-level page table, the level 1 page table is chosen.
-2. In the IDLE state, translations are assumed to be invalid in all addressing spaces.
-3. The signal indicating the instruction page table walk is set to 0.
-4. A conditional check is performed: if there is a shared TLB access request and the entry is not found in the shared TLB (indicating a shared TLB miss), the following steps are executed:
-
- a. The address of the desired Page Table Entry within the level 1 page table is calculated by multiplying the Physical Page Number (PPN) of the level 1 page table from the SATP register by the page size (4kB). This result is then added to the product of the Virtual Page Number (VPN1), and the size of a page table entry(4 bytes).
-
-.. figure:: ../images/ptw_idle.png
- :name: **Figure 21:** Address of Desired PTE at Level 1
- :align: center
- :width: 68%
- :alt: ptw_idle
-
- **Figure 21:** Address of Desired PTE at Level 1
-
-.. _example:
-
- b. The signal indicating whether it's an instruction page table walk is updated based on the ITLB miss.
- c. The ASID and virtual address are saved for the page table walk.
- d. A shared TLB miss is indicated.
-
-.. raw:: html
-
- WAIT GRANT state
-
-In the **WAIT_GRANT** state of the Page Table Walker's finite state machine, a data request is sent to retrieve memory information. It waits for a data grant signal from the Dcache controller, remaining in this state until granted. Once granted, it activates a tag valid signal, marking data validity. The state then transitions to "PTE_LOOKUP" for page table entry lookup.
-
-.. raw:: html
-
- PTE LOOKUP state
-
-In the **PTE_LOOKUP** state of the Page Table Walker (PTW) finite state machine, the PTW performs the actual lookup and evaluation of the page table entry (PTE) based on the virtual address translation. The behavior and operations performed in this state are detailed as follows:
-
-1. The state waits for a valid signal indicating that the data from the memory subsystem, specifically the page table entry, is available for processing.
-2. Upon receiving the valid signal, the PTW proceeds with examining the retrieved page table entry to determine its properties and validity.
-3. The state checks if the global mapping bit in the PTE is set, and if so, sets the global mapping signal to indicate that the translation applies globally across all address spaces.
-4. The state distinguishes between two cases: Invalid PTE and Valid PTE.
-
- a. If the valid bit of the PTE is not set, or if the PTE has reserved RWX field encodings, it signifies an Invalid PTE. In such cases, the state transitions to the "PROPAGATE_ERROR" state, indicating a page-fault exception due to an invalid translation.
-
-.. figure:: ../images/ptw_pte_1.png
- :name: **Figure 22:** Invalid PTE and reserved RWX encoding leads to page fault
- :align: center
- :width: 70%
- :alt: ptw_pte_1
-
- **Figure 22:** Invalid PTE and reserved RWX encoding leads to page fault
-
-.. _example1:
-
- b. If the PTE is valid, the state advances to the "LATENCY" state, indicating a period of processing latency. Additionally, if the "read" flag (pte.r) or the "execute" flag (pte.x) is set, the PTE is considered valid.
-
-5. Within the Valid PTE scenario, the state performs further checks based on whether the translation is intended for instruction fetching or data access:
-
- a. For instruction page table walk, if the page is not executable (pte.x is not set) or not marked as accessible (pte.a is not set), the state transitions to the "PROPAGATE_ERROR" state.
-
-.. figure:: ../images/ptw_iptw.png
- :name: **Figure 23:** For Instruction Page Table Walk
- :align: center
- :width: 70%
- :alt: ptw_iptw
-
- **Figure 23:** For Instruction Page Table Walk
-
-.. _example2:
-
- b. For data page table walk, the state checks if the page is readable (pte.r is set) or if the page is executable only but made readable by setting the MXR bit in xSTATUS CSR register. If either condition is met, it indicates a valid translation. If not, the state transitions to the "PROPAGATE_ERROR" state.
-
-.. figure:: ../images/ptw_dptw.png
- :name: **Figure 24:** Data Access Page Table Walk
- :width: 70%
- :alt: ptw_dptw
-
- **Figure 24:** Data Access Page Table Walk
-
-.. _example3:
-
- c. If the access is intended for storing data, additional checks are performed: If the page is not writable (pte.w is not set) or if it is not marked as dirty (pte.d is not set), the state transitions to the "PROPAGATE_ERROR" state.
-
-.. figure:: ../images/ptw_dptw_s.png
- :name: **Figure 25:** Data Access Page Table Walk, Store requested
- :align: center
- :width: 70%
- :alt: ptw_dptw_s
-
- **Figure 25:** Data Access Page Table Walk, Store requested
-
-6. The state also checks for potential misalignment issues in the translation: If the current page table level is the first level (LVL1) and if the PPN0 of in PTE is not zero, it indicates a misaligned superpage, leading to a transition to the "PROPAGATE_ERROR" state.
-
-.. figure:: ../images/ptw_mis_sup.png
- :name: **Figure 26:** Misaligned Superpage Check
- :align: center
- :width: 70%
- :alt: ptw_mis_sup
-
- **Figure 26:** Misaligned Superpage Check
-
-7. If the PTE is valid but the page is neither readable nor executable, the PTW recognizes the PTE as a pointer to the next level of the page table, indicating that additional translation information can be found in the referenced page table at a lower level.
-8. If the current page table level is the first level (LVL1), the PTW proceeds to switch to the second level (LVL2) page table, updating the next level pointer and calculating the address for the next page table entry using the Physical Page Number from the PTE and the index of the level 2 page table from virtual address.
-
-.. figure:: ../images/ptw_nlvl.png
- :name: **Figure 27:** Address of desired PTE at next level of Page Table
- :align: center
- :width: 70%
- :alt: ptw_nlvl
-
- **Figure 27:** Address of desired PTE at next level of Page Table
-
-9. The state then transitions to the "WAIT_GRANT" state, indicating that the PTW is awaiting the grant signal to proceed with requesting the next level page table entry.
-10. If the current level is already the second level (LVL2), an error is flagged, and the state transitions to the "PROPAGATE_ERROR" state, signifying an unexpected situation where the PTW is already at the last level page table.
-11. If the translation access is found to be restricted by the Physical Memory Protection (PMP) settings (allow_access is false), the state updates the shared TLB update signal to indicate that the TLB entry should not be updated. Additionally, the saved address for the page table walk is restored to its previous value, and the state transitions to the "PROPAGATE_ACCESS_ERROR" state.
-12. Lastly, if the data request for the page table entry was granted, the state indicates to the cache subsystem that the tag associated with the data is now valid.
-
-.. figure:: ../images/ptw_pte_flowchart.png
- :name: **Figure 28:** Flow Chart of PTE LOOKUP State
- :align: center
- :alt: ptw_pte_flowchart
-
- **Figure 28:** Flow Chart of PTE LOOKUP State
-
-.. raw:: html
-
- PROPAGATE ERROR state
-
-This state indicates a detected error in the page table walk process, and an error signal is asserted to indicate the Page Table Walker's error condition, triggering a transition to the "LATENCY" state for error signal propagation.
-
-.. raw:: html
-
- PROPAGATE ACCESS ERROR state
-
-This state indicates a detected access error in the page table walk process, and an access error signal is asserted to indicate the Page Table Walker's access error condition, triggering a transition to the "LATENCY" state for access error signal propagation.
-
-.. raw:: html
-
- WAIT RVALID state
-
-This state waits until it gets the "read valid" signal, and when it does, it's ready to start a new page table walk.
-
-.. raw:: html
-
- LATENCY state
-
-The LATENCY state introduces a latency period to allow for necessary system actions or signals to stabilize. After the latency period, the FSM transitions back to the IDLE state, indicating that the system is prepared for a new translation request.
-
-.. raw:: html
-
- Flush Scenario
-
-The first step when a flush is triggered is to check whether the Page Table Entry (PTE) lookup process is currently in progress. If the PTW (Page Table Walker) module is indeed in the middle of a PTE lookup operation, the code then proceeds to evaluate a specific aspect of this operation.
-
-* **Check for Data Validity (rvalid):** Within the PTE lookup operation, it's important to ensure that the data being used for the translation is valid. In other words, the code checks whether the "rvalid" signal (which likely indicates the validity of the data) is not active. If the data is not yet valid, it implies that the PTW module is waiting for the data to become valid before completing the lookup. In such a case, the code takes appropriate action to wait for the data to become valid before proceeding further.
-
-* **Check for Waiting on Grant:** The second condition the code checks for during a flush scenario is whether the PTW module is currently waiting for a "grant." This "grant" signal is typically used to indicate permission or authorization to proceed with an operation. If the PTW module is indeed in a state of waiting for this grant signal, it implies that it requires authorization before continuing its task.
-
- * **Waiting for Grant:** If the PTW module is in a state of waiting for the grant signal, the code ensures that it continues to wait for the grant signal to be asserted before proceeding further.
-
-* **Return to Idle State if Neither Condition is Met:** After evaluating the above two conditions, the code determines whether either of these conditions is true. If neither of these conditions applies, it suggests that the PTW module can return to its idle state, indicating that it can continue normal operations without any dependencies on the flush condition.
diff --git a/docs/04_cv32a65x/design/source/parameters.adoc b/docs/04_cv32a65x/design/source/parameters.adoc
new file mode 100644
index 0000000000..070d768175
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/parameters.adoc
@@ -0,0 +1,93 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[cv32a65x_PARAMETERS]]
+
+.cv32a65x parameter configuration
+|===
+|Name | description | description
+
+|XLEN | General Purpose Register Size (in bits) | 32
+|RVA | Atomic RISC-V extension | False
+|RVB | Bit manipulation RISC-V extension | True
+|RVV | Vector RISC-V extension | False
+|RVC | Compress RISC-V extension | True
+|RVH | Hypervisor RISC-V extension | False
+|RVZCB | Zcb RISC-V extension | True
+|RVZCMP | Zcmp RISC-V extension | False
+|RVZiCond | Zicond RISC-V extension | False
+|RVZicntr | Zicntr RISC-V extension | False
+|RVZihpm | Zihpm RISC-V extension | False
+|RVF | Floating Point | False
+|RVD | Floating Point | False
+|XF16 | Non standard 16bits Floating Point extension | False
+|XF16ALT | Non standard 16bits Floating Point Alt extension | False
+|XF8 | Non standard 8bits Floating Point extension | False
+|XFVec | Non standard Vector Floating Point extension | False
+|PerfCounterEn | Perf counters | False
+|MmuPresent | MMU | False
+|RVS | Supervisor mode | False
+|RVU | User mode | False
+|DebugEn | Debug support | False
+|DmBaseAddress | Base address of the debug module | 0x0
+|HaltAddress | Address to jump when halt request | 0x800
+|ExceptionAddress | Address to jump when exception | 0x808
+|TvalEn | Tval Support Enable | False
+|DirectVecOnly | MTVEC CSR supports only direct mode | True
+|NrPMPEntries | PMP entries number | 8
+|PMPCfgRstVal | PMP CSR configuration reset values | [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]
+|PMPAddrRstVal | PMP CSR address reset values | [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]
+|PMPEntryReadOnly | PMP CSR read-only bits | 0
+|NrNonIdempotentRules | PMA non idempotent rules number | 0
+|NonIdempotentAddrBase | PMA NonIdempotent region base address | [0b0, 0b0]
+|NonIdempotentLength | PMA NonIdempotent region length | [0b0, 0b0]
+|NrExecuteRegionRules | PMA regions with execute rules number | 0
+|ExecuteRegionAddrBase | PMA Execute region base address | [0x80000000, 0x10000, 0x0]
+|ExecuteRegionLength | PMA Execute region address base | [0x40000000, 0x10000, 0x1000]
+|NrCachedRegionRules | PMA regions with cache rules number | 1
+|CachedRegionAddrBase | PMA cache region base address | [0x80000000]
+|CachedRegionLength | PMA cache region rules | [0x40000000]
+|CvxifEn | CV-X-IF coprocessor interface enable | True
+|NOCType | NOC bus type | config_pkg::NOC_TYPE_AXI4_ATOP
+|AxiAddrWidth | AXI address width | 64
+|AxiDataWidth | AXI data width | 64
+|AxiIdWidth | AXI ID width | 4
+|AxiUserWidth | AXI User width | 32
+|AxiBurstWriteEn | AXI burst in write | False
+|MemTidWidth | TODO | 4
+|IcacheByteSize | Instruction cache size (in bytes) | 2048
+|IcacheSetAssoc | Instruction cache associativity (number of ways) | 2
+|IcacheLineWidth | Instruction cache line width | 128
+|DCacheType | Cache Type | config_pkg::HPDCACHE
+|DcacheIdWidth | Data cache ID | 1
+|DcacheByteSize | Data cache size (in bytes) | 2028
+|DcacheSetAssoc | Data cache associativity (number of ways) | 2
+|DcacheLineWidth | Data cache line width | 128
+|DataUserEn | User field on data bus enable | 1
+|WtDcacheWbufDepth | Write-through data cache write buffer depth | 2
+|FetchUserEn | User field on fetch bus enable | 1
+|FetchUserWidth | Width of fetch user field | 32
+|FpgaEn | Is FPGA optimization of CV32A6 | False
+|TechnoCut | Is Techno Cut instanciated | True
+|SuperscalarEn | Enable superscalar* with 2 issue ports and 2 commit ports. | True
+|NrCommitPorts | Number of commit ports. Forced to 2 if SuperscalarEn. | 1
+|NrLoadPipeRegs | Load cycle latency number | 0
+|NrStorePipeRegs | Store cycle latency number | 0
+|NrScoreboardEntries | Scoreboard length | 8
+|NrLoadBufEntries | Load buffer entry buffer | 2
+|MaxOutstandingStores | Maximum number of outstanding stores | 7
+|RASDepth | Return address stack depth | 2
+|BTBEntries | Branch target buffer entries | 0
+|BHTEntries | Branch history entries | 32
+|InstrTlbEntries | MMU instruction TLB entries | 2
+|DataTlbEntries | MMU data TLB entries | 2
+|UseSharedTlb | MMU option to use shared TLB | True
+|SharedTlbDepth | MMU depth of shared TLB | 64
+|===
diff --git a/docs/04_cv32a65x/design/source/parameters_cv32a65x.rst b/docs/04_cv32a65x/design/source/parameters_cv32a65x.rst
deleted file mode 100644
index 7ca2918dd3..0000000000
--- a/docs/04_cv32a65x/design/source/parameters_cv32a65x.rst
+++ /dev/null
@@ -1,321 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _cv32a65x_PARAMETERS:
-
-.. list-table:: cv32a65x parameter configuration
- :header-rows: 1
-
- * - Name
- - description
- - Value
-
- * - XLEN
- - General Purpose Register Size (in bits)
- - 32
-
- * - RVA
- - Atomic RISC-V extension
- - False
-
- * - RVB
- - Bit manipulation RISC-V extension
- - True
-
- * - RVV
- - Vector RISC-V extension
- - False
-
- * - RVC
- - Compress RISC-V extension
- - True
-
- * - RVH
- - Hypervisor RISC-V extension
- - False
-
- * - RVZCB
- - Zcb RISC-V extension
- - True
-
- * - RVZCMP
- - Zcmp RISC-V extension
- - False
-
- * - RVZiCond
- - Zicond RISC-V extension
- - False
-
- * - RVZicntr
- - Zicntr RISC-V extension
- - False
-
- * - RVZihpm
- - Zihpm RISC-V extension
- - False
-
- * - RVF
- - Floating Point
- - False
-
- * - RVD
- - Floating Point
- - False
-
- * - XF16
- - Non standard 16bits Floating Point extension
- - False
-
- * - XF16ALT
- - Non standard 16bits Floating Point Alt extension
- - False
-
- * - XF8
- - Non standard 8bits Floating Point extension
- - False
-
- * - XFVec
- - Non standard Vector Floating Point extension
- - False
-
- * - PerfCounterEn
- - Perf counters
- - False
-
- * - MmuPresent
- - MMU
- - False
-
- * - RVS
- - Supervisor mode
- - False
-
- * - RVU
- - User mode
- - False
-
- * - DebugEn
- - Debug support
- - False
-
- * - DmBaseAddress
- - Base address of the debug module
- - 0x0
-
- * - HaltAddress
- - Address to jump when halt request
- - 0x800
-
- * - ExceptionAddress
- - Address to jump when exception
- - 0x808
-
- * - TvalEn
- - Tval Support Enable
- - False
-
- * - DirectVecOnly
- - MTVEC CSR supports only direct mode
- - True
-
- * - NrPMPEntries
- - PMP entries number
- - 8
-
- * - PMPCfgRstVal
- - PMP CSR configuration reset values
- - [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]
-
- * - PMPAddrRstVal
- - PMP CSR address reset values
- - [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0]
-
- * - PMPEntryReadOnly
- - PMP CSR read-only bits
- - 0
-
- * - NrNonIdempotentRules
- - PMA non idempotent rules number
- - 2
-
- * - NonIdempotentAddrBase
- - PMA NonIdempotent region base address
- - [0b0, 0b0]
-
- * - NonIdempotentLength
- - PMA NonIdempotent region length
- - [0b0, 0b0]
-
- * - NrExecuteRegionRules
- - PMA regions with execute rules number
- - 3
-
- * - ExecuteRegionAddrBase
- - PMA Execute region base address
- - [0x80000000, 0x10000, 0x0]
-
- * - ExecuteRegionLength
- - PMA Execute region address base
- - [0x40000000, 0x10000, 0x1000]
-
- * - NrCachedRegionRules
- - PMA regions with cache rules number
- - 1
-
- * - CachedRegionAddrBase
- - PMA cache region base address
- - [0x80000000]
-
- * - CachedRegionLength
- - PMA cache region rules
- - [0x40000000]
-
- * - CvxifEn
- - CV-X-IF coprocessor interface enable
- - True
-
- * - NOCType
- - NOC bus type
- - config_pkg::NOC_TYPE_AXI4_ATOP
-
- * - AxiAddrWidth
- - AXI address width
- - 64
-
- * - AxiDataWidth
- - AXI data width
- - 64
-
- * - AxiIdWidth
- - AXI ID width
- - 4
-
- * - AxiUserWidth
- - AXI User width
- - 32
-
- * - AxiBurstWriteEn
- - AXI burst in write
- - False
-
- * - MemTidWidth
- - TODO
- - 4
-
- * - IcacheByteSize
- - Instruction cache size (in bytes)
- - 2048
-
- * - IcacheSetAssoc
- - Instruction cache associativity (number of ways)
- - 2
-
- * - IcacheLineWidth
- - Instruction cache line width
- - 128
-
- * - DCacheType
- - Cache Type
- - config_pkg::HPDCACHE
-
- * - DcacheIdWidth
- - Data cache ID
- - 1
-
- * - DcacheByteSize
- - Data cache size (in bytes)
- - 2028
-
- * - DcacheSetAssoc
- - Data cache associativity (number of ways)
- - 2
-
- * - DcacheLineWidth
- - Data cache line width
- - 128
-
- * - DataUserEn
- - User field on data bus enable
- - 1
-
- * - WtDcacheWbufDepth
- - Write-through data cache write buffer depth
- - 2
-
- * - FetchUserEn
- - User field on fetch bus enable
- - 1
-
- * - FetchUserWidth
- - Width of fetch user field
- - 32
-
- * - FpgaEn
- - Is FPGA optimization of CV32A6
- - False
-
- * - TechnoCut
- - Is Techno Cut instanciated
- - True
-
- * - SuperscalarEn
- - Enable superscalar* with 2 issue ports and 2 commit ports.
- - True
-
- * - NrCommitPorts
- - Number of commit ports. Forced to 2 if SuperscalarEn.
- - 1
-
- * - NrLoadPipeRegs
- - Load cycle latency number
- - 0
-
- * - NrStorePipeRegs
- - Store cycle latency number
- - 0
-
- * - NrScoreboardEntries
- - Scoreboard length
- - 8
-
- * - NrLoadBufEntries
- - Load buffer entry buffer
- - 2
-
- * - MaxOutstandingStores
- - Maximum number of outstanding stores
- - 7
-
- * - RASDepth
- - Return address stack depth
- - 2
-
- * - BTBEntries
- - Branch target buffer entries
- - 0
-
- * - BHTEntries
- - Branch history entries
- - 32
-
- * - InstrTlbEntries
- - MMU instruction TLB entries
- - 2
-
- * - DataTlbEntries
- - MMU data TLB entries
- - 2
-
- * - UseSharedTlb
- - MMU option to use shared TLB
- - True
-
- * - SharedTlbDepth
- - MMU depth of shared TLB
- - 64
diff --git a/docs/04_cv32a65x/design/source/port_alu.adoc b/docs/04_cv32a65x/design/source/port_alu.adoc
new file mode 100644
index 0000000000..78dd11efe6
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_alu.adoc
@@ -0,0 +1,28 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_alu_ports]]
+
+.*alu module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`fu_data_i` | in | FU data needed to execute instruction | ISSUE_STAGE | fu_data_t
+
+|`result_o` | out | ALU result | ISSUE_STAGE | logic[CVA6Cfg.XLEN-1:0]
+
+|`alu_branch_res_o` | out | ALU branch compare result | branch_unit | logic
+
+|===
+
diff --git a/docs/04_cv32a65x/design/source/port_alu.rst b/docs/04_cv32a65x/design/source/port_alu.rst
deleted file mode 100644
index 6da09d56b7..0000000000
--- a/docs/04_cv32a65x/design/source/port_alu.rst
+++ /dev/null
@@ -1,51 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_alu_ports:
-
-.. list-table:: **alu module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``fu_data_i``
- - in
- - FU data needed to execute instruction
- - ISSUE_STAGE
- - fu_data_t
-
- * - ``result_o``
- - out
- - ALU result
- - ISSUE_STAGE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``alu_branch_res_o``
- - out
- - ALU branch compare result
- - branch_unit
- - logic
-
-
diff --git a/docs/04_cv32a65x/design/source/port_bht.adoc b/docs/04_cv32a65x/design/source/port_bht.adoc
new file mode 100644
index 0000000000..e54d765432
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_bht.adoc
@@ -0,0 +1,34 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_bht_ports]]
+
+.*bht module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`vpc_i` | in | Virtual PC | CACHE | logic[CVA6Cfg.VLEN-1:0]
+
+|`bht_update_i` | in | Update bht with resolved address | EXECUTE | bht_update_t
+
+|`bht_prediction_o` | out | Prediction from bht | FRONTEND | ariane_pkg::bht_prediction_t[CVA6Cfg.INSTR_PER_FETCH-1:0]
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+For any HW configuration,::
+* `flush_bp_i` input is tied to 0
+As DebugEn = False,::
+* `debug_mode_i` input is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_bht.rst b/docs/04_cv32a65x/design/source/port_bht.rst
deleted file mode 100644
index 3661996fc9..0000000000
--- a/docs/04_cv32a65x/design/source/port_bht.rst
+++ /dev/null
@@ -1,57 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_bht_ports:
-
-.. list-table:: **bht module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``vpc_i``
- - in
- - Virtual PC
- - CACHE
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``bht_update_i``
- - in
- - Update bht with resolved address
- - EXECUTE
- - bht_update_t
-
- * - ``bht_prediction_o``
- - out
- - Prediction from bht
- - FRONTEND
- - ariane_pkg::bht_prediction_t[CVA6Cfg.INSTR_PER_FETCH-1:0]
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| For any HW configuration,
-| ``flush_bp_i`` input is tied to 0
-| As DebugEn = False,
-| ``debug_mode_i`` input is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_branch_unit.adoc b/docs/04_cv32a65x/design/source/port_branch_unit.adoc
new file mode 100644
index 0000000000..42d209cdc5
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_branch_unit.adoc
@@ -0,0 +1,48 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_branch_unit_ports]]
+
+.*branch_unit module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`fu_data_i` | in | FU data needed to execute instruction | ISSUE_STAGE | fu_data_t
+
+|`pc_i` | in | Instruction PC | ISSUE_STAGE | logic[CVA6Cfg.VLEN-1:0]
+
+|`is_compressed_instr_i` | in | Instruction is compressed | ISSUE_STAGE | logic
+
+|`branch_valid_i` | in | Branch unit instruction is valid | ISSUE_STAGE | logic
+
+|`branch_comp_res_i` | in | ALU branch compare result | ALU | logic
+
+|`branch_result_o` | out | Brach unit result | ISSUE_STAGE | logic[CVA6Cfg.VLEN-1:0]
+
+|`branch_predict_i` | in | Information of branch prediction | ISSUE_STAGE | branchpredict_sbe_t
+
+|`resolved_branch_o` | out | Signaling that we resolved the branch | ISSUE_STAGE | bp_resolve_t
+
+|`resolve_branch_o` | out | Branch is resolved, new entries can be accepted by scoreboard | ID_STAGE | logic
+
+|`branch_exception_o` | out | Branch exception out | TO_BE_COMPLETED | exception_t
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As RVH = False,::
+* `v_i` input is tied to 0
+As DebugEn = False,::
+* `debug_mode_i` input is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_branch_unit.rst b/docs/04_cv32a65x/design/source/port_branch_unit.rst
deleted file mode 100644
index e9eb72fb75..0000000000
--- a/docs/04_cv32a65x/design/source/port_branch_unit.rst
+++ /dev/null
@@ -1,99 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_branch_unit_ports:
-
-.. list-table:: **branch_unit module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``fu_data_i``
- - in
- - FU data needed to execute instruction
- - ISSUE_STAGE
- - fu_data_t
-
- * - ``pc_i``
- - in
- - Instruction PC
- - ISSUE_STAGE
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``is_compressed_instr_i``
- - in
- - Instruction is compressed
- - ISSUE_STAGE
- - logic
-
- * - ``branch_valid_i``
- - in
- - Branch unit instruction is valid
- - ISSUE_STAGE
- - logic
-
- * - ``branch_comp_res_i``
- - in
- - ALU branch compare result
- - ALU
- - logic
-
- * - ``branch_result_o``
- - out
- - Brach unit result
- - ISSUE_STAGE
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``branch_predict_i``
- - in
- - Information of branch prediction
- - ISSUE_STAGE
- - branchpredict_sbe_t
-
- * - ``resolved_branch_o``
- - out
- - Signaling that we resolved the branch
- - ISSUE_STAGE
- - bp_resolve_t
-
- * - ``resolve_branch_o``
- - out
- - Branch is resolved, new entries can be accepted by scoreboard
- - ID_STAGE
- - logic
-
- * - ``branch_exception_o``
- - out
- - Branch exception out
- - TO_BE_COMPLETED
- - exception_t
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As RVH = False,
-| ``v_i`` input is tied to 0
-| As DebugEn = False,
-| ``debug_mode_i`` input is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_btb.adoc b/docs/04_cv32a65x/design/source/port_btb.adoc
new file mode 100644
index 0000000000..809661bb04
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_btb.adoc
@@ -0,0 +1,34 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_btb_ports]]
+
+.*btb module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`vpc_i` | in | Virtual PC | CACHE | logic[CVA6Cfg.VLEN-1:0]
+
+|`btb_update_i` | in | Update BTB with resolved address | EXECUTE | btb_update_t
+
+|`btb_prediction_o` | out | BTB Prediction | FRONTEND | btb_prediction_t[CVA6Cfg.INSTR_PER_FETCH-1:0]
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+For any HW configuration,::
+* `flush_bp_i` input is tied to 0
+As DebugEn = False,::
+* `debug_mode_i` input is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_btb.rst b/docs/04_cv32a65x/design/source/port_btb.rst
deleted file mode 100644
index bda7f8244b..0000000000
--- a/docs/04_cv32a65x/design/source/port_btb.rst
+++ /dev/null
@@ -1,57 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_btb_ports:
-
-.. list-table:: **btb module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``vpc_i``
- - in
- - Virtual PC
- - CACHE
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``btb_update_i``
- - in
- - Update BTB with resolved address
- - EXECUTE
- - btb_update_t
-
- * - ``btb_prediction_o``
- - out
- - BTB Prediction
- - FRONTEND
- - btb_prediction_t[CVA6Cfg.INSTR_PER_FETCH-1:0]
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| For any HW configuration,
-| ``flush_bp_i`` input is tied to 0
-| As DebugEn = False,
-| ``debug_mode_i`` input is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_commit_stage.adoc b/docs/04_cv32a65x/design/source/port_commit_stage.adoc
new file mode 100644
index 0000000000..c4351d619f
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_commit_stage.adoc
@@ -0,0 +1,84 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_commit_stage_ports]]
+
+.*commit_stage module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`halt_i` | in | Request to halt the core | CONTROLLER | logic
+
+|`flush_dcache_i` | in | request to flush dcache, also flush the pipeline | CACHE | logic
+
+|`exception_o` | out | TO_BE_COMPLETED | EX_STAGE | exception_t
+
+|`commit_instr_i` | in | The instruction we want to commit | ISSUE_STAGE | scoreboard_entry_t[CVA6Cfg.NrCommitPorts-1:0]
+
+|`commit_drop_i` | in | The instruction is cancelled | ISSUE_STAGE | logic[CVA6Cfg.NrCommitPorts-1:0]
+
+|`commit_ack_o` | out | Acknowledge that we are indeed committing | ISSUE_STAGE | logic[CVA6Cfg.NrCommitPorts-1:0]
+
+|`commit_macro_ack_o` | out | Acknowledge that we are indeed committing | CSR_REGFILE | logic[CVA6Cfg.NrCommitPorts-1:0]
+
+|`waddr_o` | out | Register file write address | ISSUE_STAGE | logic[CVA6Cfg.NrCommitPorts-1:0][4:0]
+
+|`wdata_o` | out | Register file write data | ISSUE_STAGE | logic[CVA6Cfg.NrCommitPorts-1:0][CVA6Cfg.XLEN-1:0]
+
+|`we_gpr_o` | out | Register file write enable | ISSUE_STAGE | logic[CVA6Cfg.NrCommitPorts-1:0]
+
+|`we_fpr_o` | out | Floating point register enable | ISSUE_STAGE | logic[CVA6Cfg.NrCommitPorts-1:0]
+
+|`pc_o` | out | TO_BE_COMPLETED | FRONTEND_CSR_REGFILE | logic[CVA6Cfg.VLEN-1:0]
+
+|`csr_op_o` | out | Decoded CSR operation | CSR_REGFILE | fu_op
+
+|`csr_wdata_o` | out | Data to write to CSR | CSR_REGFILE | logic[CVA6Cfg.XLEN-1:0]
+
+|`csr_rdata_i` | in | Data to read from CSR | CSR_REGFILE | logic[CVA6Cfg.XLEN-1:0]
+
+|`csr_exception_i` | in | Exception or interrupt occurred in CSR stage (the same as commit) | CSR_REGFILE | exception_t
+
+|`commit_lsu_o` | out | Commit the pending store | EX_STAGE | logic
+
+|`commit_lsu_ready_i` | in | Commit buffer of LSU is ready | EX_STAGE | logic
+
+|`commit_tran_id_o` | out | Transaction id of first commit port | ID_STAGE | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`no_st_pending_i` | in | no store is pending | EX_STAGE | logic
+
+|`commit_csr_o` | out | Commit the pending CSR instruction | EX_STAGE | logic
+
+|`flush_commit_o` | out | Request a pipeline flush | CONTROLLER | logic
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As RVF = 0,::
+* `dirty_fp_state_o` output is tied to 0
+* `csr_write_fflags_o` output is tied to 0
+As DebugEn = False,::
+* `single_step_i` input is tied to 0
+As RVA = False,::
+* `amo_resp_i` input is tied to 0
+* `amo_valid_commit_o` output is tied to 0
+As FenceEn = 0,::
+* `fence_i_o` output is tied to 0
+* `fence_o` output is tied to 0
+As RVS = False,::
+* `sfence_vma_o` output is tied to 0
+As RVH = False,::
+* `hfence_vvma_o` output is tied to 0
+* `hfence_gvma_o` output is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_commit_stage.rst b/docs/04_cv32a65x/design/source/port_commit_stage.rst
deleted file mode 100644
index 8625513436..0000000000
--- a/docs/04_cv32a65x/design/source/port_commit_stage.rst
+++ /dev/null
@@ -1,183 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_commit_stage_ports:
-
-.. list-table:: **commit_stage module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``halt_i``
- - in
- - Request to halt the core
- - CONTROLLER
- - logic
-
- * - ``flush_dcache_i``
- - in
- - request to flush dcache, also flush the pipeline
- - CACHE
- - logic
-
- * - ``exception_o``
- - out
- - TO_BE_COMPLETED
- - EX_STAGE
- - exception_t
-
- * - ``commit_instr_i``
- - in
- - The instruction we want to commit
- - ISSUE_STAGE
- - scoreboard_entry_t[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``commit_drop_i``
- - in
- - The instruction is cancelled
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``commit_ack_o``
- - out
- - Acknowledge that we are indeed committing
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``commit_macro_ack_o``
- - out
- - Acknowledge that we are indeed committing
- - CSR_REGFILE
- - logic[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``waddr_o``
- - out
- - Register file write address
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrCommitPorts-1:0][4:0]
-
- * - ``wdata_o``
- - out
- - Register file write data
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrCommitPorts-1:0][CVA6Cfg.XLEN-1:0]
-
- * - ``we_gpr_o``
- - out
- - Register file write enable
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``we_fpr_o``
- - out
- - Floating point register enable
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``pc_o``
- - out
- - TO_BE_COMPLETED
- - FRONTEND_CSR_REGFILE
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``csr_op_o``
- - out
- - Decoded CSR operation
- - CSR_REGFILE
- - fu_op
-
- * - ``csr_wdata_o``
- - out
- - Data to write to CSR
- - CSR_REGFILE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``csr_rdata_i``
- - in
- - Data to read from CSR
- - CSR_REGFILE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``csr_exception_i``
- - in
- - Exception or interrupt occurred in CSR stage (the same as commit)
- - CSR_REGFILE
- - exception_t
-
- * - ``commit_lsu_o``
- - out
- - Commit the pending store
- - EX_STAGE
- - logic
-
- * - ``commit_lsu_ready_i``
- - in
- - Commit buffer of LSU is ready
- - EX_STAGE
- - logic
-
- * - ``commit_tran_id_o``
- - out
- - Transaction id of first commit port
- - ID_STAGE
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``no_st_pending_i``
- - in
- - no store is pending
- - EX_STAGE
- - logic
-
- * - ``commit_csr_o``
- - out
- - Commit the pending CSR instruction
- - EX_STAGE
- - logic
-
- * - ``flush_commit_o``
- - out
- - Request a pipeline flush
- - CONTROLLER
- - logic
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As RVF = 0,
-| ``dirty_fp_state_o`` output is tied to 0
-| ``csr_write_fflags_o`` output is tied to 0
-| As DebugEn = False,
-| ``single_step_i`` input is tied to 0
-| As RVA = False,
-| ``amo_resp_i`` input is tied to 0
-| ``amo_valid_commit_o`` output is tied to 0
-| As FenceEn = 0,
-| ``fence_i_o`` output is tied to 0
-| ``fence_o`` output is tied to 0
-| As RVS = False,
-| ``sfence_vma_o`` output is tied to 0
-| As RVH = False,
-| ``hfence_vvma_o`` output is tied to 0
-| ``hfence_gvma_o`` output is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_compressed_decoder.adoc b/docs/04_cv32a65x/design/source/port_compressed_decoder.adoc
new file mode 100644
index 0000000000..d0e4aeda07
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_compressed_decoder.adoc
@@ -0,0 +1,28 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_compressed_decoder_ports]]
+
+.*compressed_decoder module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`instr_i` | in | Input instruction coming from fetch stage | FRONTEND | logic[31:0]
+
+|`instr_o` | out | Output instruction in uncompressed format | decoder | logic[31:0]
+
+|`illegal_instr_o` | out | Input instruction is illegal | decoder | logic
+
+|`is_macro_instr_o` | out | Output instruction is macro | decoder | logic
+
+|`is_compressed_o` | out | Output instruction is compressed | decoder | logic
+
+|===
+
diff --git a/docs/04_cv32a65x/design/source/port_compressed_decoder.rst b/docs/04_cv32a65x/design/source/port_compressed_decoder.rst
deleted file mode 100644
index 4a5cdb30cf..0000000000
--- a/docs/04_cv32a65x/design/source/port_compressed_decoder.rst
+++ /dev/null
@@ -1,51 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_compressed_decoder_ports:
-
-.. list-table:: **compressed_decoder module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``instr_i``
- - in
- - Input instruction coming from fetch stage
- - FRONTEND
- - logic[31:0]
-
- * - ``instr_o``
- - out
- - Output instruction in uncompressed format
- - decoder
- - logic[31:0]
-
- * - ``illegal_instr_o``
- - out
- - Input instruction is illegal
- - decoder
- - logic
-
- * - ``is_macro_instr_o``
- - out
- - Output instruction is macro
- - decoder
- - logic
-
- * - ``is_compressed_o``
- - out
- - Output instruction is compressed
- - decoder
- - logic
-
-
diff --git a/docs/04_cv32a65x/design/source/port_controller.adoc b/docs/04_cv32a65x/design/source/port_controller.adoc
new file mode 100644
index 0000000000..771a05f71b
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_controller.adoc
@@ -0,0 +1,74 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_controller_ports]]
+
+.*controller module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`set_pc_commit_o` | out | Set PC om PC Gen | FRONTEND | logic
+
+|`flush_if_o` | out | Flush the IF stage | FRONTEND | logic
+
+|`flush_unissued_instr_o` | out | Flush un-issued instructions of the scoreboard | FRONTEND | logic
+
+|`flush_id_o` | out | Flush ID stage | ID_STAGE | logic
+
+|`flush_ex_o` | out | Flush EX stage | EX_STAGE | logic
+
+|`flush_bp_o` | out | Flush branch predictors | FRONTEND | logic
+
+|`flush_icache_o` | out | Flush ICache | CACHE | logic
+
+|`flush_dcache_o` | out | Flush DCache | CACHE | logic
+
+|`flush_dcache_ack_i` | in | Acknowledge the whole DCache Flush | CACHE | logic
+
+|`halt_csr_i` | in | Halt request from CSR (WFI instruction) | CSR_REGFILE | logic
+
+|`halt_o` | out | Halt signal to commit stage | COMMIT_STAGE | logic
+
+|`eret_i` | in | Return from exception | CSR_REGFILE | logic
+
+|`ex_valid_i` | in | We got an exception, flush the pipeline | FRONTEND | logic
+
+|`resolved_branch_i` | in | We got a resolved branch, check if we need to flush the front-end | EX_STAGE | bp_resolve_t
+
+|`flush_csr_i` | in | We got an instruction which altered the CSR, flush the pipeline | CSR_REGFILE | logic
+
+|`flush_commit_i` | in | Flush request from commit stage | COMMIT_STAGE | logic
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As RVH = False,::
+* `v_i` input is tied to 0
+* `flush_tlb_vvma_o` output is tied to 0
+* `flush_tlb_gvma_o` output is tied to 0
+* `hfence_vvma_i` input is tied to 0
+* `hfence_gvma_i` input is tied to 0
+As MMUPresent = 0,::
+* `flush_tlb_o` output is tied to 0
+As EnableAccelerator = 0,::
+* `halt_acc_i` input is tied to 0
+* `flush_acc_i` input is tied to 0
+As DebugEn = False,::
+* `set_debug_pc_i` input is tied to 0
+As FenceEn = 0,::
+* `fence_i_i` input is tied to 0
+* `fence_i` input is tied to 0
+As RVS = False,::
+* `sfence_vma_i` input is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_controller.rst b/docs/04_cv32a65x/design/source/port_controller.rst
deleted file mode 100644
index 7569ab898d..0000000000
--- a/docs/04_cv32a65x/design/source/port_controller.rst
+++ /dev/null
@@ -1,149 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_controller_ports:
-
-.. list-table:: **controller module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``set_pc_commit_o``
- - out
- - Set PC om PC Gen
- - FRONTEND
- - logic
-
- * - ``flush_if_o``
- - out
- - Flush the IF stage
- - FRONTEND
- - logic
-
- * - ``flush_unissued_instr_o``
- - out
- - Flush un-issued instructions of the scoreboard
- - FRONTEND
- - logic
-
- * - ``flush_id_o``
- - out
- - Flush ID stage
- - ID_STAGE
- - logic
-
- * - ``flush_ex_o``
- - out
- - Flush EX stage
- - EX_STAGE
- - logic
-
- * - ``flush_bp_o``
- - out
- - Flush branch predictors
- - FRONTEND
- - logic
-
- * - ``flush_icache_o``
- - out
- - Flush ICache
- - CACHE
- - logic
-
- * - ``flush_dcache_o``
- - out
- - Flush DCache
- - CACHE
- - logic
-
- * - ``flush_dcache_ack_i``
- - in
- - Acknowledge the whole DCache Flush
- - CACHE
- - logic
-
- * - ``halt_csr_i``
- - in
- - Halt request from CSR (WFI instruction)
- - CSR_REGFILE
- - logic
-
- * - ``halt_o``
- - out
- - Halt signal to commit stage
- - COMMIT_STAGE
- - logic
-
- * - ``eret_i``
- - in
- - Return from exception
- - CSR_REGFILE
- - logic
-
- * - ``ex_valid_i``
- - in
- - We got an exception, flush the pipeline
- - FRONTEND
- - logic
-
- * - ``resolved_branch_i``
- - in
- - We got a resolved branch, check if we need to flush the front-end
- - EX_STAGE
- - bp_resolve_t
-
- * - ``flush_csr_i``
- - in
- - We got an instruction which altered the CSR, flush the pipeline
- - CSR_REGFILE
- - logic
-
- * - ``flush_commit_i``
- - in
- - Flush request from commit stage
- - COMMIT_STAGE
- - logic
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As RVH = False,
-| ``v_i`` input is tied to 0
-| ``flush_tlb_vvma_o`` output is tied to 0
-| ``flush_tlb_gvma_o`` output is tied to 0
-| ``hfence_vvma_i`` input is tied to 0
-| ``hfence_gvma_i`` input is tied to 0
-| As MMUPresent = 0,
-| ``flush_tlb_o`` output is tied to 0
-| As EnableAccelerator = 0,
-| ``halt_acc_i`` input is tied to 0
-| ``flush_acc_i`` input is tied to 0
-| As DebugEn = False,
-| ``set_debug_pc_i`` input is tied to 0
-| As FenceEn = 0,
-| ``fence_i_i`` input is tied to 0
-| ``fence_i`` input is tied to 0
-| As RVS = False,
-| ``sfence_vma_i`` input is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_csr_buffer.adoc b/docs/04_cv32a65x/design/source/port_csr_buffer.adoc
new file mode 100644
index 0000000000..5db8d7aa72
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_csr_buffer.adoc
@@ -0,0 +1,36 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_csr_buffer_ports]]
+
+.*csr_buffer module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`flush_i` | in | Flush CSR | CONTROLLER | logic
+
+|`fu_data_i` | in | FU data needed to execute instruction | ISSUE_STAGE | fu_data_t
+
+|`csr_ready_o` | out | CSR FU is ready | ISSUE_STAGE | logic
+
+|`csr_valid_i` | in | CSR instruction is valid | ISSUE_STAGE | logic
+
+|`csr_result_o` | out | CSR buffer result | ISSUE_STAGE | logic[CVA6Cfg.XLEN-1:0]
+
+|`csr_commit_i` | in | commit the pending CSR OP | TO_BE_COMPLETED | logic
+
+|`csr_addr_o` | out | CSR address to write | COMMIT_STAGE | logic[11:0]
+
+|===
+
diff --git a/docs/04_cv32a65x/design/source/port_csr_buffer.rst b/docs/04_cv32a65x/design/source/port_csr_buffer.rst
deleted file mode 100644
index e83ad5e34a..0000000000
--- a/docs/04_cv32a65x/design/source/port_csr_buffer.rst
+++ /dev/null
@@ -1,75 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_csr_buffer_ports:
-
-.. list-table:: **csr_buffer module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``flush_i``
- - in
- - Flush CSR
- - CONTROLLER
- - logic
-
- * - ``fu_data_i``
- - in
- - FU data needed to execute instruction
- - ISSUE_STAGE
- - fu_data_t
-
- * - ``csr_ready_o``
- - out
- - CSR FU is ready
- - ISSUE_STAGE
- - logic
-
- * - ``csr_valid_i``
- - in
- - CSR instruction is valid
- - ISSUE_STAGE
- - logic
-
- * - ``csr_result_o``
- - out
- - CSR buffer result
- - ISSUE_STAGE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``csr_commit_i``
- - in
- - commit the pending CSR OP
- - TO_BE_COMPLETED
- - logic
-
- * - ``csr_addr_o``
- - out
- - CSR address to write
- - COMMIT_STAGE
- - logic[11:0]
-
-
diff --git a/docs/04_cv32a65x/design/source/port_csr_regfile.adoc b/docs/04_cv32a65x/design/source/port_csr_regfile.adoc
new file mode 100644
index 0000000000..dd93ed3985
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_csr_regfile.adoc
@@ -0,0 +1,125 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_csr_regfile_ports]]
+
+.*csr_regfile module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`time_irq_i` | in | Timer threw a interrupt | SUBSYSTEM | logic
+
+|`flush_o` | out | send a flush request out when a CSR with a side effect changes | CONTROLLER | logic
+
+|`halt_csr_o` | out | halt requested | CONTROLLER | logic
+
+|`commit_instr_i` | in | Instruction to be committed | ID_STAGE | scoreboard_entry_t[CVA6Cfg.NrCommitPorts-1:0]
+
+|`commit_ack_i` | in | Commit acknowledged a instruction -> increase instret CSR | COMMIT_STAGE | logic[CVA6Cfg.NrCommitPorts-1:0]
+
+|`boot_addr_i` | in | Address from which to start booting, mtvec is set to the same address | SUBSYSTEM | logic[CVA6Cfg.VLEN-1:0]
+
+|`hart_id_i` | in | Hart id in a multicore environment (reflected in a CSR) | SUBSYSTEM | logic[CVA6Cfg.XLEN-1:0]
+
+|`ex_i` | in | We've got an exception from the commit stage, take it | COMMIT_STAGE | exception_t
+
+|`csr_op_i` | in | Operation to perform on the CSR file | COMMIT_STAGE | fu_op
+
+|`csr_addr_i` | in | Address of the register to read/write | EX_STAGE | logic[11:0]
+
+|`csr_wdata_i` | in | Write data in | COMMIT_STAGE | logic[CVA6Cfg.XLEN-1:0]
+
+|`csr_rdata_o` | out | Read data out | COMMIT_STAGE | logic[CVA6Cfg.XLEN-1:0]
+
+|`pc_i` | in | PC of instruction accessing the CSR | COMMIT_STAGE | logic[CVA6Cfg.VLEN-1:0]
+
+|`csr_exception_o` | out | attempts to access a CSR without appropriate privilege | COMMIT_STAGE | exception_t
+
+|`epc_o` | out | Output the exception PC to PC Gen, the correct CSR (mepc, sepc) is set accordingly | FRONTEND | logic[CVA6Cfg.VLEN-1:0]
+
+|`eret_o` | out | Return from exception, set the PC of epc_o | FRONTEND | logic
+
+|`trap_vector_base_o` | out | Output base of exception vector, correct CSR is output (mtvec, stvec) | FRONTEND | logic[CVA6Cfg.VLEN-1:0]
+
+|`irq_ctrl_o` | out | interrupt management to id stage | ID_STAGE | irq_ctrl_t
+
+|`irq_i` | in | external interrupt in | SUBSYSTEM | logic[1:0]
+
+|`ipi_i` | in | inter processor interrupt -> connected to machine mode sw | SUBSYSTEM | logic
+
+|`icache_en_o` | out | L1 ICache Enable | CACHE | logic
+
+|`dcache_en_o` | out | L1 DCache Enable | CACHE | logic
+
+|`rvfi_csr_o` | out | none | none | rvfi_probes_csr_t
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As RVF = 0,::
+* `dirty_fp_state_i` input is tied to 0
+* `csr_write_fflags_i` input is tied to 0
+* `fs_o` output is tied to 0
+* `fflags_o` output is tied to 0
+* `frm_o` output is tied to 0
+* `fprec_o` output is tied to 0
+As EnableAccelerator = 0,::
+* `dirty_v_state_i` input is tied to 0
+* `acc_fflags_ex_i` input is tied to 0
+* `acc_fflags_ex_valid_i` input is tied to 0
+* `acc_cons_en_o` output is tied to 0
+* `pmpcfg_o` output is tied to 0
+* `pmpaddr_o` output is tied to 0
+As PRIV = MachineOnly,::
+* `priv_lvl_o` output is tied to MachineMode
+* `ld_st_priv_lvl_o` output is tied to MAchineMode
+* `tvm_o` output is tied to 0
+* `tw_o` output is tied to 0
+* `tsr_o` output is tied to 0
+As RVH = False,::
+* `v_o` output is tied to 0
+* `vfs_o` output is tied to 0
+* `en_g_translation_o` output is tied to 0
+* `en_ld_st_g_translation_o` output is tied to 0
+* `ld_st_v_o` output is tied to 0
+* `csr_hs_ld_st_inst_i` input is tied to 0
+* `vs_sum_o` output is tied to 0
+* `vmxr_o` output is tied to 0
+* `vsatp_ppn_o` output is tied to 0
+* `vs_asid_o` output is tied to 0
+* `hgatp_ppn_o` output is tied to 0
+* `vmid_o` output is tied to 0
+* `vtw_o` output is tied to 0
+* `hu_o` output is tied to 0
+As RVV = False,::
+* `vs_o` output is tied to 0
+As RVS = False,::
+* `en_translation_o` output is tied to 0
+* `en_ld_st_translation_o` output is tied to 0
+* `sum_o` output is tied to 0
+* `mxr_o` output is tied to 0
+* `satp_ppn_o` output is tied to 0
+* `asid_o` output is tied to 0
+As DebugEn = False,::
+* `debug_req_i` input is tied to 0
+* `set_debug_pc_o` output is tied to 0
+* `debug_mode_o` output is tied to 0
+* `single_step_o` output is tied to 0
+As PerfCounterEn = 0,::
+* `perf_addr_o` output is tied to 0
+* `perf_data_o` output is tied to 0
+* `perf_data_i` input is tied to 0
+* `perf_we_o` output is tied to 0
+* `mcountinhibit_o` output is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_csr_regfile.rst b/docs/04_cv32a65x/design/source/port_csr_regfile.rst
deleted file mode 100644
index 7eb94e58fd..0000000000
--- a/docs/04_cv32a65x/design/source/port_csr_regfile.rst
+++ /dev/null
@@ -1,228 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_csr_regfile_ports:
-
-.. list-table:: **csr_regfile module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``time_irq_i``
- - in
- - Timer threw a interrupt
- - SUBSYSTEM
- - logic
-
- * - ``flush_o``
- - out
- - send a flush request out when a CSR with a side effect changes
- - CONTROLLER
- - logic
-
- * - ``halt_csr_o``
- - out
- - halt requested
- - CONTROLLER
- - logic
-
- * - ``commit_instr_i``
- - in
- - Instruction to be committed
- - ID_STAGE
- - scoreboard_entry_t[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``commit_ack_i``
- - in
- - Commit acknowledged a instruction -> increase instret CSR
- - COMMIT_STAGE
- - logic[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``boot_addr_i``
- - in
- - Address from which to start booting, mtvec is set to the same address
- - SUBSYSTEM
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``hart_id_i``
- - in
- - Hart id in a multicore environment (reflected in a CSR)
- - SUBSYSTEM
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``ex_i``
- - in
- - We've got an exception from the commit stage, take it
- - COMMIT_STAGE
- - exception_t
-
- * - ``csr_op_i``
- - in
- - Operation to perform on the CSR file
- - COMMIT_STAGE
- - fu_op
-
- * - ``csr_addr_i``
- - in
- - Address of the register to read/write
- - EX_STAGE
- - logic[11:0]
-
- * - ``csr_wdata_i``
- - in
- - Write data in
- - COMMIT_STAGE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``csr_rdata_o``
- - out
- - Read data out
- - COMMIT_STAGE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``pc_i``
- - in
- - PC of instruction accessing the CSR
- - COMMIT_STAGE
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``csr_exception_o``
- - out
- - attempts to access a CSR without appropriate privilege
- - COMMIT_STAGE
- - exception_t
-
- * - ``epc_o``
- - out
- - Output the exception PC to PC Gen, the correct CSR (mepc, sepc) is set accordingly
- - FRONTEND
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``eret_o``
- - out
- - Return from exception, set the PC of epc_o
- - FRONTEND
- - logic
-
- * - ``trap_vector_base_o``
- - out
- - Output base of exception vector, correct CSR is output (mtvec, stvec)
- - FRONTEND
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``irq_ctrl_o``
- - out
- - interrupt management to id stage
- - ID_STAGE
- - irq_ctrl_t
-
- * - ``irq_i``
- - in
- - external interrupt in
- - SUBSYSTEM
- - logic[1:0]
-
- * - ``ipi_i``
- - in
- - inter processor interrupt -> connected to machine mode sw
- - SUBSYSTEM
- - logic
-
- * - ``icache_en_o``
- - out
- - L1 ICache Enable
- - CACHE
- - logic
-
- * - ``dcache_en_o``
- - out
- - L1 DCache Enable
- - CACHE
- - logic
-
- * - ``rvfi_csr_o``
- - out
- - none
- - none
- - rvfi_probes_csr_t
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As RVF = 0,
-| ``dirty_fp_state_i`` input is tied to 0
-| ``csr_write_fflags_i`` input is tied to 0
-| ``fs_o`` output is tied to 0
-| ``fflags_o`` output is tied to 0
-| ``frm_o`` output is tied to 0
-| ``fprec_o`` output is tied to 0
-| As EnableAccelerator = 0,
-| ``dirty_v_state_i`` input is tied to 0
-| ``acc_fflags_ex_i`` input is tied to 0
-| ``acc_fflags_ex_valid_i`` input is tied to 0
-| ``acc_cons_en_o`` output is tied to 0
-| ``pmpcfg_o`` output is tied to 0
-| ``pmpaddr_o`` output is tied to 0
-| As PRIV = MachineOnly,
-| ``priv_lvl_o`` output is tied to MachineMode
-| ``ld_st_priv_lvl_o`` output is tied to MAchineMode
-| ``tvm_o`` output is tied to 0
-| ``tw_o`` output is tied to 0
-| ``tsr_o`` output is tied to 0
-| As RVH = False,
-| ``v_o`` output is tied to 0
-| ``vfs_o`` output is tied to 0
-| ``en_g_translation_o`` output is tied to 0
-| ``en_ld_st_g_translation_o`` output is tied to 0
-| ``ld_st_v_o`` output is tied to 0
-| ``csr_hs_ld_st_inst_i`` input is tied to 0
-| ``vs_sum_o`` output is tied to 0
-| ``vmxr_o`` output is tied to 0
-| ``vsatp_ppn_o`` output is tied to 0
-| ``vs_asid_o`` output is tied to 0
-| ``hgatp_ppn_o`` output is tied to 0
-| ``vmid_o`` output is tied to 0
-| ``vtw_o`` output is tied to 0
-| ``hu_o`` output is tied to 0
-| As RVV = False,
-| ``vs_o`` output is tied to 0
-| As RVS = False,
-| ``en_translation_o`` output is tied to 0
-| ``en_ld_st_translation_o`` output is tied to 0
-| ``sum_o`` output is tied to 0
-| ``mxr_o`` output is tied to 0
-| ``satp_ppn_o`` output is tied to 0
-| ``asid_o`` output is tied to 0
-| As DebugEn = False,
-| ``debug_req_i`` input is tied to 0
-| ``set_debug_pc_o`` output is tied to 0
-| ``debug_mode_o`` output is tied to 0
-| ``single_step_o`` output is tied to 0
-| As PerfCounterEn = 0,
-| ``perf_addr_o`` output is tied to 0
-| ``perf_data_o`` output is tied to 0
-| ``perf_data_i`` input is tied to 0
-| ``perf_we_o`` output is tied to 0
-| ``mcountinhibit_o`` output is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_cva6.adoc b/docs/04_cv32a65x/design/source/port_cva6.adoc
new file mode 100644
index 0000000000..e7fc817ddc
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_cva6.adoc
@@ -0,0 +1,46 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_cva6_ports]]
+
+.*cva6 module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`boot_addr_i` | in | Reset boot address | SUBSYSTEM | logic[CVA6Cfg.VLEN-1:0]
+
+|`hart_id_i` | in | Hard ID reflected as CSR | SUBSYSTEM | logic[CVA6Cfg.XLEN-1:0]
+
+|`irq_i` | in | Level sensitive (async) interrupts | SUBSYSTEM | logic[1:0]
+
+|`ipi_i` | in | Inter-processor (async) interrupt | SUBSYSTEM | logic
+
+|`time_irq_i` | in | Timer (async) interrupt | SUBSYSTEM | logic
+
+|`cvxif_req_o` | out | CVXIF request | SUBSYSTEM | cvxif_req_t
+
+|`cvxif_resp_i` | in | CVXIF response | SUBSYSTEM | cvxif_resp_t
+
+|`noc_req_o` | out | noc request, can be AXI or OpenPiton | SUBSYSTEM | noc_req_t
+
+|`noc_resp_i` | in | noc response, can be AXI or OpenPiton | SUBSYSTEM | noc_resp_t
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As DebugEn = False,::
+* `debug_req_i` input is tied to 0
+As IsRVFI = 0,::
+* `rvfi_probes_o` output is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_cva6.rst b/docs/04_cv32a65x/design/source/port_cva6.rst
deleted file mode 100644
index 5d9fa282aa..0000000000
--- a/docs/04_cv32a65x/design/source/port_cva6.rst
+++ /dev/null
@@ -1,93 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_cva6_ports:
-
-.. list-table:: **cva6 module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``boot_addr_i``
- - in
- - Reset boot address
- - SUBSYSTEM
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``hart_id_i``
- - in
- - Hard ID reflected as CSR
- - SUBSYSTEM
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``irq_i``
- - in
- - Level sensitive (async) interrupts
- - SUBSYSTEM
- - logic[1:0]
-
- * - ``ipi_i``
- - in
- - Inter-processor (async) interrupt
- - SUBSYSTEM
- - logic
-
- * - ``time_irq_i``
- - in
- - Timer (async) interrupt
- - SUBSYSTEM
- - logic
-
- * - ``cvxif_req_o``
- - out
- - CVXIF request
- - SUBSYSTEM
- - cvxif_req_t
-
- * - ``cvxif_resp_i``
- - in
- - CVXIF response
- - SUBSYSTEM
- - cvxif_resp_t
-
- * - ``noc_req_o``
- - out
- - noc request, can be AXI or OpenPiton
- - SUBSYSTEM
- - noc_req_t
-
- * - ``noc_resp_i``
- - in
- - noc response, can be AXI or OpenPiton
- - SUBSYSTEM
- - noc_resp_t
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As DebugEn = False,
-| ``debug_req_i`` input is tied to 0
-| As IsRVFI = 0,
-| ``rvfi_probes_o`` output is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_cva6_hpdcache_subsystem.adoc b/docs/04_cv32a65x/design/source/port_cva6_hpdcache_subsystem.adoc
new file mode 100644
index 0000000000..bb2f5e43bf
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_cva6_hpdcache_subsystem.adoc
@@ -0,0 +1,74 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_cva6_hpdcache_subsystem_ports]]
+
+.*cva6_hpdcache_subsystem module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`noc_req_o` | out | noc request, can be AXI or OpenPiton | SUBSYSTEM | noc_req_t
+
+|`noc_resp_i` | in | noc response, can be AXI or OpenPiton | SUBSYSTEM | noc_resp_t
+
+|`icache_en_i` | in | Instruction cache enable | CSR_REGFILE | logic
+
+|`icache_flush_i` | in | Flush the instruction cache | CONTROLLER | logic
+
+|`icache_areq_i` | in | Input address translation request | EX_STAGE | icache_areq_t
+
+|`icache_areq_o` | out | Output address translation request | EX_STAGE | icache_arsp_t
+
+|`icache_dreq_i` | in | Input data translation request | FRONTEND | icache_dreq_t
+
+|`icache_dreq_o` | out | Output data translation request | FRONTEND | icache_drsp_t
+
+|`dcache_enable_i` | in | Data cache enable | CSR_REGFILE | logic
+
+|`dcache_flush_i` | in | Data cache flush | CONTROLLER | logic
+
+|`dcache_flush_ack_o` | out | Flush acknowledge | CONTROLLER | logic
+
+|`dcache_amo_req_i` | in | AMO request | EX_STAGE | ariane_pkg::amo_req_t
+
+|`dcache_amo_resp_o` | out | AMO response | EX_STAGE | ariane_pkg::amo_resp_t
+
+|`dcache_req_ports_i` | in | Data cache input request ports | EX_STAGE | dcache_req_i_t[NumPorts-1:0]
+
+|`dcache_req_ports_o` | out | Data cache output request ports | EX_STAGE | dcache_req_o_t[NumPorts-1:0]
+
+|`wbuffer_empty_o` | out | Write buffer status to know if empty | EX_STAGE | logic
+
+|`wbuffer_not_ni_o` | out | Write buffer status to know if not non idempotent | EX_STAGE | logic
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As PerfCounterEn = 0,::
+* `icache_miss_o` output is tied to 0
+* `dcache_miss_o` output is tied to 0
+For any HW configuration,::
+* `dcache_cmo_req_i` input is tied to 0
+* `dcache_cmo_resp_o` output is tied to open
+* `hwpf_base_set_i` input is tied to 0
+* `hwpf_base_i` input is tied to 0
+* `hwpf_base_o` output is tied to 0
+* `hwpf_param_set_i` input is tied to 0
+* `hwpf_param_i` input is tied to 0
+* `hwpf_param_o` output is tied to 0
+* `hwpf_throttle_set_i` input is tied to 0
+* `hwpf_throttle_i` input is tied to 0
+* `hwpf_throttle_o` output is tied to 0
+* `hwpf_status_o` output is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_cva6_hpdcache_subsystem.rst b/docs/04_cv32a65x/design/source/port_cva6_hpdcache_subsystem.rst
deleted file mode 100644
index 225dc34f64..0000000000
--- a/docs/04_cv32a65x/design/source/port_cva6_hpdcache_subsystem.rst
+++ /dev/null
@@ -1,153 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_cva6_hpdcache_subsystem_ports:
-
-.. list-table:: **cva6_hpdcache_subsystem module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``noc_req_o``
- - out
- - noc request, can be AXI or OpenPiton
- - SUBSYSTEM
- - noc_req_t
-
- * - ``noc_resp_i``
- - in
- - noc response, can be AXI or OpenPiton
- - SUBSYSTEM
- - noc_resp_t
-
- * - ``icache_en_i``
- - in
- - Instruction cache enable
- - CSR_REGFILE
- - logic
-
- * - ``icache_flush_i``
- - in
- - Flush the instruction cache
- - CONTROLLER
- - logic
-
- * - ``icache_areq_i``
- - in
- - Input address translation request
- - EX_STAGE
- - icache_areq_t
-
- * - ``icache_areq_o``
- - out
- - Output address translation request
- - EX_STAGE
- - icache_arsp_t
-
- * - ``icache_dreq_i``
- - in
- - Input data translation request
- - FRONTEND
- - icache_dreq_t
-
- * - ``icache_dreq_o``
- - out
- - Output data translation request
- - FRONTEND
- - icache_drsp_t
-
- * - ``dcache_enable_i``
- - in
- - Data cache enable
- - CSR_REGFILE
- - logic
-
- * - ``dcache_flush_i``
- - in
- - Data cache flush
- - CONTROLLER
- - logic
-
- * - ``dcache_flush_ack_o``
- - out
- - Flush acknowledge
- - CONTROLLER
- - logic
-
- * - ``dcache_amo_req_i``
- - in
- - AMO request
- - EX_STAGE
- - ariane_pkg::amo_req_t
-
- * - ``dcache_amo_resp_o``
- - out
- - AMO response
- - EX_STAGE
- - ariane_pkg::amo_resp_t
-
- * - ``dcache_req_ports_i``
- - in
- - Data cache input request ports
- - EX_STAGE
- - dcache_req_i_t[NumPorts-1:0]
-
- * - ``dcache_req_ports_o``
- - out
- - Data cache output request ports
- - EX_STAGE
- - dcache_req_o_t[NumPorts-1:0]
-
- * - ``wbuffer_empty_o``
- - out
- - Write buffer status to know if empty
- - EX_STAGE
- - logic
-
- * - ``wbuffer_not_ni_o``
- - out
- - Write buffer status to know if not non idempotent
- - EX_STAGE
- - logic
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As PerfCounterEn = 0,
-| ``icache_miss_o`` output is tied to 0
-| ``dcache_miss_o`` output is tied to 0
-| For any HW configuration,
-| ``dcache_cmo_req_i`` input is tied to 0
-| ``dcache_cmo_resp_o`` output is tied to open
-| ``hwpf_base_set_i`` input is tied to 0
-| ``hwpf_base_i`` input is tied to 0
-| ``hwpf_base_o`` output is tied to 0
-| ``hwpf_param_set_i`` input is tied to 0
-| ``hwpf_param_i`` input is tied to 0
-| ``hwpf_param_o`` output is tied to 0
-| ``hwpf_throttle_set_i`` input is tied to 0
-| ``hwpf_throttle_i`` input is tied to 0
-| ``hwpf_throttle_o`` output is tied to 0
-| ``hwpf_status_o`` output is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_cvxif_fu.adoc b/docs/04_cv32a65x/design/source/port_cvxif_fu.adoc
new file mode 100644
index 0000000000..8a7e4b8e54
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_cvxif_fu.adoc
@@ -0,0 +1,50 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_cvxif_fu_ports]]
+
+.*cvxif_fu module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`x_valid_i` | in | CVXIF instruction is valid | ISSUE_STAGE | logic
+
+|`x_trans_id_i` | in | Transaction ID | ISSUE_STAGE | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`x_illegal_i` | in | Instruction is illegal, determined during CVXIF issue transaction | ISSUE_STAGE | logic
+
+|`x_off_instr_i` | in | Offloaded instruction | ISSUE_STAGE | logic[31:0]
+
+|`x_ready_o` | out | CVXIF is ready | ISSUE_STAGE | logic
+
+|`x_trans_id_o` | out | CVXIF result transaction ID | ISSUE_STAGE | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`x_exception_o` | out | CVXIF exception | ISSUE_STAGE | exception_t
+
+|`x_result_o` | out | CVXIF FU result | ISSUE_STAGE | logic[CVA6Cfg.XLEN-1:0]
+
+|`x_valid_o` | out | CVXIF result valid | ISSUE_STAGE | logic
+
+|`x_we_o` | out | CVXIF write enable | ISSUE_STAGE | logic
+
+|`x_rd_o` | out | CVXIF destination register | ISSUE_STAGE | logic[4:0]
+
+|`result_valid_i` | in | none | none | logic
+
+|`result_i` | in | none | none | x_result_t
+
+|`result_ready_o` | out | none | none | logic
+
+|===
+
diff --git a/docs/04_cv32a65x/design/source/port_cvxif_fu.rst b/docs/04_cv32a65x/design/source/port_cvxif_fu.rst
deleted file mode 100644
index 7e481a15a4..0000000000
--- a/docs/04_cv32a65x/design/source/port_cvxif_fu.rst
+++ /dev/null
@@ -1,103 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_cvxif_fu_ports:
-
-.. list-table:: **cvxif_fu module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``fu_data_i``
- - in
- - FU data needed to execute instruction
- - ISSUE_STAGE
- - fu_data_t
-
- * - ``x_valid_i``
- - in
- - CVXIF instruction is valid
- - ISSUE_STAGE
- - logic
-
- * - ``x_ready_o``
- - out
- - CVXIF is ready
- - ISSUE_STAGE
- - logic
-
- * - ``x_off_instr_i``
- - in
- - Offloaded instruction
- - ISSUE_STAGE
- - logic[31:0]
-
- * - ``x_trans_id_o``
- - out
- - CVXIF transaction ID
- - ISSUE_STAGE
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``x_exception_o``
- - out
- - CVXIF exception
- - ISSUE_STAGE
- - exception_t
-
- * - ``x_result_o``
- - out
- - CVXIF FU result
- - ISSUE_STAGE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``x_valid_o``
- - out
- - CVXIF result valid
- - ISSUE_STAGE
- - logic
-
- * - ``x_we_o``
- - out
- - CVXIF write enable
- - ISSUE_STAGE
- - logic
-
- * - ``cvxif_req_o``
- - out
- - CVXIF request
- - SUBSYSTEM
- - cvxif_pkg::cvxif_req_t
-
- * - ``cvxif_resp_i``
- - in
- - CVXIF response
- - SUBSYSTEM
- - cvxif_pkg::cvxif_resp_t
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As PRIV = MachineOnly,
-| ``priv_lvl_i`` input is tied to MachineMode
-
diff --git a/docs/04_cv32a65x/design/source/port_decoder.adoc b/docs/04_cv32a65x/design/source/port_decoder.adoc
new file mode 100644
index 0000000000..6efc8f9671
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_decoder.adoc
@@ -0,0 +1,68 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_decoder_ports]]
+
+.*decoder module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`pc_i` | in | PC from fetch stage | FRONTEND | logic[CVA6Cfg.VLEN-1:0]
+
+|`is_compressed_i` | in | Is a compressed instruction | compressed_decoder | logic
+
+|`compressed_instr_i` | in | Compressed form of instruction | FRONTEND | logic[15:0]
+
+|`is_illegal_i` | in | Illegal compressed instruction | compressed_decoder | logic
+
+|`instruction_i` | in | Instruction from fetch stage | FRONTEND | logic[31:0]
+
+|`is_macro_instr_i` | in | Is a macro instruction | macro_decoder | logic
+
+|`is_last_macro_instr_i` | in | Is a last macro instruction | macro_decoder | logic
+
+|`is_double_rd_macro_instr_i` | in | Is mvsa01/mva01s macro instruction | macro_decoder | logic
+
+|`branch_predict_i` | in | Is a branch predict instruction | FRONTEND | branchpredict_sbe_t
+
+|`ex_i` | in | If an exception occured in fetch stage | FRONTEND | exception_t
+
+|`irq_i` | in | Level sensitive (async) interrupts | SUBSYSTEM | logic[1:0]
+
+|`irq_ctrl_i` | in | Interrupt control status | CSR_REGFILE | irq_ctrl_t
+
+|`instruction_o` | out | Instruction to be added to scoreboard entry | ISSUE_STAGE | scoreboard_entry_t
+
+|`orig_instr_o` | out | Instruction | ISSUE_STAGE | logic[31:0]
+
+|`is_control_flow_instr_o` | out | Is a control flow instruction | ISSUE_STAGE | logic
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As DebugEn = False,::
+* `debug_req_i` input is tied to 0
+* `debug_mode_i` input is tied to 0
+As PRIV = MachineOnly,::
+* `priv_lvl_i` input is tied to MachineMode
+* `tvm_i` input is tied to 0
+* `tw_i` input is tied to 0
+* `tsr_i` input is tied to 0
+As RVH = False,::
+* `v_i` input is tied to 0
+* `vfs_i` input is tied to 0
+* `vtw_i` input is tied to 0
+* `hu_i` input is tied to 0
+As RVF = 0,::
+* `fs_i` input is tied to 0
+* `frm_i` input is tied to 0
+As RVV = False,::
+* `vs_i` input is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_decoder.rst b/docs/04_cv32a65x/design/source/port_decoder.rst
deleted file mode 100644
index 424dd7861d..0000000000
--- a/docs/04_cv32a65x/design/source/port_decoder.rst
+++ /dev/null
@@ -1,131 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_decoder_ports:
-
-.. list-table:: **decoder module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``pc_i``
- - in
- - PC from fetch stage
- - FRONTEND
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``is_compressed_i``
- - in
- - Is a compressed instruction
- - compressed_decoder
- - logic
-
- * - ``compressed_instr_i``
- - in
- - Compressed form of instruction
- - FRONTEND
- - logic[15:0]
-
- * - ``is_illegal_i``
- - in
- - Illegal compressed instruction
- - compressed_decoder
- - logic
-
- * - ``instruction_i``
- - in
- - Instruction from fetch stage
- - FRONTEND
- - logic[31:0]
-
- * - ``is_macro_instr_i``
- - in
- - Is a macro instruction
- - macro_decoder
- - logic
-
- * - ``is_last_macro_instr_i``
- - in
- - Is a last macro instruction
- - macro_decoder
- - logic
-
- * - ``is_double_rd_macro_instr_i``
- - in
- - Is mvsa01/mva01s macro instruction
- - macro_decoder
- - logic
-
- * - ``branch_predict_i``
- - in
- - Is a branch predict instruction
- - FRONTEND
- - branchpredict_sbe_t
-
- * - ``ex_i``
- - in
- - If an exception occured in fetch stage
- - FRONTEND
- - exception_t
-
- * - ``irq_i``
- - in
- - Level sensitive (async) interrupts
- - SUBSYSTEM
- - logic[1:0]
-
- * - ``irq_ctrl_i``
- - in
- - Interrupt control status
- - CSR_REGFILE
- - irq_ctrl_t
-
- * - ``instruction_o``
- - out
- - Instruction to be added to scoreboard entry
- - ISSUE_STAGE
- - scoreboard_entry_t
-
- * - ``orig_instr_o``
- - out
- - Instruction
- - ISSUE_STAGE
- - logic[31:0]
-
- * - ``is_control_flow_instr_o``
- - out
- - Is a control flow instruction
- - ISSUE_STAGE
- - logic
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As DebugEn = False,
-| ``debug_req_i`` input is tied to 0
-| ``debug_mode_i`` input is tied to 0
-| As PRIV = MachineOnly,
-| ``priv_lvl_i`` input is tied to MachineMode
-| ``tvm_i`` input is tied to 0
-| ``tw_i`` input is tied to 0
-| ``tsr_i`` input is tied to 0
-| As RVH = False,
-| ``v_i`` input is tied to 0
-| ``vfs_i`` input is tied to 0
-| ``vtw_i`` input is tied to 0
-| ``hu_i`` input is tied to 0
-| As RVF = 0,
-| ``fs_i`` input is tied to 0
-| ``frm_i`` input is tied to 0
-| As RVV = False,
-| ``vs_i`` input is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_ex_stage.adoc b/docs/04_cv32a65x/design/source/port_ex_stage.adoc
new file mode 100644
index 0000000000..8473147904
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_ex_stage.adoc
@@ -0,0 +1,189 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_ex_stage_ports]]
+
+.*ex_stage module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`flush_i` | in | Fetch flush request | CONTROLLER | logic
+
+|`rs1_forwarding_i` | in | rs1 forwarding | ISSUE_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0]
+
+|`rs2_forwarding_i` | in | rs2 forwarding | ISSUE_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0]
+
+|`fu_data_i` | in | FU data useful to execute instruction | ISSUE_STAGE | fu_data_t[CVA6Cfg.NrIssuePorts-1:0]
+
+|`pc_i` | in | PC of the current instruction | ISSUE_STAGE | logic[CVA6Cfg.VLEN-1:0]
+
+|`is_compressed_instr_i` | in | Report whether instruction is compressed | ISSUE_STAGE | logic
+
+|`flu_result_o` | out | Fixed Latency Unit result | ISSUE_STAGE | logic[CVA6Cfg.XLEN-1:0]
+
+|`flu_trans_id_o` | out | ID of the scoreboard entry at which a=to write back | ISSUE_STAGE | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`flu_exception_o` | out | Fixed Latency Unit exception | ISSUE_STAGE | exception_t
+
+|`flu_ready_o` | out | FLU is ready | ISSUE_STAGE | logic
+
+|`flu_valid_o` | out | FLU result is valid | ISSUE_STAGE | logic
+
+|`alu_valid_i` | in | ALU instruction is valid | ISSUE_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`branch_valid_i` | in | Branch unit instruction is valid | ISSUE_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`branch_predict_i` | in | Information of branch prediction | ISSUE_STAGE | branchpredict_sbe_t
+
+|`resolved_branch_o` | out | The branch engine uses the write back from the ALU | several_modules | bp_resolve_t
+
+|`resolve_branch_o` | out | Signaling that we resolved the branch | ISSUE_STAGE | logic
+
+|`csr_valid_i` | in | CSR instruction is valid | ISSUE_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`csr_addr_o` | out | CSR address to write | COMMIT_STAGE | logic[11:0]
+
+|`csr_commit_i` | in | CSR commit | COMMIT_STAGE | logic
+
+|`mult_valid_i` | in | MULT instruction is valid | ISSUE_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`lsu_ready_o` | out | LSU is ready | ISSUE_STAGE | logic
+
+|`lsu_valid_i` | in | LSU instruction is valid | ISSUE_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`load_valid_o` | out | Load result is valid | ISSUE_STAGE | logic
+
+|`load_result_o` | out | Load result valid | ISSUE_STAGE | logic[CVA6Cfg.XLEN-1:0]
+
+|`load_trans_id_o` | out | Load instruction ID | ISSUE_STAGE | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`load_exception_o` | out | Exception generated by load instruction | ISSUE_STAGE | exception_t
+
+|`store_valid_o` | out | Store result is valid | ISSUe_STAGE | logic
+
+|`store_result_o` | out | Store result | ISSUE_STAGE | logic[CVA6Cfg.XLEN-1:0]
+
+|`store_trans_id_o` | out | Store instruction ID | ISSUE_STAGE | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`store_exception_o` | out | Exception generated by store instruction | ISSUE_STAGE | exception_t
+
+|`lsu_commit_i` | in | LSU commit | COMMIT_STAGE | logic
+
+|`lsu_commit_ready_o` | out | Commit queue ready to accept another commit request | COMMIT_STAGE | logic
+
+|`commit_tran_id_i` | in | Commit transaction ID | COMMIT_STAGE | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`no_st_pending_o` | out | TO_BE_COMPLETED | COMMIT_STAGE | logic
+
+|`alu2_valid_i` | in | ALU2 instruction is valid | ISSUE_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`x_valid_i` | in | CVXIF instruction is valid | ISSUE_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`x_ready_o` | out | CVXIF is ready | ISSUE_STAGE | logic
+
+|`x_off_instr_i` | in | none | none | logic[31:0]
+
+|`x_trans_id_o` | out | CVXIF transaction ID | ISSUE_STAGE | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`x_exception_o` | out | CVXIF exception | ISSUE_STAGE | exception_t
+
+|`x_result_o` | out | CVXIF result | ISSUE_STAGE | logic[CVA6Cfg.XLEN-1:0]
+
+|`x_valid_o` | out | CVXIF result valid | ISSUE_STAGE | logic
+
+|`x_we_o` | out | CVXIF write enable | ISSUE_STAGE | logic
+
+|`x_rd_o` | out | CVXIF destination register | ISSUE_STAGE | logic[4:0]
+
+|`x_result_valid_i` | in | CVXIF Result interface | SUBSYSTEM | logic
+
+|`x_result_i` | in | none | none | x_result_t
+
+|`x_result_ready_o` | out | none | none | logic
+
+|`x_transaction_rejected_i` | in | CVXIF Issue transaction rejected -> illegal instruction | ISSUE_STAGE | logic
+
+|`icache_areq_i` | in | icache translation response | CACHE | icache_arsp_t
+
+|`icache_areq_o` | out | icache translation request | CACHE | icache_areq_t
+
+|`dcache_req_ports_i` | in | Data cache request ouput | CACHE | dcache_req_o_t[2:0]
+
+|`dcache_req_ports_o` | out | Data cache request input | CACHE | dcache_req_i_t[2:0]
+
+|`dcache_wbuffer_empty_i` | in | Write buffer is empty | CACHE | logic
+
+|`dcache_wbuffer_not_ni_i` | in | TO_BE_COMPLETED | CACHE | logic
+
+|`pmpcfg_i` | in | Report the PMP configuration | CSR_REGFILE | riscv::pmpcfg_t[CVA6Cfg.NrPMPEntries:0]
+
+|`pmpaddr_i` | in | Report the PMP addresses | CSR_REGFILE | logic[CVA6Cfg.NrPMPEntries:0][CVA6Cfg.PLEN-3:0]
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As DebugEn = False,::
+* `debug_mode_i` input is tied to 0
+As RVH = False,::
+* `tinst_i` input is tied to 0
+* `enable_g_translation_i` input is tied to 0
+* `en_ld_st_g_translation_i` input is tied to 0
+* `flush_tlb_vvma_i` input is tied to 0
+* `flush_tlb_gvma_i` input is tied to 0
+* `v_i` input is tied to 0
+* `ld_st_v_i` input is tied to 0
+* `csr_hs_ld_st_inst_o` output is tied to 0
+* `vs_sum_i` input is tied to 0
+* `vmxr_i` input is tied to 0
+* `vsatp_ppn_i` input is tied to 0
+* `vs_asid_i` input is tied to 0
+* `hgatp_ppn_i` input is tied to 0
+* `vmid_i` input is tied to 0
+As EnableAccelerator = 0,::
+* `stall_st_pending_i` input is tied to 0
+* `acc_valid_i` input is tied to 0
+As RVA = False,::
+* `amo_valid_commit_i` input is tied to 0
+* `amo_req_o` output is tied to 0
+* `amo_resp_i` input is tied to 0
+As RVF = 0,::
+* `fpu_ready_o` output is tied to 0
+* `fpu_valid_i` input is tied to 0
+* `fpu_fmt_i` input is tied to 0
+* `fpu_rm_i` input is tied to 0
+* `fpu_frm_i` input is tied to 0
+* `fpu_prec_i` input is tied to 0
+* `fpu_trans_id_o` output is tied to 0
+* `fpu_result_o` output is tied to 0
+* `fpu_valid_o` output is tied to 0
+* `fpu_exception_o` output is tied to 0
+As RVS = False,::
+* `enable_translation_i` input is tied to 0
+* `en_ld_st_translation_i` input is tied to 0
+* `sum_i` input is tied to 0
+* `mxr_i` input is tied to 0
+* `satp_ppn_i` input is tied to 0
+* `asid_i` input is tied to 0
+As MMUPresent = 0,::
+* `flush_tlb_i` input is tied to 0
+As PRIV = MachineOnly,::
+* `priv_lvl_i` input is tied to MachineMode
+* `ld_st_priv_lvl_i` input is tied to MAchineMode
+As PerfCounterEn = 0,::
+* `itlb_miss_o` output is tied to 0
+* `dtlb_miss_o` output is tied to 0
+As IsRVFI = 0,::
+* `rvfi_lsu_ctrl_o` output is tied to 0
+* `rvfi_mem_paddr_o` output is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_ex_stage.rst b/docs/04_cv32a65x/design/source/port_ex_stage.rst
deleted file mode 100644
index 18a84056f5..0000000000
--- a/docs/04_cv32a65x/design/source/port_ex_stage.rst
+++ /dev/null
@@ -1,406 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_ex_stage_ports:
-
-.. list-table:: **ex_stage module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``flush_i``
- - in
- - Fetch flush request
- - CONTROLLER
- - logic
-
- * - ``rs1_forwarding_i``
- - in
- - rs1 forwarding
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0]
-
- * - ``rs2_forwarding_i``
- - in
- - rs2 forwarding
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0]
-
- * - ``fu_data_i``
- - in
- - FU data useful to execute instruction
- - ISSUE_STAGE
- - fu_data_t[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``pc_i``
- - in
- - PC of the current instruction
- - ISSUE_STAGE
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``is_compressed_instr_i``
- - in
- - Report whether instruction is compressed
- - ISSUE_STAGE
- - logic
-
- * - ``flu_result_o``
- - out
- - Fixed Latency Unit result
- - ISSUE_STAGE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``flu_trans_id_o``
- - out
- - ID of the scoreboard entry at which a=to write back
- - ISSUE_STAGE
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``flu_exception_o``
- - out
- - Fixed Latency Unit exception
- - ISSUE_STAGE
- - exception_t
-
- * - ``flu_ready_o``
- - out
- - FLU is ready
- - ISSUE_STAGE
- - logic
-
- * - ``flu_valid_o``
- - out
- - FLU result is valid
- - ISSUE_STAGE
- - logic
-
- * - ``alu_valid_i``
- - in
- - ALU instruction is valid
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``branch_valid_i``
- - in
- - Branch unit instruction is valid
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``branch_predict_i``
- - in
- - Information of branch prediction
- - ISSUE_STAGE
- - branchpredict_sbe_t
-
- * - ``resolved_branch_o``
- - out
- - The branch engine uses the write back from the ALU
- - several_modules
- - bp_resolve_t
-
- * - ``resolve_branch_o``
- - out
- - Signaling that we resolved the branch
- - ISSUE_STAGE
- - logic
-
- * - ``csr_valid_i``
- - in
- - CSR instruction is valid
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``csr_addr_o``
- - out
- - CSR address to write
- - COMMIT_STAGE
- - logic[11:0]
-
- * - ``csr_commit_i``
- - in
- - CSR commit
- - COMMIT_STAGE
- - logic
-
- * - ``mult_valid_i``
- - in
- - MULT instruction is valid
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``lsu_ready_o``
- - out
- - LSU is ready
- - ISSUE_STAGE
- - logic
-
- * - ``lsu_valid_i``
- - in
- - LSU instruction is valid
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``load_valid_o``
- - out
- - Load result is valid
- - ISSUE_STAGE
- - logic
-
- * - ``load_result_o``
- - out
- - Load result valid
- - ISSUE_STAGE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``load_trans_id_o``
- - out
- - Load instruction ID
- - ISSUE_STAGE
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``load_exception_o``
- - out
- - Exception generated by load instruction
- - ISSUE_STAGE
- - exception_t
-
- * - ``store_valid_o``
- - out
- - Store result is valid
- - ISSUe_STAGE
- - logic
-
- * - ``store_result_o``
- - out
- - Store result
- - ISSUE_STAGE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``store_trans_id_o``
- - out
- - Store instruction ID
- - ISSUE_STAGE
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``store_exception_o``
- - out
- - Exception generated by store instruction
- - ISSUE_STAGE
- - exception_t
-
- * - ``lsu_commit_i``
- - in
- - LSU commit
- - COMMIT_STAGE
- - logic
-
- * - ``lsu_commit_ready_o``
- - out
- - Commit queue ready to accept another commit request
- - COMMIT_STAGE
- - logic
-
- * - ``commit_tran_id_i``
- - in
- - Commit transaction ID
- - COMMIT_STAGE
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``no_st_pending_o``
- - out
- - TO_BE_COMPLETED
- - COMMIT_STAGE
- - logic
-
- * - ``alu2_valid_i``
- - in
- - ALU2 instruction is valid
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``x_valid_i``
- - in
- - CVXIF instruction is valid
- - ISSUE_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``x_ready_o``
- - out
- - CVXIF is ready
- - ISSUE_STAGE
- - logic
-
- * - ``x_off_instr_i``
- - in
- - undecoded instruction
- - ISSUE_STAGE
- - logic[31:0]
-
- * - ``x_trans_id_o``
- - out
- - CVXIF transaction ID
- - ISSUE_STAGE
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``x_exception_o``
- - out
- - CVXIF exception
- - ISSUE_STAGE
- - exception_t
-
- * - ``x_result_o``
- - out
- - CVXIF result
- - ISSUE_STAGE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``x_valid_o``
- - out
- - CVXIF result valid
- - ISSUE_STAGE
- - logic
-
- * - ``x_we_o``
- - out
- - CVXIF write enable
- - ISSUE_STAGE
- - logic
-
- * - ``cvxif_req_o``
- - out
- - CVXIF request
- - SUBSYSTEM
- - cvxif_pkg::cvxif_req_t
-
- * - ``cvxif_resp_i``
- - in
- - CVXIF response
- - SUBSYSTEM
- - cvxif_pkg::cvxif_resp_t
-
- * - ``icache_areq_i``
- - in
- - icache translation response
- - CACHE
- - icache_arsp_t
-
- * - ``icache_areq_o``
- - out
- - icache translation request
- - CACHE
- - icache_areq_t
-
- * - ``dcache_req_ports_i``
- - in
- - Data cache request ouput
- - CACHE
- - dcache_req_o_t[2:0]
-
- * - ``dcache_req_ports_o``
- - out
- - Data cache request input
- - CACHE
- - dcache_req_i_t[2:0]
-
- * - ``dcache_wbuffer_empty_i``
- - in
- - Write buffer is empty
- - CACHE
- - logic
-
- * - ``dcache_wbuffer_not_ni_i``
- - in
- - TO_BE_COMPLETED
- - CACHE
- - logic
-
- * - ``pmpcfg_i``
- - in
- - Report the PMP configuration
- - CSR_REGFILE
- - riscv::pmpcfg_t[CVA6Cfg.NrPMPEntries:0]
-
- * - ``pmpaddr_i``
- - in
- - Report the PMP addresses
- - CSR_REGFILE
- - logic[CVA6Cfg.NrPMPEntries:0][CVA6Cfg.PLEN-3:0]
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As DebugEn = False,
-| ``debug_mode_i`` input is tied to 0
-| As RVH = False,
-| ``tinst_i`` input is tied to 0
-| ``enable_g_translation_i`` input is tied to 0
-| ``en_ld_st_g_translation_i`` input is tied to 0
-| ``flush_tlb_vvma_i`` input is tied to 0
-| ``flush_tlb_gvma_i`` input is tied to 0
-| ``v_i`` input is tied to 0
-| ``ld_st_v_i`` input is tied to 0
-| ``csr_hs_ld_st_inst_o`` output is tied to 0
-| ``vs_sum_i`` input is tied to 0
-| ``vmxr_i`` input is tied to 0
-| ``vsatp_ppn_i`` input is tied to 0
-| ``vs_asid_i`` input is tied to 0
-| ``hgatp_ppn_i`` input is tied to 0
-| ``vmid_i`` input is tied to 0
-| As EnableAccelerator = 0,
-| ``stall_st_pending_i`` input is tied to 0
-| ``acc_valid_i`` input is tied to 0
-| As RVA = False,
-| ``amo_valid_commit_i`` input is tied to 0
-| ``amo_req_o`` output is tied to 0
-| ``amo_resp_i`` input is tied to 0
-| As RVF = 0,
-| ``fpu_ready_o`` output is tied to 0
-| ``fpu_valid_i`` input is tied to 0
-| ``fpu_fmt_i`` input is tied to 0
-| ``fpu_rm_i`` input is tied to 0
-| ``fpu_frm_i`` input is tied to 0
-| ``fpu_prec_i`` input is tied to 0
-| ``fpu_trans_id_o`` output is tied to 0
-| ``fpu_result_o`` output is tied to 0
-| ``fpu_valid_o`` output is tied to 0
-| ``fpu_exception_o`` output is tied to 0
-| As RVS = False,
-| ``enable_translation_i`` input is tied to 0
-| ``en_ld_st_translation_i`` input is tied to 0
-| ``sum_i`` input is tied to 0
-| ``mxr_i`` input is tied to 0
-| ``satp_ppn_i`` input is tied to 0
-| ``asid_i`` input is tied to 0
-| As MMUPresent = 0,
-| ``flush_tlb_i`` input is tied to 0
-| As PRIV = MachineOnly,
-| ``priv_lvl_i`` input is tied to MachineMode
-| ``ld_st_priv_lvl_i`` input is tied to MAchineMode
-| As PerfCounterEn = 0,
-| ``itlb_miss_o`` output is tied to 0
-| ``dtlb_miss_o`` output is tied to 0
-| As IsRVFI = 0,
-| ``rvfi_lsu_ctrl_o`` output is tied to 0
-| ``rvfi_mem_paddr_o`` output is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_frontend.adoc b/docs/04_cv32a65x/design/source/port_frontend.adoc
new file mode 100644
index 0000000000..2ee13da958
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_frontend.adoc
@@ -0,0 +1,59 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_frontend_ports]]
+
+.*frontend module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`boot_addr_i` | in | Next PC when reset | SUBSYSTEM | logic[CVA6Cfg.VLEN-1:0]
+
+|`flush_i` | in | Flush requested by FENCE, mis-predict and exception | CONTROLLER | logic
+
+|`halt_i` | in | Halt requested by WFI and Accelerate port | CONTROLLER | logic
+
+|`set_pc_commit_i` | in | Set COMMIT PC as next PC requested by FENCE, CSR side-effect and Accelerate port | CONTROLLER | logic
+
+|`pc_commit_i` | in | COMMIT PC | COMMIT | logic[CVA6Cfg.VLEN-1:0]
+
+|`ex_valid_i` | in | Exception event | COMMIT | logic
+
+|`resolved_branch_i` | in | Mispredict event and next PC | EXECUTE | bp_resolve_t
+
+|`eret_i` | in | Return from exception event | CSR | logic
+
+|`epc_i` | in | Next PC when returning from exception | CSR | logic[CVA6Cfg.VLEN-1:0]
+
+|`trap_vector_base_i` | in | Next PC when jumping into exception | CSR | logic[CVA6Cfg.VLEN-1:0]
+
+|`icache_dreq_o` | out | Handshake between CACHE and FRONTEND (fetch) | CACHES | icache_dreq_t
+
+|`icache_dreq_i` | in | Handshake between CACHE and FRONTEND (fetch) | CACHES | icache_drsp_t
+
+|`fetch_entry_o` | out | Handshake's data between fetch and decode | ID_STAGE | fetch_entry_t[CVA6Cfg.NrIssuePorts-1:0]
+
+|`fetch_entry_valid_o` | out | Handshake's valid between fetch and decode | ID_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`fetch_entry_ready_i` | in | Handshake's ready between fetch and decode | ID_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+For any HW configuration,::
+* `flush_bp_i` input is tied to 0
+As DebugEn = False,::
+* `set_debug_pc_i` input is tied to 0
+* `debug_mode_i` input is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_frontend.rst b/docs/04_cv32a65x/design/source/port_frontend.rst
deleted file mode 100644
index 2f715e294d..0000000000
--- a/docs/04_cv32a65x/design/source/port_frontend.rst
+++ /dev/null
@@ -1,130 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_frontend_ports:
-
-.. list-table:: **frontend module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``boot_addr_i``
- - in
- - Next PC when reset
- - SUBSYSTEM
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``flush_i``
- - in
- - Flush requested by FENCE, mis-predict and exception
- - CONTROLLER
- - logic
-
- * - ``halt_i``
- - in
- - Halt requested by WFI and Accelerate port
- - CONTROLLER
- - logic
-
- * - ``set_pc_commit_i``
- - in
- - Set COMMIT PC as next PC requested by FENCE, CSR side-effect and Accelerate port
- - CONTROLLER
- - logic
-
- * - ``pc_commit_i``
- - in
- - COMMIT PC
- - COMMIT
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``ex_valid_i``
- - in
- - Exception event
- - COMMIT
- - logic
-
- * - ``resolved_branch_i``
- - in
- - Mispredict event and next PC
- - EXECUTE
- - bp_resolve_t
-
- * - ``eret_i``
- - in
- - Return from exception event
- - CSR
- - logic
-
- * - ``epc_i``
- - in
- - Next PC when returning from exception
- - CSR
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``trap_vector_base_i``
- - in
- - Next PC when jumping into exception
- - CSR
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``icache_dreq_o``
- - out
- - Handshake between CACHE and FRONTEND (fetch)
- - CACHES
- - icache_dreq_t
-
- * - ``icache_dreq_i``
- - in
- - Handshake between CACHE and FRONTEND (fetch)
- - CACHES
- - icache_drsp_t
-
- * - ``fetch_entry_o``
- - out
- - Handshake's data between fetch and decode
- - ID_STAGE
- - fetch_entry_t[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``fetch_entry_valid_o``
- - out
- - Handshake's valid between fetch and decode
- - ID_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``fetch_entry_ready_i``
- - in
- - Handshake's ready between fetch and decode
- - ID_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| For any HW configuration,
-| ``flush_bp_i`` input is tied to 0
-| As DebugEn = False,
-| ``set_debug_pc_i`` input is tied to 0
-| ``debug_mode_i`` input is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_id_stage.adoc b/docs/04_cv32a65x/design/source/port_id_stage.adoc
new file mode 100644
index 0000000000..82538a3b41
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_id_stage.adoc
@@ -0,0 +1,76 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_id_stage_ports]]
+
+.*id_stage module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`flush_i` | in | Fetch flush request | CONTROLLER | logic
+
+|`fetch_entry_i` | in | Handshake's data between fetch and decode | FRONTEND | fetch_entry_t[CVA6Cfg.NrIssuePorts-1:0]
+
+|`fetch_entry_valid_i` | in | Handshake's valid between fetch and decode | FRONTEND | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`fetch_entry_ready_o` | out | Handshake's ready between fetch and decode | FRONTEND | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`issue_entry_o` | out | Handshake's data between decode and issue | ISSUE | scoreboard_entry_t[CVA6Cfg.NrIssuePorts-1:0]
+
+|`orig_instr_o` | out | Instruction value | ISSUE | logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
+
+|`issue_entry_valid_o` | out | Handshake's valid between decode and issue | ISSUE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`is_ctrl_flow_o` | out | Report if instruction is a control flow instruction | ISSUE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`issue_instr_ack_i` | in | Handshake's acknowlege between decode and issue | ISSUE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`irq_i` | in | Level sensitive (async) interrupts | SUBSYSTEM | logic[1:0]
+
+|`irq_ctrl_i` | in | Interrupt control status | CSR_REGFILE | irq_ctrl_t
+
+|`hart_id_i` | in | none | none | logic[CVA6Cfg.XLEN-1:0]
+
+|`compressed_ready_i` | in | none | none | logic
+
+|`compressed_resp_i` | in | none | none | x_compressed_resp_t
+
+|`compressed_valid_o` | out | none | none | logic
+
+|`compressed_req_o` | out | none | none | x_compressed_req_t
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As DebugEn = False,::
+* `debug_req_i` input is tied to 0
+* `debug_mode_i` input is tied to 0
+As IsRVFI = 0,::
+* `rvfi_is_compressed_o` output is tied to 0
+As PRIV = MachineOnly,::
+* `priv_lvl_i` input is tied to MachineMode
+* `tvm_i` input is tied to 0
+* `tw_i` input is tied to 0
+* `tsr_i` input is tied to 0
+As RVH = False,::
+* `v_i` input is tied to 0
+* `vfs_i` input is tied to 0
+* `vtw_i` input is tied to 0
+* `hu_i` input is tied to 0
+As RVF = 0,::
+* `fs_i` input is tied to 0
+* `frm_i` input is tied to 0
+As RVV = False,::
+* `vs_i` input is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_id_stage.rst b/docs/04_cv32a65x/design/source/port_id_stage.rst
deleted file mode 100644
index f7a4b0c799..0000000000
--- a/docs/04_cv32a65x/design/source/port_id_stage.rst
+++ /dev/null
@@ -1,121 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_id_stage_ports:
-
-.. list-table:: **id_stage module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``flush_i``
- - in
- - Fetch flush request
- - CONTROLLER
- - logic
-
- * - ``fetch_entry_i``
- - in
- - Handshake's data between fetch and decode
- - FRONTEND
- - fetch_entry_t[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``fetch_entry_valid_i``
- - in
- - Handshake's valid between fetch and decode
- - FRONTEND
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``fetch_entry_ready_o``
- - out
- - Handshake's ready between fetch and decode
- - FRONTEND
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``issue_entry_o``
- - out
- - Handshake's data between decode and issue
- - ISSUE
- - scoreboard_entry_t[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``orig_instr_o``
- - out
- - Instruction value
- - ISSUE
- - logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
-
- * - ``issue_entry_valid_o``
- - out
- - Handshake's valid between decode and issue
- - ISSUE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``is_ctrl_flow_o``
- - out
- - Report if instruction is a control flow instruction
- - ISSUE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``issue_instr_ack_i``
- - in
- - Handshake's acknowlege between decode and issue
- - ISSUE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``irq_i``
- - in
- - Level sensitive (async) interrupts
- - SUBSYSTEM
- - logic[1:0]
-
- * - ``irq_ctrl_i``
- - in
- - Interrupt control status
- - CSR_REGFILE
- - irq_ctrl_t
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As DebugEn = False,
-| ``debug_req_i`` input is tied to 0
-| ``debug_mode_i`` input is tied to 0
-| As IsRVFI = 0,
-| ``rvfi_is_compressed_o`` output is tied to 0
-| As PRIV = MachineOnly,
-| ``priv_lvl_i`` input is tied to MachineMode
-| ``tvm_i`` input is tied to 0
-| ``tw_i`` input is tied to 0
-| ``tsr_i`` input is tied to 0
-| As RVH = False,
-| ``v_i`` input is tied to 0
-| ``vfs_i`` input is tied to 0
-| ``vtw_i`` input is tied to 0
-| ``hu_i`` input is tied to 0
-| As RVF = 0,
-| ``fs_i`` input is tied to 0
-| ``frm_i`` input is tied to 0
-| As RVV = False,
-| ``vs_i`` input is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_instr_queue.adoc b/docs/04_cv32a65x/design/source/port_instr_queue.adoc
new file mode 100644
index 0000000000..7c796313f4
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_instr_queue.adoc
@@ -0,0 +1,58 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_instr_queue_ports]]
+
+.*instr_queue module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`flush_i` | in | Fetch flush request | CONTROLLER | logic
+
+|`instr_i` | in | Instruction | instr_realign | logic[CVA6Cfg.INSTR_PER_FETCH-1:0][31:0]
+
+|`addr_i` | in | Instruction address | instr_realign | logic[CVA6Cfg.INSTR_PER_FETCH-1:0][CVA6Cfg.VLEN-1:0]
+
+|`valid_i` | in | Instruction is valid | instr_realign | logic[CVA6Cfg.INSTR_PER_FETCH-1:0]
+
+|`ready_o` | out | Handshake’s ready with CACHE | CACHE | logic
+
+|`consumed_o` | out | Indicates instructions consummed, or popped by ID_STAGE | FRONTEND | logic[CVA6Cfg.INSTR_PER_FETCH-1:0]
+
+|`exception_i` | in | Exception (which is page-table fault) | CACHE | ariane_pkg::frontend_exception_t
+
+|`exception_addr_i` | in | Exception address | CACHE | logic[CVA6Cfg.VLEN-1:0]
+
+|`predict_address_i` | in | Branch predict | FRONTEND | logic[CVA6Cfg.VLEN-1:0]
+
+|`cf_type_i` | in | Instruction predict address | FRONTEND | ariane_pkg::cf_t[CVA6Cfg.INSTR_PER_FETCH-1:0]
+
+|`replay_o` | out | Replay instruction because one of the FIFO was full | FRONTEND | logic
+
+|`replay_addr_o` | out | Address at which to replay the fetch | FRONTEND | logic[CVA6Cfg.VLEN-1:0]
+
+|`fetch_entry_o` | out | Handshake’s data with ID_STAGE | ID_STAGE | fetch_entry_t[CVA6Cfg.NrIssuePorts-1:0]
+
+|`fetch_entry_valid_o` | out | Handshake’s valid with ID_STAGE | ID_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`fetch_entry_ready_i` | in | Handshake’s ready with ID_STAGE | ID_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As RVH = False,::
+* `exception_gpaddr_i` input is tied to 0
+* `exception_tinst_i` input is tied to 0
+* `exception_gva_i` input is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_instr_queue.rst b/docs/04_cv32a65x/design/source/port_instr_queue.rst
deleted file mode 100644
index 5217fcd227..0000000000
--- a/docs/04_cv32a65x/design/source/port_instr_queue.rst
+++ /dev/null
@@ -1,129 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_instr_queue_ports:
-
-.. list-table:: **instr_queue module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``flush_i``
- - in
- - Fetch flush request
- - CONTROLLER
- - logic
-
- * - ``instr_i``
- - in
- - Instruction
- - instr_realign
- - logic[CVA6Cfg.INSTR_PER_FETCH-1:0][31:0]
-
- * - ``addr_i``
- - in
- - Instruction address
- - instr_realign
- - logic[CVA6Cfg.INSTR_PER_FETCH-1:0][CVA6Cfg.VLEN-1:0]
-
- * - ``valid_i``
- - in
- - Instruction is valid
- - instr_realign
- - logic[CVA6Cfg.INSTR_PER_FETCH-1:0]
-
- * - ``ready_o``
- - out
- - Handshake’s ready with CACHE
- - CACHE
- - logic
-
- * - ``consumed_o``
- - out
- - Indicates instructions consummed, or popped by ID_STAGE
- - FRONTEND
- - logic[CVA6Cfg.INSTR_PER_FETCH-1:0]
-
- * - ``exception_i``
- - in
- - Exception (which is page-table fault)
- - CACHE
- - ariane_pkg::frontend_exception_t
-
- * - ``exception_addr_i``
- - in
- - Exception address
- - CACHE
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``predict_address_i``
- - in
- - Branch predict
- - FRONTEND
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``cf_type_i``
- - in
- - Instruction predict address
- - FRONTEND
- - ariane_pkg::cf_t[CVA6Cfg.INSTR_PER_FETCH-1:0]
-
- * - ``replay_o``
- - out
- - Replay instruction because one of the FIFO was full
- - FRONTEND
- - logic
-
- * - ``replay_addr_o``
- - out
- - Address at which to replay the fetch
- - FRONTEND
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``fetch_entry_o``
- - out
- - Handshake’s data with ID_STAGE
- - ID_STAGE
- - fetch_entry_t[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``fetch_entry_valid_o``
- - out
- - Handshake’s valid with ID_STAGE
- - ID_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``fetch_entry_ready_i``
- - in
- - Handshake’s ready with ID_STAGE
- - ID_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As RVH = False,
-| ``exception_gpaddr_i`` input is tied to 0
-| ``exception_tinst_i`` input is tied to 0
-| ``exception_gva_i`` input is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_instr_realign.adoc b/docs/04_cv32a65x/design/source/port_instr_realign.adoc
new file mode 100644
index 0000000000..1e51e1afc5
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_instr_realign.adoc
@@ -0,0 +1,38 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_instr_realign_ports]]
+
+.*instr_realign module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`flush_i` | in | Fetch flush request | CONTROLLER | logic
+
+|`valid_i` | in | 32-bit block is valid | CACHE | logic
+
+|`serving_unaligned_o` | out | Instruction is unaligned | FRONTEND | logic
+
+|`address_i` | in | 32-bit block address | CACHE | logic[CVA6Cfg.VLEN-1:0]
+
+|`data_i` | in | 32-bit block | CACHE | logic[CVA6Cfg.FETCH_WIDTH-1:0]
+
+|`valid_o` | out | instruction is valid | FRONTEND | logic[CVA6Cfg.INSTR_PER_FETCH-1:0]
+
+|`addr_o` | out | Instruction address | FRONTEND | logic[CVA6Cfg.INSTR_PER_FETCH-1:0][CVA6Cfg.VLEN-1:0]
+
+|`instr_o` | out | Instruction | instr_scan&instr_queue | logic[CVA6Cfg.INSTR_PER_FETCH-1:0][31:0]
+
+|===
+
diff --git a/docs/04_cv32a65x/design/source/port_instr_realign.rst b/docs/04_cv32a65x/design/source/port_instr_realign.rst
deleted file mode 100644
index fef98d99e6..0000000000
--- a/docs/04_cv32a65x/design/source/port_instr_realign.rst
+++ /dev/null
@@ -1,81 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_instr_realign_ports:
-
-.. list-table:: **instr_realign module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``flush_i``
- - in
- - Fetch flush request
- - CONTROLLER
- - logic
-
- * - ``valid_i``
- - in
- - 32-bit block is valid
- - CACHE
- - logic
-
- * - ``serving_unaligned_o``
- - out
- - Instruction is unaligned
- - FRONTEND
- - logic
-
- * - ``address_i``
- - in
- - 32-bit block address
- - CACHE
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``data_i``
- - in
- - 32-bit block
- - CACHE
- - logic[CVA6Cfg.FETCH_WIDTH-1:0]
-
- * - ``valid_o``
- - out
- - instruction is valid
- - FRONTEND
- - logic[CVA6Cfg.INSTR_PER_FETCH-1:0]
-
- * - ``addr_o``
- - out
- - Instruction address
- - FRONTEND
- - logic[CVA6Cfg.INSTR_PER_FETCH-1:0][CVA6Cfg.VLEN-1:0]
-
- * - ``instr_o``
- - out
- - Instruction
- - instr_scan&instr_queue
- - logic[CVA6Cfg.INSTR_PER_FETCH-1:0][31:0]
-
-
diff --git a/docs/04_cv32a65x/design/source/port_instr_scan.adoc b/docs/04_cv32a65x/design/source/port_instr_scan.adoc
new file mode 100644
index 0000000000..799791820f
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_instr_scan.adoc
@@ -0,0 +1,46 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_instr_scan_ports]]
+
+.*instr_scan module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`instr_i` | in | Instruction to be predecoded | instr_realign | logic[31:0]
+
+|`rvi_return_o` | out | Return instruction | FRONTEND | logic
+
+|`rvi_call_o` | out | JAL instruction | FRONTEND | logic
+
+|`rvi_branch_o` | out | Branch instruction | FRONTEND | logic
+
+|`rvi_jalr_o` | out | JALR instruction | FRONTEND | logic
+
+|`rvi_jump_o` | out | Unconditional jump instruction | FRONTEND | logic
+
+|`rvi_imm_o` | out | Instruction immediat | FRONTEND | logic[CVA6Cfg.VLEN-1:0]
+
+|`rvc_branch_o` | out | Branch compressed instruction | FRONTEND | logic
+
+|`rvc_jump_o` | out | Unconditional jump compressed instruction | FRONTEND | logic
+
+|`rvc_jr_o` | out | JR compressed instruction | FRONTEND | logic
+
+|`rvc_return_o` | out | Return compressed instruction | FRONTEND | logic
+
+|`rvc_jalr_o` | out | JALR compressed instruction | FRONTEND | logic
+
+|`rvc_call_o` | out | JAL compressed instruction | FRONTEND | logic
+
+|`rvc_imm_o` | out | Instruction compressed immediat | FRONTEND | logic[CVA6Cfg.VLEN-1:0]
+
+|===
+
diff --git a/docs/04_cv32a65x/design/source/port_instr_scan.rst b/docs/04_cv32a65x/design/source/port_instr_scan.rst
deleted file mode 100644
index dbc877777e..0000000000
--- a/docs/04_cv32a65x/design/source/port_instr_scan.rst
+++ /dev/null
@@ -1,105 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_instr_scan_ports:
-
-.. list-table:: **instr_scan module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``instr_i``
- - in
- - Instruction to be predecoded
- - instr_realign
- - logic[31:0]
-
- * - ``rvi_return_o``
- - out
- - Return instruction
- - FRONTEND
- - logic
-
- * - ``rvi_call_o``
- - out
- - JAL instruction
- - FRONTEND
- - logic
-
- * - ``rvi_branch_o``
- - out
- - Branch instruction
- - FRONTEND
- - logic
-
- * - ``rvi_jalr_o``
- - out
- - JALR instruction
- - FRONTEND
- - logic
-
- * - ``rvi_jump_o``
- - out
- - Unconditional jump instruction
- - FRONTEND
- - logic
-
- * - ``rvi_imm_o``
- - out
- - Instruction immediat
- - FRONTEND
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``rvc_branch_o``
- - out
- - Branch compressed instruction
- - FRONTEND
- - logic
-
- * - ``rvc_jump_o``
- - out
- - Unconditional jump compressed instruction
- - FRONTEND
- - logic
-
- * - ``rvc_jr_o``
- - out
- - JR compressed instruction
- - FRONTEND
- - logic
-
- * - ``rvc_return_o``
- - out
- - Return compressed instruction
- - FRONTEND
- - logic
-
- * - ``rvc_jalr_o``
- - out
- - JALR compressed instruction
- - FRONTEND
- - logic
-
- * - ``rvc_call_o``
- - out
- - JAL compressed instruction
- - FRONTEND
- - logic
-
- * - ``rvc_imm_o``
- - out
- - Instruction compressed immediat
- - FRONTEND
- - logic[CVA6Cfg.VLEN-1:0]
-
-
diff --git a/docs/04_cv32a65x/design/source/port_issue_read_operands.adoc b/docs/04_cv32a65x/design/source/port_issue_read_operands.adoc
new file mode 100644
index 0000000000..1311ff9c22
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_issue_read_operands.adoc
@@ -0,0 +1,136 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_issue_read_operands_ports]]
+
+.*issue_read_operands module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`flush_i` | in | Flush | CONTROLLER | logic
+
+|`issue_instr_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | scoreboard_entry_t[CVA6Cfg.NrIssuePorts-1:0]
+
+|`orig_instr_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
+
+|`issue_instr_valid_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`issue_ack_o` | out | Issue stage acknowledge | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`rs1_o` | out | rs1 operand address | scoreboard | logic[CVA6Cfg.NrIssuePorts-1:0][REG_ADDR_SIZE-1:0]
+
+|`rs1_i` | in | rs1 operand | scoreboard | logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
+
+|`rs1_valid_i` | in | rs1 operand is valid | scoreboard | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`rs2_o` | out | rs2 operand address | scoreboard | logic[CVA6Cfg.NrIssuePorts-1:0][REG_ADDR_SIZE-1:0]
+
+|`rs2_i` | in | rs2 operand | scoreboard | logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
+
+|`rs2_valid_i` | in | rs2 operand is valid | scoreboard | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`rs3_o` | out | rs3 operand address | scoreboard | logic[CVA6Cfg.NrIssuePorts-1:0][REG_ADDR_SIZE-1:0]
+
+|`rs3_i` | in | rs3 operand | scoreboard | rs3_len_t[CVA6Cfg.NrIssuePorts-1:0]
+
+|`rs3_valid_i` | in | rs3 operand is valid | scoreboard | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`rd_clobber_gpr_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | fu_t[2**REG_ADDR_SIZE-1:0]
+
+|`rd_clobber_fpr_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | fu_t[2**REG_ADDR_SIZE-1:0]
+
+|`fu_data_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | fu_data_t[CVA6Cfg.NrIssuePorts-1:0]
+
+|`rs1_forwarding_o` | out | Unregistered version of fu_data_o.operanda | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
+
+|`rs2_forwarding_o` | out | Unregistered version of fu_data_o.operandb | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
+
+|`pc_o` | out | Instruction pc | TO_BE_COMPLETED | logic[CVA6Cfg.VLEN-1:0]
+
+|`is_compressed_instr_o` | out | Is compressed instruction | TO_BE_COMPLETED | logic
+
+|`flu_ready_i` | in | Fixed Latency Unit ready to accept new request | TO_BE_COMPLETED | logic
+
+|`alu_valid_o` | out | ALU output is valid | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`branch_valid_o` | out | Branch instruction is valid | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`branch_predict_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | branchpredict_sbe_t
+
+|`lsu_ready_i` | in | Load Store Unit is ready | TO_BE_COMPLETED | logic
+
+|`lsu_valid_o` | out | Load Store Unit result is valid | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`mult_valid_o` | out | Mult result is valid | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`alu2_valid_o` | out | ALU output is valid | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`csr_valid_o` | out | CSR result is valid | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`cvxif_valid_o` | out | CVXIF result is valid | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`cvxif_ready_i` | in | CVXIF is ready | TO_BE_COMPLETED | logic
+
+|`cvxif_off_instr_o` | out | CVXIF offloaded instruction | TO_BE_COMPLETED | logic[31:0]
+
+|`hart_id_i` | in | CVA6 Hart ID | SUBSYSTEM | logic[CVA6Cfg.XLEN-1:0]
+
+|`x_issue_ready_i` | in | none | none | logic
+
+|`x_issue_resp_i` | in | none | none | x_issue_resp_t
+
+|`x_issue_valid_o` | out | none | none | logic
+
+|`x_issue_req_o` | out | none | none | x_issue_req_t
+
+|`x_register_ready_i` | in | none | none | logic
+
+|`x_register_valid_o` | out | none | none | logic
+
+|`x_register_o` | out | none | none | x_register_t
+
+|`x_commit_valid_o` | out | none | none | logic
+
+|`x_commit_o` | out | none | none | x_commit_t
+
+|`x_transaction_accepted_o` | out | none | none | logic
+
+|`x_transaction_rejected_o` | out | none | none | logic
+
+|`x_issue_writeback_o` | out | none | none | logic
+
+|`x_id_o` | out | none | none | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`waddr_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic[CVA6Cfg.NrCommitPorts-1:0][4:0]
+
+|`wdata_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic[CVA6Cfg.NrCommitPorts-1:0][CVA6Cfg.XLEN-1:0]
+
+|`we_gpr_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic[CVA6Cfg.NrCommitPorts-1:0]
+
+|`stall_issue_o` | out | Stall signal, we do not want to fetch any more entries | TO_BE_COMPLETED | logic
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As EnableAccelerator = 0,::
+* `stall_i` input is tied to 0
+As RVH = False,::
+* `tinst_o` output is tied to 0
+As RVF = 0,::
+* `fpu_ready_i` input is tied to 0
+* `fpu_valid_o` output is tied to 0
+* `fpu_fmt_o` output is tied to 0
+* `fpu_rm_o` output is tied to 0
+* `we_fpr_i` input is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_issue_read_operands.rst b/docs/04_cv32a65x/design/source/port_issue_read_operands.rst
deleted file mode 100644
index 946bdf1b8d..0000000000
--- a/docs/04_cv32a65x/design/source/port_issue_read_operands.rst
+++ /dev/null
@@ -1,267 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_issue_read_operands_ports:
-
-.. list-table:: **issue_read_operands module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``flush_i``
- - in
- - Flush
- - CONTROLLER
- - logic
-
- * - ``issue_instr_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - scoreboard_entry_t[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``orig_instr_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
-
- * - ``issue_instr_valid_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``issue_ack_o``
- - out
- - Issue stage acknowledge
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``rs1_o``
- - out
- - rs1 operand address
- - scoreboard
- - logic[CVA6Cfg.NrIssuePorts-1:0][REG_ADDR_SIZE-1:0]
-
- * - ``rs1_i``
- - in
- - rs1 operand
- - scoreboard
- - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
-
- * - ``rs1_valid_i``
- - in
- - rs1 operand is valid
- - scoreboard
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``rs2_o``
- - out
- - rs2 operand address
- - scoreboard
- - logic[CVA6Cfg.NrIssuePorts-1:0][REG_ADDR_SIZE-1:0]
-
- * - ``rs2_i``
- - in
- - rs2 operand
- - scoreboard
- - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
-
- * - ``rs2_valid_i``
- - in
- - rs2 operand is valid
- - scoreboard
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``rs3_o``
- - out
- - rs3 operand address
- - scoreboard
- - logic[CVA6Cfg.NrIssuePorts-1:0][REG_ADDR_SIZE-1:0]
-
- * - ``rs3_i``
- - in
- - rs3 operand
- - scoreboard
- - rs3_len_t[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``rs3_valid_i``
- - in
- - rs3 operand is valid
- - scoreboard
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``rd_clobber_gpr_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - fu_t[2**REG_ADDR_SIZE-1:0]
-
- * - ``rd_clobber_fpr_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - fu_t[2**REG_ADDR_SIZE-1:0]
-
- * - ``fu_data_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - fu_data_t[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``rs1_forwarding_o``
- - out
- - Unregistered version of fu_data_o.operanda
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
-
- * - ``rs2_forwarding_o``
- - out
- - Unregistered version of fu_data_o.operandb
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
-
- * - ``pc_o``
- - out
- - Instruction pc
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``is_compressed_instr_o``
- - out
- - Is compressed instruction
- - TO_BE_COMPLETED
- - logic
-
- * - ``flu_ready_i``
- - in
- - Fixed Latency Unit ready to accept new request
- - TO_BE_COMPLETED
- - logic
-
- * - ``alu_valid_o``
- - out
- - ALU output is valid
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``branch_valid_o``
- - out
- - Branch instruction is valid
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``branch_predict_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - branchpredict_sbe_t
-
- * - ``lsu_ready_i``
- - in
- - Load Store Unit is ready
- - TO_BE_COMPLETED
- - logic
-
- * - ``lsu_valid_o``
- - out
- - Load Store Unit result is valid
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``mult_valid_o``
- - out
- - Mult result is valid
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``alu2_valid_o``
- - out
- - ALU output is valid
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``csr_valid_o``
- - out
- - CSR result is valid
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``cvxif_valid_o``
- - out
- - CVXIF result is valid
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``cvxif_ready_i``
- - in
- - CVXIF is ready
- - TO_BE_COMPLETED
- - logic
-
- * - ``cvxif_off_instr_o``
- - out
- - CVXIF offloaded instruction
- - TO_BE_COMPLETED
- - logic[31:0]
-
- * - ``waddr_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrCommitPorts-1:0][4:0]
-
- * - ``wdata_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrCommitPorts-1:0][CVA6Cfg.XLEN-1:0]
-
- * - ``we_gpr_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``stall_issue_o``
- - out
- - Stall signal, we do not want to fetch any more entries
- - TO_BE_COMPLETED
- - logic
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As EnableAccelerator = 0,
-| ``stall_i`` input is tied to 0
-| As RVH = False,
-| ``tinst_o`` output is tied to 0
-| As RVF = 0,
-| ``fpu_ready_i`` input is tied to 0
-| ``fpu_valid_o`` output is tied to 0
-| ``fpu_fmt_o`` output is tied to 0
-| ``fpu_rm_o`` output is tied to 0
-| ``we_fpr_i`` input is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_issue_stage.adoc b/docs/04_cv32a65x/design/source/port_issue_stage.adoc
new file mode 100644
index 0000000000..fcb044082b
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_issue_stage.adoc
@@ -0,0 +1,140 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_issue_stage_ports]]
+
+.*issue_stage module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`flush_unissued_instr_i` | in | TO_BE_COMPLETED | CONTROLLER | logic
+
+|`flush_i` | in | TO_BE_COMPLETED | CONTROLLER | logic
+
+|`decoded_instr_i` | in | Handshake's data with decode stage | ID_STAGE | scoreboard_entry_t[CVA6Cfg.NrIssuePorts-1:0]
+
+|`orig_instr_i` | in | instruction value | ID_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
+
+|`decoded_instr_valid_i` | in | Handshake's valid with decode stage | ID_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`is_ctrl_flow_i` | in | Is instruction a control flow instruction | ID_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`decoded_instr_ack_o` | out | Handshake's acknowlege with decode stage | ID_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`rs1_forwarding_o` | out | rs1 forwarding | EX_STAGE | [CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0]
+
+|`rs2_forwarding_o` | out | rs2 forwarding | EX_STAGE | [CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0]
+
+|`fu_data_o` | out | FU data useful to execute instruction | EX_STAGE | fu_data_t[CVA6Cfg.NrIssuePorts-1:0]
+
+|`pc_o` | out | Program Counter | EX_STAGE | logic[CVA6Cfg.VLEN-1:0]
+
+|`is_compressed_instr_o` | out | Is compressed instruction | EX_STAGE | logic
+
+|`flu_ready_i` | in | Fixed Latency Unit is ready | EX_STAGE | logic
+
+|`alu_valid_o` | out | ALU FU is valid | EX_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`resolve_branch_i` | in | Signaling that we resolved the branch | EX_STAGE | logic
+
+|`lsu_ready_i` | in | Load store unit FU is ready | EX_STAGE | logic
+
+|`lsu_valid_o` | out | Load store unit FU is valid | EX_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`branch_valid_o` | out | Branch unit is valid | EX_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`branch_predict_o` | out | Information of branch prediction | EX_STAGE | branchpredict_sbe_t
+
+|`mult_valid_o` | out | Mult FU is valid | EX_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`alu2_valid_o` | out | ALU2 FU is valid | EX_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`csr_valid_o` | out | CSR is valid | EX_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`xfu_valid_o` | out | CVXIF FU is valid | EX_STAGE | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`xfu_ready_i` | in | CVXIF is FU ready | EX_STAGE | logic
+
+|`x_off_instr_o` | out | CVXIF offloader instruction value | EX_STAGE | logic[31:0]
+
+|`hart_id_i` | in | CVA6 Hart ID | SUBSYSTEM | logic[CVA6Cfg.XLEN-1:0]
+
+|`x_issue_ready_i` | in | none | none | logic
+
+|`x_issue_resp_i` | in | none | none | x_issue_resp_t
+
+|`x_issue_valid_o` | out | none | none | logic
+
+|`x_issue_req_o` | out | none | none | x_issue_req_t
+
+|`x_register_ready_i` | in | none | none | logic
+
+|`x_register_valid_o` | out | none | none | logic
+
+|`x_register_o` | out | none | none | x_register_t
+
+|`x_commit_valid_o` | out | none | none | logic
+
+|`x_commit_o` | out | none | none | x_commit_t
+
+|`x_transaction_rejected_o` | out | CVXIF Transaction rejected -> instruction is illegal | EX_STAGE | logic
+
+|`trans_id_i` | in | Transaction ID | EX_STAGE | logic[CVA6Cfg.NrWbPorts-1:0][CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`resolved_branch_i` | in | The branch engine uses the write back from the ALU | EX_STAGE | bp_resolve_t
+
+|`wbdata_i` | in | TO_BE_COMPLETED | EX_STAGE | logic[CVA6Cfg.NrWbPorts-1:0][CVA6Cfg.XLEN-1:0]
+
+|`ex_ex_i` | in | exception from execute stage or CVXIF | EX_STAGE | exception_t[CVA6Cfg.NrWbPorts-1:0]
+
+|`wt_valid_i` | in | TO_BE_COMPLETED | EX_STAGE | logic[CVA6Cfg.NrWbPorts-1:0]
+
+|`x_we_i` | in | CVXIF write enable | EX_STAGE | logic
+
+|`x_rd_i` | in | CVXIF destination register | ISSUE_STAGE | logic[4:0]
+
+|`waddr_i` | in | TO_BE_COMPLETED | EX_STAGE | logic[CVA6Cfg.NrCommitPorts-1:0][4:0]
+
+|`wdata_i` | in | TO_BE_COMPLETED | EX_STAGE | logic[CVA6Cfg.NrCommitPorts-1:0][CVA6Cfg.XLEN-1:0]
+
+|`we_gpr_i` | in | GPR write enable | EX_STAGE | logic[CVA6Cfg.NrCommitPorts-1:0]
+
+|`commit_instr_o` | out | Instructions to commit | COMMIT_STAGE | scoreboard_entry_t[CVA6Cfg.NrCommitPorts-1:0]
+
+|`commit_drop_o` | out | Instruction is cancelled | COMMIT_STAGE | logic[CVA6Cfg.NrCommitPorts-1:0]
+
+|`commit_ack_i` | in | Commit acknowledge | COMMIT_STAGE | logic[CVA6Cfg.NrCommitPorts-1:0]
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As PerfCounterEn = 0,::
+* `sb_full_o` output is tied to 0
+* `stall_issue_o` output is tied to 0
+As EnableAccelerator = 0,::
+* `stall_i` input is tied to 0
+* `issue_instr_o` output is tied to 0
+* `issue_instr_hs_o` output is tied to 0
+As RVH = False,::
+* `tinst_o` output is tied to 0
+As RVF = 0,::
+* `fpu_ready_i` input is tied to 0
+* `fpu_valid_o` output is tied to 0
+* `fpu_fmt_o` output is tied to 0
+* `fpu_rm_o` output is tied to 0
+* `we_fpr_i` input is tied to 0
+As IsRVFI = 0,::
+* `rvfi_issue_pointer_o` output is tied to 0
+* `rvfi_commit_pointer_o` output is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_issue_stage.rst b/docs/04_cv32a65x/design/source/port_issue_stage.rst
deleted file mode 100644
index 7e5b9b27e2..0000000000
--- a/docs/04_cv32a65x/design/source/port_issue_stage.rst
+++ /dev/null
@@ -1,275 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_issue_stage_ports:
-
-.. list-table:: **issue_stage module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``flush_unissued_instr_i``
- - in
- - TO_BE_COMPLETED
- - CONTROLLER
- - logic
-
- * - ``flush_i``
- - in
- - TO_BE_COMPLETED
- - CONTROLLER
- - logic
-
- * - ``decoded_instr_i``
- - in
- - Handshake's data with decode stage
- - ID_STAGE
- - scoreboard_entry_t[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``orig_instr_i``
- - in
- - instruction value
- - ID_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
-
- * - ``decoded_instr_valid_i``
- - in
- - Handshake's valid with decode stage
- - ID_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``is_ctrl_flow_i``
- - in
- - Is instruction a control flow instruction
- - ID_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``decoded_instr_ack_o``
- - out
- - Handshake's acknowlege with decode stage
- - ID_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``rs1_forwarding_o``
- - out
- - rs1 forwarding
- - EX_STAGE
- - [CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0]
-
- * - ``rs2_forwarding_o``
- - out
- - rs2 forwarding
- - EX_STAGE
- - [CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.VLEN-1:0]
-
- * - ``fu_data_o``
- - out
- - FU data useful to execute instruction
- - EX_STAGE
- - fu_data_t[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``pc_o``
- - out
- - Program Counter
- - EX_STAGE
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``is_compressed_instr_o``
- - out
- - Is compressed instruction
- - EX_STAGE
- - logic
-
- * - ``flu_ready_i``
- - in
- - Fixed Latency Unit is ready
- - EX_STAGE
- - logic
-
- * - ``alu_valid_o``
- - out
- - ALU FU is valid
- - EX_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``resolve_branch_i``
- - in
- - Signaling that we resolved the branch
- - EX_STAGE
- - logic
-
- * - ``lsu_ready_i``
- - in
- - Load store unit FU is ready
- - EX_STAGE
- - logic
-
- * - ``lsu_valid_o``
- - out
- - Load store unit FU is valid
- - EX_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``branch_valid_o``
- - out
- - Branch unit is valid
- - EX_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``branch_predict_o``
- - out
- - Information of branch prediction
- - EX_STAGE
- - branchpredict_sbe_t
-
- * - ``mult_valid_o``
- - out
- - Mult FU is valid
- - EX_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``alu2_valid_o``
- - out
- - ALU2 FU is valid
- - EX_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``csr_valid_o``
- - out
- - CSR is valid
- - EX_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``x_issue_valid_o``
- - out
- - CVXIF FU is valid
- - EX_STAGE
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``x_issue_ready_i``
- - in
- - CVXIF is FU ready
- - EX_STAGE
- - logic
-
- * - ``x_off_instr_o``
- - out
- - CVXIF offloader instruction value
- - EX_STAGE
- - logic[31:0]
-
- * - ``trans_id_i``
- - in
- - Transaction ID
- - EX_STAGE
- - logic[CVA6Cfg.NrWbPorts-1:0][CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``resolved_branch_i``
- - in
- - The branch engine uses the write back from the ALU
- - EX_STAGE
- - bp_resolve_t
-
- * - ``wbdata_i``
- - in
- - TO_BE_COMPLETED
- - EX_STAGE
- - logic[CVA6Cfg.NrWbPorts-1:0][CVA6Cfg.XLEN-1:0]
-
- * - ``ex_ex_i``
- - in
- - exception from execute stage or CVXIF
- - EX_STAGE
- - exception_t[CVA6Cfg.NrWbPorts-1:0]
-
- * - ``wt_valid_i``
- - in
- - TO_BE_COMPLETED
- - EX_STAGE
- - logic[CVA6Cfg.NrWbPorts-1:0]
-
- * - ``x_we_i``
- - in
- - CVXIF write enable
- - EX_STAGE
- - logic
-
- * - ``waddr_i``
- - in
- - TO_BE_COMPLETED
- - EX_STAGE
- - logic[CVA6Cfg.NrCommitPorts-1:0][4:0]
-
- * - ``wdata_i``
- - in
- - TO_BE_COMPLETED
- - EX_STAGE
- - logic[CVA6Cfg.NrCommitPorts-1:0][CVA6Cfg.XLEN-1:0]
-
- * - ``we_gpr_i``
- - in
- - GPR write enable
- - EX_STAGE
- - logic[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``commit_instr_o``
- - out
- - Instructions to commit
- - COMMIT_STAGE
- - scoreboard_entry_t[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``commit_drop_o``
- - out
- - Instruction is cancelled
- - COMMIT_STAGE
- - logic[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``commit_ack_i``
- - in
- - Commit acknowledge
- - COMMIT_STAGE
- - logic[CVA6Cfg.NrCommitPorts-1:0]
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As PerfCounterEn = 0,
-| ``sb_full_o`` output is tied to 0
-| ``stall_issue_o`` output is tied to 0
-| As EnableAccelerator = 0,
-| ``stall_i`` input is tied to 0
-| ``issue_instr_o`` output is tied to 0
-| ``issue_instr_hs_o`` output is tied to 0
-| As RVH = False,
-| ``tinst_o`` output is tied to 0
-| As RVF = 0,
-| ``fpu_ready_i`` input is tied to 0
-| ``fpu_valid_o`` output is tied to 0
-| ``fpu_fmt_o`` output is tied to 0
-| ``fpu_rm_o`` output is tied to 0
-| ``we_fpr_i`` input is tied to 0
-| As IsRVFI = 0,
-| ``rvfi_issue_pointer_o`` output is tied to 0
-| ``rvfi_commit_pointer_o`` output is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_load_store_unit.adoc b/docs/04_cv32a65x/design/source/port_load_store_unit.adoc
new file mode 100644
index 0000000000..7fa01ad7a0
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_load_store_unit.adoc
@@ -0,0 +1,115 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_load_store_unit_ports]]
+
+.*load_store_unit module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`flush_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|`stall_st_pending_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|`no_st_pending_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|`fu_data_i` | in | FU data needed to execute instruction | ISSUE_STAGE | fu_data_t
+
+|`lsu_ready_o` | out | Load Store Unit is ready | ISSUE_STAGE | logic
+
+|`lsu_valid_i` | in | Load Store Unit instruction is valid | ISSUE_STAGE | logic
+
+|`load_trans_id_o` | out | Load transaction ID | ISSUE_STAGE | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`load_result_o` | out | Load result | ISSUE_STAGE | logic[CVA6Cfg.XLEN-1:0]
+
+|`load_valid_o` | out | Load result is valid | ISSUE_STAGE | logic
+
+|`load_exception_o` | out | Load exception | ISSUE_STAGE | exception_t
+
+|`store_trans_id_o` | out | Store transaction ID | ISSUE_STAGE | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`store_result_o` | out | Store result | ISSUE_STAGE | logic[CVA6Cfg.XLEN-1:0]
+
+|`store_valid_o` | out | Store result is valid | ISSUE_STAGE | logic
+
+|`store_exception_o` | out | Store exception | ISSUE_STAGE | exception_t
+
+|`commit_i` | in | Commit the first pending store | TO_BE_COMPLETED | logic
+
+|`commit_ready_o` | out | Commit queue is ready to accept another commit request | TO_BE_COMPLETED | logic
+
+|`commit_tran_id_i` | in | Commit transaction ID | TO_BE_COMPLETED | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`icache_areq_i` | in | Instruction cache input request | CACHES | icache_arsp_t
+
+|`icache_areq_o` | out | Instruction cache output request | CACHES | icache_areq_t
+
+|`dcache_req_ports_i` | in | Data cache request output | CACHES | dcache_req_o_t[2:0]
+
+|`dcache_req_ports_o` | out | Data cache request input | CACHES | dcache_req_i_t[2:0]
+
+|`dcache_wbuffer_empty_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|`dcache_wbuffer_not_ni_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|`pmpcfg_i` | in | PMP configuration | CSR_REGFILE | riscv::pmpcfg_t[CVA6Cfg.NrPMPEntries:0]
+
+|`pmpaddr_i` | in | PMP address | CSR_REGFILE | logic[CVA6Cfg.NrPMPEntries:0][CVA6Cfg.PLEN-3:0]
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As RVA = False,::
+* `amo_valid_commit_i` input is tied to 0
+* `amo_req_o` output is tied to 0
+* `amo_resp_i` input is tied to 0
+As RVH = False,::
+* `tinst_i` input is tied to 0
+* `enable_g_translation_i` input is tied to 0
+* `en_ld_st_g_translation_i` input is tied to 0
+* `v_i` input is tied to 0
+* `ld_st_v_i` input is tied to 0
+* `csr_hs_ld_st_inst_o` output is tied to 0
+* `vs_sum_i` input is tied to 0
+* `vmxr_i` input is tied to 0
+* `vsatp_ppn_i` input is tied to 0
+* `vs_asid_i` input is tied to 0
+* `hgatp_ppn_i` input is tied to 0
+* `vmid_i` input is tied to 0
+* `vmid_to_be_flushed_i` input is tied to 0
+* `gpaddr_to_be_flushed_i` input is tied to 0
+* `flush_tlb_vvma_i` input is tied to 0
+* `flush_tlb_gvma_i` input is tied to 0
+As RVS = False,::
+* `enable_translation_i` input is tied to 0
+* `en_ld_st_translation_i` input is tied to 0
+* `sum_i` input is tied to 0
+* `mxr_i` input is tied to 0
+* `satp_ppn_i` input is tied to 0
+* `asid_i` input is tied to 0
+* `asid_to_be_flushed_i` input is tied to 0
+* `vaddr_to_be_flushed_i` input is tied to 0
+As PRIV = MachineOnly,::
+* `priv_lvl_i` input is tied to MachineMode
+* `ld_st_priv_lvl_i` input is tied to MAchineMode
+As MMUPresent = 0,::
+* `flush_tlb_i` input is tied to 0
+As PerfCounterEn = 0,::
+* `itlb_miss_o` output is tied to 0
+* `dtlb_miss_o` output is tied to 0
+As IsRVFI = 0,::
+* `rvfi_lsu_ctrl_o` output is tied to 0
+* `rvfi_mem_paddr_o` output is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_load_store_unit.rst b/docs/04_cv32a65x/design/source/port_load_store_unit.rst
deleted file mode 100644
index 8f3c1fe798..0000000000
--- a/docs/04_cv32a65x/design/source/port_load_store_unit.rst
+++ /dev/null
@@ -1,226 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_load_store_unit_ports:
-
-.. list-table:: **load_store_unit module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``flush_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``stall_st_pending_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``no_st_pending_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``fu_data_i``
- - in
- - FU data needed to execute instruction
- - ISSUE_STAGE
- - fu_data_t
-
- * - ``lsu_ready_o``
- - out
- - Load Store Unit is ready
- - ISSUE_STAGE
- - logic
-
- * - ``lsu_valid_i``
- - in
- - Load Store Unit instruction is valid
- - ISSUE_STAGE
- - logic
-
- * - ``load_trans_id_o``
- - out
- - Load transaction ID
- - ISSUE_STAGE
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``load_result_o``
- - out
- - Load result
- - ISSUE_STAGE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``load_valid_o``
- - out
- - Load result is valid
- - ISSUE_STAGE
- - logic
-
- * - ``load_exception_o``
- - out
- - Load exception
- - ISSUE_STAGE
- - exception_t
-
- * - ``store_trans_id_o``
- - out
- - Store transaction ID
- - ISSUE_STAGE
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``store_result_o``
- - out
- - Store result
- - ISSUE_STAGE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``store_valid_o``
- - out
- - Store result is valid
- - ISSUE_STAGE
- - logic
-
- * - ``store_exception_o``
- - out
- - Store exception
- - ISSUE_STAGE
- - exception_t
-
- * - ``commit_i``
- - in
- - Commit the first pending store
- - TO_BE_COMPLETED
- - logic
-
- * - ``commit_ready_o``
- - out
- - Commit queue is ready to accept another commit request
- - TO_BE_COMPLETED
- - logic
-
- * - ``commit_tran_id_i``
- - in
- - Commit transaction ID
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``icache_areq_i``
- - in
- - Instruction cache input request
- - CACHES
- - icache_arsp_t
-
- * - ``icache_areq_o``
- - out
- - Instruction cache output request
- - CACHES
- - icache_areq_t
-
- * - ``dcache_req_ports_i``
- - in
- - Data cache request output
- - CACHES
- - dcache_req_o_t[2:0]
-
- * - ``dcache_req_ports_o``
- - out
- - Data cache request input
- - CACHES
- - dcache_req_i_t[2:0]
-
- * - ``dcache_wbuffer_empty_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``dcache_wbuffer_not_ni_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``pmpcfg_i``
- - in
- - PMP configuration
- - CSR_REGFILE
- - riscv::pmpcfg_t[CVA6Cfg.NrPMPEntries:0]
-
- * - ``pmpaddr_i``
- - in
- - PMP address
- - CSR_REGFILE
- - logic[CVA6Cfg.NrPMPEntries:0][CVA6Cfg.PLEN-3:0]
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As RVA = False,
-| ``amo_valid_commit_i`` input is tied to 0
-| ``amo_req_o`` output is tied to 0
-| ``amo_resp_i`` input is tied to 0
-| As RVH = False,
-| ``tinst_i`` input is tied to 0
-| ``enable_g_translation_i`` input is tied to 0
-| ``en_ld_st_g_translation_i`` input is tied to 0
-| ``v_i`` input is tied to 0
-| ``ld_st_v_i`` input is tied to 0
-| ``csr_hs_ld_st_inst_o`` output is tied to 0
-| ``vs_sum_i`` input is tied to 0
-| ``vmxr_i`` input is tied to 0
-| ``vsatp_ppn_i`` input is tied to 0
-| ``vs_asid_i`` input is tied to 0
-| ``hgatp_ppn_i`` input is tied to 0
-| ``vmid_i`` input is tied to 0
-| ``vmid_to_be_flushed_i`` input is tied to 0
-| ``gpaddr_to_be_flushed_i`` input is tied to 0
-| ``flush_tlb_vvma_i`` input is tied to 0
-| ``flush_tlb_gvma_i`` input is tied to 0
-| As RVS = False,
-| ``enable_translation_i`` input is tied to 0
-| ``en_ld_st_translation_i`` input is tied to 0
-| ``sum_i`` input is tied to 0
-| ``mxr_i`` input is tied to 0
-| ``satp_ppn_i`` input is tied to 0
-| ``asid_i`` input is tied to 0
-| ``asid_to_be_flushed_i`` input is tied to 0
-| ``vaddr_to_be_flushed_i`` input is tied to 0
-| As PRIV = MachineOnly,
-| ``priv_lvl_i`` input is tied to MachineMode
-| ``ld_st_priv_lvl_i`` input is tied to MAchineMode
-| As MMUPresent = 0,
-| ``flush_tlb_i`` input is tied to 0
-| As PerfCounterEn = 0,
-| ``itlb_miss_o`` output is tied to 0
-| ``dtlb_miss_o`` output is tied to 0
-| As IsRVFI = 0,
-| ``rvfi_lsu_ctrl_o`` output is tied to 0
-| ``rvfi_mem_paddr_o`` output is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_load_unit.adoc b/docs/04_cv32a65x/design/source/port_load_unit.adoc
new file mode 100644
index 0000000000..e594181d3e
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_load_unit.adoc
@@ -0,0 +1,70 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_load_unit_ports]]
+
+.*load_unit module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`flush_i` | in | Flush signal | CONTROLLER | logic
+
+|`valid_i` | in | Load request is valid | LSU_BYPASS | logic
+
+|`lsu_ctrl_i` | in | Load request input | LSU_BYPASS | lsu_ctrl_t
+
+|`pop_ld_o` | out | Pop the load request from the LSU bypass FIFO | LSU_BYPASS | logic
+
+|`valid_o` | out | Load unit result is valid | ISSUE_STAGE | logic
+
+|`trans_id_o` | out | Load transaction ID | ISSUE_STAGE | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`result_o` | out | Load result | ISSUE_STAGE | logic[CVA6Cfg.XLEN-1:0]
+
+|`ex_o` | out | Load exception | ISSUE_STAGE | exception_t
+
+|`translation_req_o` | out | Request address translation | MMU | logic
+
+|`vaddr_o` | out | Virtual address | MMU | logic[CVA6Cfg.VLEN-1:0]
+
+|`paddr_i` | in | Physical address | MMU | logic[CVA6Cfg.PLEN-1:0]
+
+|`ex_i` | in | Excepted which appears before load | MMU | exception_t
+
+|`page_offset_o` | out | Page offset for address checking | STORE_UNIT | logic[11:0]
+
+|`page_offset_matches_i` | in | Indicates if the page offset matches a store unit entry | STORE_UNIT | logic
+
+|`store_buffer_empty_i` | in | Store buffer is empty | STORE_UNIT | logic
+
+|`commit_tran_id_i` | in | Transaction ID of the committing instruction | COMMIT_STAGE | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`req_port_i` | in | Data cache request out | CACHES | dcache_req_o_t
+
+|`req_port_o` | out | Data cache request in | CACHES | dcache_req_i_t
+
+|`dcache_wbuffer_not_ni_i` | in | Presence of non-idempotent operations in the D$ write buffer | CACHES | logic
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As RVH = False,::
+* `tinst_o` output is tied to 0
+* `hs_ld_st_inst_o` output is tied to 0
+* `hlvx_inst_o` output is tied to 0
+For any HW configuration,::
+* `dtlb_hit_i` input is tied to 1
+As MMUPresent = 0,::
+* `dtlb_ppn_i` input is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_load_unit.rst b/docs/04_cv32a65x/design/source/port_load_unit.rst
deleted file mode 100644
index 99a2ff7d13..0000000000
--- a/docs/04_cv32a65x/design/source/port_load_unit.rst
+++ /dev/null
@@ -1,157 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_load_unit_ports:
-
-.. list-table:: **load_unit module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``flush_i``
- - in
- - Flush signal
- - CONTROLLER
- - logic
-
- * - ``valid_i``
- - in
- - Load request is valid
- - LSU_BYPASS
- - logic
-
- * - ``lsu_ctrl_i``
- - in
- - Load request input
- - LSU_BYPASS
- - lsu_ctrl_t
-
- * - ``pop_ld_o``
- - out
- - Pop the load request from the LSU bypass FIFO
- - LSU_BYPASS
- - logic
-
- * - ``valid_o``
- - out
- - Load unit result is valid
- - ISSUE_STAGE
- - logic
-
- * - ``trans_id_o``
- - out
- - Load transaction ID
- - ISSUE_STAGE
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``result_o``
- - out
- - Load result
- - ISSUE_STAGE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``ex_o``
- - out
- - Load exception
- - ISSUE_STAGE
- - exception_t
-
- * - ``translation_req_o``
- - out
- - Request address translation
- - MMU
- - logic
-
- * - ``vaddr_o``
- - out
- - Virtual address
- - MMU
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``paddr_i``
- - in
- - Physical address
- - MMU
- - logic[CVA6Cfg.PLEN-1:0]
-
- * - ``ex_i``
- - in
- - Excepted which appears before load
- - MMU
- - exception_t
-
- * - ``page_offset_o``
- - out
- - Page offset for address checking
- - STORE_UNIT
- - logic[11:0]
-
- * - ``page_offset_matches_i``
- - in
- - Indicates if the page offset matches a store unit entry
- - STORE_UNIT
- - logic
-
- * - ``store_buffer_empty_i``
- - in
- - Store buffer is empty
- - STORE_UNIT
- - logic
-
- * - ``commit_tran_id_i``
- - in
- - Transaction ID of the committing instruction
- - COMMIT_STAGE
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``req_port_i``
- - in
- - Data cache request out
- - CACHES
- - dcache_req_o_t
-
- * - ``req_port_o``
- - out
- - Data cache request in
- - CACHES
- - dcache_req_i_t
-
- * - ``dcache_wbuffer_not_ni_i``
- - in
- - Presence of non-idempotent operations in the D$ write buffer
- - CACHES
- - logic
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As RVH = False,
-| ``tinst_o`` output is tied to 0
-| ``hs_ld_st_inst_o`` output is tied to 0
-| ``hlvx_inst_o`` output is tied to 0
-| For any HW configuration,
-| ``dtlb_hit_i`` input is tied to 1
-| As MMUPresent = 0,
-| ``dtlb_ppn_i`` input is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_lsu_bypass.adoc b/docs/04_cv32a65x/design/source/port_lsu_bypass.adoc
new file mode 100644
index 0000000000..540af4878b
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_lsu_bypass.adoc
@@ -0,0 +1,36 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_lsu_bypass_ports]]
+
+.*lsu_bypass module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`flush_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|`lsu_req_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | lsu_ctrl_t
+
+|`lsu_req_valid_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|`pop_ld_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|`pop_st_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|`lsu_ctrl_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | lsu_ctrl_t
+
+|`ready_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|===
+
diff --git a/docs/04_cv32a65x/design/source/port_lsu_bypass.rst b/docs/04_cv32a65x/design/source/port_lsu_bypass.rst
deleted file mode 100644
index 8eac0f7ab4..0000000000
--- a/docs/04_cv32a65x/design/source/port_lsu_bypass.rst
+++ /dev/null
@@ -1,75 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_lsu_bypass_ports:
-
-.. list-table:: **lsu_bypass module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``flush_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``lsu_req_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - lsu_ctrl_t
-
- * - ``lsu_req_valid_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``pop_ld_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``pop_st_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``lsu_ctrl_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - lsu_ctrl_t
-
- * - ``ready_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
-
diff --git a/docs/04_cv32a65x/design/source/port_mult.adoc b/docs/04_cv32a65x/design/source/port_mult.adoc
new file mode 100644
index 0000000000..90af4c8bfa
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_mult.adoc
@@ -0,0 +1,36 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_mult_ports]]
+
+.*mult module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`flush_i` | in | Flush | CONTROLLER | logic
+
+|`fu_data_i` | in | FU data needed to execute instruction | ISSUE_STAGE | fu_data_t
+
+|`mult_valid_i` | in | Mult instruction is valid | ISSUE_STAGE | logic
+
+|`result_o` | out | Mult result | ISSUE_STAGE | logic[CVA6Cfg.XLEN-1:0]
+
+|`mult_valid_o` | out | Mult result is valid | ISSUE_STAGE | logic
+
+|`mult_ready_o` | out | Mutl is ready | ISSUE_STAGE | logic
+
+|`mult_trans_id_o` | out | Mult transaction ID | ISSUE_STAGE | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|===
+
diff --git a/docs/04_cv32a65x/design/source/port_mult.rst b/docs/04_cv32a65x/design/source/port_mult.rst
deleted file mode 100644
index 41e342d72f..0000000000
--- a/docs/04_cv32a65x/design/source/port_mult.rst
+++ /dev/null
@@ -1,75 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_mult_ports:
-
-.. list-table:: **mult module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``flush_i``
- - in
- - Flush
- - CONTROLLER
- - logic
-
- * - ``fu_data_i``
- - in
- - FU data needed to execute instruction
- - ISSUE_STAGE
- - fu_data_t
-
- * - ``mult_valid_i``
- - in
- - Mult instruction is valid
- - ISSUE_STAGE
- - logic
-
- * - ``result_o``
- - out
- - Mult result
- - ISSUE_STAGE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``mult_valid_o``
- - out
- - Mult result is valid
- - ISSUE_STAGE
- - logic
-
- * - ``mult_ready_o``
- - out
- - Mutl is ready
- - ISSUE_STAGE
- - logic
-
- * - ``mult_trans_id_o``
- - out
- - Mult transaction ID
- - ISSUE_STAGE
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
-
diff --git a/docs/04_cv32a65x/design/source/port_multiplier.adoc b/docs/04_cv32a65x/design/source/port_multiplier.adoc
new file mode 100644
index 0000000000..b759d487bd
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_multiplier.adoc
@@ -0,0 +1,40 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_multiplier_ports]]
+
+.*multiplier module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`trans_id_i` | in | Multiplier transaction ID | Mult | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`mult_valid_i` | in | Multiplier instruction is valid | Mult | logic
+
+|`operation_i` | in | Multiplier operation | Mult | fu_op
+
+|`operand_a_i` | in | A operand | Mult | logic[CVA6Cfg.XLEN-1:0]
+
+|`operand_b_i` | in | B operand | Mult | logic[CVA6Cfg.XLEN-1:0]
+
+|`result_o` | out | Multiplier result | Mult | logic[CVA6Cfg.XLEN-1:0]
+
+|`mult_valid_o` | out | Mutliplier result is valid | Mult | logic
+
+|`mult_ready_o` | out | Multiplier FU is ready | Mult | logic
+
+|`mult_trans_id_o` | out | Multiplier transaction ID | Mult | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|===
+
diff --git a/docs/04_cv32a65x/design/source/port_multiplier.rst b/docs/04_cv32a65x/design/source/port_multiplier.rst
deleted file mode 100644
index 5dfca691c0..0000000000
--- a/docs/04_cv32a65x/design/source/port_multiplier.rst
+++ /dev/null
@@ -1,87 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_multiplier_ports:
-
-.. list-table:: **multiplier module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``trans_id_i``
- - in
- - Multiplier transaction ID
- - Mult
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``mult_valid_i``
- - in
- - Multiplier instruction is valid
- - Mult
- - logic
-
- * - ``operation_i``
- - in
- - Multiplier operation
- - Mult
- - fu_op
-
- * - ``operand_a_i``
- - in
- - A operand
- - Mult
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``operand_b_i``
- - in
- - B operand
- - Mult
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``result_o``
- - out
- - Multiplier result
- - Mult
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``mult_valid_o``
- - out
- - Mutliplier result is valid
- - Mult
- - logic
-
- * - ``mult_ready_o``
- - out
- - Multiplier FU is ready
- - Mult
- - logic
-
- * - ``mult_trans_id_o``
- - out
- - Multiplier transaction ID
- - Mult
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
-
diff --git a/docs/04_cv32a65x/design/source/port_ras.adoc b/docs/04_cv32a65x/design/source/port_ras.adoc
new file mode 100644
index 0000000000..8e195dc53f
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_ras.adoc
@@ -0,0 +1,34 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_ras_ports]]
+
+.*ras module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`push_i` | in | Push address in RAS | FRONTEND | logic
+
+|`pop_i` | in | Pop address from RAS | FRONTEND | logic
+
+|`data_i` | in | Data to be pushed | FRONTEND | logic[CVA6Cfg.VLEN-1:0]
+
+|`data_o` | out | Popped data | FRONTEND | ras_t
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+For any HW configuration,::
+* `flush_bp_i` input is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_ras.rst b/docs/04_cv32a65x/design/source/port_ras.rst
deleted file mode 100644
index f0bdb4d401..0000000000
--- a/docs/04_cv32a65x/design/source/port_ras.rst
+++ /dev/null
@@ -1,61 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_ras_ports:
-
-.. list-table:: **ras module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``push_i``
- - in
- - Push address in RAS
- - FRONTEND
- - logic
-
- * - ``pop_i``
- - in
- - Pop address from RAS
- - FRONTEND
- - logic
-
- * - ``data_i``
- - in
- - Data to be pushed
- - FRONTEND
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``data_o``
- - out
- - Popped data
- - FRONTEND
- - ras_t
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| For any HW configuration,
-| ``flush_bp_i`` input is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_scoreboard.adoc b/docs/04_cv32a65x/design/source/port_scoreboard.adoc
new file mode 100644
index 0000000000..ee4870f11f
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_scoreboard.adoc
@@ -0,0 +1,97 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_scoreboard_ports]]
+
+.*scoreboard module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`sb_full_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|`flush_unissued_instr_i` | in | Flush only un-issued instructions | TO_BE_COMPLETED | logic
+
+|`flush_i` | in | Flush whole scoreboard | TO_BE_COMPLETED | logic
+
+|`rd_clobber_gpr_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | ariane_pkg::fu_t[2**ariane_pkg::REG_ADDR_SIZE-1:0]
+
+|`rd_clobber_fpr_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | ariane_pkg::fu_t[2**ariane_pkg::REG_ADDR_SIZE-1:0]
+
+|`x_transaction_accepted_i` | in | none | none | logic
+
+|`x_issue_writeback_i` | in | none | none | logic
+
+|`x_id_i` | in | none | none | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`rs1_i` | in | rs1 operand address | issue_read_operands | logic[CVA6Cfg.NrIssuePorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0]
+
+|`rs1_o` | out | rs1 operand | issue_read_operands | logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
+
+|`rs1_valid_o` | out | rs1 operand is valid | issue_read_operands | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`rs2_i` | in | rs2 operand address | issue_read_operands | logic[CVA6Cfg.NrIssuePorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0]
+
+|`rs2_o` | out | rs2 operand | issue_read_operands | logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
+
+|`rs2_valid_o` | out | rs2 operand is valid | issue_read_operands | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`rs3_i` | in | rs3 operand address | issue_read_operands | logic[CVA6Cfg.NrIssuePorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0]
+
+|`rs3_o` | out | rs3 operand | issue_read_operands | rs3_len_t[CVA6Cfg.NrIssuePorts-1:0]
+
+|`rs3_valid_o` | out | rs3 operand is valid | issue_read_operands | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`commit_instr_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | scoreboard_entry_t[CVA6Cfg.NrCommitPorts-1:0]
+
+|`commit_drop_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | logic[CVA6Cfg.NrCommitPorts-1:0]
+
+|`commit_ack_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic[CVA6Cfg.NrCommitPorts-1:0]
+
+|`decoded_instr_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | scoreboard_entry_t[CVA6Cfg.NrIssuePorts-1:0]
+
+|`orig_instr_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
+
+|`decoded_instr_valid_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`decoded_instr_ack_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`orig_instr_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
+
+|`issue_instr_valid_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`issue_ack_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic[CVA6Cfg.NrIssuePorts-1:0]
+
+|`resolved_branch_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | bp_resolve_t
+
+|`trans_id_i` | in | Transaction ID at which to write the result back | TO_BE_COMPLETED | logic[CVA6Cfg.NrWbPorts-1:0][CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`wbdata_i` | in | Results to write back | TO_BE_COMPLETED | logic[CVA6Cfg.NrWbPorts-1:0][CVA6Cfg.XLEN-1:0]
+
+|`ex_i` | in | Exception from a functional unit (e.g.: ld/st exception) | TO_BE_COMPLETED | exception_t[CVA6Cfg.NrWbPorts-1:0]
+
+|`wt_valid_i` | in | Indicates valid results | TO_BE_COMPLETED | logic[CVA6Cfg.NrWbPorts-1:0]
+
+|`x_we_i` | in | Cvxif we for writeback | TO_BE_COMPLETED | logic
+
+|`x_rd_i` | in | CVXIF destination register | ISSUE_STAGE | logic[4:0]
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As EnableAccelerator = 0,::
+* `issue_instr_o` output is tied to 0
+As IsRVFI = 0,::
+* `rvfi_issue_pointer_o` output is tied to 0
+* `rvfi_commit_pointer_o` output is tied to 0
+
diff --git a/docs/04_cv32a65x/design/source/port_scoreboard.rst b/docs/04_cv32a65x/design/source/port_scoreboard.rst
deleted file mode 100644
index ad5afa9757..0000000000
--- a/docs/04_cv32a65x/design/source/port_scoreboard.rst
+++ /dev/null
@@ -1,220 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_scoreboard_ports:
-
-.. list-table:: **scoreboard module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``sb_full_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``flush_unissued_instr_i``
- - in
- - Flush only un-issued instructions
- - TO_BE_COMPLETED
- - logic
-
- * - ``flush_i``
- - in
- - Flush whole scoreboard
- - TO_BE_COMPLETED
- - logic
-
- * - ``rd_clobber_gpr_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - ariane_pkg::fu_t[2**ariane_pkg::REG_ADDR_SIZE-1:0]
-
- * - ``rd_clobber_fpr_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - ariane_pkg::fu_t[2**ariane_pkg::REG_ADDR_SIZE-1:0]
-
- * - ``rs1_i``
- - in
- - rs1 operand address
- - issue_read_operands
- - logic[CVA6Cfg.NrIssuePorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0]
-
- * - ``rs1_o``
- - out
- - rs1 operand
- - issue_read_operands
- - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
-
- * - ``rs1_valid_o``
- - out
- - rs1 operand is valid
- - issue_read_operands
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``rs2_i``
- - in
- - rs2 operand address
- - issue_read_operands
- - logic[CVA6Cfg.NrIssuePorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0]
-
- * - ``rs2_o``
- - out
- - rs2 operand
- - issue_read_operands
- - logic[CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0]
-
- * - ``rs2_valid_o``
- - out
- - rs2 operand is valid
- - issue_read_operands
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``rs3_i``
- - in
- - rs3 operand address
- - issue_read_operands
- - logic[CVA6Cfg.NrIssuePorts-1:0][ariane_pkg::REG_ADDR_SIZE-1:0]
-
- * - ``rs3_o``
- - out
- - rs3 operand
- - issue_read_operands
- - rs3_len_t[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``rs3_valid_o``
- - out
- - rs3 operand is valid
- - issue_read_operands
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``commit_instr_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - scoreboard_entry_t[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``commit_drop_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``commit_ack_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``decoded_instr_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - scoreboard_entry_t[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``orig_instr_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
-
- * - ``decoded_instr_valid_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``decoded_instr_ack_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``orig_instr_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0][31:0]
-
- * - ``issue_instr_valid_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``issue_ack_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrIssuePorts-1:0]
-
- * - ``resolved_branch_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - bp_resolve_t
-
- * - ``trans_id_i``
- - in
- - Transaction ID at which to write the result back
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrWbPorts-1:0][CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``wbdata_i``
- - in
- - Results to write back
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrWbPorts-1:0][CVA6Cfg.XLEN-1:0]
-
- * - ``ex_i``
- - in
- - Exception from a functional unit (e.g.: ld/st exception)
- - TO_BE_COMPLETED
- - exception_t[CVA6Cfg.NrWbPorts-1:0]
-
- * - ``wt_valid_i``
- - in
- - Indicates valid results
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrWbPorts-1:0]
-
- * - ``x_we_i``
- - in
- - Cvxif we for writeback
- - TO_BE_COMPLETED
- - logic
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As EnableAccelerator = 0,
-| ``issue_instr_o`` output is tied to 0
-| As IsRVFI = 0,
-| ``rvfi_issue_pointer_o`` output is tied to 0
-| ``rvfi_commit_pointer_o`` output is tied to 0
-
diff --git a/docs/04_cv32a65x/design/source/port_scoreboard.rst.ori b/docs/04_cv32a65x/design/source/port_scoreboard.rst.ori
deleted file mode 100644
index ebd3fc64ef..0000000000
--- a/docs/04_cv32a65x/design/source/port_scoreboard.rst.ori
+++ /dev/null
@@ -1,229 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_scoreboard_ports:
-
-.. list-table:: scoreboard module IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - Connection
- - Type
-
- * - ``clk_i``
- - in
- - Clock
- - TO_BE_COMPLETED
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - TO_BE_COMPLETED
- - logic
-
- * - ``sb_full_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``flush_unissued_instr_i``
- - in
- - flush only un-issued instructions
- - TO_BE_COMPLETED
- - logic
-
- * - ``flush_i``
- - in
- - flush whole scoreboard
- - TO_BE_COMPLETED
- - logic
-
- * - ``unresolved_branch_i``
- - in
- - we have an unresolved branch
- - TO_BE_COMPLETED
- - logic
-
- * - ``rd_clobber_gpr_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - ariane_pkg::fu_t[2**ariane_pkg::REG_ADDR_SIZE-1:0]
-
- * - ``rd_clobber_fpr_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - ariane_pkg::fu_t[2**ariane_pkg::REG_ADDR_SIZE-1:0]
-
- * - ``rs1_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[ariane_pkg::REG_ADDR_SIZE-1:0]
-
- * - ``rs1_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - riscv::xlen_t
-
- * - ``rs1_valid_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``rs2_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[ariane_pkg::REG_ADDR_SIZE-1:0]
-
- * - ``rs2_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - riscv::xlen_t
-
- * - ``rs2_valid_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``rs3_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[ariane_pkg::REG_ADDR_SIZE-1:0]
-
- * - ``rs3_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - rs3_len_t
-
- * - ``rs3_valid_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``commit_instr_o``
- - out
- - TO_BE_COMPLETED
- - COMMIT_STAGE
- - ariane_pkg::scoreboard_entry_t[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``commit_ack_i``
- - in
- - Advance the commit pointer when acknowledge
- - COMMIT_STAGE
- - logic[CVA6Cfg.NrCommitPorts-1:0]
-
- * - ``decoded_instr_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - ariane_pkg::scoreboard_entry_t
-
- * - ``orig_instr_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[31:0]
-
- * - ``decoded_instr_valid_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``decoded_instr_ack_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``issue_instr_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - ariane_pkg::scoreboard_entry_t
-
- * - ``orig_instr_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[31:0]
-
- * - ``issue_instr_valid_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``issue_ack_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``resolved_branch_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - ariane_pkg::bp_resolve_t
-
- * - ``trans_id_i``
- - in
- - transaction ID at which to write the result back
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrWbPorts-1:0][ariane_pkg::TRANS_ID_BITS-1:0]
-
- * - ``wbdata_i``
- - in
- - write data in
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrWbPorts-1:0][riscv::XLEN-1:0]
-
- * - ``ex_i``
- - in
- - exception from a functional unit (e.g.: ld/st exception)
- - TO_BE_COMPLETED
- - ariane_pkg::exception_t[CVA6Cfg.NrWbPorts-1:0]
-
- * - ``wt_valid_i``
- - in
- - data in is valid
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrWbPorts-1:0]
-
- * - ``x_we_i``
- - in
- - cvxif we for writeback
- - TO_BE_COMPLETED
- - logic
-
- * - ``rvfi_issue_pointer_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[ariane_pkg::TRANS_ID_BITS-1:0]
-
- * - ``rvfi_commit_pointer_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.NrCommitPorts-1:0][ariane_pkg::TRANS_ID_BITS-1:0]
diff --git a/docs/04_cv32a65x/design/source/port_serdiv.adoc b/docs/04_cv32a65x/design/source/port_serdiv.adoc
new file mode 100644
index 0000000000..8c17be5cb2
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_serdiv.adoc
@@ -0,0 +1,44 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_serdiv_ports]]
+
+.*serdiv module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`id_i` | in | Serdiv translation ID | Mult | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`op_a_i` | in | A operand | Mult | logic[WIDTH-1:0]
+
+|`op_b_i` | in | B operand | Mult | logic[WIDTH-1:0]
+
+|`rem` | in | Serdiv operation | Mult | logic[1:0]opcode_i,//0:udiv,2:urem,1:div,3:
+
+|`in_vld_i` | in | Serdiv instruction is valid | Mult | logic
+
+|`in_rdy_o` | out | Serdiv FU is ready | Mult | logic
+
+|`flush_i` | in | Flush | CONTROLLER | logic
+
+|`out_vld_o` | out | Serdiv result is valid | Mult | logic
+
+|`out_rdy_i` | in | Serdiv is ready | Mult | logic
+
+|`id_o` | out | Serdiv transaction ID | Mult | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`res_o` | out | Serdiv result | Mult | logic[WIDTH-1:0]
+
+|===
+
diff --git a/docs/04_cv32a65x/design/source/port_serdiv.rst b/docs/04_cv32a65x/design/source/port_serdiv.rst
deleted file mode 100644
index 467df2704a..0000000000
--- a/docs/04_cv32a65x/design/source/port_serdiv.rst
+++ /dev/null
@@ -1,99 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_serdiv_ports:
-
-.. list-table:: **serdiv module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``id_i``
- - in
- - Serdiv translation ID
- - Mult
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``op_a_i``
- - in
- - A operand
- - Mult
- - logic[WIDTH-1:0]
-
- * - ``op_b_i``
- - in
- - B operand
- - Mult
- - logic[WIDTH-1:0]
-
- * - ``rem``
- - in
- - Serdiv operation
- - Mult
- - logic[1:0]opcode_i,//0:udiv,2:urem,1:div,3:
-
- * - ``in_vld_i``
- - in
- - Serdiv instruction is valid
- - Mult
- - logic
-
- * - ``in_rdy_o``
- - out
- - Serdiv FU is ready
- - Mult
- - logic
-
- * - ``flush_i``
- - in
- - Flush
- - CONTROLLER
- - logic
-
- * - ``out_vld_o``
- - out
- - Serdiv result is valid
- - Mult
- - logic
-
- * - ``out_rdy_i``
- - in
- - Serdiv is ready
- - Mult
- - logic
-
- * - ``id_o``
- - out
- - Serdiv transaction ID
- - Mult
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``res_o``
- - out
- - Serdiv result
- - Mult
- - logic[WIDTH-1:0]
-
-
diff --git a/docs/04_cv32a65x/design/source/port_store_unit.adoc b/docs/04_cv32a65x/design/source/port_store_unit.adoc
new file mode 100644
index 0000000000..35151db588
--- /dev/null
+++ b/docs/04_cv32a65x/design/source/port_store_unit.adoc
@@ -0,0 +1,78 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[_CVA6_store_unit_ports]]
+
+.*store_unit module* IO ports
+|===
+|Signal | IO | Description | connexion | Type
+
+|`clk_i` | in | Subsystem Clock | SUBSYSTEM | logic
+
+|`rst_ni` | in | Asynchronous reset active low | SUBSYSTEM | logic
+
+|`flush_i` | in | Flush | CONTROLLER | logic
+
+|`stall_st_pending_i` | in | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|`no_st_pending_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|`store_buffer_empty_o` | out | Store buffer is empty | TO_BE_COMPLETED | logic
+
+|`valid_i` | in | Store instruction is valid | ISSUE_STAGE | logic
+
+|`lsu_ctrl_i` | in | Data input | ISSUE_STAGE | lsu_ctrl_t
+
+|`pop_st_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|`commit_i` | in | Instruction commit | TO_BE_COMPLETED | logic
+
+|`commit_ready_o` | out | TO_BE_COMPLETED | TO_BE_COMPLETED | logic
+
+|`valid_o` | out | Store result is valid | ISSUE_STAGE | logic
+
+|`trans_id_o` | out | Transaction ID | ISSUE_STAGE | logic[CVA6Cfg.TRANS_ID_BITS-1:0]
+
+|`result_o` | out | Store result | ISSUE_STAGE | logic[CVA6Cfg.XLEN-1:0]
+
+|`ex_o` | out | Store exception output | TO_BE_COMPLETED | exception_t
+
+|`translation_req_o` | out | Address translation request | TO_BE_COMPLETED | logic
+
+|`vaddr_o` | out | Virtual address | TO_BE_COMPLETED | logic[CVA6Cfg.VLEN-1:0]
+
+|`paddr_i` | in | Physical address | TO_BE_COMPLETED | logic[CVA6Cfg.PLEN-1:0]
+
+|`ex_i` | in | Exception raised before store | TO_BE_COMPLETED | exception_t
+
+|`page_offset_i` | in | Address to be checked | load_unit | logic[11:0]
+
+|`page_offset_matches_o` | out | Address check result | load_unit | logic
+
+|`req_port_i` | in | Data cache request | CACHES | dcache_req_o_t
+
+|`req_port_o` | out | Data cache response | CACHES | dcache_req_i_t
+
+|===
+Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
+
+As RVA = False,::
+* `amo_valid_commit_i` input is tied to 0
+* `amo_req_o` output is tied to 0
+* `amo_resp_i` input is tied to 0
+As IsRVFI = 0,::
+* `rvfi_mem_paddr_o` output is tied to 0
+As RVH = False,::
+* `tinst_o` output is tied to 0
+* `hs_ld_st_inst_o` output is tied to 0
+* `hlvx_inst_o` output is tied to 0
+For any HW configuration,::
+* `dtlb_hit_i` input is tied to 1
+
diff --git a/docs/04_cv32a65x/design/source/port_store_unit.rst b/docs/04_cv32a65x/design/source/port_store_unit.rst
deleted file mode 100644
index eda5a1058b..0000000000
--- a/docs/04_cv32a65x/design/source/port_store_unit.rst
+++ /dev/null
@@ -1,173 +0,0 @@
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_store_unit_ports:
-
-.. list-table:: **store_unit module** IO ports
- :header-rows: 1
-
- * - Signal
- - IO
- - Description
- - connexion
- - Type
-
- * - ``clk_i``
- - in
- - Subsystem Clock
- - SUBSYSTEM
- - logic
-
- * - ``rst_ni``
- - in
- - Asynchronous reset active low
- - SUBSYSTEM
- - logic
-
- * - ``flush_i``
- - in
- - Flush
- - CONTROLLER
- - logic
-
- * - ``stall_st_pending_i``
- - in
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``no_st_pending_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``store_buffer_empty_o``
- - out
- - Store buffer is empty
- - TO_BE_COMPLETED
- - logic
-
- * - ``valid_i``
- - in
- - Store instruction is valid
- - ISSUE_STAGE
- - logic
-
- * - ``lsu_ctrl_i``
- - in
- - Data input
- - ISSUE_STAGE
- - lsu_ctrl_t
-
- * - ``pop_st_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``commit_i``
- - in
- - Instruction commit
- - TO_BE_COMPLETED
- - logic
-
- * - ``commit_ready_o``
- - out
- - TO_BE_COMPLETED
- - TO_BE_COMPLETED
- - logic
-
- * - ``valid_o``
- - out
- - Store result is valid
- - ISSUE_STAGE
- - logic
-
- * - ``trans_id_o``
- - out
- - Transaction ID
- - ISSUE_STAGE
- - logic[CVA6Cfg.TRANS_ID_BITS-1:0]
-
- * - ``result_o``
- - out
- - Store result
- - ISSUE_STAGE
- - logic[CVA6Cfg.XLEN-1:0]
-
- * - ``ex_o``
- - out
- - Store exception output
- - TO_BE_COMPLETED
- - exception_t
-
- * - ``translation_req_o``
- - out
- - Address translation request
- - TO_BE_COMPLETED
- - logic
-
- * - ``vaddr_o``
- - out
- - Virtual address
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.VLEN-1:0]
-
- * - ``paddr_i``
- - in
- - Physical address
- - TO_BE_COMPLETED
- - logic[CVA6Cfg.PLEN-1:0]
-
- * - ``ex_i``
- - in
- - Exception raised before store
- - TO_BE_COMPLETED
- - exception_t
-
- * - ``page_offset_i``
- - in
- - Address to be checked
- - load_unit
- - logic[11:0]
-
- * - ``page_offset_matches_o``
- - out
- - Address check result
- - load_unit
- - logic
-
- * - ``req_port_i``
- - in
- - Data cache request
- - CACHES
- - dcache_req_o_t
-
- * - ``req_port_o``
- - out
- - Data cache response
- - CACHES
- - dcache_req_i_t
-
-Due to cv32a65x configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below
-
-| As RVA = False,
-| ``amo_valid_commit_i`` input is tied to 0
-| ``amo_req_o`` output is tied to 0
-| ``amo_resp_i`` input is tied to 0
-| As IsRVFI = 0,
-| ``rvfi_mem_paddr_o`` output is tied to 0
-| As RVH = False,
-| ``tinst_o`` output is tied to 0
-| ``hs_ld_st_inst_o`` output is tied to 0
-| ``hlvx_inst_o`` output is tied to 0
-| For any HW configuration,
-| ``dtlb_hit_i`` input is tied to 1
-
diff --git a/docs/04_cv32a65x/index.rst b/docs/04_cv32a65x/index.rst
index 71e91ee8e5..ad7e6d23a7 100644
--- a/docs/04_cv32a65x/index.rst
+++ b/docs/04_cv32a65x/index.rst
@@ -6,4 +6,4 @@ CV32A65X documentation
riscv/unpriv.rst
riscv/priv.rst
- design/source/index.rst
+ design/design.rst
diff --git a/docs/README.md b/docs/README.md
new file mode 100644
index 0000000000..d8b87bbcdb
--- /dev/null
+++ b/docs/README.md
@@ -0,0 +1,26 @@
+# CVA6 documentation
+
+CVA6 documentation is published as a Read the Docs documentation.
+It can be generated by running `make html` in this directory.
+
+## Configuration-specific manuals
+
+For each supported target (e.g. `cv32a65x`), there are two manuals included in the main documentation: a tailored RISC-V instruction set manual, and a design documentation.
+These documents are generated as HTML files, are committed to the repository, and are included when generating the main documentation.
+
+### Instruction set manual
+
+Instruction set manuals (privileged & unprivileged) are based on the official RISC-V Instruction Set Manual repository.
+Some parts are stripped down or annotated to only include what's relevant for each specific configuration.
+
+These manuals can be generated with: `make -C 04_cv32a65x/riscv priv-html unpriv-html`.
+Replace `04_cv32a65x` with the desired target.
+
+### Design documentation
+
+Design documentation describes the internal architecture of the CVA6 processor.
+
+It can be generated with: `make -C 04_cv32a65x/design design-html`.
+
+Some of the files used in this documentation (`port_*.adoc`) are directly generated from the RTL.
+They can be updated by running `python3 scripts/spec_builder.py`.
diff --git a/docs/riscv-isa/src/config_define.adoc b/docs/common/config_define.adoc
similarity index 100%
rename from docs/riscv-isa/src/config_define.adoc
rename to docs/common/config_define.adoc
diff --git a/docs/conf.py b/docs/conf.py
index 4c7c11135b..0454f4fbcb 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -37,7 +37,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
-exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store', '*.yaml', '*.xml',
+exclude_patterns = ['_build', '**/build', 'Thumbs.db', '.DS_Store', '*.yaml', '*.xml',
'csr-from-ip-xact/**/*_csr.md', 'csr-ip-xact/**/cva6_csr.*']
diff --git a/docs/design/build.mk b/docs/design/build.mk
new file mode 100644
index 0000000000..6a90d2ef1f
--- /dev/null
+++ b/docs/design/build.mk
@@ -0,0 +1,38 @@
+# Copyright 2024 Thales DIS France SAS
+# Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+# you may not use this file except in compliance with the License.
+# SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+# You may obtain a copy of the License at https://solderpad.org/licenses/
+#
+# Original Author: Jean-Roch COULON - Thales
+
+ifeq ($(CONFIG),)
+$(error CONFIG must be defined)
+endif
+
+# Path of current file, intended to be included by a configuration subfolder
+design_dir := $(dir $(lastword $(MAKEFILE_LIST)))
+
+all: design-pdf design-html
+
+setup:
+ mkdir -p build
+ pwd
+ echo $(design_dir)
+ cp -r $(design_dir)/design-manual/* build
+ cp -r $(design_dir)/../../config/gen_from_riscv_config/$(CONFIG)/* build/source
+ cp -r $(design_dir)/../riscv-isa/riscv-isa-manual/docs-resources build
+ cp ../config/config.adoc build/source
+ cp $(design_dir)/../common/*.adoc build/source
+ cp -rf source build
+
+design-pdf: setup
+ cd build; make SKIP_DOCKER=true build/design.pdf
+ cp ./build/build/design.pdf design-$(CONFIG).pdf
+
+design-html: setup
+ cd build; make SKIP_DOCKER=true build/design.html
+ cp ./build/build/design.html design-$(CONFIG).html
+
+clean:
+ rm -rf build
diff --git a/docs/design/design-manual/Makefile b/docs/design/design-manual/Makefile
new file mode 100644
index 0000000000..e3bc3cbe1e
--- /dev/null
+++ b/docs/design/design-manual/Makefile
@@ -0,0 +1,122 @@
+# Makefile for RISC-V ISA Manuals
+#
+# This work is licensed under the Creative Commons Attribution-ShareAlike 4.0
+# International License. To view a copy of this license, visit
+# http://creativecommons.org/licenses/by-sa/4.0/ or send a letter to
+# Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
+#
+# SPDX-License-Identifier: CC-BY-SA-4.0
+#
+# Description:
+#
+# This Makefile is designed to automate the process of building and packaging
+# the documentation for RISC-V ISA Manuals. It supports multiple build targets
+# for generating documentation in various formats (PDF, HTML, EPUB).
+#
+# Building with a preinstalled docker container is recommended.
+# Install by running:
+#
+# docker pull riscvintl/riscv-docs-base-container-image:latest
+#
+
+DOCS := design
+
+DATE ?= $(shell date +%Y-%m-%d)
+DOCKER_IMG := riscvintl/riscv-docs-base-container-image:latest
+ifneq ($(SKIP_DOCKER),true)
+ DOCKER_CMD = \
+ docker run --rm -v ${PWD}/$@.workdir:/build -w /build \
+ ${DOCKER_IMG} \
+ /bin/sh -c
+ DOCKER_QUOTE := "
+else
+ DOCKER_CMD = \
+ cd $@.workdir &&
+endif
+
+WORKDIR_SETUP = \
+ rm -rf $@.workdir && \
+ mkdir -p $@.workdir && \
+ cp -r source docs-resources $@.workdir
+
+WORKDIR_TEARDOWN = \
+ mv $@.workdir/$@ $@ && \
+ rm -rf $@.workdir
+
+SRC_DIR := source
+BUILD_DIR := build
+
+DOCS_PDF := $(addprefix $(BUILD_DIR)/, $(addsuffix .pdf, $(DOCS)))
+DOCS_HTML := $(addprefix $(BUILD_DIR)/, $(addsuffix .html, $(DOCS)))
+DOCS_EPUB := $(addprefix $(BUILD_DIR)/, $(addsuffix .epub, $(DOCS)))
+
+ENV := LANG=C.utf8
+XTRA_ADOC_OPTS :=
+ASCIIDOCTOR_PDF := $(ENV) asciidoctor-pdf
+ASCIIDOCTOR_HTML := $(ENV) asciidoctor
+ASCIIDOCTOR_EPUB := $(ENV) asciidoctor-epub3
+OPTIONS := --trace \
+ -a compress \
+ -a mathematical-format=svg \
+ -a pdf-fontsdir=docs-resources/fonts \
+ -a pdf-theme=docs-resources/themes/riscv-pdf.yml \
+ $(XTRA_ADOC_OPTS) \
+ -D build \
+ --failure-level=WARN \
+ -a attribute-missing=warn
+REQUIRES :=
+
+.PHONY: all build clean build-container build-no-container build-docs build-pdf build-html build-epub
+
+all: build
+
+build-docs: $(DOCS_PDF) $(DOCS_HTML) $(DOCS_EPUB)
+build-pdf: $(DOCS_PDF)
+build-html: $(DOCS_HTML)
+build-epub: $(DOCS_EPUB)
+
+ALL_SRCS := $(shell git ls-files $(SRC_DIR))
+
+$(BUILD_DIR)/%.pdf: $(SRC_DIR)/%.adoc $(ALL_SRCS)
+ $(WORKDIR_SETUP)
+ $(DOCKER_CMD) $(DOCKER_QUOTE) $(ASCIIDOCTOR_PDF) $(OPTIONS) $(REQUIRES) $< $(DOCKER_QUOTE)
+ $(WORKDIR_TEARDOWN)
+
+$(BUILD_DIR)/%.html: $(SRC_DIR)/%.adoc $(ALL_SRCS)
+ $(WORKDIR_SETUP)
+ $(DOCKER_CMD) $(DOCKER_QUOTE) $(ASCIIDOCTOR_HTML) $(OPTIONS) $(REQUIRES) $< $(DOCKER_QUOTE)
+ $(WORKDIR_TEARDOWN)
+
+$(BUILD_DIR)/%.epub: $(SRC_DIR)/%.adoc $(ALL_SRCS)
+ $(WORKDIR_SETUP)
+ $(DOCKER_CMD) $(DOCKER_QUOTE) $(ASCIIDOCTOR_EPUB) $(OPTIONS) $(REQUIRES) $< $(DOCKER_QUOTE)
+ $(WORKDIR_TEARDOWN)
+
+build:
+ @echo "Checking if Docker is available..."
+ @if command -v docker >/dev/null 2>&1 ; then \
+ echo "Docker is available, building inside Docker container..."; \
+ $(MAKE) build-container; \
+ else \
+ echo "Docker is not available, building without Docker..."; \
+ $(MAKE) build-no-container; \
+ fi
+
+build-container:
+ @echo "Starting build inside Docker container..."
+ $(MAKE) build-docs
+ @echo "Build completed successfully inside Docker container."
+
+build-no-container:
+ @echo "Starting build..."
+ $(MAKE) SKIP_DOCKER=true build-docs
+ @echo "Build completed successfully."
+
+# Update docker image to latest
+docker-pull-latest:
+ docker pull ${DOCKER_IMG}
+
+clean:
+ @echo "Cleaning up generated files..."
+ rm -rf $(BUILD_DIR)
+ @echo "Cleanup completed."
diff --git a/docs/04_cv32a65x/design/source/AXI.rst b/docs/design/design-manual/source/AXI.adoc
similarity index 86%
rename from docs/04_cv32a65x/design/source/AXI.rst
rename to docs/design/design-manual/source/AXI.adoc
index 595f64397f..e8bf7b80d9 100644
--- a/docs/04_cv32a65x/design/source/AXI.rst
+++ b/docs/design/design-manual/source/AXI.adoc
@@ -1,4 +1,4 @@
-..
+////
Copyright 2023 Thales DIS France SAS
Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -6,5 +6,7 @@
You may obtain a copy of the License at https://solderpad.org/licenses/
Original Author: Jean-Roch COULON - Thales
+////
+[[axi]]
-.. include:: ../../../01_cva6_user/AXI_Interface.rst
+include::AXI_Interface.adoc[]
diff --git a/docs/design/design-manual/source/AXI_Interface.adoc b/docs/design/design-manual/source/AXI_Interface.adoc
new file mode 100644
index 0000000000..1da1cf31c0
--- /dev/null
+++ b/docs/design/design-manual/source/AXI_Interface.adoc
@@ -0,0 +1,895 @@
+////
+ Copyright (c) 2023 OpenHW Group
+ Copyright (c) 2023 Thales
+
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+
+ Original Author: Alae Eddine EZ ZEJJARI (alae-eddine.ez-zejjari@external.thalesgroup.com)
+////
+
+[[cva6_axi]]
+AXI
+~~~
+
+[[cva6_axi-introduction]]
+Introduction
+^^^^^^^^^^^^
+In this chapter, we describe in detail the restriction that apply to the supported features.
+
+In order to understand how the AXI memory interface behaves in CVA6, it is necessary to read the AMBA AXI and ACE Protocol Specification (https://developer.arm.com/documentation/ihi0022/hc) and this chapter.
+
+_Applicability of this chapter to configurations:_
+
+[cols=",",options="header",]
+|=============================
+|Configuration |Implementation
+|CV32A60AX |AXI included
+|CV32A60X |AXI included
+|=============================
+
+[[about-the-axi4-protocol]]
+About the AXI4 protocol
++++++++++++++++++++++++
+
+The AMBA AXI protocol supports high-performance, high-frequency system designs for communication between Manager and Subordinate components.
+
+The AXI protocol features are:
+
+* It is suitable for high-bandwidth and low-latency designs.
+* High-frequency operation is provided, without using complex bridges.
+* The protocol meets the interface requirements of a wide range of components.
+* It is suitable for memory controllers with high initial access latency.
+* Flexibility in the implementation of interconnect architectures is provided.
+* It is backward-compatible with AHB and APB interfaces.
+
+The key features of the AXI protocol are:
+
+* Separate address/control and data phases.
+* Support for unaligned data transfers, using byte strobes.
+* Uses burst-based transactions with only the start address issued.
+* Separate read and write data channels, that can provide low-cost Direct Memory Access (DMA).
+* Support for issuing multiple outstanding addresses.
+* Support for out-of-order transaction completion.
+* Permits easy addition of register stages to provide timing closure.
+
+The present specification is based on: https://developer.arm.com/documentation/ihi0022/hc
+
+
+[[axi4-and-cva6]]
+AXI4 and CVA6
++++++++++++++
+
+The AXI bus protocol is used with the CVA6 processor as a memory interface. Since the processor is the one that initiates the connection with the memory, it will have a manager interface to send requests to the subordinate, which will be the memory.
+
+Features supported by CVA6 are the ones in the AMBA AXI4 specification and the Atomic Operation feature from AXI5. With restriction that apply to some features.
+
+This doesn’t mean that all the full set of signals available on an AXI interface are supported by the CVA6. Nevertheless, all required AXI signals are implemented.
+
+Supported AXI4 features are defined in AXI Protocol Specification sections: A3, A4, A5, A6 and A7.
+
+Supported AXI5 feature are defined in AXI Protocol Specification section: E1.1.
+
+
+[[signal-description-section-a2]]
+Signal Description (Section A2)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This section introduces the AXI memory interface signals of CVA6. Most of the signals are supported by CVA6, the tables summarizing the signals identify the exceptions.
+
+In the following tables, the *Src* column tells whether the signal is driven by Manager ou Subordinate.
+
+The AXI required and optional signals, and the default signals values that apply when an optional signal is not implemented are defined in AXI Protocol Specification section A9.3.
+
+[[global-signals-section-a2.1]]
+Global signals (Section A2.1)
++++++++++++++++++++++++++++++
+
+Table 2.1 shows the global AXI memory interface signals.
+
+[width="100%",cols="20%,20%,60%",options="header",]
+|==========================================================
+|*Signal* |*Src* |*Description*
+|*ACLK* |Clock source a|
+[verse]
+--
+Global clock signal. Synchronous signals are sampled on the
+rising edge of the global clock.
+--
+
+|*WDATA* |Reset source a|
+[verse]
+--
+Global reset signal. This signal is active-LOW.
+--
+
+|==========================================================
+
+[[write-address-channel-signals-section-a2.2]]
+Write address channel signals (Section A2.2)
+++++++++++++++++++++++++++++++++++++++++++++
+
+Table 2.2 shows the AXI memory interface write address channel signals. Unless the description indicates otherwise, a signal can take any parameter if is supported.
+
+[width="100%",cols="15%,15%,15%,55%",options="header",]
+|=====================================================================
+|*Signal* |*Src* |*Support* |*Description*
+|*AWID* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Identification tag for a write transaction.
+CVA6 gives the id depending on the type of transaction.
+See transaction_identifiers_label.
+--
+
+|*AWADDR* |M |Yes a|
+[verse]
+--
+The address of the first transfer in a write transaction.
+--
+
+|*AWLEN* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Length, the exact number of data transfers in a write
+transaction. This information determines the number of
+data transfers associated with the address.
+All write transactions performed by CVA6 are of length 1.
+(AWLEN = 0b00000000)
+--
+
+|*AWSIZE* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Size, the number of bytes in each data transfer in a write
+transaction
+See address_structure_label.
+--
+
+|*AWBURST* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Burst type, indicates how address changes between each
+transfer in a write transaction.
+All write transactions performed by CVA6 are of burst type
+INCR. (AWBURST = 0b01)
+--
+
+|*AWLOCK* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Provides information about the atomic characteristics of a
+write transaction.
+--
+
+|*AWCACHE* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Indicates how a write transaction is required to progress
+through a system.
+The subordinate is always of type Normal Non-cacheable Non-bufferable.
+(AWCACHE = 0b0010)
+--
+
+|*AWPROT* |M |Yes a|
+[verse]
+--
+Protection attributes of a write transaction:
+privilege, security level, and access type.
+The value of AWPROT is always 0b000.
+--
+
+|*AWQOS* |M a|
+[verse]
+--
+No
+(optional)
+--
+
+ a|
+[verse]
+--
+Quality of Service identifier for a write transaction.
+AWQOS = 0b0000
+--
+
+|*AWREGION* |M a|
+[verse]
+--
+No
+(optional)
+--
+
+ a|
+[verse]
+--
+Region indicator for a write transaction.
+AWREGION = 0b0000
+--
+
+|*AWUSER* |M a|
+[verse]
+--
+No
+(optional)
+--
+
+ a|
+[verse]
+--
+User-defined extension for the write address channel.
+AWUSER = 0b00
+--
+
+|*AWATOP* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+AWATOP indicates the Properties of the Atomic Operation
+used for a write transaction.
+See atomic_transactions_label.
+--
+
+|*AWVALID* |M |Yes a|
+[verse]
+--
+Indicates that the write address channel signals are valid.
+--
+
+|*AWREADY* |S |Yes a|
+[verse]
+--
+Indicates that a transfer on the write address channel
+can be accepted.
+--
+
+|=====================================================================
+
+[[write-data-channel-signals-section-a2.3]]
+Write data channel signals (Section A2.3)
++++++++++++++++++++++++++++++++++++++++++
+
+Table 2.3 shows the AXI write data channel signals. Unless the description indicates otherwise, a signal can take any parameter if is supported.
+
+[width="100%",cols="15%,15%,15%,55%",options="header",]
+|==========================================================
+|*Signal* |*Src* |*Support* |*Description*
+|*WDATA* |M |Yes a|
+[verse]
+--
+Write data.
+--
+
+|*WSTRB* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Write strobes, indicate which byte lanes hold valid data
+See data_read_and_write_structure_label.
+--
+
+|*WLAST* |M |Yes a|
+[verse]
+--
+Indicates whether this is the last data transfer in a write
+transaction.
+--
+
+|*WUSER* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+User-defined extension for the write data channel.
+--
+
+|*WVALID* |M |Yes a|
+[verse]
+--
+Indicates that the write data channel signals are valid.
+--
+
+|*WREADY* |S |Yes a|
+[verse]
+--
+Indicates that a transfer on the write data channel can be
+accepted.
+--
+
+|==========================================================
+
+[[write-response-channel-signals-section-a2.4]]
+Write Response Channel signals (Section A2.4)
++++++++++++++++++++++++++++++++++++++++++++++
+
+Table 2.4 shows the AXI write response channel signals. Unless the description indicates otherwise, a signal can take any parameter if is supported.
+
+[width="100%",cols="15%,15%,15%,55%",options="header",]
+|=============================================================
+|*Signal* |*Src* |*Support* |*Description*
+|*BID* |S a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Identification tag for a write response.
+CVA6 gives the id depending on the type of transaction.
+See transaction_identifiers_label.
+--
+
+|*BRESP* |S |Yes a|
+[verse]
+--
+Write response, indicates the status of a write transaction.
+See read_and_write_response_structure_label.
+--
+
+|*BUSER* |S a|
+[verse]
+--
+No
+(optional)
+--
+
+ a|
+[verse]
+--
+User-defined extension for the write response channel.
+Not supported.
+--
+
+|*BVALID* |S |Yes a|
+[verse]
+--
+Indicates that the write response channel signals are valid.
+--
+
+|*BREADY* |M |Yes a|
+[verse]
+--
+Indicates that a transfer on the write response channel can be
+accepted.
+--
+
+|=============================================================
+
+[[read-address-channel-signals-section-a2.5]]
+Read address channel signals (Section A2.5)
++++++++++++++++++++++++++++++++++++++++++++
+
+Table 2.5 shows the AXI read address channel signals. Unless the description indicates otherwise, a signal can take any parameter if is supported.
+
+
+[width="100%",cols="15%,15%,15%,55%",options="header",]
+|================================================================
+|*Signal* |*Src* |*Support* |*Description*
+|*ARID* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Identification tag for a read transaction.
+CVA6 gives the id depending on the type of transaction.
+See transaction_identifiers_label.
+--
+
+|*ARADDR* |M a|
+[verse]
+--
+Yes
+--
+
+ a|
+[verse]
+--
+The address of the first transfer in a read transaction.
+--
+
+|*ARLEN* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Length, the exact number of data transfers in a read
+transaction. This information determines the number of data
+transfers associated with the address.
+All read transactions performed by CVA6 have a length equal to 0,
+ICACHE_LINE_WIDTH/64 or DCACHE_LINE_WIDTH/64.
+--
+
+|*ARSIZE* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Size, the number of bytes in each data transfer in a read
+transaction
+See address_structure_label.
+--
+
+|*ARBURST* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Burst type, indicates how address changes between each
+transfer in a read transaction.
+All Read transactions performed by CVA6 are of burst type INCR.
+(ARBURST = 0b01)
+--
+
+|*ARLOCK* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Provides information about the atomic characteristics of
+a read transaction.
+--
+
+|*ARCACHE* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Indicates how a read transaction is required to progress
+through a system.
+The memory is always of type Normal Non-cacheable Non-bufferable.
+(ARCACHE = 0b0010)
+--
+
+|*ARPROT* |M a|
+[verse]
+--
+Yes
+--
+
+ a|
+[verse]
+--
+Protection attributes of a read transaction:
+privilege, security level, and access type.
+The value of ARPROT is always 0b000.
+--
+
+|*ARQOS* |M a|
+[verse]
+--
+No
+(optional)
+--
+
+ a|
+[verse]
+--
+Quality of Service identifier for a read transaction.
+ARQOS= 0b00
+--
+
+|*ARREGION* |M a|
+[verse]
+--
+No
+(optional)
+--
+
+ a|
+[verse]
+--
+Region indicator for a read transaction.
+ARREGION= 0b00
+--
+
+|*ARUSER* |M a|
+[verse]
+--
+No
+(optional)
+--
+
+ a|
+[verse]
+--
+User-defined extension for the read address channel.
+ARUSER= 0b00
+--
+
+|*ARVALID* |M a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Indicates that the read address channel signals are valid.
+--
+
+|*ARREADY* |S a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+Indicates that a transfer on the read address channel can be
+accepted.
+--
+
+|================================================================
+
+[[read-data-channel-signals-section-a2.6]]
+Read data channel signals (Section A2.6)
+++++++++++++++++++++++++++++++++++++++++
+
+Table 2.6 shows the AXI read data channel signals. Unless the description indicates otherwise, a signal can take any parameter if is supported.
+
+
+[width="100%",cols="15%,15%,15%,55%",options="header",]
+|==================================================================
+|*Signal* |*Src* |*Support* |*Description*
+|*RID* |S a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+The ID tag of the read data transfer.
+CVA6 gives the id depending on the type of transaction.
+See transaction_identifiers_label.
+--
+
+|*RDATA* |S |Yes a|
+[verse]
+--
+Read data.
+--
+
+|*RLAST* |S |Yes a|
+[verse]
+--
+Indicates whether this is the last data transfer in a read
+transaction.
+--
+
+|*RUSER* |S a|
+[verse]
+--
+Yes
+(optional)
+--
+
+ a|
+[verse]
+--
+User-defined extension for the read data channel.
+Not supported.
+--
+
+|*RVALID* |S |Yes a|
+[verse]
+--
+Indicates that the read data channel signals are valid.
+--
+
+|*RREADY* |M |Yes a|
+[verse]
+--
+Indicates that a transfer on the read data channel can be accepted.
+--
+
+|==================================================================
+
+[[single-interface-requirements-transaction-structure-section-a3.4]]
+Single Interface Requirements: Transaction structure (Section A3.4)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This section describes the structure of transactions. The following sections define the address, data, and response
+structures
+
+[[address_structure_label]]
+Address structure (Section A3.4.1)
+++++++++++++++++++++++++++++++++++
+
+The AXI protocol is burst-based. The Manager begins each burst by driving control information and the address of the first byte in the transaction to the Subordinate. As the burst progresses, the Subordinate must calculate the addresses of subsequent transfers in the burst.
+
+*Burst length*
+
+The burst length is specified by:
+
+* `ARLEN[7:0]`, for read transfers
+* `AWLEN[7:0]`, for write transfers
+
+The burst length for AXI4 is defined as: `Burst_Length = AxLEN[3:0] + 1`.
+
+CVA6 has some limitation governing the use of bursts:
+
+* _All read transactions performed by CVA6 are of burst length equal to 0, ICACHE_LINE_WIDTH/64 or DCACHE_LINE_WIDTH/64._
+* _All write transactions performed by CVA6 are of burst length equal to 1._
+
+*Burst size*
+
+The maximum number of bytes to transfer in each data transfer, or beat, in a burst, is specified by:
+
+* `ARSIZE[2:0]`, for read transfers
+* `AWSIZE[2:0]`, for write transfers
+
+_The maximum value can be taking by AxSIZE is log2(AXI DATA WIDTH/8) (8 bytes by transfer)._
+_If(RV32) AWSIZE < 3 (The maximum store size is 4 bytes)_
+
+*Burst type*
+
+The AXI protocol defines three burst types:
+
+* *FIXED*
+* *INCR*
+* *WRAP*
+
+The burst type is specified by:
+
+* `ARBURST[1:0]`, for read transfers
+* `AWBURST[1:0]`, for write transfers
+
+_All transactions performed by CVA6 are of burst type INCR. (AxBURST = 0b01)_
+
+[[data_read_and_write_structure_label]]
+Data read and write structure: (Section A3.4.4)
++++++++++++++++++++++++++++++++++++++++++++++++
+
+*Write strobes*
+
+The `WSTRB[n:0]` signals when HIGH, specify the byte lanes of the data bus that contain valid information. There is one write strobe
+for each 8 bits of the write data bus, therefore `WSTRB[n]` corresponds to `WDATA[(8n)+7: (8n)]`.
+
+_Write Strobe width is equal to (AXI_DATA_WIDTH/8) (n = (AXI_DATA_WIDTH/8)-1)._
+
+_The size of transactions performed by cva6 is equal to the number of data byte lanes containing valid information._
+_This means 1, 2, 4, ... or (AXI_DATA_WIDTH/8) byte lanes containing valid information._
+_CVA6 doesn't perform unaligned memory acces, therefore the WSTRB take only combination of aligned access_
+_If(RV32) WSTRB < 255 (Since AWSIZE lower than 3, so the data bus cannot have more than 4 valid byte lanes)_
+
+*Unaligned transfers*
+
+For any burst that is made up of data transfers wider than 1 byte, the first bytes accessed might be unaligned with the natural
+address boundary. For example, a 32-bit data packet that starts at a byte address of 0x1002 is not aligned to the natural 32-bit
+transfer size.
+
+_CVA6 does not perform Unaligned transfers._
+
+[[read_and_write_response_structure_label]]
+Read and write response structure (Section A3.4.5)
+++++++++++++++++++++++++++++++++++++++++++++++++++
+
+The AXI protocol provides response signaling for both read and write transactions:
+
+* For read transactions, the response information from the Subordinate is signaled on the read data channel.
+* For write transactions, the response information is signaled on the write response channel.
+
+CVA6 does not consider the responses sent by the memory except in the exclusive Access ( `XRESP[1:0]` = 0b01 ).
+
+[[transaction-attributes-memory-types-section-a4]]
+Transaction Attributes: Memory types (Section A4)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+This section describes the attributes that determine how a transaction should be treated by the AXI subordinate that is connected to the CVA6.
+
+`AxCACHE` always takeq 0b0010. The subordinate should be a Normal Non-cacheable Non-bufferable.
+
+The required behavior for Normal Non-cacheable Non-bufferable memory is:
+
+* The write response must be obtained from the final destination.
+* Read data must be obtained from the final destination.
+* Transactions are modifiable.
+* Writes can be merged.
+
+[[transaction_identifiers_label]]
+Transaction Identifiers (Section A5)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+The AXI protocol includes AXI ID transaction identifiers. A Manager can use these to identify separate transactions that must be returned in order.
+
+The CVA6 identify each type of transaction with a specific ID:
+
+* For read transaction, id can be 0 or 1. (0 for instruction fetch and 1 for data)
+* For write transaction, id = 1.
+* For Atomic operation, id = 3. This ID must be sent in the write channels and also in the read channel if the transaction performed requires response data.
+* For Exclusive transaction, id = 3.
+
+[[axi-ordering-model-section-a6]]
+AXI Ordering Model (Section A6)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+[[axi-ordering-model-overview-section-a6.1]]
+AXI ordering model overview (Section A6.1)
+++++++++++++++++++++++++++++++++++++++++++
+
+The AXI ordering model is based on the use of the transaction identifier, which is signaled on `ARID` or `AWID`.
+
+Transaction requests on the same channel, with the same ID and destination are guaranteed to remain in order.
+
+Transaction responses with the same ID are returned in the same order as the requests were issued.
+
+Write transaction requests, with the same destination are guaranteed to remain in order. Because all write transaction performed by CVA6 have the same ID.
+
+CVA6 can perform multiple outstanding write address transactions.
+
+CVA6 cannot perform a Read transaction and a Write one at the same time. Therefore there no ordering problems between Read and write transactions.
+
+The ordering model does not give any ordering guarantees between:
+
+* Transactions from different Managers
+* Read Transactions with different IDs
+* Transactions to different Memory locations
+
+If the CVA6 requires ordering between transactions that have no ordering guarantee, the Manager must wait to receive a response to the first transaction before issuing the second transaction.
+
+[[memory-locations-and-peripheral-regions-section-a6.2]]
+Memory locations and Peripheral regions (Section A6.2)
+++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+The address map in AMBA is made up of Memory locations and Peripheral regions. But the AXI is associated to the memory interface of CVA6.
+
+A Memory location has all of the following properties:
+
+* A read of a byte from a Memory location returns the last value that was written to that byte location.
+* A write to a byte of a Memory location updates the value at that location to a new value that is obtained by a subsequent read of that location.
+* Reading or writing to a Memory location has no side-effects on any other Memory location.
+* Observation guarantees for Memory are given for each location.
+* The size of a Memory location is equal to the single-copy atomicity size for that component.
+
+[[transactions-and-ordering-section-a6.3]]
+Transactions and ordering (Section A6.3)
+++++++++++++++++++++++++++++++++++++++++
+
+A transaction is a read or a write to one or more address locations. The locations are determined by AxADDR and any relevant qualifiers such as the Non-secure bit in `AxPROT`.
+
+* Ordering guarantees are given only between accesses to the same Memory location or Peripheral region.
+* A transaction to a Peripheral region must be entirely contained within that region.
+* A transaction that spans multiple Memory locations has multiple ordering guarantees.
+
+Transaction performed by CVA6 is of type Normal, because `AxCACHE[1]` is asserted.
+
+Normal transactions are used to access Memory locations and are not expected to be used to access Peripheral regions.
+
+A Normal access to a Peripheral region must complete in a protocol-compliant manner, but the result is IMPLEMENTATION DEFINED.
+
+A write transaction performed by CVA6 is Non-bufferable (It is not possible to send an early response before the transaction reach the final destination), because `AxCACHE[0]` is deasserted.
+
+[[ordered-write-observation-section-a6.8]]
+Ordered write observation (Section A6.8)
+++++++++++++++++++++++++++++++++++++++++
+
+To improve compatibility with interface protocols that support a different ordering model, a Subordinate interface can give stronger ordering guarantees for write transactions. A stronger ordering guarantee is known as Ordered Write Observation.
+
+_The CVA6 AXI interface exhibits Ordered Write Observation, so the Ordered_Write_Observation property is True._
+
+An interface that exhibits Ordered Write Observation gives guarantees for write transactions that are not dependent on the destination or address:
+
+* A write W1 is guaranteed to be observed by a write W2, where W2 is issued after W1, from the same Manager, with the same ID.
+
+[[atomic_transactions_label]]
+Atomic transactions (Section E1.1)
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+AMBA 5 introduces Atomic transactions, which perform more than just a single access and have an operation that is associated with the transaction. Atomic transactions enable sending the operation to the data, permitting the operation to be performed closer to where the data is located. Atomic transactions are suited to situations where the data is located a significant distance from the agent that must perform the operation.
+
+_If(RVA) AWATOP = 0 (If AMO instructions are not supported, CVA6 cannot perform Atomic transaction)_
+
+_CVA6 supports just the AtomicLoad and AtomicSwap transaction. So `AWATOP[5:4]` can be 00, 10 or 11._
+
+_CVA6 performs only little-endian operation. So `AWATOP[3]` = 0._
+
+_For AtomicLoad, CVA6 supports all arithmetic operations encoded on the lower-order `AWATOP[2:0]` signals._
+
+[[cva6-constraints]]
+CVA6 Constraints
+^^^^^^^^^^^^^^^^
+
+This section describes cross-cases between several features that are not supported by CVA6.
+
+* ARID = 0 && ARSIZE = log(AXI_DATA_WIDTH/8), CVA6 always requests max number of words in case of read transaction with ID 0 (instruction fetch)
+* if(RV32) ARSIZE != 3 && ARLEN = 0 && ARID = 1, the maximum load instruction size is 4 bytes
+* if(!RVA) AxLOCK = 0, if AMO instructions are not supported, CVA6 cannot perform exclusive transaction
+* if(RVA) AxLOCK = 1 => AxSIZE > 1, CVA6 doesn't perform exclusive transaction with size lower than 4 bytes
diff --git a/docs/design/design-manual/source/CSRs.adoc b/docs/design/design-manual/source/CSRs.adoc
new file mode 100644
index 0000000000..7c1c0b7b64
--- /dev/null
+++ b/docs/design/design-manual/source/CSRs.adoc
@@ -0,0 +1,3 @@
+[[csrs]]
+
+include::csr/csr.adoc[]
\ No newline at end of file
diff --git a/docs/04_cv32a65x/design/source/csr_list.rst b/docs/design/design-manual/source/CVXIF.adoc
similarity index 85%
rename from docs/04_cv32a65x/design/source/csr_list.rst
rename to docs/design/design-manual/source/CVXIF.adoc
index 07373e9c5f..359125ad06 100644
--- a/docs/04_cv32a65x/design/source/csr_list.rst
+++ b/docs/design/design-manual/source/CVXIF.adoc
@@ -1,4 +1,4 @@
-..
+////
Copyright 2023 Thales DIS France SAS
Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -6,6 +6,8 @@
You may obtain a copy of the License at https://solderpad.org/licenses/
Original Author: Jean-Roch COULON - Thales
+////
+[[cvxif]]
-.. include:: ../../../csr-from-ip-xact/cv32a60x/csr_list.rst
+include::CVX_Interface_Coprocessor.adoc[]
diff --git a/docs/design/design-manual/source/CVX_Interface_Coprocessor.adoc b/docs/design/design-manual/source/CVX_Interface_Coprocessor.adoc
new file mode 100644
index 0000000000..4290a1372e
--- /dev/null
+++ b/docs/design/design-manual/source/CVX_Interface_Coprocessor.adoc
@@ -0,0 +1,294 @@
+[[cva6_cvx_interface_coprocessor]]
+CV-X-IF Interface and Coprocessor
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The CV-X-IF interface of CVA6 allows to extend its supported instruction
+set with external coprocessors.
+
+_Applicability of this chapter to configurations:_
+
+[cols=",",options="header",]
+|=============================
+|Configuration |Implementation
+|CV32A60AX |CV-X-IF included
+|CV32A60X |CV-X-IF included
+|CV64A6_MMU |CV-X-IF included
+|=============================
+
+[[cv-x-if-interface-specification]]
+CV-X-IF interface specification
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+[[description]]
+Description
++++++++++++
+
+This design specification presents global functionalities of
+Core-V-eXtension-Interface (XIF, CVXIF, CV-X-IF, X-interface) in the CVA6 core.
+
+
+[source,sourceCode,text]
+----
+The CORE-V X-Interface is a RISC-V eXtension interface that provides a
+generalized framework suitable to implement custom coprocessors and ISA
+extensions for existing RISC-V processors.
+
+--core-v-xif Readme, https://github.com/openhwgroup/core-v-xif
+----
+
+The specification of the CV-X-IF bus protocol can be found at [CV-X-IF].
+
+CV-X-IF aims to:
+
+* Create interfaces to connect a coprocessor to the CVA6 to execute instructions.
+* Offload CVA6 illegal instrutions to the coprocessor to be executed.
+* Get the results of offloaded instructions from the coprocessor so they are written back into the CVA6 register file.
+* Add standard RISC-V instructions unsupported by CVA6 or custom instructions and implement them in a coprocessor.
+* Kill offloaded instructions to allow speculative execution in the coprocessor. (Unsupported in CVA6 yet)
+* Connect the coprocessor to memory via the CVA6 Load and Store Unit. (Unsupported in CVA6 yet)
+
+The coprocessor operates like another functional unit so it is connected
+to the CVA6 in the execute stage.
+
+Only the 3 mandatory interfaces from the CV-X-IF specification (issue, commit and result
+) have been implemented.
+Compressed interface, Memory Interface and Memory result interface are not yet
+implemented in the CVA6.
+
+[[supported-parameters]]
+Supported Parameters
+++++++++++++++++++++
+
+The following table presents CVXIF parameters supported by CVA6.
+
+[cols=",,",options="header",]
+|=============================================
+|Signal |Value |Description
+|*X_NUM_RS* |int: 2 or 3 (configurable) a|
+[verse]
+--
+Number of register file read ports that can
+be used by the eXtension interface
+--
+
+ |
+|*X_ID_WIDTH* |int: 3 a|
+[verse]
+--
+Identification width for the eXtension
+interface
+--
+
+ |
+|*X_MEM_WIDTH* |n/a (feature not supported) a|
+[verse]
+--
+Memory access width for loads/stores via the
+eXtension interface
+--
+
+ |
+|*X_RFR_WIDTH* |int: `XLEN` (32 or 64) a|
+[verse]
+--
+Register file read access width for the
+eXtension interface
+--
+
+ |
+|*X_RFW_WIDTH* |int: `XLEN` (32 or 64) a|
+[verse]
+--
+Register file write access width for the
+eXtension interface
+--
+
+ |
+|*X_MISA* |logic[31:0]: 0x0000_0000 a|
+[verse]
+--
+MISA extensions implemented on the eXtension
+interface
+--
+
+ |
+|=============================================
+
+[[cv-x-if-enabling]]
+CV-X-IF Enabling
+++++++++++++++++
+
+CV-X-IF can be enabled or disabled via the `CVA6ConfigCvxifEn` parameter in the SystemVerilog source code.
+
+[[illegal-instruction-decoding]]
+Illegal instruction decoding
+++++++++++++++++++++++++++++
+
+The CVA6 decoder module detects illegal instructions for the CVA6, prepares exception field
+with relevant information (exception code "ILLEGAL INSTRUCTION", instruction value).
+
+The exception valid flag is raised in CVA6 decoder when CV-X-IF is disabled. Otherwise
+it is not raised at this stage because the decision belongs to the coprocessor
+after the offload process.
+
+[[rs3-support]]
+RS3 support
++++++++++++
+
+The number of source registers used by the CV-X-IF coprocessor is configurable with 2 or
+3 source registers.
+
+If CV-X-IF is enabled and configured with 3 source registers,
+a third read port is added to the CVA6 general purpose register file.
+
+[[description-of-interface-connections-between-cva6-and-coprocessor]]
+Description of interface connections between CVA6 and Coprocessor
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+In CVA6 execute stage, there is a new functional unit dedicated to drive the CV-X-IF interfaces.
+Here is _how_ and _to what_ CV-X-IF interfaces are connected to the CVA6.
+
+* Issue interface::
+ ** Request;;
+ *** [verse]
+ --
+ Operands are connected to `issue_req.rs` signals
+ --
+ *** [verse]
+ --
+ Scoreboard transaction id is connected to `issue_req.id` signal.
+ Therefore scoreboard ids and offloaded instruction ids are linked
+ together (equal in this implementation). It allows the CVA6 to do out
+ of order execution with the coprocessor in the same way as other
+ functional units.
+ --
+ *** [verse]
+ --
+ Undecoded instruction is connected to `issue_req.instruction`
+ --
+ *** [verse]
+ --
+ Valid signal for CVXIF functional unit is connected to
+ `issue_req.valid`
+ --
+ *** [verse]
+ --
+ All `issue_req.rs_valid` signals are set to 1. The validity of source
+ registers is assured by the validity of valid signal sent from issue stage.
+ --
+ ** Response;;
+ *** [verse]
+ --
+ If `issue_resp.accept` is set during a transaction (i.e. issue valid
+ and ready are set), the offloaded instruction is accepted by the coprocessor
+ and a result transaction will happen.
+ --
+ *** [verse]
+ --
+ If `issue_resp.accept` is not set during a transaction, the offloaded
+ instruction is illegal and an illegal instruction exception will be
+ raised as soon as no result transaction are written on the writeback bus.
+ --
+* Commit interface::
+ ** [verse]
+ --
+ Valid signal of commit interface is connected to the valid signal of
+ issue interface.
+ --
+ ** [verse]
+ --
+ Id signal of commit interface is connected to issue interface id signal
+ (i.e. scoreboard id).
+ --
+ ** [verse]
+ --
+ Killing of offload instruction is never set. (Unsupported feature)
+ --
+ ** [verse]
+ --
+ Therefore all accepted offloaded instructions are commited to their
+ execution and no killing of instruction is possible in this implementation.
+ --
+* Result interface::
+ ** Request;;
+ *** [verse]
+ --
+ Ready signal of result interface is always set as CVA6 is always ready
+ to take a result from coprocessor for an accepted offloaded instruction.
+ --
+ ** Response;;
+ *** [verse]
+ --
+ Result response is directly connected to writeback bus of the CV-X-IF
+ functionnal unit.
+ --
+ *** [verse]
+ --
+ Valid signal of result interface is connected to valid signal of
+ writeback bus.
+ --
+ *** [verse]
+ --
+ Id signal of result interface is connected to scoreboard id of
+ writeback bus.
+ --
+ *** [verse]
+ --
+ Write enable signal of result interface is connected to a dedicated CV-X-IF WE
+ signal in CVA6 which signals scoreboard if a writeback should happen
+ or not to the CVA6 register file.
+ --
+ *** [verse]
+ --
+ `exccode` and `exc` signal of result interface are connected to exception
+ signals of writeback bus. Exception from coprocessor does not write
+ the `tval` field in exception signal of writeback bus.
+ --
+ *** [verse]
+ --
+ Three registers are added to hold illegal instruction information in
+ case a result transaction and a non-accepted issue transaction happen
+ in the same cycle. Result transactions will be written to the writeback
+ bus in this case having priority over the non-accepted instruction due
+ to being linked to an older offloaded instruction. Once the writeback
+ bus is free, an illegal instruction exception will be raised thanks to
+ information held in these three registers.
+ --
+
+[[coprocessor-recommendations-for-use-with-cva6s-cv-x-if]]
+Coprocessor recommendations for use with CVA6's CV-X-IF
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+CVA6 supports all coprocessors supporting the CV-X-IF specification with the exception of :
+
+* Coprocessor requiring the Memory interface and Memory result interface (not implemented in CVA6 yet).::
+ ** All memory transaction should happen via the Issue interface, i.e. Load into CVA6 register file
+ then initialize an issue transaction.
+* Coprocessor requiring the Compressed interface (not implemented in CVA6 yet).::
+ ** RISC-V Compressed extension (RVC) is already implemented in CVA6 User Space for custom compressed instruction
+ is not big enough to have RVC and a custom compressed extension.
+* Stateful coprocessors.::
+ ** CVA6 will commit on the Commit interface all its issue transactions. Speculation
+ informations are only kept in the CVA6 and speculation process is only done in CVA6.
+ The coprocessor shall be stateless otherwise it will not be able to revert its state if CVA6 kills an
+ in-flight instruction (in case of mispredict or flush).
+
+[[how-to-use-cva6-without-cv-x-if-interface]]
+How to use CVA6 without CV-X-IF interface
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Select a configuration with `CVA6ConfigCvxifEn` parameter disabled or change it for your configuration.
+
+Never let the CV-X-IF interface unconnected with the `CVA6ConfigCvxifEn` parameter enabled.
+
+[[how-to-design-a-coprocessor-for-the-cv-x-if-interface]]
+How to design a coprocessor for the CV-X-IF interface
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+_The team is looking for a contributor to write this section._
+
+[[how-to-program-a-cv-x-if-coprocessor]]
+How to program a CV-X-IF coprocessor
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+_The team is looking for a contributor to write this section._
diff --git a/docs/design/design-manual/source/Traps_Interrupts_Exceptions.adoc b/docs/design/design-manual/source/Traps_Interrupts_Exceptions.adoc
new file mode 100644
index 0000000000..078e02584e
--- /dev/null
+++ b/docs/design/design-manual/source/Traps_Interrupts_Exceptions.adoc
@@ -0,0 +1,129 @@
+[[traps-interrupts-exceptions]]
+Traps, Interrupts, Exceptions
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Traps are composed of interrupts and exceptions.
+Interrupts are asynchronous events whereas exceptions are synchronous ones.
+On one hand, interrupts are occuring independently of the instructions
+(mainly raised by peripherals or debug module).
+On the other hand, an instruction may raise exceptions synchronously.
+
+[[raising-traps]]
+Raising Traps
+^^^^^^^^^^^^^
+
+When a trap is raised, the behaviour of the CVA6 core depends on
+several CSRs and some CSRs are modified.
+
+[[configuration-csrs]]
+Configuration CSRs
+++++++++++++++++++
+
+CSRs having an effect on the core behaviour when a trap occurs are:
+
+* `mstatus` and `sstatus`: several fields control the core behaviour like interrupt enable (`MIE`, `SIE`)
+* `mtvec` and `stvec`: specifies the address of trap handler.
+* `medeleg`: specifies which exceptions can be handled by a lower privileged mode (S-mode)
+* `mideleg`: specifies which interrupts can be handled by a lower privileged mode (S-mode)
+
+[[modified-csrs]]
+Modified CSRs
++++++++++++++
+
+CSRs (or fields) updated by the core when a trap occurs are:
+
+* `mstatus` or `sstatus`: several fields are updated like previous privilege mode (`MPP`, `SPP`), previous interrupt enabled (`MPIE`, SPIE``)
+* `mepc` or `sepc`: updated with the virtual address of the interrupted instruction or the instruction raising the exception.
+* `mcause` or `scause`: updated with a code indicating the event causing the trap.
+* `mtval` or `stval`: updated with exception specific information like the faulting virtual address
+
+[[supported-exceptions]]
+Supported exceptions
+++++++++++++++++++++
+
+The following exceptions are supported by the CVA6:
+
+* instruction address misaligned
+** control flow instruction with misaligned target
+
+* instruction access fault
+** access to PMP region without execute permissions
+
+* illegal instruction:
+** unimplemented CSRs
+** unsupported extensions
+
+* breakpoint (`EBREAK`)
+
+* load address misaligned:
+** `LH` at 2n+1 address
+** `LW` at 4n+1, 4n+2, 4n+3 address
+
+* load access fault
+** access to PMP region without read permissions
+
+* store/AMO address misaligned
+** `SH` at 2n+1 address
+** `SW` at 4n+1, 4n+2, 4n+3 address
+
+* store/AMO access fault
+** access to PMP region without write permissions
+
+* environment call (`ECALL`) from U-mode
+
+* environment call (`ECALL`) from S-mode
+
+* environment call (`ECALL`) from M-mode
+
+* instruction page fault
+
+* load page fault
+** access to effective address without read permissions
+
+* store/AMO page fault
+** access to effective address without write permissions
+
+* debug request (custom) via debug interface
+
+Note: all exceptions are supported except the ones linked to the hypervisor extension
+
+[[trap-return]]
+Trap return
+^^^^^^^^^^^
+
+Trap handler ends with trap return instruction (`MRET`, `SRET`). The behaviour of the CVA6 core depends on several CSRs.
+
+[[configuration-csrs-1]]
+Configuration CSRs
+++++++++++++++++++
+
+CSRs having an effect on the core behaviour when returning from a trap are:
+
+* `mstatus`: several fields control the core behaviour like previous privilege mode (`MPP`, `SPP`), previous interrupt enabled (`MPIE`, `SPIE`)
+
+[[modified-csrs-1]]
+Modified CSRs
++++++++++++++
+
+CSRs (or fields) updated by the core when returning from a trap are:
+
+* `mstatus`: several fields are updated like interrupt enable (`MIE`, `SIE`), modify privilege (`MPRV`)
+
+[[interrupts]]
+Interrupts
+^^^^^^^^^^
+
+* external interrupt: `irq_i` signal
+* software interrupt (inter-processor interrupt): `ipi_i` signal
+* timer interrupt: `time_irq_i` signal
+* debug interrupt: `debug_req_i` signal
+
+These signals are level sensitive. It means the interrupt is raised until it is cleared.
+
+The exception code field (`mcause` CSR) depends on the interrupt source.
+
+[[wait-for-interrupt]]
+Wait for Interrupt
+^^^^^^^^^^^^^^^^^^
+
+* CVA6 implementation: `WFI` stalls the core. The instruction is not available in U-mode (raise illegal instruction exception). Such exception is also raised when `TW=1` in `mstatus`.
diff --git a/docs/04_cv32a65x/design/source/architecture.rst b/docs/design/design-manual/source/architecture.adoc
similarity index 57%
rename from docs/04_cv32a65x/design/source/architecture.rst
rename to docs/design/design-manual/source/architecture.adoc
index 8ddd680a17..7de7ea334a 100644
--- a/docs/04_cv32a65x/design/source/architecture.rst
+++ b/docs/design/design-manual/source/architecture.adoc
@@ -1,4 +1,4 @@
-..
+////
Copyright 2022 Thales DIS design services SAS
Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -6,42 +6,29 @@
You may obtain a copy of the License at https://solderpad.org/licenses/
Original Author: Jean-Roch COULON - Thales
+////
-
-
+[[architecture-and-modules]]
Architecture and Modules
-========================
+------------------------
-The CV32A65X is fully synthesizable. It has been designed mainly for ASIC designs, but FPGA synthesis is supported as well.
+The {ohg-config} is fully synthesizable. It has been designed mainly for ASIC designs, but FPGA synthesis is supported as well.
For ASIC synthesis, the whole design is completely synchronous and uses positive-edge triggered flip-flops. The core occupies an area of about 80 kGE. The clock frequency can be more than 1GHz depending of technology.
-The CV32A65X subsystem is composed of 8 modules.
-
-.. figure:: ../images/subsystems.png
- :name: CV32A6 v0.1.0 modules
- :align: center
- :alt:
+The {ohg-config} subsystem is composed of 8 modules.
- CV32A65X modules
+image:subsystems.png[{ohg-config} modules]
Connections between modules are illustrated in the following block diagram. FRONTEND, DECODE, ISSUE, EXECUTE, COMMIT and CONTROLLER are part of the pipeline. And CACHES implements the instruction and data caches and CSRFILE contains registers.
-.. figure:: ../images/CV32A65X_subsystems.png
- :name: CV32A65X subsystem
- :align: center
- :alt:
-
- CV32A65X pipeline and modules
-
-.. toctree::
- :hidden:
+image:{ohg-config}_subsystems.png[{ohg-config} pipeline and modules]
- cv32a6_frontend
- cva6_id_stage
- cva6_issue_stage
- cv32a6_execute
- cva6_commit_stage
- cva6_controller
- cva6_csr_regfile
- cva6_caches
+include::cv32a6_frontend.adoc[]
+include::cva6_id_stage.adoc[]
+include::cva6_issue_stage.adoc[]
+include::cv32a6_execute.adoc[]
+include::cva6_commit_stage.adoc[]
+include::cva6_controller.adoc[]
+include::cva6_csr_regfile.adoc[]
+include::cva6_caches.adoc[]
diff --git a/docs/04_cv32a65x/design/source/cv32a6_execute.rst b/docs/design/design-manual/source/cv32a6_execute.adoc
similarity index 75%
rename from docs/04_cv32a65x/design/source/cv32a6_execute.rst
rename to docs/design/design-manual/source/cv32a6_execute.adoc
index 57d4899342..55f98719cf 100644
--- a/docs/04_cv32a65x/design/source/cv32a6_execute.rst
+++ b/docs/design/design-manual/source/cv32a6_execute.adoc
@@ -1,12 +1,11 @@
-.. _CVA6_EX_STAGE:
+[[CVA6_EX_STAGE]]
-###############
EX_STAGE Module
-###############
+~~~~~~~~~~~~~~~
-***********
+[[ex_stage-description]]
Description
-***********
+^^^^^^^^^^^
The EX_STAGE module is a logical stage which implements the execute stage.
It encapsulates the following functional units: ALU, Branch Unit, CSR buffer, Mult, load and store and CVXIF.
@@ -16,89 +15,73 @@ The module is connected to:
* ID_STAGE module provides scoreboard entry.
*
-.. include:: port_ex_stage.rst
-
-*************
+[[ex_stage-functionality]]
Functionality
-*************
+^^^^^^^^^^^^^
TO BE COMPLETED
-**********
+[[ex_stage-submodules]]
Submodules
-**********
-
-.. figure:: ../images/ex_stage_modules.png
- :name: EX_STAGE submodules
- :align: center
- :alt:
-
- EX_STAGE submodules
+^^^^^^^^^^
+image:ex_stage_modules.png[EX_STAGE submodules]
+[[alu]]
alu
-===
++++
The arithmetic logic unit (ALU) is a small piece of hardware which performs 32 and 64-bit arithmetic and bitwise operations: subtraction, addition, shifts, comparisons...
It always completes its operation in a single cycle.
-.. include:: port_alu.rst
-
+include::port_alu.adoc[]
+[[branch_unit]]
branch_unit
-===========
++++++++++++
The branch unit module manages all kinds of control flow changes i.e.: conditional and unconditional jumps.
It calculates the target address and decides whether to take the branch or not.
It also decides if a branch was mis-predicted or not and reports corrective actions to the pipeline stages.
-.. include:: port_branch_unit.rst
-
+include::port_branch_unit.adoc[]
+[[csr_buffer]]
CSR_buffer
-==========
+++++++++++
The CSR buffer module stores the CSR address at which the instruction is going to read/write.
As the CSR instruction alters the processor architectural state, this instruction has to be buffered until the commit stage decides to execute the instruction.
-.. include:: port_csr_buffer.rst
-
+include::port_csr_buffer.adoc[]
+[[mult]]
mult
-====
+++++
The multiplier module supports the division and multiplication operations.
-.. figure:: ../images/mult_modules.png
- :name: mult submodules
- :align: center
- :alt:
-
- mult submodules
+image:mult_modules.png[mult submodules]
-.. include:: port_mult.rst
+include::port_mult.adoc[]
-
-----------
-multiplier
-----------
+[[multiplier]]
+====== multiplier
Multiplication is performed in two cycles and is fully pipelined.
-.. include:: port_multiplier.rst
-
+include::port_multiplier.adoc[]
-------
-serdiv
-------
+[[serdiv]]
+====== serdiv
The division is a simple serial divider which needs 64 cycles in the worst case.
-.. include:: port_serdiv.rst
-
+include::port_serdiv.adoc[]
+[[load_store_unit-lsu]]
load_store_unit (LSU)
-=====================
++++++++++++++++++++++
The load store module interfaces with the data cache (D$) to manage the load and store operations.
@@ -106,19 +89,12 @@ The LSU does not handle misaligned accesses.
Misaligned accesses are double word accesses which are not aligned to a 64-bit boundary, word accesses which are not aligned to a 32-bit boundary and half word accesses which are not aligned on 16-bit boundary.
If the LSU encounters a misaligned load or store, it throws a misaligned exception.
-.. figure:: ../images/load_store_unit_modules.png
- :name: load_store_unit submodules
- :align: center
- :alt:
-
- load_store_unit submodules
+image:load_store_unit_modules.png[load_store_unit submodules]
-.. include:: port_load_store_unit.rst
+include::port_load_store_unit.adoc[]
-
-----------
-store_unit
-----------
+[[store_unit]]
+====== store_unit
The store_unit module manages the data store operations.
@@ -132,12 +108,10 @@ When commit buffer is not empty, the buffer automatically tries to write the old
Furthermore, the store_unit module provides information to the load_unit to know if an outstanding store matches addresses with a load.
-.. include:: port_store_unit.rst
-
+include::port_store_unit.adoc[]
----------
-load_unit
----------
+[[load_unit]]
+====== load_unit
The load unit module manages the data load operations.
@@ -156,27 +130,21 @@ If the load request address is non-idempotent, it stalls until the write buffer
It also stalls until the incoming load instruction is the next instruction to be committed.
When the D$ allows the read of the data, the data is sent to the load unit and the load instruction can be committed (4).
-.. figure:: ../images/schema_fsm_load_control.png
- :align: center
+image:schema_fsm_load_control.png[Load unit's interactions]
- Load unit's interactions
+include::port_load_unit.adoc[]
-.. include:: port_load_unit.rst
-
-
-----------
-lsu_bypass
-----------
+[[lsu_bypass]]
+====== lsu_bypass
The LSU bypass is a FIFO which keeps instructions from the issue stage when the store unit or the load unit are not available immediately.
-.. include:: port_lsu_bypass.rst
-
+include::port_lsu_bypass.adoc[]
+[[cvxif_fu]]
CVXIF_fu
-========
+++++++++
TO BE COMPLETED
-.. include:: port_cvxif_fu.rst
-
+include::port_cvxif_fu.adoc[]
diff --git a/docs/04_cv32a65x/design/source/cv32a6_frontend.rst b/docs/design/design-manual/source/cv32a6_frontend.adoc
similarity index 55%
rename from docs/04_cv32a65x/design/source/cv32a6_frontend.rst
rename to docs/design/design-manual/source/cv32a6_frontend.adoc
index f647a618a2..1012c7cb50 100644
--- a/docs/04_cv32a65x/design/source/cv32a6_frontend.rst
+++ b/docs/design/design-manual/source/cv32a6_frontend.adoc
@@ -1,4 +1,4 @@
-..
+////
Copyright 2021 Thales DIS design services SAS
Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -6,14 +6,16 @@
You may obtain a copy of the License at https://solderpad.org/licenses/
Original Author: Jean-Roch COULON - Thales
+////
-.. _CV32A6_FRONTEND:
+[[CV32A6_FRONTEND]]
FRONTEND Module
-===============
+~~~~~~~~~~~~~~~
+[[frontend-description]]
Description
------------
+^^^^^^^^^^^
The FRONTEND module implements two first stages of the cva6 pipeline,
PC gen and Fetch stages.
@@ -29,74 +31,75 @@ The module is connected to:
* CACHES module provides fethed instructions to FRONTEND.
* DECODE module receives instructions from FRONTEND.
* CONTROLLER module can order to flush and to halt FRONTEND PC gen stage
-* EXECUTE, CONTROLLER, CSR and COMMIT modules trigger PC jumping due to a branch misprediction, an exception, a return from an exception, a debug entry or a pipeline flush.
- They provides the PC next value.
+* EXECUTE, CONTROLLER, CSR and COMMIT modules trigger PC jumping due to
+a branch misprediction, an exception, a return from an exception, a
+debug entry or a pipeline flush. They provides the PC next value.
* CSR module states about debug mode.
-.. include:: port_frontend.rst
+include::port_frontend.adoc[]
+[[frontend-functionality]]
Functionality
--------------
-
-
+^^^^^^^^^^^^^
+[[pc-generation-stage]]
PC Generation stage
-~~~~~~~~~~~~~~~~~~~
+^^^^^^^^^^^^^^^^^^^
PC gen generates the next program counter. The next PC can originate from the following sources (listed in order of precedence):
-* **Reset state:** At reset, the PC is assigned to the boot address.
-
-* **Branch Prediction:** The fetched instruction is predecoded by the instr_scan submodule.
- When the instruction is a control flow, three cases are considered:
-
- 1. When the instruction is a JALR which corresponds to a return (rs1 = x1 or rs1 = x5).
- RAS provides next PC as a prediction.
-
- 2. When the instruction is a JALR which **does not** correspond to a return.
- If BTB (Branch Target Buffer) returns a valid address, then BTB predicts next PC.
- Else JALR is not considered as a control flow instruction, which will generate a mispredict.
-
- 3. When the instruction is a conditional branch.
- If BHT (Branch History table) returns a valid address, then BHT predicts next PC.
- Else the prediction depends on the PC relative jump offset sign: if sign is negative the prediction is taken, otherwise the prediction is not taken.
-
- Then the PC gen informs the Fetch stage that it performed a prediction on the PC.
-
-* **Default:** The next 32-bit block is fetched.
- PC Gen fetches word boundary 32-bits block from CACHES module. And the fetch stage identifies the instructions from the 32-bits blocks.
-
-* **Mispredict:** Misprediction are feedbacked by EX_STAGE module.
- In any case we need to correct our action and start fetching from the correct address.
-
-* **Replay instruction fetch:** When the instruction queue is full, the instr_queue submodule asks the fetch replay and provides the address to be replayed.
-
-* **Return from environment call:** When CSR requests a return from an environment call, next PC takes the value of the PC of the instruction after the one pointed to by the mepc CSR.
-
-* **Exception/Interrupt:** If an exception is triggered by CSR_REGISTER, next PC takes the value of the trap vector base address CSR.
-
-* **Pipeline starting fetching from COMMIT PC:** When the commit stage is halted by a WFI instruction or when the pipeline has been flushed due to CSR change, next PC takes the value of the PC coming from the COMMIT submodule.
- As CSR instructions do not exist in a compressed form, PC is unconditionally incremented by 4.
-
-.. user and supervisor modes are not supported by CV32A65X
- The trap vector base address can be different depending on whether the exception traps to S-Mode or M-Mode (user mode exceptions are currently not supported).
- It is the purpose of the CSR Unit to figure out where to trap to and present the correct address to PC Gen.
-
-.. Debug feature is not supported by CV32A65X
- * **Debug:** Debug has the highest order of precedence as it can interrupt any control flow requests. It also the only source of control flow change which can actually happen simultaneously to any other of the forced control flow changes.
- The debug jump is requested by CSR.
- The address to be jumped into is HW coded.
-
+* *Reset state:* At reset, the PC is assigned to the boot address.
+
+* *Branch Prediction:* The fetched instruction is predecoded by the
+instr_scan submodule. When the instruction is a control flow, three
+cases are considered:
++
+________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
+1. When the instruction is a JALR which corresponds to a return (rs1 = x1 or rs1 = x5).
+RAS provides next PC as a prediction.
+2. When the instruction is a JALR which *does not* correspond to areturn.
+If BTB (Branch Target Buffer) returns a valid address, then BTBpredicts next PC.
+Else JALR is not considered as a control flow instruction, which will generate a mispredict.
+3. When the instruction is a conditional branch.
+If BHT (Branch History table) returns a valid address, then BHT predicts next PC.
+Else the prediction depends on the PC relative jump offset sign: if sign is negative the prediction is taken, otherwise the prediction is not taken.
+________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________
++
+Then the PC gen informs the Fetch stage that it performed a prediction on the PC.
+
+* *Default:* The next 32-bit block is fetched.
+PC Gen fetches word boundary 32-bits block from CACHES module. And the fetch stage identifies the instructions from the 32-bits blocks.
+
+* *Mispredict:* Misprediction are feedbacked by EX_STAGE module.
+In any case we need to correct our action and start fetching from the correct address.
+
+* *Replay instruction fetch:* When the instruction queue is full, the instr_queue submodule asks the fetch replay and provides the address to be replayed.
+
+* *Return from environment call:* When CSR requests a return from an environment call, next PC takes the value of the PC of the instruction after the one pointed to by the mepc CSR.
+
+* *Exception/Interrupt:* If an exception is triggered by CSR_REGISTER, next PC takes the value of the trap vector base address CSR.
+ifdef::RVS-true,RVU-true[]
+The trap vector base address can be different depending on whether the exception traps to S-Mode or M-Mode.
+It is the purpose of the CSR Unit to figure out where to trap to and present the correct address to PC Gen.
+endif::[]
+
+* *Pipeline starting fetching from COMMIT PC:* When the commit stage is halted by a WFI instruction or when the pipeline has been flushed due to CSR change, next PC takes the value of the PC coming from the COMMIT submodule.
+As CSR instructions do not exist in a compressed form, PC is unconditionally incremented by 4.
+
+ifeval::[{DebugEn} == true]
+* *Debug:* Debug has the highest order of precedence as it can interrupt any control flow requests. It also the only source of control flow change which can actually happen simultaneously to any other of the forced control flow changes.
+The debug jump is requested by CSR.
+The address to be jumped into is HW coded.
+endif::[]
All program counters are logical addressed.
+ifeval::[{MmuPresent} == true]
+If the logical to physical mapping changes, a ``fence.vm`` instruction should be used to flush the pipeline and TLBs.
+endif::[]
-.. MMU is not supported in CV32A65X
- If the logical to physical mapping changes, a ``fence.vm`` instruction should be used to flush the pipeline *and TLBs (MMU is not enabled in CV32A6 v0.1.0)*.
-
-
-
+[[fetch-stage]]
Fetch Stage
-~~~~~~~~~~~
+^^^^^^^^^^^
Fetch stage controls the CACHE module by a handshaking protocol.
Fetched data is a 32-bit block with a word-aligned address.
@@ -104,44 +107,38 @@ A granted fetch is processed by the instr_realign submodule to produce instructi
Then instructions are pushed into an internal instruction FIFO called instruction queue (instr_queue submodule).
This submodule stores the instructions and sends them to the DECODE module.
-.. TO_BE_COMPLETED MMU also feedback an exception, but not present in 65X
+// TO_BE_COMPLETED MMU also feedback an exception, but not present in 65X
Memory can feedback potential exceptions which can be bus errors, invalid accesses or instruction page faults.
The FRONTEND transmits the exception from CACHES to DECODE.
+[[submodules]]
Submodules
-----------
-
-.. figure:: ../images/frontend_modules.png
- :name: FRONTEND submodules
- :align: center
+^^^^^^^^^^
- FRONTEND submodules
+image:frontend_modules.png[FRONTEND submodules]
-.. figure:: ../images/ZoominFrontend.png
- :name: frontend-schematic
- :align: center
-
- FRONTEND submodule interconnections
+image:ZoominFrontend.png[FRONTEND submodule interconnections]
+[[instr_realign-submodule]]
Instr_realign submodule
-~~~~~~~~~~~~~~~~~~~~~~~
++++++++++++++++++++++++
The 32-bit aligned block coming from the CACHE module enters the instr_realign submodule.
This submodule extracts the instructions from the 32-bit blocks.
It is possible to fetch up to two instructions per cycle when C extension is used.
An not-compressed instruction can be misaligned on the block size, interleaved with two cache blocks.
In that case, two cache accesses are needed to get the whole instruction.
-The instr_realign submodule provides at maximum two instructions per cycle when compressed extensionis enabled, else one instruction per cycle.
+The instr_realign submodule provides at maximum two instructions per cycle when compressed extension is enabled, else one instruction per cycle.
Incomplete instruction is stored in instr_realign submodule until its second half is fetched.
-.. include:: port_instr_realign.rst
-
+include::port_instr_realign.adoc[]
+[[instr_queue-submodule]]
Instr_queue submodule
-~~~~~~~~~~~~~~~~~~~~~
++++++++++++++++++++++
The instr_queue receives mutliple instructions from instr_realign submodule to create a valid stream of instructions to be decoded (by DECODE), to be issued (by ISSUE) and executed (by EXECUTE).
FRONTEND pushes in FIFO to store the instructions and related information needed in case of mispredict or exception: instructions, instruction control flow type, exception, exception address and predicted address.
@@ -152,11 +149,11 @@ If the instruction queue is full, a replay request is sent to inform the fetch m
The instruction queue can be flushed by CONTROLLER.
-.. include:: port_instr_queue.rst
-
+include::port_instr_queue.adoc[]
+[[instr_scan-submodule]]
instr_scan submodule
-~~~~~~~~~~~~~~~~~~~~
+++++++++++++++++++++
As compressed extension is enabled, two instr_scan are instantiated to handle up to two instructions per cycle.
@@ -164,64 +161,56 @@ Each instr_scan submodule pre-decodes the fetched instructions coming from the i
The instr_scan submodule is a flox controler which provides the intruction type: branch, jump, return, jalr, imm, call or others.
These outputs are used by the branch prediction feature.
-.. include:: port_instr_scan.rst
-
+include::port_instr_scan.adoc[]
+[[bht-branch-history-table-submodule]]
BHT (Branch History Table) submodule
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
+++++++++++++++++++++++++++++++++++++
BHT is implemented as a memory which is composed of **BHTDepth configuration parameter** entries. The lower address bits of the virtual address point to the memory entry.
When a branch instruction is resolved by the EX_STAGE module, the branch PC and the taken (or not taken) status information is stored in the Branch History Table.
-.. TO_BE_COMPLETED: Specify the behaviour when BHT is saturated
+// TO_BE_COMPLETED: Specify the behaviour when BHT is saturated
The Branch History Table is a table of two-bit saturating counters that takes the virtual address of the current fetched instruction by the CACHE.
It states whether the current branch request should be taken or not.
The two bit counter is updated by the successive execution of the instructions as shown in the following figure.
-.. figure:: ../images/bht.png
- :name: BHT saturation
- :align: center
- :alt:
-
- BHT saturation
+image:bht.png[BHT saturation]
-.. TODO: if debug enable, The BHT is not updated if processor is in debug mode.
+// TODO: if debug enable, The BHT is not updated if processor is in debug mode.
When a branch instruction is pre-decoded by instr_scan submodule, the BHT valids whether the PC address is in the BHT and provides the taken or not prediction.
The BHT is never flushed.
-.. include:: port_bht.rst
+include::port_bht.adoc[]
+[[btb-branch-target-buffer-submodule]]
BTB (Branch Target Buffer) submodule
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
+++++++++++++++++++++++++++++++++++++
BTB is implemented as an array which is composed of **BTBDepth configuration parameter** entries.
The lower address bits of the virtual address point to the memory entry.
When an JALR instruction is found mispredicted by the EX_STAGE module, the JALR PC and the target address are stored into the BTB.
-.. TODO: Specify the behaviour when BTB is saturated
+// TODO: Specify the behaviour when BTB is saturated
-.. TODO: when debug enabled, The BTB is not updated if processor is in debug mode.
+// TODO: when debug enabled, The BTB is not updated if processor is in debug mode.
When a JALR instruction is pre-decoded by instr_scan submodule, the BTB informs whether the input PC address is in the BTB.
In this case, the BTB provides the predicted target address.
The BTB is never flushed.
+include::port_btb.adoc[]
-.. include:: port_btb.rst
-
-
+[[ras-return-address-stack-submodule]]
RAS (Return Address Stack) submodule
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
+++++++++++++++++++++++++++++++++++++
RAS is implemented as a LIFO which is composed of **RASDepth configuration parameter** entries.
@@ -232,5 +221,4 @@ If the predicted return address is wrong due for instance to speculation or RAS
The RAS is never flushed.
-.. include:: port_ras.rst
-
+include::port_ras.adoc[]
diff --git a/docs/design/design-manual/source/cv32a6_glossary.adoc b/docs/design/design-manual/source/cv32a6_glossary.adoc
new file mode 100644
index 0000000000..d0f0906e2d
--- /dev/null
+++ b/docs/design/design-manual/source/cv32a6_glossary.adoc
@@ -0,0 +1,65 @@
+[[CV32A6_GLOSSARY]]
+[[glossary]]
+Glossary
+--------
+
+* *ALU*: Arithmetic/Logic Unit
+* *APU*: Application Processing Unit
+* *ASIC*: Application-Specific Integrated Circuit
+* *AXI*: Advanced eXtensible Interface
+* *BHT*: Branch History Table
+* *BTB*: Branch Target Buffer
+* *Byte*: 8-bit data item
+* *CPU*: Central Processing Unit, processor
+* *CSR*: Control and Status Register
+* *Custom extension*: Non-Standard extension to the RISC-V base
+instruction set (RISC-V Instruction Set Manual, Volume I: User-Level
+ISA)
+* *CVA6*: Core-V Application class processor with a 6 stage pipeline
+* *D$*: Data Cache
+* *DPI*: Direct Programming Interface
+* *EX* or *EXE*: Instruction Execute
+* *FPGA*: Field Programmable Gate Array
+* *FPU*: Floating Point Unit
+* *Halfword*: 16-bit data item
+* *Halfword aligned address*: An address is halfword aligned if it is
+divisible by 2
+* *I$*: Instruction Cache
+* *ID*: Instruction Decode
+* *IF*: Instruction Fetch
+* *ISA*: Instruction Set Architecture
+* *KGE*: Kilo Gate Equivalents (NAND2)
+* *LSU*: Load Store Unit
+* *M-Mode*: Machine Mode (RISC-V Instruction Set Manual, Volume II:
+Privileged Architecture)
+* *MMU*: Memory Management Unit
+* *NC*: Not Cacheable
+* *OBI*: Open Bus Interface
+* *OoO*: Out Of Order
+* *PC*: Program Counter
+* *PMP*: Physical memory protection (RISC-V Instruction Set Manual,
+Volume II: Privileged Architecture)
+* *PTW*: Page Table Walker
+* *PULP platform*: Parallel Ultra Low Power Platform
+()
+* *RAS*: Return Address Stack
+* *RV32C*: RISC-V Compressed (C extension)
+* *RV32F*: RISC-V Floating Point (F extension)
+* *S-Mode*: Supervisor Mode (RISC-V Instruction Set Manual, Volume II:
+Privileged Architecture)
+* *SIMD*: Single Instruction/Multiple Data
+* *Standard extension*: Standard extension to the RISC-V base
+instruction set (RISC-V Instruction Set Manual, Volume I: User-Level
+ISA)
+* *TLB*: Translation Lookaside Buffer
+* *U-Mode*: User Mode (RISC-V Instruction Set Manual, Volume II:
+Privileged Architecture)
+* *VLEN*: Virtual address length
+* *WARL*: Write Any Values, Reads Legal Values
+* *WB*: Write Back of instruction results
+* *WLRL*: Write/Read Only Legal Values
+* *Word*: 32-bit data item
+* *Word aligned address*: An address is word aligned if it is divisible
+by 4
+* *WPRI*: Reserved Writes Preserve Values, Reads Ignore Values
+* *XLEN*: RISC-V processor data length
diff --git a/docs/04_cv32a65x/design/source/cva6_caches.rst b/docs/design/design-manual/source/cva6_caches.adoc
similarity index 68%
rename from docs/04_cv32a65x/design/source/cva6_caches.rst
rename to docs/design/design-manual/source/cva6_caches.adoc
index 21e1d7fec8..1e9fcb2b9d 100644
--- a/docs/04_cv32a65x/design/source/cva6_caches.rst
+++ b/docs/design/design-manual/source/cva6_caches.adoc
@@ -1,4 +1,4 @@
-..
+////
Copyright 2024 Thales DIS France SAS
Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
you may not use this file except in compliance with the License.
@@ -6,36 +6,33 @@
You may obtain a copy of the License at https://solderpad.org/licenses/
Original Author: Jean-Roch COULON - Thales
+////
-.. _CVA6_CACHES:
-
+[[CVA6_CACHES]]
CACHES Module
-=============
+~~~~~~~~~~~~~
+[[caches-description]]
Description
------------
+^^^^^^^^^^^
-The CACHES module implements an instruction cache, a data cache and an AXI adapter.
+The CACHES module implements an instruction cache, a data cache and an
+AXI adapter.
The module is connected to:
* TO_BE_COMPLETED
-.. include:: port_cva6_hpdcache_subsystem.rst
-
+include::port_cva6_hpdcache_subsystem.adoc[]
+[[caches-functionality]]
Functionality
--------------
+^^^^^^^^^^^^^
TO BE COMPLETED
-
+[[caches-submodules]]
Submodules
-----------
-
-.. figure:: ../images/caches.png
- :name: CACHES submodules
- :align: center
- :alt:
+^^^^^^^^^^
- CACHES submodules
+image:caches.png[CACHES submodules]
diff --git a/docs/design/design-manual/source/cva6_commit_stage.adoc b/docs/design/design-manual/source/cva6_commit_stage.adoc
new file mode 100644
index 0000000000..99611f2ce9
--- /dev/null
+++ b/docs/design/design-manual/source/cva6_commit_stage.adoc
@@ -0,0 +1,42 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[CVA6_COMMIT_STAGE]]
+COMMIT_STAGE Module
+~~~~~~~~~~~~~~~~~~~
+
+[[commit_stage-description]]
+Description
+^^^^^^^^^^^
+
+The COMMIT_STAGE module implements the commit stage, which is the last
+stage in the processor’s pipeline. For the instructions for which the
+execution is completed, it updates the architectural state: writing CSR
+registers, committing stores and writing back data to the register file.
+The commit stage controls the stalling and the flushing of the
+processor.
+
+The commit stage also manages the exceptions. An exception can occur
+during the first four pipeline stages (PCgen cannot generate an
+exception) or happen in commit stage, coming from the CSR_REGFILE or
+from an interrupt. Exceptions are precise: they are considered during
+the commit only and associated with the related instruction.
+
+The module is connected to:
+
+* TO BE COMPLETED
+
+include::port_commit_stage.adoc[]
+
+[[commit_stage-functionality]]
+Functionality
+^^^^^^^^^^^^^
+
+TO BE COMPLETED
diff --git a/docs/04_cv32a65x/design/source/cva6_controller.rst b/docs/design/design-manual/source/cva6_controller.adoc
similarity index 76%
rename from docs/04_cv32a65x/design/source/cva6_controller.rst
rename to docs/design/design-manual/source/cva6_controller.adoc
index 468970856e..6be2f70285 100644
--- a/docs/04_cv32a65x/design/source/cva6_controller.rst
+++ b/docs/design/design-manual/source/cva6_controller.adoc
@@ -1,4 +1,4 @@
-..
+////
Copyright 2024 Thales DIS France SAS
Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
you may not use this file except in compliance with the License.
@@ -6,14 +6,15 @@
You may obtain a copy of the License at https://solderpad.org/licenses/
Original Author: Jean-Roch COULON - Thales
+////
-.. _CVA6_CONTROLLER:
-
+[[CVA6_CONTROLLER]]
CONTROLLER Module
-=================
+~~~~~~~~~~~~~~~~~
+[[controller-description]]
Description
------------
+^^^^^^^^^^^
The CONTROLLER module implements ... TO BE COMPLETED
@@ -21,10 +22,10 @@ The module is connected to:
* TO BE COMPLETED
-.. include:: port_controller.rst
+include::port_controller.adoc[]
+[[controller-functionality]]
Functionality
--------------
+^^^^^^^^^^^^^
TO BE COMPLETED
-
diff --git a/docs/04_cv32a65x/design/source/cva6_csr_regfile.rst b/docs/design/design-manual/source/cva6_csr_regfile.adoc
similarity index 76%
rename from docs/04_cv32a65x/design/source/cva6_csr_regfile.rst
rename to docs/design/design-manual/source/cva6_csr_regfile.adoc
index bdc6b35487..a79bd9bf93 100644
--- a/docs/04_cv32a65x/design/source/cva6_csr_regfile.rst
+++ b/docs/design/design-manual/source/cva6_csr_regfile.adoc
@@ -1,4 +1,4 @@
-..
+////
Copyright 2024 Thales DIS France SAS
Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
you may not use this file except in compliance with the License.
@@ -6,14 +6,15 @@
You may obtain a copy of the License at https://solderpad.org/licenses/
Original Author: Jean-Roch COULON - Thales
+////
-.. _CVA6_CSR_REGFILE:
-
+[[CVA6_CSR_REGFILE]]
CSR_REGFILE Module
-==================
+~~~~~~~~~~~~~~~~~~
+[[csr_regfile-description]]
Description
------------
+^^^^^^^^^^^
The CSR_REGFILE module implements ... TO BE COMPLETED
@@ -21,9 +22,10 @@ The module is connected to:
* TO BE COMPLETED
-.. include:: port_csr_regfile.rst
+include::port_csr_regfile.adoc[]
+[[csr_regfile-functionality]]
Functionality
--------------
+^^^^^^^^^^^^^
TO BE COMPLETED
diff --git a/docs/04_cv32a65x/design/source/cva6_id_stage.rst b/docs/design/design-manual/source/cva6_id_stage.adoc
similarity index 52%
rename from docs/04_cv32a65x/design/source/cva6_id_stage.rst
rename to docs/design/design-manual/source/cva6_id_stage.adoc
index faa3c579ea..0527ef6a94 100644
--- a/docs/04_cv32a65x/design/source/cva6_id_stage.rst
+++ b/docs/design/design-manual/source/cva6_id_stage.adoc
@@ -1,4 +1,4 @@
-..
+////
Copyright 2024 Thales DIS France SAS
Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
you may not use this file except in compliance with the License.
@@ -6,74 +6,74 @@
You may obtain a copy of the License at https://solderpad.org/licenses/
Original Author: Jean-Roch COULON - Thales
-
-.. _CVA6_ID_STAGE:
-
+////
+
+[[CVA6_ID_STAGE]]
ID_STAGE Module
-===============
+~~~~~~~~~~~~~~~
+[[id_stage-description]]
Description
------------
+^^^^^^^^^^^
-The ID_STAGE module implements the decode stage of the pipeline.
-Its main purpose is to decode RISC-V instructions coming from FRONTEND module
-(fetch stage) and send them to the ISSUE_STAGE module (issue stage).
+The ID_STAGE module implements the decode stage of the pipeline. Its
+main purpose is to decode RISC-V instructions coming from FRONTEND
+module (fetch stage) and send them to the ISSUE_STAGE module (issue
+stage).
The compressed_decoder module checks whether the incoming instruction is
-compressed and output the corresponding uncompressed instruction.
-Then the decoder module decodes the instruction and send it to the
-issue stage.
-
+compressed and output the corresponding uncompressed instruction. Then
+the decoder module decodes the instruction and send it to the issue
+stage.
The module is connected to:
* CONTROLLER module can flush ID_STAGE decode stage
* FRONTEND module sends instrution to ID_STAGE module
* ISSUE module receives the decoded instruction from ID_STAGE module
-* CSR_REGFILE module sends status information about privilege mode, traps, extension support.
-
-.. include:: port_id_stage.rst
-
+* CSR_REGFILE module sends status information about privilege mode,
+traps, extension support.
+include::port_id_stage.adoc[]
+[[id_stage-functionality]]
Functionality
--------------
+^^^^^^^^^^^^^
TO BE COMPLETED
-
+[[id_stage-submodules]]
Submodules
-----------
-
-.. figure:: ../images/id_stage_modules.png
- :name: ID_STAGE submodules
- :align: center
- :alt:
-
- ID_STAGE submodules
+^^^^^^^^^^
+image:id_stage_modules.png[ID_STAGE submodules]
+[[compressed_decoder]]
Compressed_decoder
-~~~~~~~~~~~~~~~~~~
+++++++++++++++++++
The compressed_decoder module decompresses all the compressed
-instructions taking a 16-bit compressed instruction and expanding it
-to its 32-bit equivalent.
-All compressed instructions have a 32-bit equivalent.
+instructions taking a 16-bit compressed instruction and expanding it to
+its 32-bit equivalent. All compressed instructions have a 32-bit
+equivalent.
-.. include:: port_compressed_decoder.rst
+include::port_compressed_decoder.adoc[]
+[[decoder]]
Decoder
-~~~~~~~
-
-The decoder module takes the output of compressed_decoder module and decodes it.
-It transforms the instruction to the most fundamental control structure in pipeline, a scoreboard entry.
++++++++
-The scoreboard entry contains an exception entry which is composed of a valid field, a cause and a value called TVAL.
-As TVALEn configuration parameter is zero, the TVAL field is not implemented.
+The decoder module takes the output of compressed_decoder module and
+decodes it. It transforms the instruction to the most fundamental
+control structure in pipeline, a scoreboard entry.
-A potential illegal instruction exception can be detected during decoding.
-If no exception has happened previously in fetch stage, the decoder will valid the exception and add the cause and tval value to the scoreboard entry.
+The scoreboard entry contains an exception entry which is composed of a
+valid field, a cause and a value called TVAL. As TVALEn configuration
+parameter is zero, the TVAL field is not implemented.
-.. include:: port_decoder.rst
+A potential illegal instruction exception can be detected during
+decoding. If no exception has happened previously in fetch stage, the
+decoder will valid the exception and add the cause and tval value to the
+scoreboard entry.
+include::port_decoder.adoc[]
diff --git a/docs/design/design-manual/source/cva6_issue_stage.adoc b/docs/design/design-manual/source/cva6_issue_stage.adoc
new file mode 100644
index 0000000000..6e2889d1df
--- /dev/null
+++ b/docs/design/design-manual/source/cva6_issue_stage.adoc
@@ -0,0 +1,65 @@
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[CVA6_ISSUE_STAGE]]
+ISSUE_STAGE Module
+~~~~~~~~~~~~~~~~~~
+
+[[issue_stage-description]]
+Description
+^^^^^^^^^^^
+
+The execution can be roughly divided into four parts: issue(1), read
+operands(2), execute(3) and write-back(4). The ISSUE_STAGE module
+handles step one, two and four. The ISSUE_STAGE module receives the
+decoded instructions and issues them to the various functional units.
+
+A data structure called scoreboard is used to keep track of data related
+to the issue instruction: which functional unit and which destination
+register they are. The scoreboard handle the write-back data received
+from the COMMIT_STAGE module.
+
+Furthermore it contains the CPU’s register file.
+
+The module is connected to:
+
+* TO BE COMPLETED
+
+include::port_issue_stage.adoc[]
+
+[[issue_stage-functionality]]
+Functionality
+^^^^^^^^^^^^^
+
+TO BE COMPLETED
+
+[[issue_stage-submodules]]
+Submodules
+^^^^^^^^^^
+
+image:issue_stage_modules.png[ISSUE_STAGE submodules]
+
+[[scoreboard]]
+Scoreboard
+++++++++++
+
+The scoreboard contains a FIFO to store the decoded instructions. Issued
+instruction is pushed to the FIFO if it is not full. It indicates which
+registers are going to be clobbered by a previously issued instruction.
+
+include::port_scoreboard.adoc[]
+
+[[issue_read_operands]]
+Issue_read_operands
++++++++++++++++++++
+
+TO BE COMPLETED
+
+include::port_issue_read_operands.adoc[]
diff --git a/docs/design/design-manual/source/design.adoc b/docs/design/design-manual/source/design.adoc
new file mode 100644
index 0000000000..1fdb50d401
--- /dev/null
+++ b/docs/design/design-manual/source/design.adoc
@@ -0,0 +1,40 @@
+////
+ Copyright (c) 2022 Thales
+ Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+include::config.adoc[]
+include::config_define.adoc[]
+
+[[DesignDocument]]
+= Design Documentation for {ohg-config} architecture
+:description: Design documentation for {ohg-config}
+:company: THALES
+:doctype: book
+:sectnums:
+:sectnumlevels: 5
+:toc: left
+:toclevels: 4
+:table-caption: Table
+:figure-caption: Figure
+:xrefstyle: short
+:imagesdir: images
+:example-caption: Example
+:listing-caption: Listing
+:chapter-refsig: Chapter
+:section-refsig: Section
+:appendix-refsig: Appendix
+:data-uri:
+
+Editor: *Jean Roch Coulon*
+
+include::intro.adoc[]
+include::subsystem.adoc[]
+include::functionality.adoc[]
+include::architecture.adoc[]
+include::cv32a6_glossary.adoc[]
diff --git a/docs/04_cv32a65x/design/source/functionality.rst b/docs/design/design-manual/source/functionality.adoc
similarity index 70%
rename from docs/04_cv32a65x/design/source/functionality.rst
rename to docs/design/design-manual/source/functionality.adoc
index 71198e13ee..b4bd673f42 100644
--- a/docs/04_cv32a65x/design/source/functionality.rst
+++ b/docs/design/design-manual/source/functionality.adoc
@@ -1,4 +1,4 @@
-..
+////
Copyright 2023 Thales DIS France SAS
Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -6,17 +6,14 @@
You may obtain a copy of the License at https://solderpad.org/licenses/
Original Author: Jean-Roch COULON - Thales
+////
-
-
+[[functionality]]
Functionality
-=============
-
-.. toctree::
- :maxdepth: 1
+-------------
- instructions
- traps
- CSRs
- AXI
- CVXIF
+include::instructions.adoc[]
+include::traps.adoc[]
+include::CSRs.adoc[]
+include::AXI.adoc[]
+include::CVXIF.adoc[]
diff --git a/docs/04_cv32a65x/design/images/CVA6_subsystems.png b/docs/design/design-manual/source/images/CVA6_subsystems.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/CVA6_subsystems.png
rename to docs/design/design-manual/source/images/CVA6_subsystems.png
diff --git a/docs/04_cv32a65x/design/images/LZC.png b/docs/design/design-manual/source/images/LZC.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/LZC.png
rename to docs/design/design-manual/source/images/LZC.png
diff --git a/docs/04_cv32a65x/design/images/RR.png b/docs/design/design-manual/source/images/RR.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/RR.png
rename to docs/design/design-manual/source/images/RR.png
diff --git a/docs/04_cv32a65x/design/images/ZoominFrontend.png b/docs/design/design-manual/source/images/ZoominFrontend.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/ZoominFrontend.png
rename to docs/design/design-manual/source/images/ZoominFrontend.png
diff --git a/docs/04_cv32a65x/design/images/ariane_overview.drawio.png b/docs/design/design-manual/source/images/ariane_overview.drawio.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/ariane_overview.drawio.png
rename to docs/design/design-manual/source/images/ariane_overview.drawio.png
diff --git a/docs/04_cv32a65x/design/images/ariane_overview.png b/docs/design/design-manual/source/images/ariane_overview.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/ariane_overview.png
rename to docs/design/design-manual/source/images/ariane_overview.png
diff --git a/docs/04_cv32a65x/design/images/bht.png b/docs/design/design-manual/source/images/bht.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/bht.png
rename to docs/design/design-manual/source/images/bht.png
diff --git a/docs/04_cv32a65x/design/images/caches.png b/docs/design/design-manual/source/images/caches.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/caches.png
rename to docs/design/design-manual/source/images/caches.png
diff --git a/docs/04_cv32a65x/design/images/cva6_tlb_entry.png b/docs/design/design-manual/source/images/cva6_tlb_entry.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/cva6_tlb_entry.png
rename to docs/design/design-manual/source/images/cva6_tlb_entry.png
diff --git a/docs/04_cv32a65x/design/images/cva6_tlb_hit.png b/docs/design/design-manual/source/images/cva6_tlb_hit.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/cva6_tlb_hit.png
rename to docs/design/design-manual/source/images/cva6_tlb_hit.png
diff --git a/docs/04_cv32a65x/design/images/ex_stage_modules.png b/docs/design/design-manual/source/images/ex_stage_modules.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/ex_stage_modules.png
rename to docs/design/design-manual/source/images/ex_stage_modules.png
diff --git a/docs/04_cv32a65x/design/images/frontend_modules.png b/docs/design/design-manual/source/images/frontend_modules.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/frontend_modules.png
rename to docs/design/design-manual/source/images/frontend_modules.png
diff --git a/docs/04_cv32a65x/design/images/id_stage_modules.png b/docs/design/design-manual/source/images/id_stage_modules.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/id_stage_modules.png
rename to docs/design/design-manual/source/images/id_stage_modules.png
diff --git a/docs/04_cv32a65x/design/images/in_out_tlb.png b/docs/design/design-manual/source/images/in_out_tlb.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/in_out_tlb.png
rename to docs/design/design-manual/source/images/in_out_tlb.png
diff --git a/docs/04_cv32a65x/design/images/issue_stage_modules.png b/docs/design/design-manual/source/images/issue_stage_modules.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/issue_stage_modules.png
rename to docs/design/design-manual/source/images/issue_stage_modules.png
diff --git a/docs/04_cv32a65x/design/images/load_store_unit_modules.png b/docs/design/design-manual/source/images/load_store_unit_modules.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/load_store_unit_modules.png
rename to docs/design/design-manual/source/images/load_store_unit_modules.png
diff --git a/docs/04_cv32a65x/design/images/mmu_control_flow.png b/docs/design/design-manual/source/images/mmu_control_flow.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/mmu_control_flow.png
rename to docs/design/design-manual/source/images/mmu_control_flow.png
diff --git a/docs/04_cv32a65x/design/images/mmu_in_out.png b/docs/design/design-manual/source/images/mmu_in_out.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/mmu_in_out.png
rename to docs/design/design-manual/source/images/mmu_in_out.png
diff --git a/docs/04_cv32a65x/design/images/mmu_major_blocks.png b/docs/design/design-manual/source/images/mmu_major_blocks.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/mmu_major_blocks.png
rename to docs/design/design-manual/source/images/mmu_major_blocks.png
diff --git a/docs/04_cv32a65x/design/images/mult_modules.png b/docs/design/design-manual/source/images/mult_modules.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/mult_modules.png
rename to docs/design/design-manual/source/images/mult_modules.png
diff --git a/docs/04_cv32a65x/design/images/openhw-landscape.svg b/docs/design/design-manual/source/images/openhw-landscape.svg
similarity index 100%
rename from docs/04_cv32a65x/design/images/openhw-landscape.svg
rename to docs/design/design-manual/source/images/openhw-landscape.svg
diff --git a/docs/04_cv32a65x/design/images/plru_tree_indexing.png b/docs/design/design-manual/source/images/plru_tree_indexing.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/plru_tree_indexing.png
rename to docs/design/design-manual/source/images/plru_tree_indexing.png
diff --git a/docs/04_cv32a65x/design/images/ptw_dptw.png b/docs/design/design-manual/source/images/ptw_dptw.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/ptw_dptw.png
rename to docs/design/design-manual/source/images/ptw_dptw.png
diff --git a/docs/04_cv32a65x/design/images/ptw_dptw_s.png b/docs/design/design-manual/source/images/ptw_dptw_s.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/ptw_dptw_s.png
rename to docs/design/design-manual/source/images/ptw_dptw_s.png
diff --git a/docs/04_cv32a65x/design/images/ptw_idle.png b/docs/design/design-manual/source/images/ptw_idle.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/ptw_idle.png
rename to docs/design/design-manual/source/images/ptw_idle.png
diff --git a/docs/04_cv32a65x/design/images/ptw_in_out.png b/docs/design/design-manual/source/images/ptw_in_out.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/ptw_in_out.png
rename to docs/design/design-manual/source/images/ptw_in_out.png
diff --git a/docs/04_cv32a65x/design/images/ptw_iptw.png b/docs/design/design-manual/source/images/ptw_iptw.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/ptw_iptw.png
rename to docs/design/design-manual/source/images/ptw_iptw.png
diff --git a/docs/04_cv32a65x/design/images/ptw_mis_sup.png b/docs/design/design-manual/source/images/ptw_mis_sup.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/ptw_mis_sup.png
rename to docs/design/design-manual/source/images/ptw_mis_sup.png
diff --git a/docs/04_cv32a65x/design/images/ptw_nlvl.png b/docs/design/design-manual/source/images/ptw_nlvl.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/ptw_nlvl.png
rename to docs/design/design-manual/source/images/ptw_nlvl.png
diff --git a/docs/04_cv32a65x/design/images/ptw_pte_1.png b/docs/design/design-manual/source/images/ptw_pte_1.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/ptw_pte_1.png
rename to docs/design/design-manual/source/images/ptw_pte_1.png
diff --git a/docs/04_cv32a65x/design/images/ptw_pte_flowchart.png b/docs/design/design-manual/source/images/ptw_pte_flowchart.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/ptw_pte_flowchart.png
rename to docs/design/design-manual/source/images/ptw_pte_flowchart.png
diff --git a/docs/04_cv32a65x/design/images/ptw_state_diagram.png b/docs/design/design-manual/source/images/ptw_state_diagram.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/ptw_state_diagram.png
rename to docs/design/design-manual/source/images/ptw_state_diagram.png
diff --git a/docs/04_cv32a65x/design/images/replacement_entry.png b/docs/design/design-manual/source/images/replacement_entry.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/replacement_entry.png
rename to docs/design/design-manual/source/images/replacement_entry.png
diff --git a/docs/04_cv32a65x/design/images/schema_fsm_load_control.png b/docs/design/design-manual/source/images/schema_fsm_load_control.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/schema_fsm_load_control.png
rename to docs/design/design-manual/source/images/schema_fsm_load_control.png
diff --git a/docs/04_cv32a65x/design/images/sfence_vaddr_asid.png b/docs/design/design-manual/source/images/sfence_vaddr_asid.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/sfence_vaddr_asid.png
rename to docs/design/design-manual/source/images/sfence_vaddr_asid.png
diff --git a/docs/04_cv32a65x/design/images/sfence_vaddr_x0.png b/docs/design/design-manual/source/images/sfence_vaddr_x0.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/sfence_vaddr_x0.png
rename to docs/design/design-manual/source/images/sfence_vaddr_x0.png
diff --git a/docs/04_cv32a65x/design/images/sfence_x0_asid.png b/docs/design/design-manual/source/images/sfence_x0_asid.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/sfence_x0_asid.png
rename to docs/design/design-manual/source/images/sfence_x0_asid.png
diff --git a/docs/04_cv32a65x/design/images/sfence_x0_x0.png b/docs/design/design-manual/source/images/sfence_x0_x0.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/sfence_x0_x0.png
rename to docs/design/design-manual/source/images/sfence_x0_x0.png
diff --git a/docs/04_cv32a65x/design/images/shared_tlb.png b/docs/design/design-manual/source/images/shared_tlb.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/shared_tlb.png
rename to docs/design/design-manual/source/images/shared_tlb.png
diff --git a/docs/04_cv32a65x/design/images/shared_tlb_in_out.png b/docs/design/design-manual/source/images/shared_tlb_in_out.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/shared_tlb_in_out.png
rename to docs/design/design-manual/source/images/shared_tlb_in_out.png
diff --git a/docs/04_cv32a65x/design/images/shared_tlb_set.png b/docs/design/design-manual/source/images/shared_tlb_set.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/shared_tlb_set.png
rename to docs/design/design-manual/source/images/shared_tlb_set.png
diff --git a/docs/04_cv32a65x/design/images/subsystems.png b/docs/design/design-manual/source/images/subsystems.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/subsystems.png
rename to docs/design/design-manual/source/images/subsystems.png
diff --git a/docs/04_cv32a65x/design/images/update_tree.png b/docs/design/design-manual/source/images/update_tree.png
similarity index 100%
rename from docs/04_cv32a65x/design/images/update_tree.png
rename to docs/design/design-manual/source/images/update_tree.png
diff --git a/docs/design/design-manual/source/instructions.adoc b/docs/design/design-manual/source/instructions.adoc
new file mode 100644
index 0000000000..d7e0e5ba96
--- /dev/null
+++ b/docs/design/design-manual/source/instructions.adoc
@@ -0,0 +1,19 @@
+////
+ Copyright 2023 Thales DIS France SAS
+ Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[instructions]]
+Instructions
+~~~~~~~~~~~~
+
+The next subchapter lists the extensions implemented in {ohg-config}. By
+configuration, we can enable/disable the extensions. {ohg-config} supports
+the extensions described in the next subchapters.
+
+include::isa/isa.adoc[]
diff --git a/docs/design/design-manual/source/intro.adoc b/docs/design/design-manual/source/intro.adoc
new file mode 100644
index 0000000000..927a69af1a
--- /dev/null
+++ b/docs/design/design-manual/source/intro.adoc
@@ -0,0 +1,120 @@
+////
+ Copyright 2022 Thales DIS design services SAS
+ Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.0
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+[[introduction]]
+Introduction
+------------
+
+The OpenHW Group uses https://semver.org/[semantic versioning] to
+describe the release status of its IP. This document describes the
+{ohg-config} configuration version of CVA6. This intends to be the first
+formal release of CVA6.
+
+CVA6 is a 6-stage in-order and single issue processor core which
+implements the RISC-V instruction set. CVA6 can be configured as a 32-
+or 64-bit core (RV32 or RV64), called CV32A6 or CV64A6.
+
+The objective of this document is to provide enough information to allow
+the RTL modification (by designers) and the RTL verification (by
+verificators). This document is not dedicated to CVA6 users looking for
+information to develop software like instructions or registers.
+
+The CVA6 architecture is illustrated in the following figure.
+
+image:ariane_overview.drawio.png[CVA6 Architecture]
+
+[[license]]
+License
+~~~~~~~
+
+[verse]
+--
+Copyright 2022 Thales
+Copyright 2018 ETH Zürich and University of Bologna
+SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+Licensed under the Solderpad Hardware License v 2.1 (the “License”); you may not use this file except in compliance with the License, or, at your option, the Apache License version 2.0. You may obtain a copy of the License at https://solderpad.org/licenses/SHL-2.1/.
+Unless required by applicable law or agreed to in writing, any work distributed under the License is distributed on an “AS IS” BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
+--
+
+[[standards-compliance]]
+Standards Compliance
+~~~~~~~~~~~~~~~~~~~~
+
+To ease the reading, the reference to these specifications can be
+implicit in the requirements below. For the sake of precision, the
+requirements identify the versions of RISC-V extensions from these
+specifications.
+
+* *[CVA6req]* “CVA6 requirement specification”,
+https://github.com/openhwgroup/cva6/blob/master/docs/specifications/cva6_requirement_specification.rst,
+HASH#767c465.
+* *[RVunpriv]* “The RISC-V Instruction Set Manual, Volume I: User-Level
+ISA, Document Version 20191213”, Editors Andrew Waterman and Krste
+Asanović, RISC-V Foundation, December 13, 2019.
+* *[RVpriv]* “The RISC-V Instruction Set Manual, Volume II: Privileged
+Architecture, Document Version 20211203”, Editors Andrew Waterman, Krste
+Asanović and John Hauser, RISC-V Foundation, December 4, 2021.
+* *[RVdbg]* “RISC-V External Debug Support, Document Version 0.13.2”,
+Editors Tim Newsome and Megan Wachs, RISC-V Foundation, March 22, 2019.
+* *[RVcompat]* “RISC-V Architectural Compatibility Test Framework”,
+https://github.com/riscv-non-isa/riscv-arch-test.
+* *[AXI]* AXI Specification,
+https://developer.arm.com/documentation/ihi0022/hc.
+* *[CV-X-IF]* Placeholder for the CV-X-IF coprocessor interface
+currently prepared at OpenHW Group; current version in
+https://docs.openhwgroup.org/projects/openhw-group-core-v-xif/.
+* *[OpenPiton]* “OpenPiton Microarchitecture Specification”, Princeton
+University,
+https://parallel.princeton.edu/openpiton/docs/micro_arch.pdf.
+
+CV32A6 is a standards-compliant 32-bit processor fully compliant with
+RISC-V specifications: [RVunpriv], [RVpriv] and [RVdbg] and passes
+[RVcompat] compatibility tests, as requested by [GEN-10] in [CVA6req].
+
+[[documentation-framework]]
+Documentation framework
+~~~~~~~~~~~~~~~~~~~~~~~
+
+The framework of this document is inspired by the Common Criteria. The
+Common Criteria for Information Technology Security Evaluation (referred
+to as Common Criteria or CC) is an international standard (ISO/IEC
+15408) for computer security certification.
+
+Description of the framework:
+
+* Processor is split into module corresponding to the main modules of
+the design
+* Modules can contain several modules
+* Each module is described in a chapter, which contains the following
+subchapters: _Description_, _Functionalities_, _Architecture and
+Modules_ and _Registers_ (if any)
+* The subchapter _Description_ describes the main features of the
+submodule, the interconnections between the current module and the
+others and the inputs/outputs interface.
+* The subchapter _Functionality_ lists in details the module
+functionalities. Please avoid using the RTL signal names to explain the
+functionalities.
+* The subchapter _Architecture and Modules_ provides a drawing to
+present the module hierarchy, then the functionalities covered by the
+module
+* The subchapter _Registers_ specifies the module registers if any
+
+[[contributors]]
+Contributors
+~~~~~~~~~~~~
+
+[verse]
+--
+Jean-Roch Coulon - Thales
+Ayoub Jalali (mailto:ayoub.jalali@external.thalesgroup.com[ayoub.jalali@external.thalesgroup.com])
+Alae Eddine Ezzejjari (mailto:alae-eddine.ez-zejjari@external.thalesgroup.com[alae-eddine.ez-zejjari@external.thalesgroup.com])
+--
+
+*[TO BE COMPLETED]*
diff --git a/docs/design/design-manual/source/mmu.adoc b/docs/design/design-manual/source/mmu.adoc
new file mode 100644
index 0000000000..204fac8232
--- /dev/null
+++ b/docs/design/design-manual/source/mmu.adoc
@@ -0,0 +1,1258 @@
+[[CVA6_MMU]]
+[[memory-management-unit]]
+Memory Management Unit
+----------------------
+
+The Memory Management Unit (MMU) SV32 module is a crucial component in
+the RISC-V-based processor, serving as the backbone for virtual memory
+management and address translation.
+
+image:mmu_in_out.png[*Figure 1:* Inputs and Outputs of CVA6
+MMU SV32,scaledwidth=70.0%]
+
+At its core, the MMU SV32 plays a pivotal role in translating virtual
+addresses into their corresponding physical counterparts. This
+translation process is paramount for providing memory protection,
+isolation, and efficient memory management in modern computer systems.
+Importantly, it handles both instruction and data accesses, ensuring a
+seamless interaction between the processor and virtual memory. Within
+the MMU, several major blocks play pivotal roles in this address
+translation process. These includes:
+
+* Instruction TLB (ITLB)
+* Data TLB (DTLB)
+* Shared TLB
+* Page Table Walker (PTW)
+
+image:mmu_major_blocks.png[*Figure 2:* Major Blocks in CVA6
+MMU SV32,scaledwidth=60.0%]
+
+The MMU SV32 manages privilege levels and access control, enforcing
+permissions for user and supervisor modes while handling access
+exceptions. It employs Translation Lookaside Buffers (TLBs) for
+efficient address translation, reducing the need for page table access.
+TLB hits yield quick translations, but on misses, the shared TLB is
+consulted, and if necessary, the Page Table Walker (PTW) performs page
+table walks, updating TLBs and managing exceptions during the process.
+
+In addition to these functionalities, the MMU SV32 seamlessly integrates
+support for Physical Memory Protection (PMP), enabling it to enforce
+access permissions and memory protection configurations as specified by
+the PMP settings. This additional layer of security and control enhances
+the management of memory accesses
+
+The MMU SV32 maintains interfaces with the instruction cache (ICache)
+and the load-store unit (LSU). It receives virtual addresses from these
+components and proceeds to translate them into physical addresses, a
+fundamental task for ensuring proper program execution and memory
+access.
+
+[cols=",,,,",options="header",]
+|=======================================================================
+|Signal |IO |Connection Type |Type |Description
+|`clk_i` |in |Subsystem |logic |Subsystem Clock
+
+|`rst_ni` |in |Subsystem |logic |Asynchronous reset active low
+
+|`flush_i` |in |Controller |logic |Sfence Committed
+
+|`enable_translation_i` |in |CSR RegFile |logic |Indicate address
+translation request for instruction
+
+|`en_ld_st_translation_i` |in |CSR RegFile |logic |Indicate address
+translation request for load or store
+
+|`icache_areq_i` |in |Cache Subsystem |icache_arsp_t |Icache Response
+
+|`icache_areq_o` |out |Cache Subsystem |icache_areq_t |Icache Request
+
+|`misaligned_ex_i` |in |Load Store Unit |exception_t |Indicate
+misaligned exception
+
+|`lsu_req_i` |in |Load Store Unit |logic |Request address translation
+
+|`lsu_vaddr_i` |in |Load Store Unit |logic [riscv::VLEN-1:0] |Virtual
+Address In
+
+|`lsu_is_store_i` |in |Store Unit |logic |Translation is requested by a
+store
+
+|`lsu_dtlb_hit_o` |out |Store / Load Unit |logic |Indicate a DTLB hit
+
+|`lsu_dtlb_ppn_o` |out |Load Unit |logic [riscv::PPNW-1:0] |Send PNN to
+LSU
+
+|`lsu_valid_o` |out |Load Store Unit |logic |Indicate a valid
+translation
+
+|`lsu_paddr_o` |out |Store / Load Unit |logic [riscv::PLEN-1:0]
+|Translated Address
+
+|`lsu_exception_o` |out |Store / Load Unit |exception_t |Address
+Translation threw an exception
+
+|`priv_lvl_i` |in |CSR RegFile |riscv::priv_lvl_t |Privilege level for
+instruction fetch interface
+
+|`ld_st_priv_lvl_i` |in |CSR RegFile |riscv::priv_lvl_t |Privilege Level
+for Data Interface
+
+|`sum_i` |in |CSR RegFile |logic |Supervisor User Memory Access bit in
+xSTATUS CSR register
+
+|`mxr_i` |in |CSR RegFile |logic |Make Executable Readable bit in
+xSTATUS CSR register
+
+|`satp_ppn_I` |in |CSR RegFile |logic [riscv::PPNW-1:0] |PPN of top
+level page table from SATP register
+
+|`asid_i` |in |CSR RegFile |logic [ASID_WIDTH-1:0] |ASID to for the
+lookup
+
+|`asid_to_be_flushed` |in |Execute Stage |logic [ASID_WIDTH-1:0] |ASID
+of the entry to be flushed.
+
+|`vaddr_to_be_flushed_i` |in |Execute Stage |logic [riscv::VLEN-1:0]
+|Virtual address of the entry to be flushed.
+
+|`flush_tlb_i` |in |Controller |logic |SFENCE.VMA committed
+
+|`itlb_miss_o` |out |Performance Counter |logic |Indicate an ITLB miss
+
+|`dtlb_miss_o` |out |Performance Counter |logic |Indicate a DTLB miss
+
+|`req_port_i` |in |Cache Subsystem |dcache_req_o_t |D Cache Data
+Requests
+
+|`req_port_o` |out |Cache Subsystem |dcache_req_i_t |D Cache Data
+Response
+
+|`pmpcfg_i` |in |CSR RegFile |riscv::pmpcfg_t [15:0] |PMP configurations
+
+|`pmpaddr_i` |in |CSR RegFile |logic [15:0][riscv::PLEN-3:0] |PMP
+Address
+|=======================================================================
+
+[cols=",,",options="header",]
+|===============================================================
+|Signal |Type |Description
+|`fetch_valid` |logic |Address Translation Valid
+|`fetch_paddr` |logic [riscv::PLEN-1:0] |Physical Address In
+|`fetch_exception` |exception_t |Exception occurred during fetch
+|===============================================================
+
+[cols=",,",options="header",]
+|===========================================================
+|Signal |Type |Description
+|`fetch_req` |logic |Address Translation Request
+|`fetch_vaddr` |logic [riscv::VLEN-1:0] |Virtual Address out
+|===========================================================
+
+[cols=",,",options="header",]
+|=======================================================================
+|Signal |Type |Description
+|`cause` |riscv::xlen_t |Cause of exception
+
+|`tval` |riscv::xlen_t |Additional information of causing exception
+(e.g. instruction causing it), address of LD/ST fault
+
+|`valid` |logic |Indicate that exception is valid
+|=======================================================================
+
+[cols=",,",options="header",]
+|====================================================================
+|Signal |Type |Description
+|`locked` |logic |Lock this configuration
+|`reserved` |logic[1:0] |Reserved bits in pmpcfg CSR
+|`addr_mode` |pmp_addr_mode_t |Addressing Modes: OFF, TOR, NA4, NAPOT
+|`access_type` |pmpcfg_access_t |None, read, write, execute
+|====================================================================
+
+image:mmu_control_flow.png[*Figure 3:* Control Flow in CVA6
+MMU SV32,scaledwidth=95.0%]
+
+Two potential exception sources exist:
+
+* Hardware Page Table Walker (HPTW) throwing an exception, signifying a
+page fault exception.
+* Access error due to insufficient permissions of PMP, known as an
+access exception.
+
+The IF stage initiates a request to retrieve memory content at a
+specific virtual address. When the MMU is disabled, the instruction
+fetch request is directly passed to the I$ without modifications.
+
+If virtual memory translation is enabled for instruction fetches, the
+following operations are performed in the instruction interface:
+
+* Compatibility of requested virtual address with selected page based
+address translation scheme is checked.
+* For 4K page translation, the module determines the fetch physical
+address by combining the physical page number (PPN) from ITLB content
+and the offset from the virtual address.
+* In the case of Mega page translation, if the ITLB indicates a 4M page,
+the VPN0 from the fetch virtual address is written to the PPN0 of the
+fetch physical address to ensure alignment for superpage translation.
+* If the Instruction TLB (ITLB) lookup hits, the fetch valid signal
+(which indicates a valid physical address) is activated in response to
+the input fetch request. Memory region accessibility is checked from the
+perspective of the fetch operation, potentially triggering a page fault
+exception in case of an access error or insufficient PMP permission.
+* In case of an ITLB miss, if the page table walker (PTW) is active
+(only active if there is a shared TLB miss) and handling instruction
+fetches, the fetch valid signal is determined based on PTW errors or
+access exceptions.
+
+If the fetch physical address doesn't match any execute region, an
+Instruction Access Fault is raised. When not translating, PMPs are
+immediately checked against the physical address for access
+verification.
+
+If address translation is enabled for load or store, and no misaligned
+exception has occurred, the following operations are performed in the
+data interface:
+
+* Initially, translation is assumed to be invalid, signified by the MMU
+to LSU.
+* The translated physical address is formed by combining the PPN from
+the Page Table Entry (PTE) and the offset from the virtual address
+requiring translation. This send one cycle later due to the additional
+bank of registers which delayed the MMU’s answer. The PPN from the PTE
+is also shared separately with LSU in the same cycle as the hit.
+* In the case of superpage translation, as in SV32, known as the 4M
+page, PPN0 of the translated physical address and the separately shared
+PPN are updated with the VPN0 of the virtual address.
+
+If a Data TLB (DTLB) hit occurs, it indicates a valid translation, and
+various fault checks are performed depending on whether it's a load or
+store request.
+
+* For store requests, if the page is not writable, the dirty flag isn't
+set, or privileges are violated, it results in a page fault
+corresponding to the store access. If PMPs are also violated, it leads
+to an access fault corresponding to the store access. Page faults take
+precedence over access faults.
+* For load requests, a page fault is triggered if there are insufficient
+access privileges. PMPs are checked again during load access, resulting
+in an access fault corresponding to load access if PMPs are violated.
+
+In case of a DTLB miss, potential exceptions are monitored during the
+page table walk. If the PTW indicates a page fault, the corresponding
+page fault related to the requested type is signaled. If the PTW
+indicates an access exception, the load access fault is indicated
+through address translation because the page table walker can only throw
+load access faults.
+
+When address translation is not enabled, the physical address is
+immediately checked against Physical Memory Protections (PMPs). If there
+is a request from LSU, no misaligned exception, and PMPs are violated,
+it results in an access fault corresponding to the request being
+indicated.
+
+[[translation-lookaside-buffer]]
+Translation Lookaside Buffer
+----------------------------
+
+Page tables are accessed for translating virtual memory addresses to
+physical memory addresses. This translation needs to be carried out for
+every load and store instruction and also for every instruction fetch.
+Since page tables are resident in physical memory, accessing these
+tables in all these situations has a significant impact on performance.
+Page table accesses occur in patterns that are closely related in time.
+Furthermore, the spatial and temporal locality of data accesses or
+instruction fetches mean that the same page is referenced repeatedly.
+Taking advantage of these access patterns the processor keeps the
+information of recent address translations, to enable fast retrieval, in
+a small cache called the Translation Lookaside Buffer (TLB) or an
+address-translation cache.
+
+The CVA6 TLB is structured as a fully associative cache, where the
+virtual address that needs to be translated is compared against all the
+individual TLB entries. Given a virtual address, the processor examines
+the TLB (TLB lookup) to determine if the virtual page number (VPN) of
+the page being accessed is in the TLB. When a TLB entry is found (TLB
+hit), the TLB returns the corresponding physical page number (PPN) which
+is used to calculate the target physical address. If no TLB entry is
+found (TLB miss) the processor has to read individual page table entries
+from memory (Table walk). In CVA6 table walking is supported by
+dedicated hardware. Once the processor finishes the table walk it has
+the Physical Page Number (PPN) corresponding to the Virtual Page Number
+(VPN) That needs to be translated. The processor adds an entry for this
+address translation to the TLB so future translations of that virtual
+address will happen quickly through the TLB. During the table walk the
+processor may find out that the corresponding physical page is not
+resident in memory. At this stage a page table exception (Page Fault) is
+generated which gets handled by the operating system. The operating
+system places the appropriate page in memory, updates the appropriate
+page tables and returns execution to the instruction which generated the
+exception.
+
+The inputs and output signals of the TLB are shown in the following two
+figures.
+
+image:in_out_tlb.png[*Figure 4:* Inputs and Outputs of CVA6
+TLB,scaledwidth=65.0%]
+
+[cols=",,,,",options="header",]
+|=======================================================================
+|Signal |IO |connection |Type |Description
+|`clk_i` |in |SUBSYSTEM |logic |Subsystem Clock
+
+|`rst_ni` |in |SUBSYSTEM |logic |Asynchronous reset active low
+
+|`flush_i` |in |Controller |logic |Asynchronous reset active low
+
+|`update_i` |in |Shared TLB |tlb_update_sv32_t |Updated tag and content
+of TLB
+
+|`lu_access_i` |in |Cache Subsystem |logic |Signal indicating a lookup
+access is being requested
+
+|`lu_asid_i` |in |CSR RegFile |logic[ASID_WIDTH-1:0] |ASID (Address
+Space Identifier) for the lookup
+
+|`lu_vaddr_i` |in |Cache Subsystem |logic[riscv::VLEN-1:0] |Virtual
+address for the lookup
+
+|`lu_content_o` |out |MMU SV32 |riscv::pte_sv32_t |Output for the
+content of the TLB entry
+
+|`asid_to_be_flushed_i` |in |Execute Stage |logic[ASID_WIDTH-1:0] |ASID
+of the entry to be flushed
+
+|`vaddr_to_be_flushed_i` |in |Execute Stage |logic[riscv::VLEN-1:0]
+|Virtual address of the entry to be flushed
+
+|`lu_is_4M_o` |out |MMU SV32 |logic |Output indicating whether the TLB
+entry corresponds to a 4MB page
+
+|`lu_hit_o` |out |MMU SV32 |logic |Output indicating whether the lookup
+resulted in a hit or miss
+|=======================================================================
+
+[cols=",,",options="header",]
+|=======================================================================
+|Signal |Type |Description
+|`valid` |logic |Indicates whether the TLB update entry is valid or not
+
+|`is_4M` |logic |Indicates if the TLB entry corresponds to a 4MB page
+
+|`vpn` |logic[19:0] |Virtual Page Number (VPN) used for updating the
+TLB, consisting of 20 bits
+
+|`asid` |logic[8:0] |Address Space Identifier (ASID) used for updating
+the TLB, with a length of 9 bits for Sv32 MMU
+
+|`content` |riscv::pte_sv32_t |Content of the TLB update entry, defined
+by the structure
+|=======================================================================
+
+[cols=",,",options="header",]
+|=======================================================================
+|Signal |Type |Description
+|`ppn` |logic[21:0] |22 bit Physical Page Number (PPN)
+
+|`rsw` |logic[1:0] |Reserved for use by supervisor software
+
+|`d` |logic a|
+[verse]
+--
+Dirty bit indicating whether the page has been modified (dirty) or not
+0: Page is clean i.e., has not been written
+1: Page is dirty i.e., has been written
+--
+
+|`a` |logic a|
+[verse]
+--
+Accessed bit indicating whether the page has been accessed
+0: Virtual page has not been accessed since the last time A bit was cleared
+1: Virtual page has been read, written, or fetched from since the last time the A bit was cleared
+--
+
+|`g` |logic a|
+[verse]
+--
+Global bit marking a page as part of a global address space valid for all ASIDs
+0: Translation is valid for specific ASID
+1: Translation is valid for all ASIDs
+--
+
+|`u` |logic a|
+[verse]
+--
+User bit indicating privilege level of the page
+0: Page is not accessible in user mode but in supervisor mode
+1: Page is accessible in user mode but not in supervisor mode
+--
+
+|`x` |logic a|
+[verse]
+--
+Execute bit which allows execution of code from the page
+0: Code execution is not allowed
+1: Code execution is permitted
+--
+
+|`w` |logic a|
+[verse]
+--
+Write bit allows the page to be written
+0: Write operations are not allowed
+1: Write operations are permitted
+--
+
+|`r` |logic a|
+[verse]
+--
+Read bit allows read access to the page
+0: Read operations are not allowed
+1: Read operations are permitted
+--
+
+|`v` |logic a|
+[verse]
+--
+Valid bit indicating the page table entry is valid
+0: Page is invalid i.e. page is not in DRAM, translation is not valid
+1: Page is valid i.e. page resides in the DRAM, translation is valid
+--
+
+|=======================================================================
+
+The number of TLB entries can be changed via a design parameter. In
+32-bit configurations of CVA6 only 2 TLB entries are instantiated. Each
+TLB entry is made up of two fields: Tag and Content. The Tag field holds
+the virtual page number (VPN1, VPN0), ASID, page size (is_4M) along with
+a valid bit (VALID) indicating that the entry is valid. The SV32 virtual
+page number, which is supported by CV32A6X, is further split into two
+separate virtual page numbers VPN1 and VPN0. The Content field contains
+two physical page numbers (PPN1, PPN0) along with a number of bits which
+specify various attributes of the physical page. Note that the V bit in
+the Content field is the V bit which is present in the page table in
+memory. It is copied from the page table, as is, and the VALID bit in
+the Tag is set based on its value.The TLB entry fields are shown in
+*Figure 2*.
+
+image:cva6_tlb_entry.png[*Figure 5:* Fields in CVA6 TLB
+entry,scaledwidth=80.0%]
+
+The CVA6 TLB implements the following three functions:
+
+* *Translation:* This function implements the address lookup and match
+logic.
+* *Update and Flush:* This function implements the update and flush
+logic.
+* *Pseudo Least Recently Used Replacement Policy:* This function
+implements the replacement policy for TLB entries.
+
+This function takes in the virtual address and certain other fields,
+examines the TLB to determine if the virtual page number of the page
+being accessed is in the TLB or not. If a TLB entry is found (TLB hit),
+the TLB returns the corresponding physical page number (PPN) which is
+then used to calculate the target physical address. The following checks
+are done as part of this lookup function to find a match in the TLB:
+
+* *Validity Check:* For a TLB hit, the associated TLB entry must be
+valid .
+* *ASID and Global Flag Check:* The TLB entry's ASID must match the
+given ASID (ASID associated with the Virtual address). If the TLB
+entry’s Global bit (G) bit is set then this check is not done. This
+ensures that the translation is either specific to the provided ASID or
+it is globally applicable.
+* *Level 1 VPN match:* SV32 implements a two-level page table. As such
+the virtual address is broken up into three parts which are the virtual
+page number 1, virtual page number 0 and displacement. So the condition
+that is checked next is that the virtual page number 1 of the virtual
+address matches the virtual page number 1(VPN1) of the TLB entry.
+* *Level 0 VPN match or 4-Mega Page:* The last condition to be checked,
+for a TLB hit, is that the virtual page number 0 of the virtual address
+matches the virtual page number 0 of the TLB entry (VPN0). This match is
+ignored if the is_4M bit in the Tag is set which implies a super 4M
+page.
+
+All the conditions listed above are checked against every TLB entry. If
+there is a TLB hit then the corresponding bit in the hit array is set.
+*Figure 3* Illustrates the TLB hit/miss process listed above.
+
+image:cva6_tlb_hit.png[*Figure 6:* Block diagram of CVA6 TLB
+hit or miss,scaledwidth=75.0%]
+
+The SFENCE.VMA instruction can be used with certain specific source
+register specifiers (rs1 & rs2) to flush a specific TLB entry, some set
+of TLB entries or all TLB entries. Like all instructions this action
+only takes place when the SFENCE.VMA instruction is committed (shown via
+the commit_sfence signal in the following figures.) The behavior of the
+instruction is as follows:
+
+* *If rs1 is not equal to x0 and rs2 is not equal to x0:* Invalidate all
+TLB entries which contain leaf page table entries corresponding to the
+virtual address in rs1 (shown below as Virtual Address to be flushed)
+and that match the address space identifier as specified by integer
+register rs2 (shown below as asid_to_be_flushed_i), except for entries
+containing global mappings. This is referred to as the “SFENCE.VMA vaddr
+asid” case.
+
+image:sfence_vaddr_asid.png[*Figure 7:* Invalidate TLB entry
+if ASID and virtual address match,scaledwidth=75.0%]
+
+* *If rs1 is equal to x0 and rs2 is equal to x0:* Invalidate all TLB
+entries for all address spaces. This is referred to as the "SFENCE.VMA
+x0 x0" case.
+
+image:sfence_x0_x0.png[*Figure 8:* Invalidate all TLB entries
+if both source register specifiers are x0,scaledwidth=62.0%]
+
+* *If rs1 is not equal to x0 and rs2 is equal to x0:* invalidate all TLB
+entries that contain leaf page table entries corresponding to the
+virtual address in rs1, for all address spaces. This is referred to as
+the “SFENCE.VMA vaddr x0” case.
+
+image:sfence_vaddr_x0.png[*Figure 9:* Invalidate TLB entry
+with matching virtual address for all address spaces,scaledwidth=75.0%]
+
+* *If rs1 is equal to x0 and rs2 is not equal to x0:* Invalidate all TLB
+entries matching the address space identified by integer register rs2,
+except for entries containing global mappings. This is referred to as
+the “SFENCE.VMA 0 asid” case.
+
+image:sfence_x0_asid.png[*Figure 10:* Invalidate TLB entry for
+matching ASIDs,scaledwidth=75.0%]
+
+When a TLB valid update request is signaled by the shared TLB, and the
+replacement policy select the update of a specific TLB entry, the
+corresponding entry's tag is updated with the new tag, and its
+associated content is refreshed with the information from the update
+request. This ensures that the TLB entry accurately reflects the new
+translation information.
+
+Cache replacement algorithms are used to determine which TLB entry
+should be replaced, because it is not likely to be used in the near
+future. The Pseudo-Least-Recently-Used (PLRU) is a cache entry
+replacement algorithm, derived from Least-Recently-Used (LRU) cache
+entry replacement algorithm, used by the TLB. Instead of precisely
+tracking recent usage as the LRU algorithm does, PLRU employs an
+approximate measure to determine which entry in the cache has not been
+recently used and as such can be replaced.
+
+CVA6 implements the PLRU algorithm via the Tree-PLRU method which
+implements a binary tree. The TLB entries are the leaf nodes of the
+tree. Each internal node, of the tree, consists of a single bit,
+referred to as the state bit or plru bit, indicating which subtree
+contains the (pseudo) least recently used entry (the PLRU); 0 for the
+left hand tree and 1 for the right hand tree. Following this traversal,
+the leaf node reached, corresponds to the PLRU entry which can be
+replaced. Having accessed an entry (so as to replace it) we need to
+promote that entry to be the Most Recently Used (MRU) entry. This is
+done by updating the value of each node along the access path to point
+away from that entry. If the accessed entry is a right child i.e., its
+parent node value is 1, it is set to 0, and if the parent is the left
+child of its parent (the grandparent of the accessed node) then its node
+value is set to 1 and so on all the way up to the root node.
+
+The PLRU binary tree is implemented as an array of node values. Nodes
+are organized in the array based on levels, with those from lower levels
+appearing before higher ones. Furthermore those on the left side of a
+node appear before those on the right side of a node. The figure below
+shows a tree and the corresponding array.
+
+image:plru_tree_indexing.png[*Figure 11:* PLRU Tree
+Indexing,scaledwidth=60.0%]
+
+For n-way associative, we require n - 1 internal nodes in the tree. With
+those nodes, two operations need to be performed efficiently.
+
+* Promote the accessed entry to be MRU
+* Identify which entry to replace (i.e. the PLRU entry)
+
+For a TLB entry which is accessed, the following steps are taken to make
+it the MRU:
+
+1. Iterate through each level of the binary tree.
+2. Calculate the index of the leftmost child within the current level.
+Let us call that index the index base.
+3. Calculate the shift amount to identify the relevant node based on
+the level and TLB entry index.
+4. Calculate the new value that the node should have in order to make
+the accessed entry the Most Recently Used (MRU). The new value of the
+root node is the opposite of the TLB entry index, MSB at the root node,
+MSB - 1 at node at next level and so on.
+5. Assign this new value to the relevant node, ensuring that the hit
+entry becomes the MRU within the binary tree structure.
+
+At level 0, no bit of the TLB entry’s index determines the offset from
+the index base because it’s a root node. At level 1, MSB of entry’s
+index determines the amount of offset from index base at that level. At
+level 2, the first two bits of the entry's index from MSB side determine
+the offset from the index base because there are 4 nodes at the level 2
+and so on.
+
+image:update_tree.png[*Figure 12:* Promote Entry to be
+MRU,scaledwidth=82.0%]
+
+In the above figure entry at index 5, is accessed. To make it MRU entry,
+every node along the access path should point away from it. Entry 5 is a
+right child, therefore, its parent plru bit set to 0, its parent is a
+left child, its grand parent’s plru bit set to 1, and great
+grandparent’s plru bit set to 0.
+
+Every TLB entry is checked for the replacement entry. The following
+steps are taken:
+
+1. Iterate through each level of the binary tree.
+2. Calculate the index of the leftmost child within the current level.
+Let us call that index the index base.
+3. Calculate the shift amount to identify the relevant node based on
+the level and TLB entry index.
+4. If the corresponding bit of the entry's index matches the value of
+the node being traversed at the current level, keep the replacement
+signal high for that entry; otherwise, set the replacement signal to
+low.
+
+image:replacement_entry.png[*Figure 13:* Possible path
+traverse for entry selection for replacement,scaledwidth=65.0%]
+
+Figure shows every possible path that traverses to find out the PLRU
+entry. If the plru bit at each level matches with the corresponding bit
+of the entry's index, that’s the next entry to replace. Below Table
+shows the entry selection for replacement.
+
+[width="81%",cols="35%,27%,38%",]
+|================================================
+|*Path Traverse* |*PLRU Bits* |*Entry to replace*
+a|
+0 -> 1 -> 3::
+ *
+
+ a|
+___
+000
+___
+
+---------------+::
+ 001
+
+ a|
+_
+0
+_
+
+----------------------+::
+ 1
+
+a|
+0 -> 1 -> 4::
+ *
+
+ a|
+___
+010
+___
+
+---------------+::
+ 011
+
+ a|
+_
+2
+_
+
+----------------------+::
+ 3
+
+a|
+0 -> 2 -> 5::
+ *
+
+ a|
+___
+100
+___
+
+---------------+::
+ 101
+
+ a|
+_
+4
+_
+
+----------------------+::
+ 5
+
+a|
+0 -> 2 -> 6::
+ *
+
+ a|
+___
+110
+___
+
+---------------+::
+ 111
+
+ a|
+_
+6
+_
+
+----------------------+::
+ 7
+
+|================================================
+
+[[shared-translation-lookaside-buffer]]
+Shared Translation Lookaside Buffer
+-----------------------------------
+
+The CVA6 shared TLB is structured as a 2-way associative cache, where
+the virtual address requiring translation is compared with the set
+indicated by the virtual page number. The shared TLB is looked up in
+case of an Instruction TLB (ITLB) or data TLB (DTLB) miss, signaled by
+these TLBs. If the entry is found in the shared TLB set, the respective
+TLB, whose translation is being requested, is updated. If the entry is
+not found in the shared TLB, then the processor has to perform a page
+table walk. Once the processor obtains a PPN corresponding to the VPN,
+the shared TLB is updated with this information. If the physical page is
+not found in the page table, it results in a page fault, which is
+handled by the operating system. The operating system will then place
+the corresponding physical page in memory.
+
+The inputs and output signals of the shared TLB are shown in the
+following two figures.
+
+image:shared_tlb_in_out.png[*Figure 14:* Inputs and outputs of
+CVA6 shared TLB,scaledwidth=60.0%]
+
+[cols=",,,,",options="header",]
+|=======================================================================
+|Signal |IO |Connection |Type |Description
+|`clk_i` |in |Subsystem |logic |Subsystem Clock
+
+|`rst_ni` |in |Subsystem |logic |Asynchronous reset active low
+
+|`flush_i` |in |Controller |logic |TLB flush request
+
+|`enable_translation_i` |in |CSR Regfile |logic |CSRs indicate to enable
+Sv32
+
+|`en_ld_st_translation_i` |in |CSR Regfile |logic |Enable virtual memory
+translation for load/stores
+
+|`asid_i` |in |CSR Regfile |logic |ASID for the lookup
+
+|`itlb_access_i` |in |Cache Subsystem |logic |Signal indicating a lookup
+access in ITLB is being requested.
+
+|`itlb_hit_i` |in |ITLB |logic |Signal indicating an ITLB hit
+
+|`itlb_vaddr_i` |in |Cache Subsystem |logic[31:0] |Virtual address
+lookup in ITLB
+
+|`dtlb_access_i` |in |Load/Store Unit |logic |Signal indicating a lookup
+access in DTLB is being requested.
+
+|`dtlb_hit_i` |in |DTLB |logic |Signal indicating a DTLB hit
+
+|`dtlb_vaddr_i` |in |Load/Store Unit |logic[31:0] |Virtual address
+lookup in DTLB
+
+|`itlb_update_o` |out |ITLB |tlb_update_sv32_t |Tag and content to
+update ITLB
+
+|`dtlb_update_o` |out |DTLB |tlb_update_sv32_t |Tag and content to
+update DTLB
+
+|`itlb_miss_o` |out |Performance Counter |logic |Signal indicating an
+ITLB miss
+
+|`dtlb_miss_o` |out |Performance Counter |logic |Signal indicating a
+DTLB miss
+
+|`shared_tlb_access_o` |out |PTW |logic |Signal indicating a lookup
+access in shared TLB is being requested
+
+|`shared_tlb_hit_o` |out |PTW |logic |Signal indicating a shared TLB hit
+
+|`shared_tlb_vadd_o` |out |PTW |logic[31:0] |Virtual address lookup in
+shared TLB
+
+|`itlb_req_o` |out |PTW |logic |ITLB Request Output
+
+|`shared_tlb_update_i` |in |PTW |tlb_update_sv32_t |Updated tag and
+content of shared TLB
+|=======================================================================
+
+[cols=",,",options="header",]
+|=======================================================================
+|Signal |Type |Description
+|`is_4M` |logic |Indicates if the shared TLB entry corresponds to a 4MB
+page.
+
+|`vpn1` |logic[9:0] |Virtual Page Number (VPN) represents the index of
+PTE in the page table level 1.
+
+|`vpn0` |logic[9:0] |Virtual Page Number (VPN) represents the index of
+PTE in the page table level 0.
+
+|`asid` |logic |Address Space Identifier (ASID) used to identify
+different address spaces
+|=======================================================================
+
+Shared TLB is 2-way associative, with a depth of 64. A single entry in
+the set contains the valid bit, tag and the content. The Tag segment
+stores details such as the virtual page number (VPN1, VPN0), ASID, and
+page size (is_4M). The Content field contains two physical page numbers
+(PPN1, PPN0) along with a number of bits which specify various
+attributes of the physical page.
+
+image:shared_tlb.png[*Figure 15:* CVA6 Shared TLB
+Structure,scaledwidth=60.0%]
+
+The implementation of a shared TLB in CVA6 is described in the following
+sections:
+
+* *ITLB and DTLB Miss:* Prepare a shared TLB lookup if the entry is not
+found in ITLB or DTLB.
+* *Tag Comparison:* Look up the provided virtual address in the shared
+TLB.
+* *Update and Flush:* Flush the shared TLB or update it.
+* *Replacement Policies:* First non-valid entry and random replacement
+policy.
+
+Consider a scenario where an entry is found in the ITLB or DTLB. In this
+case, there is no need to perform a lookup in the shared TLB since the
+entry has already been found. Next, there are two scenarios: an ITLB
+miss or a DTLB miss.
+
+To identify an ITLB miss, the following conditions need to be fulfilled:
+
+* Address translation must be enabled.
+* There must be an access request to the ITLB.
+* The ITLB should indicate an ITLB miss.
+* There should be no access request to the DTLB.
+
+During an ITLB miss, access is granted to read the tag and content of
+the shared TLB from their respective sram. The address for reading the
+tag and content of the shared TLB entry is calculated using the virtual
+address for which translation is not found in the ITLB. The ITLB miss is
+also explicitly indicated by the shared TLB. A request for shared TLB
+access is initiated.
+
+To identify the DTLB miss, the following conditions need to be
+fulfilled:
+
+* Address translation for load and stores must be enabled.
+* There must be an access request to the DTLB.
+* The DTLB should indicate a DTLB miss.
+
+In the case of a DTLB miss, the same logic is employed as described for
+an ITLB miss.
+
+Shared TLB lookup for a hit occurs under the same conditions as
+described for the TLB modules used as ITLB and DTLB. However, there are
+some distinctions. In both the ITLB and DTLB, the virtual address
+requiring translation is compared against all TLB entries. In contrast,
+the shared TLB only compares the tag and content of the set indicated by
+the provided virtual page number. The index of the set is extracted from
+VPN0 of the requested virtual address. Given that the shared TLB is
+2-way associative, each set contains two entries. Consequently, both of
+these entries are compared. Below figure illustrates how the set is
+opted for the lookup.
+
+image:shared_tlb_set.png[*Figure 16:* Set opted for lookup in
+shared TLB,scaledwidth=60.0%]
+
+Differing from the ITLB and DTLB, a specific virtual address or
+addressing space cannot be flushed in the shared TLB. When SFENCE.VMA is
+committed, all entries in the shared TLB are invalidated. (Cases of
+SFENCE.VMA should also be added in shared TLB)
+
+When the Page Table Walker signals a valid update request, the shared
+TLB is updated by selecting an entry through the replacement policy and
+marking it as valid. This also triggers the writing of the new tag and
+content to the respective SRAM.
+
+In CVA6's shared TLB, two replacement policies are employed for
+replacements based on a specific condition. These replacement policies
+select the entry within the set indicated by the virtual page number.
+The two policies are:
+
+* First non-valid encounter replacement policy
+* Random replacement policy
+
+First replacement policy failed if all ways are valid. Therefore, a
+random replacement policy is opted for.
+
+The module implemented in CVA6 to find the first non-valid entry in the
+shared TLB is the Leading Zero Counter (LZC). It takes three parameters
+as input:
+
+1. *WIDTH:* The width of the input vector.
+2. *MODE:* Mode selection - 0 for trailing zero, 1 for leading zero.
+3. *CNT WIDTH:* Width of the output signal containing the zero count.
+
+The input signal is the vector to be counted, and the output represents
+the count of trailing/leading zeros. If all bits in the input vector are
+zero, it will also be indicated.
+
+When initializing the module, the width of the input vector is set to
+the number of shared TLB ways. The trailing zero counter mode is
+selected. The vector of valid bits is set as the input vector, but with
+negation. This is because we want the index of the first non-valid
+entry, and LZC returns the count of trailing zeros, which actually
+corresponds to the index of the first occurrence of 1 from the least
+significant bit (LSB). if there is at least one non-valid entry, that
+entry is opted for the replacement, and If not then this is signaled by
+LZC.
+
+image:LZC.png[*Figure 17:* Replacement of First invalid
+entry.,scaledwidth=60.0%]
+
+If all ways are valid, a random replacement policy is employed for the
+replacement process. The Linear Feedback Shift Register (LFSR) is
+utilized to select the replacement entry randomly. LFSR is commonly used
+in generating sequences of pseudo-random numbers. When the enable signal
+is active, the current state of the LFSR undergoes a transformation.
+Specifically, the state is shifted right by one bit, and the result is
+combined with a predetermined masking pattern. This masking pattern is
+derived from the predefined “Masks” array, introducing a non-linear
+behavior to the sequence generation of the LFSR. The masking process
+involves XOR operations between the shifted state bits and specific
+pattern bits, contributing to the complexity and unpredictability of the
+generated sequence.
+
+image:RR.png[*Figure 18:* Entry selection for replacement
+using LFSR,scaledwidth=95.0%]
+
+[[page-table-walker]]
+Page Table Walker
+-----------------
+
+The "CVA6 Page Table Walker (PTW) for MMU Sv32" is a hardware module
+developed for the CV32A6 processor architecture, designed to facilitate
+the translation of virtual addresses into physical addresses, a crucial
+task in memory access management.
+
+image:ptw_in_out.png[*Figure 19:* Input and Outputs of Page
+Table Walker,scaledwidth=60.0%]
+
+The PTW module operates through various states, each with its specific
+function, such as handling memory access requests, validating page table
+entries, and responding to errors.
+
+Key features of this PTW module include support for two levels of page
+tables (LVL1 and LVL2) in the Sv32 standard, accommodating instruction
+and data page table walks. It rigorously validates and verifies page
+table entries (PTEs) to ensure translation accuracy and adherence to
+access permissions. This module seamlessly integrates with the CV32A6
+processor's memory management unit (MMU), which governs memory access
+control. It also takes into account global mapping, access flags, and
+privilege levels during the translation process, ensuring that memory
+access adheres to the processor's security and privilege settings.
+
+In addition to its translation capabilities, the PTW module is equipped
+to detect and manage errors, including page-fault exceptions and access
+exceptions, contributing to the robustness of the memory access system.
+It works harmoniously with physical memory protection (PMP)
+configurations, a critical aspect of modern processors' memory security.
+Moreover, the module efficiently processes virtual addresses, generating
+corresponding physical addresses, all while maintaining speculative
+translation, a feature essential for preserving processor performance
+during memory access operations.
+
+[cols=",,,,",options="header",]
+|=======================================================================
+|Signal |IO |Connection |Type |Description
+|`clk_i` |in |Subsystem |logic |Subsystem Clock
+
+|`rst_ni` |in |Subsystem |logic |Asynchronous reset active low
+
+|`flush_i` |in |Controller |logic |Sfence Committed
+
+|`ptw_active_o` |out |MMU |logic |Output signal indicating whether the
+Page Table Walker (PTW) is currently active
+
+|`walking_instr_o` |out |MMU |logic |Indicating it's an instruction page
+table walk or not
+
+|`ptw_error_o` |out |MMU |logic |Output signal indicating that an error
+occurred during PTW operation
+
+|`ptw_access_exception_o` |out |MMU |logic |Output signal indicating
+that a PMP (Physical Memory Protection) access exception occurred during
+PTW operation.
+
+|`lsu_is_store_i` |in |Store Unit |logic |Input signal indicating
+whether the translation was triggered by a store operation.
+
+|`req_port_i` |in |Cache Subsystem |dcache_req_o_t |D Cache Data
+Requests
+
+|`req_port_o` |out |Cache Subsystem / Perf Counter |dcache_req_u_t |D
+Cache Data Response
+
+|`shared_tlb_update_o` |out |Shared TLB |tlb_update_sv32_t |Updated tag
+and content of shared TLB
+
+|`update_vaddr_o` |out |MMU |logic[riscv::VLEN-1:0] |Updated VADDR from
+shared TLB
+
+|`asid_i` |in |CSR RegFile |logic[ASID_WIDTH-1:0] |ASID for the lookup
+
+|`shared_tlb_access_i` |in |Shared TLB |logic |Access request of shared
+TLB
+
+|`shared_tlb_hit_i` |in |Shared TLB |logic |Indicate shared TLB hit
+
+|`shared_tlb_vaddr_i` |in |Shared TLB |logic[riscv::VLEN-1:0] |Virtual
+Address from shared TLB
+
+|`itlb_req_i` |in |Shared TLB |logic |Indicate request to ITLB
+
+|`satp_ppn_i` |in |CSR RegFile |logic[riscv::PPNW-1:0] |PPN of top level
+page table from SATP register
+
+|`mxr_i` |in |CSR RegFile |logic |Make Executable Readable bit in
+xSTATUS CSR register
+
+|`shared_tlb_miss_o` |out |OPEN |logic |Indicate a shared TLB miss
+
+|`pmpcfg_i` |in |CSR RegFile |riscv::pmpcfg_t[15:0] |PMP configuration
+
+|`pmpaddr_i` |in |CSR RegFile |logic[15:0][riscv::PLEN-3:0] |PMP Address
+
+|`bad_paddr_o` |out |MMU |logic[riscv::PLEN-1:0] |Bad Physical Address
+in case of access exception
+|=======================================================================
+
+[cols=",,",options="header",]
+|=======================================================================
+|Signal |Type |Description
+|`address_index` |logic [DCACHE_INDEX_WIDTH-1:0] |Index of the Dcache
+Line
+
+|`address_tag` |logic [DCACHE_TAG_WIDTH-1:0] |Tag of the Dcache Line
+
+|`data_wdata` |riscv::xlen_t |Data to write in the Dcache
+
+|`data_wuser` |logic [DCACHE_USER_WIDTH-1:0] |data_wuser
+
+|`data_req` |logic |Data Request
+
+|`data_we` |logic |Data Write enabled
+
+|`data_be` |logic [(riscv::XLEN/8)-1:0] |Data Byte enable
+
+|`data_size` |logic [1:0] |Size of data
+
+|`data_id` |logic [DCACHE_TID_WIDTH-1:0] |Data ID
+
+|`kill_req` |logic |Kill the D cache request
+
+|`tag_valid` |logic |Indicate that teh tag is valid
+|=======================================================================
+
+[cols=",,",options="header",]
+|=======================================================================
+|Signal |Type |Description
+|`data_gnt` |logic |Grant of data is given in response to the data
+request
+
+|`data_rvalid` |logic |Indicate that data is valid which is sent by D
+cache
+
+|`data_rid` |logic [DCACHE_TID_WIDTH-1:0] |Requested data ID
+
+|`data_rdata` |riscv::xlen_t |Data from D cache
+
+|`data_ruser` |logic [DCACHE_USER_WIDTH-1:0] |Requested data user
+|=======================================================================
+
+Page Table Walker is implemented as a finite state machine. It listens
+to shared TLB for incoming translation requests. If there is a shared
+TLB miss, it saves the virtual address and starts the page table walk.
+Page table walker transition between 7 states in CVA6.
+
+* *IDLE:* The initial state where the PTW is awaiting a trigger, often a
+Shared TLB miss, to initiate a memory access request.
+* *WAIT_GRANT:* Request memory access and wait for data grant
+* *PTE_LOOKUP:* Once granted access, the PTW examines the valid Page
+Table Entry (PTE), checking attributes to determine the appropriate
+course of action.
+* *PROPOGATE_ERROR:* If the PTE is invalid, this state handles the
+propagation of an error, often leading to a page-fault exception due to
+non-compliance with access conditions
+* *PROPOGATE_ACCESS_ERROR:* Propagate access fault if access is not
+allowed from a PMP perspective
+* *WAIT_RVALID:* After processing a PTE, the PTW waits for a valid data
+signal, indicating that relevant data is ready for further processing.
+* *LATENCY:* Introduces a delay to account for synchronization or timing
+requirements between states.
+
+image:ptw_state_diagram.png[*Figure 20:* State Machine Diagram
+of CVA6 PTW,scaledwidth=95.0%]
+
+In the IDLE state of the Page Table Walker (PTW) finite state machine,
+the system awaits a trigger to initiate the page table walk process.
+This trigger is often prompted by a Shared Translation Lookaside Buffer
+(TLB) miss, indicating that the required translation is not present in
+the shared TLB cache. The PTW's behavior in this state is explained as
+follows:
+
+1. The top-most page table is selected for the page table walk. In the
+case of SV32, which implements a two-level page table, the level 1 page
+table is chosen.
+2. In the IDLE state, translations are assumed to be invalid in all
+addressing spaces.
+3. The signal indicating the instruction page table walk is set to 0.
+4. A conditional check is performed: if there is a shared TLB access
+request and the entry is not found in the shared TLB (indicating a
+shared TLB miss), the following steps are executed:
+a. The address of the desired Page Table Entry within the level 1 page
+table is calculated by multiplying the Physical Page Number (PPN) of the
+level 1 page table from the SATP register by the page size (4kB). This
+result is then added to the product of the Virtual Page Number (VPN1),
+and the size of a page table entry(4 bytes).
+
+image:ptw_idle.png[*Figure 21:* Address of Desired PTE at
+Level 1,scaledwidth=68.0%]
+
+In the *WAIT_GRANT* state of the Page Table Walker's finite state
+machine, a data request is sent to retrieve memory information. It waits
+for a data grant signal from the Dcache controller, remaining in this
+state until granted. Once granted, it activates a tag valid signal,
+marking data validity. The state then transitions to "PTE_LOOKUP" for
+page table entry lookup.
+
+In the *PTE_LOOKUP* state of the Page Table Walker (PTW) finite state
+machine, the PTW performs the actual lookup and evaluation of the page
+table entry (PTE) based on the virtual address translation. The behavior
+and operations performed in this state are detailed as follows:
+
+1. The state waits for a valid signal indicating that the data from the
+memory subsystem, specifically the page table entry, is available for
+processing.
+2. Upon receiving the valid signal, the PTW proceeds with examining the
+retrieved page table entry to determine its properties and validity.
+3. The state checks if the global mapping bit in the PTE is set, and if
+so, sets the global mapping signal to indicate that the translation
+applies globally across all address spaces.
+4. The state distinguishes between two cases: Invalid PTE and Valid
+PTE.
+a. If the valid bit of the PTE is not set, or if the PTE has reserved
+RWX field encodings, it signifies an Invalid PTE. In such cases, the
+state transitions to the "PROPAGATE_ERROR" state, indicating a
+page-fault exception due to an invalid translation.
+
+image:ptw_pte_1.png[*Figure 22:* Invalid PTE and reserved RWX
+encoding leads to page fault,scaledwidth=70.0%]
+
+1. Within the Valid PTE scenario, the state performs further checks
+based on whether the translation is intended for instruction fetching or
+data access:
+a. For instruction page table walk, if the page is not executable
+(pte.x is not set) or not marked as accessible (pte.a is not set), the
+state transitions to the "PROPAGATE_ERROR" state.
+
+image:ptw_iptw.png[*Figure 23:* For Instruction Page Table
+Walk,scaledwidth=70.0%]
+
+image:ptw_dptw.png[*Figure 24:* Data Access Page Table
+Walk,scaledwidth=70.0%]
+
+image:ptw_dptw_s.png[*Figure 25:* Data Access Page Table Walk,
+Store requested,scaledwidth=70.0%]
+
+1. The state also checks for potential misalignment issues in the
+translation: If the current page table level is the first level (LVL1)
+and if the PPN0 of in PTE is not zero, it indicates a misaligned
+superpage, leading to a transition to the "PROPAGATE_ERROR" state.
+
+image:ptw_mis_sup.png[*Figure 26:* Misaligned Superpage
+Check,scaledwidth=70.0%]
+
+1. If the PTE is valid but the page is neither readable nor executable,
+the PTW recognizes the PTE as a pointer to the next level of the page
+table, indicating that additional translation information can be found
+in the referenced page table at a lower level.
+2. If the current page table level is the first level (LVL1), the PTW
+proceeds to switch to the second level (LVL2) page table, updating the
+next level pointer and calculating the address for the next page table
+entry using the Physical Page Number from the PTE and the index of the
+level 2 page table from virtual address.
+
+image:ptw_nlvl.png[*Figure 27:* Address of desired PTE at next
+level of Page Table,scaledwidth=70.0%]
+
+1. The state then transitions to the "WAIT_GRANT" state, indicating
+that the PTW is awaiting the grant signal to proceed with requesting the
+next level page table entry.
+2. If the current level is already the second level (LVL2), an error is
+flagged, and the state transitions to the "PROPAGATE_ERROR" state,
+signifying an unexpected situation where the PTW is already at the last
+level page table.
+3. If the translation access is found to be restricted by the Physical
+Memory Protection (PMP) settings (allow_access is false), the state
+updates the shared TLB update signal to indicate that the TLB entry
+should not be updated. Additionally, the saved address for the page
+table walk is restored to its previous value, and the state transitions
+to the "PROPAGATE_ACCESS_ERROR" state.
+4. Lastly, if the data request for the page table entry was granted,
+the state indicates to the cache subsystem that the tag associated with
+the data is now valid.
+
+image:ptw_pte_flowchart.png[*Figure 28:* Flow Chart of PTE
+LOOKUP State]
+
+This state indicates a detected error in the page table walk process,
+and an error signal is asserted to indicate the Page Table Walker's
+error condition, triggering a transition to the "LATENCY" state for
+error signal propagation.
+
+This state indicates a detected access error in the page table walk
+process, and an access error signal is asserted to indicate the Page
+Table Walker's access error condition, triggering a transition to the
+"LATENCY" state for access error signal propagation.
+
+This state waits until it gets the "read valid" signal, and when it
+does, it's ready to start a new page table walk.
+
+The LATENCY state introduces a latency period to allow for necessary
+system actions or signals to stabilize. After the latency period, the
+FSM transitions back to the IDLE state, indicating that the system is
+prepared for a new translation request.
+
+The first step when a flush is triggered is to check whether the Page
+Table Entry (PTE) lookup process is currently in progress. If the PTW
+(Page Table Walker) module is indeed in the middle of a PTE lookup
+operation, the code then proceeds to evaluate a specific aspect of this
+operation.
+
+* *Check for Data Validity (rvalid):* Within the PTE lookup operation,
+it's important to ensure that the data being used for the translation is
+valid. In other words, the code checks whether the "rvalid" signal
+(which likely indicates the validity of the data) is not active. If the
+data is not yet valid, it implies that the PTW module is waiting for the
+data to become valid before completing the lookup. In such a case, the
+code takes appropriate action to wait for the data to become valid
+before proceeding further.
+* *Check for Waiting on Grant:* The second condition the code checks for
+during a flush scenario is whether the PTW module is currently waiting
+for a "grant." This "grant" signal is typically used to indicate
+permission or authorization to proceed with an operation. If the PTW
+module is indeed in a state of waiting for this grant signal, it implies
+that it requires authorization before continuing its task.
++
+__________________________________________________________________________________________________________________________________________________________________________________________________
+** *Waiting for Grant:* If the PTW module is in a state of waiting for
+the grant signal, the code ensures that it continues to wait for the
+grant signal to be asserted before proceeding further.
+__________________________________________________________________________________________________________________________________________________________________________________________________
+* *Return to Idle State if Neither Condition is Met:* After evaluating
+the above two conditions, the code determines whether either of these
+conditions is true. If neither of these conditions applies, it suggests
+that the PTW module can return to its idle state, indicating that it can
+continue normal operations without any dependencies on the flush
+condition.
diff --git a/docs/04_cv32a65x/design/source/subsystem.rst b/docs/design/design-manual/source/subsystem.adoc
similarity index 57%
rename from docs/04_cv32a65x/design/source/subsystem.rst
rename to docs/design/design-manual/source/subsystem.adoc
index 4f507d71bc..a28862511e 100644
--- a/docs/04_cv32a65x/design/source/subsystem.rst
+++ b/docs/design/design-manual/source/subsystem.adoc
@@ -1,4 +1,4 @@
-..
+////
Copyright 2022 Thales DIS design services SAS
Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -6,25 +6,30 @@
You may obtain a copy of the License at https://solderpad.org/licenses/
Original Author: Jean-Roch COULON - Thales
+////
-
-
+[[subsystem]]
Subsystem
-=========
+---------
+[[global-functionality]]
Global functionality
---------------------
+~~~~~~~~~~~~~~~~~~~~
-The CVA6 is a subsystem composed of the modules and protocol interfaces as illustrated
-The processor is a Harvard-based modern architecture.
-Instructions are issued in-order through the DECODE stage and executed out-of-order but committed in-order.
-The processor is Single issue, that means that at maximum one instruction per cycle can be issued to the EXECUTE stage.
+The CVA6 is a subsystem composed of the modules and protocol interfaces
+as illustrated The processor is a Harvard-based modern architecture.
+Instructions are issued in-order through the DECODE stage and executed
+out-of-order but committed in-order. The processor is Single issue, that
+means that at maximum one instruction per cycle can be issued to the
+EXECUTE stage.
-The CVA6 implements a 6-stage pipeline composed of PC Generation, Instruction Fetch, Instruction Decode, Issue stage, Execute stage and Commit stage.
-At least 6 cycles are needed to execute one instruction.
+The CVA6 implements a 6-stage pipeline composed of PC Generation,
+Instruction Fetch, Instruction Decode, Issue stage, Execute stage and
+Commit stage. At least 6 cycles are needed to execute one instruction.
+[[connection-with-other-sub-systems]]
Connection with other sub-systems
----------------------------------
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The submodule is connected to :
@@ -33,16 +38,14 @@ The submodule is connected to :
* TRACER provides support for verification
* TRAP provides traps inputs
-
+[[parameter-configuration]]
Parameter configuration
------------------------
-
-
-.. include:: parameters_cv32a65x.rst
-
+~~~~~~~~~~~~~~~~~~~~~~~
+include::parameters.adoc[]
+[[io-ports]]
IO ports
---------
+~~~~~~~~
-.. include:: port_cva6.rst
+include::port_cva6.adoc[]
diff --git a/docs/04_cv32a65x/design/source/CVXIF.rst b/docs/design/design-manual/source/traps.adoc
similarity index 84%
rename from docs/04_cv32a65x/design/source/CVXIF.rst
rename to docs/design/design-manual/source/traps.adoc
index 94dc7e4f16..fd6f42ef43 100644
--- a/docs/04_cv32a65x/design/source/CVXIF.rst
+++ b/docs/design/design-manual/source/traps.adoc
@@ -1,4 +1,4 @@
-..
+////
Copyright 2023 Thales DIS France SAS
Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
@@ -6,6 +6,10 @@
You may obtain a copy of the License at https://solderpad.org/licenses/
Original Author: Jean-Roch COULON - Thales
+////
+
+[[traps]]
+
+include::Traps_Interrupts_Exceptions.adoc[]
-.. include:: ../../../01_cva6_user/CVX_Interface_Coprocessor.rst
diff --git a/docs/index.rst b/docs/index.rst
index 5ab692133d..ce38770a99 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -56,7 +56,7 @@ The target audience of this document is current and existing members of the Open
The :doc:`CVA6 Design Document <03_cva6_design/index>` describes in detail the **CVA6**, the code base that can be used to compile/synthesize a specific core instance (e.g. cv32a65x).
-The :doc:`CV32A65X Design Document <04_cv32a65x/design/source/index>` describes in detail the **CV32A65X**, a specific core based on the CVA6 and the first production quality 32-bit application processor derived from the CVA6.
+The :doc:`CV32A65X Design Document <04_cv32a65x/design/design>` describes in detail the **CV32A65X**, a specific core based on the CVA6 and the first production quality 32-bit application processor derived from the CVA6.
The primary audience for this documentation are design and verification engineers working to bring the CV32A65X to TRL-5.
The :doc:`CVA6 APU <05_cva6_apu/index>` describes an Application Processor Unit built around the CVA6.
diff --git a/docs/riscv-isa/build.mk b/docs/riscv-isa/build.mk
index 5828ee4271..c03f3a5486 100644
--- a/docs/riscv-isa/build.mk
+++ b/docs/riscv-isa/build.mk
@@ -19,7 +19,8 @@ setup:
mkdir -p build/riscv-isa-manual
cp -r $(riscv-isa_dir)/riscv-isa-manual/* build/riscv-isa-manual
cp -r $(riscv-isa_dir)/src build/riscv-isa-manual
- cp -r src build/riscv-isa-manual
+ cp -r $(riscv-isa_dir)/../common/*.adoc build/riscv-isa-manual/src
+ cp ../config/config.adoc build/riscv-isa-manual/src
priv-pdf: setup
cd build/riscv-isa-manual; make SKIP_DOCKER=true build/riscv-privileged.pdf
diff --git a/docs/scripts/parameters_extractor.py b/docs/scripts/parameters_extractor.py
index 03a692cb45..2f1952c670 100644
--- a/docs/scripts/parameters_extractor.py
+++ b/docs/scripts/parameters_extractor.py
@@ -79,3 +79,29 @@ def writeout_parameter_table(fileout, parameters, module):
fout.write(f" * - {name}\n")
fout.write(f" - {parameters[name].description}\n")
fout.write(f" - {parameters[name].value}\n")
+
+def writeout_parameter_table_adoc(fileout, parameters, module):
+
+ with open(fileout, "w") as fout:
+ fout.write("////\n")
+ fout.write(" Copyright 2024 Thales DIS France SAS\n")
+ fout.write(
+ ' Licensed under the Solderpad Hardware License, Version 2.1 (the "License");\n'
+ )
+ fout.write(
+ " you may not use this file except in compliance with the License.\n"
+ )
+ fout.write(" SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1\n")
+ fout.write(
+ " You may obtain a copy of the License at https://solderpad.org/licenses/\n\n"
+ )
+ fout.write(" Original Author: Jean-Roch COULON - Thales\n")
+ fout.write("////\n\n")
+
+ fout.write(f"[[{module}_PARAMETERS]]\n\n")
+ fout.write(f".{module} parameter configuration\n")
+ fout.write("|===\n")
+ fout.write("|Name | description | description\n\n")
+ for name in parameters:
+ fout.write(f"|{name} | {parameters[name].description} | {parameters[name].value}\n")
+ fout.write("|===\n")
diff --git a/docs/scripts/spec_builder.py b/docs/scripts/spec_builder.py
index edf103582c..2f4f72cf89 100755
--- a/docs/scripts/spec_builder.py
+++ b/docs/scripts/spec_builder.py
@@ -10,26 +10,128 @@
#!/usr/bin/python3
import re
+import sys
from classes import Parameter
from classes import PortIO
from define_blacklist import define_blacklist
from parameters_extractor import parameters_extractor
from parameters_extractor import writeout_parameter_table
+from parameters_extractor import writeout_parameter_table_adoc
+HEADER_RST = """\
+..
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+
+"""
+
+HEADER_ADOC = """\
+////
+ Copyright 2024 Thales DIS France SAS
+ Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
+ you may not use this file except in compliance with the License.
+ SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
+ You may obtain a copy of the License at https://solderpad.org/licenses/
+
+ Original Author: Jean-Roch COULON - Thales
+////
+
+"""
+
+def print_to_rst(pathout, target, module, ports, comments):
+ fileout = f"{pathout}/port_{module}.rst"
+ print("Output file " + fileout)
+
+ with open(fileout, "w", encoding="utf-8") as fout:
+ fout.write(HEADER_RST)
+ fout.write(f".. _CVA6_{module}_ports:\n\n")
+ fout.write(f".. list-table:: **{module} module** IO ports\n")
+ fout.write(" :header-rows: 1\n")
+ fout.write("\n")
+ fout.write(" * - Signal\n")
+ fout.write(" - IO\n")
+ fout.write(" - Description\n")
+ fout.write(" - connexion\n")
+ fout.write(" - Type\n")
+ for i, port in enumerate(ports):
+ fout.write("\n")
+ fout.write(f" * - ``{port.name}``\n")
+ fout.write(f" - {port.direction}\n")
+ fout.write(f" - {port.description}\n")
+ fout.write(f" - {port.connexion}\n")
+ fout.write(f" - {port.data_type}\n")
+ fout.write("\n")
+ if len(comments) != 0:
+ fout.write(
+ f"Due to {target} configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below\n"
+ )
+ fout.write("\n")
+ for comment in comments:
+ fout.write(f"| {comment[0]},\n| {comment[1]}\n")
+ fout.write("\n")
+
+def print_to_adoc(pathout, target, module, ports, comments):
+ fileout = f"{pathout}/port_{module}.adoc"
+ print("Output file " + fileout)
+
+ # format comments
+ for comment in comments:
+ for i in range(len(comment)):
+ comment[i] = comment[i].replace('``', '`')
+ comment[i] = comment[i].replace('|', '*')
+
+ with open(fileout, "w", encoding="utf-8") as fout:
+ fout.write(HEADER_ADOC)
+
+ fout.write(f"[[_CVA6_{module}_ports]]\n\n")
+
+ fout.write(f".*{module} module* IO ports\n")
+ fout.write("|===\n")
+ fout.write("|Signal | IO | Description | connexion | Type\n\n")
+
+ for port in ports:
+ fout.write(f"|`{port.name}` | {port.direction} | {port.description} | {port.connexion} | {port.data_type}\n\n")
+ fout.write("|===\n")
+
+ if len(comments) != 0:
+ fout.write(
+ f"Due to {target} configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below\n\n"
+ )
+ for comment in comments:
+ fout.write(f"{comment[0]},::\n* {comment[1]}\n")
+ fout.write("\n")
def main():
PATH = "04_cv32a65x"
+ generate_file_type = "adoc"
[spec_number, target] = PATH.split("_")
print(spec_number, target)
+
+ # Parameters
parameters = parameters_extractor(spec_number, target)
pathout = f"./{spec_number}_{target}/design/source"
- fileout = f"{pathout}/parameters_{target}.rst"
- writeout_parameter_table(fileout, parameters, target)
+ if generate_file_type in ['rst']:
+ fileout = f"{pathout}/parameters_{target}.rst"
+ writeout_parameter_table(fileout, parameters, target)
+ elif generate_file_type in ['adoc']:
+ pathout = f"./{spec_number}_{target}/design/source"
+ fileout = f"{pathout}/parameters.adoc"
+ writeout_parameter_table_adoc(fileout, parameters, target)
+ else:
+ raise Exception("Format de sortie %s non pris en charge"%generate_file_type)
+
+ # User_cfg
export_user_cfg_doc("01_cva6_user/user_cfg_doc.rst", parameters)
+ # Ports
file = []
file.append("../core/cva6.sv")
file.append("../core/frontend/frontend.sv")
@@ -68,9 +170,7 @@ def main():
comments = []
a = re.match(r".*\/(.*).sv", filein)
module = a.group(1)
- fileout = f"{pathout}/port_{module}.rst"
print("Input file " + filein)
- print("Output file " + fileout)
ports = []
with open(filein, "r", encoding="utf-8") as fin:
description = "none"
@@ -126,49 +226,16 @@ def main():
description = "none"
connexion = "none"
- with open(fileout, "w", encoding="utf-8") as fout:
- fout.write(HEADER)
- fout.write(f".. _CVA6_{module}_ports:\n\n")
- fout.write(f".. list-table:: **{module} module** IO ports\n")
- fout.write(" :header-rows: 1\n")
- fout.write("\n")
- fout.write(" * - Signal\n")
- fout.write(" - IO\n")
- fout.write(" - Description\n")
- fout.write(" - connexion\n")
- fout.write(" - Type\n")
- for i, port in enumerate(ports):
- fout.write("\n")
- fout.write(f" * - ``{port.name}``\n")
- fout.write(f" - {port.direction}\n")
- fout.write(f" - {port.description}\n")
- fout.write(f" - {port.connexion}\n")
- fout.write(f" - {port.data_type}\n")
- fout.write("\n")
- if len(comments) != 0:
- fout.write(
- f"Due to {target} configuration, some ports are tied to a static value. These ports do not appear in the above table, they are listed below\n"
- )
- fout.write("\n")
- for comment in comments:
- fout.write(f"| {comment[0]},\n| {comment[1]}\n")
- fout.write("\n")
-
-HEADER = """\
-..
- Copyright 2024 Thales DIS France SAS
- Licensed under the Solderpad Hardware License, Version 2.1 (the "License");
- you may not use this file except in compliance with the License.
- SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
- You may obtain a copy of the License at https://solderpad.org/licenses/
-
- Original Author: Jean-Roch COULON - Thales
-
-"""
+ if generate_file_type in ['rst']:
+ print_to_rst(pathout, target, module, ports, comments)
+ elif generate_file_type in ['adoc']:
+ print_to_adoc(pathout, target, module, ports, comments)
+ else:
+ raise Exception("Format de sortie %s non pris en charge"%generate_file_type)
def export_user_cfg_doc(out_path, params):
with open(out_path, "w", encoding="utf-8") as f:
- f.write(HEADER)
+ f.write(HEADER_RST)
f.write("""\
.. _cva6_user_cfg_doc:
From b438a8ba8ece76a11cf253c5ad6413e0aa9884ef Mon Sep 17 00:00:00 2001
From: AbdessamiiOukalrazqou
<163409352+AbdessamiiOukalrazqou@users.noreply.github.com>
Date: Thu, 25 Jul 2024 20:07:45 +0200
Subject: [PATCH 037/183] [gen_from_riscv_config] Improve the tool to support
debug spec (#2398)
---
.../scripts/libs/csr_updater.py | 35 +++++++++++--------
.../scripts/libs/utils.py | 9 +++--
.../scripts/riscv_config_gen.py | 13 ++++---
3 files changed, 35 insertions(+), 22 deletions(-)
diff --git a/config/gen_from_riscv_config/scripts/libs/csr_updater.py b/config/gen_from_riscv_config/scripts/libs/csr_updater.py
index af76b67b28..2a5077d577 100644
--- a/config/gen_from_riscv_config/scripts/libs/csr_updater.py
+++ b/config/gen_from_riscv_config/scripts/libs/csr_updater.py
@@ -22,25 +22,30 @@ def csr_recursive_update(original_dict, csr_update):
original_dict[key] = value
-def csr_formatter(srcfile, customfile, modifile):
+def csr_formatter(srcfile, customfile, debugfile, modifile):
# Read original dictionary from YAML source file
with open(srcfile, "r", encoding="utf-8") as file:
original_dict = yaml.safe_load(file)
with open(customfile, "r", encoding="utf-8") as file:
custom_dict = yaml.safe_load(file)
-
- isa_data = original_dict.copy()
- isa_data["hart0"].update(custom_dict["hart0"])
- updated_values = {}
+ debug_dict = {}
+ riscv_config_data = original_dict.copy()
+ if debugfile is not None:
+ with open(debugfile, "r", encoding="utf-8") as file:
+ debug_dict = yaml.safe_load(file)
+ if debug_dict["hart0"]["debug_mode"]:
+ riscv_config_data["hart0"].update(debug_dict["hart0"])
+ riscv_config_data["hart0"].update(custom_dict["hart0"])
+ update_dict = {}
if modifile is not None:
with open(modifile, "r", encoding="utf-8") as file:
- updated_values = yaml.safe_load(file)
-
+ update_dict = yaml.safe_load(file)
+ print(riscv_config_data["hart0"])
# Update original_dict with values from updated_values recursively
- csr_recursive_update(isa_data["hart0"], updated_values)
+ csr_recursive_update(riscv_config_data["hart0"], update_dict)
# Identify and remove keys within the range specified for each register
keys_to_remove = []
- for key, value in updated_values.items():
+ for key, value in update_dict.items():
if "range" in value:
range_value = value["range"]
pattern = rf"{key}(\d+)"
@@ -51,7 +56,7 @@ def csr_formatter(srcfile, customfile, modifile):
if index >= range_value:
keys_to_remove.append(k)
# Remove excluded keys based on the condition
- exclude_data = updated_values.get("exclude")
+ exclude_data = update_dict.get("exclude")
if exclude_data:
exclude_key = exclude_data.get("key")
sub_key = exclude_data.get("sub_key")
@@ -71,12 +76,12 @@ def remove_keys_recursive(dictionary):
for k in keys_to_remove:
dictionary.pop(k)
- remove_keys_recursive(isa_data["hart0"])
- remove_keys_recursive(isa_data["hart0"])
+ remove_keys_recursive(riscv_config_data["hart0"])
+ remove_keys_recursive(riscv_config_data["hart0"])
# Remove keys from original_dict
for k in keys_to_remove:
- isa_data["hart0"].pop(k, None)
+ riscv_config_data["hart0"].pop(k, None)
# Remove keys from original_dict
for k in keys_to_remove:
- isa_data.pop(k, None)
- return isa_data["hart0"]
+ riscv_config_data.pop(k, None)
+ return riscv_config_data["hart0"]
diff --git a/config/gen_from_riscv_config/scripts/libs/utils.py b/config/gen_from_riscv_config/scripts/libs/utils.py
index 0a620462b2..738bdd5a92 100644
--- a/config/gen_from_riscv_config/scripts/libs/utils.py
+++ b/config/gen_from_riscv_config/scripts/libs/utils.py
@@ -14,7 +14,7 @@
#
# Original Author: Oukalrazqou Abdessamii
-""" Module is used to gather all utils and function to generate the csr and isa documents"""
+"""Module is used to gather all utils and function to generate the csr and isa documents"""
import io
import os
@@ -942,9 +942,10 @@ def returnMdRegDesc(self, name, address, resetValue, desc, access):
class CsrParser:
"""parse CSR RISC-V config yaml file"""
- def __init__(self, srcFile, customFile, target, modiFile=None):
+ def __init__(self, srcFile, customFile, debugfile, target, modiFile=None):
self.srcFile = srcFile
self.customFile = customFile
+ self.debugfile = debugfile
self.modiFile = modiFile
self.target = target
@@ -1256,7 +1257,9 @@ def returnDocument(self):
size = int(
data["hart0"].get("supported_xlen", "")[0]
) # depends on architecture
- data = csr_formatter(self.srcFile, self.customFile, self.modiFile)
+ data = csr_formatter(
+ self.srcFile, self.customFile, self.debugfile, self.modiFile
+ )
Registers = factorizer(data)
d = DocumentClass(docName)
m = MemoryMapClass(docName)
diff --git a/config/gen_from_riscv_config/scripts/riscv_config_gen.py b/config/gen_from_riscv_config/scripts/riscv_config_gen.py
index fd18c2afaf..ea5a58e555 100644
--- a/config/gen_from_riscv_config/scripts/riscv_config_gen.py
+++ b/config/gen_from_riscv_config/scripts/riscv_config_gen.py
@@ -13,15 +13,17 @@
# limitations under the License.
#
# Original Author: Oukalrazqou Abdessamii
-""" Module is used to factorize multiples registers with the same name to
- a specific format of registers """
+"""Module is used to factorize multiples registers with the same name to
+a specific format of registers"""
import argparse
from libs.utils import CsrParser
from libs.utils import IsaParser
+from libs.utils import SpikeParser
from libs.utils import IsaGenerator
from libs.utils import CsrGenerator
+from libs.utils import SpikeGenerator
from libs.utils import RstAddressBlock
from libs.utils import AdocAddressBlock
from libs.utils import MdAddressBlock
@@ -29,11 +31,12 @@
from libs.utils import InstadocBlock
from libs.utils import InstmdBlock
+
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="GEN From RISC-V Config")
parser.add_argument("-s", "--srcFile", help="isa_gen yaml input file")
parser.add_argument("-c", "--customFile", help=" custom_gen yaml input file")
- parser.add_argument("-d", "--destDir", help="write generated file to dir")
+ parser.add_argument("-d", "--debugFile", help=" debug_gen yaml input file")
parser.add_argument("-m", "--modif", help="ISA /CSR Formatter if exist")
parser.add_argument("-i", "--temp", help="Full ISA /SPIKETemplate")
parser.add_argument("-t", "--target", help="Specifiy Config Name")
@@ -65,7 +68,9 @@
spike_generator = SpikeGenerator(args.target, args.temp, args.modif)
spike_generator.generateSpike(document)
else:
- e = CsrParser(args.srcFile, args.customFile, args.target, args.modif)
+ e = CsrParser(
+ args.srcFile, args.customFile, args.debugFile, args.target, args.modif
+ )
document = e.returnDocument()
generator = CsrGenerator(args.target)
generator.generateCSR(C_AddressBlock, document)
From 96b050852598786d8aeb9877ebf9783aed7352a1 Mon Sep 17 00:00:00 2001
From: Zbigniew Chamski <107464696+zchamski@users.noreply.github.com>
Date: Thu, 25 Jul 2024 22:06:51 +0200
Subject: [PATCH 038/183] [riscv-config] Update PMP definitions in cv32q65x
spec (#2401)
---
.../scripts/libs/utils.py | 10 +-
.../cv32a65x/generated/isa_gen.yaml | 1020 +++++++++++++++--
.../riscv-config/cv32a65x/spec/isa_spec.yaml | 550 ++++++---
3 files changed, 1307 insertions(+), 273 deletions(-)
diff --git a/config/gen_from_riscv_config/scripts/libs/utils.py b/config/gen_from_riscv_config/scripts/libs/utils.py
index 738bdd5a92..4a26398721 100644
--- a/config/gen_from_riscv_config/scripts/libs/utils.py
+++ b/config/gen_from_riscv_config/scripts/libs/utils.py
@@ -454,11 +454,7 @@ def returnAsString(self):
field.name.upper(),
field.fieldreset,
field.fieldaccess,
- (
- Render.bitmask(field.andMask, field.orMask)
- if field.andMask and field.orMask
- else field.bitlegal
- ),
+ field.bitlegal,
]
_line.append(field.fieldDesc)
reg_table.append(_line)
@@ -1015,9 +1011,11 @@ def returnRegister(
if matches:
expr_type = str(matches.group(2))
if expr_type == "bitmask":
- # legal_value is left at default, cf. Render.bitmask().
andMask = str(matches.group(4))
orMask = str(matches.group(5))
+ legal_value = Render.bitmask(
+ andMask, orMask
+ )
elif expr_type == "in":
if matches.group(3).find(",") >= 0:
# list ==> set of values
diff --git a/config/riscv-config/cv32a65x/generated/isa_gen.yaml b/config/riscv-config/cv32a65x/generated/isa_gen.yaml
index 0b3ea13925..65104d3881 100644
--- a/config/riscv-config/cv32a65x/generated/isa_gen.yaml
+++ b/config/riscv-config/cv32a65x/generated/isa_gen.yaml
@@ -2241,7 +2241,7 @@ hart0:
warl:
dependency_fields: []
legal:
- - pmp0cfg[7:0] in [0x00:0xFF]
+ - pmp0cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
description: pmp configuration bits
@@ -2255,7 +2255,7 @@ hart0:
warl:
dependency_fields: []
legal:
- - pmp1cfg[7:0] in [0x00:0xFF]
+ - pmp1cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
description: pmp configuration bits
@@ -2269,7 +2269,7 @@ hart0:
warl:
dependency_fields: []
legal:
- - pmp2cfg[7:0] in [0x00:0xFF]
+ - pmp2cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
description: pmp configuration bits
@@ -2283,7 +2283,7 @@ hart0:
warl:
dependency_fields: []
legal:
- - pmp3cfg[7:0] in [0x00:0xFF]
+ - pmp3cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
description: pmp configuration bits
@@ -2311,7 +2311,7 @@ hart0:
warl:
dependency_fields: []
legal:
- - pmp4cfg[7:0] in [0x00:0xFF]
+ - pmp4cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
description: pmp configuration bits
@@ -2325,7 +2325,7 @@ hart0:
warl:
dependency_fields: []
legal:
- - pmp5cfg[7:0] in [0x00:0xFF]
+ - pmp5cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
description: pmp configuration bits
@@ -2339,7 +2339,7 @@ hart0:
warl:
dependency_fields: []
legal:
- - pmp6cfg[7:0] in [0x00:0xFF]
+ - pmp6cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
description: pmp configuration bits
@@ -2353,7 +2353,7 @@ hart0:
warl:
dependency_fields: []
legal:
- - pmp7cfg[7:0] in [0x00:0xFF]
+ - pmp7cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
description: pmp configuration bits
@@ -2378,12 +2378,7 @@ hart0:
pmp8cfg:
implemented: true
type:
- warl:
- dependency_fields: []
- legal:
- - pmp8cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ ro_constant: 0x0
description: pmp configuration bits
shadow:
shadow_type: rw
@@ -2392,12 +2387,7 @@ hart0:
pmp9cfg:
implemented: true
type:
- warl:
- dependency_fields: []
- legal:
- - pmp9cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ ro_constant: 0x0
description: pmp configuration bits
shadow:
shadow_type: rw
@@ -2406,12 +2396,7 @@ hart0:
pmp10cfg:
implemented: true
type:
- warl:
- dependency_fields: []
- legal:
- - pmp10cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ ro_constant: 0x0
description: pmp configuration bits
shadow:
shadow_type: rw
@@ -2420,12 +2405,7 @@ hart0:
pmp11cfg:
implemented: true
type:
- warl:
- dependency_fields: []
- legal:
- - pmp11cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ ro_constant: 0x0
description: pmp configuration bits
shadow:
shadow_type: rw
@@ -2448,12 +2428,7 @@ hart0:
pmp12cfg:
implemented: true
type:
- warl:
- dependency_fields: []
- legal:
- - pmp12cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ ro_constant: 0x0
description: pmp configuration bits
shadow:
shadow_type: rw
@@ -2462,12 +2437,7 @@ hart0:
pmp13cfg:
implemented: true
type:
- warl:
- dependency_fields: []
- legal:
- - pmp13cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ ro_constant: 0x0
description: pmp configuration bits
shadow:
shadow_type: rw
@@ -2476,12 +2446,7 @@ hart0:
pmp14cfg:
implemented: true
type:
- warl:
- dependency_fields: []
- legal:
- - pmp14cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ ro_constant: 0x0
description: pmp configuration bits
shadow:
shadow_type: rw
@@ -2490,12 +2455,7 @@ hart0:
pmp15cfg:
implemented: true
type:
- warl:
- dependency_fields: []
- legal:
- - pmp15cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ ro_constant: 0x0
description: pmp configuration bits
shadow:
shadow_type: rw
@@ -2514,7 +2474,48 @@ hart0:
priv_mode: M
pmpcfg4:
rv32:
- accessible: false
+ accessible: true
+ pmp16cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp17cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp18cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp19cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp16cfg
+ - pmp17cfg
+ - pmp18cfg
+ - pmp19cfg
rv64:
accessible: false
reset-val: 0
@@ -2523,7 +2524,48 @@ hart0:
priv_mode: M
pmpcfg5:
rv32:
- accessible: false
+ accessible: true
+ pmp20cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp21cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp22cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp23cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp20cfg
+ - pmp21cfg
+ - pmp22cfg
+ - pmp23cfg
rv64:
accessible: false
reset-val: 0
@@ -2532,7 +2574,48 @@ hart0:
priv_mode: M
pmpcfg6:
rv32:
- accessible: false
+ accessible: true
+ pmp24cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp25cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp26cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp27cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp24cfg
+ - pmp25cfg
+ - pmp26cfg
+ - pmp27cfg
rv64:
accessible: false
reset-val: 0
@@ -2541,7 +2624,48 @@ hart0:
priv_mode: M
pmpcfg7:
rv32:
- accessible: false
+ accessible: true
+ pmp28cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp29cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp30cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp31cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp28cfg
+ - pmp29cfg
+ - pmp30cfg
+ - pmp31cfg
rv64:
accessible: false
reset-val: 0
@@ -2550,7 +2674,48 @@ hart0:
priv_mode: M
pmpcfg8:
rv32:
- accessible: false
+ accessible: true
+ pmp32cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp33cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp34cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp35cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp32cfg
+ - pmp33cfg
+ - pmp34cfg
+ - pmp35cfg
rv64:
accessible: false
reset-val: 0
@@ -2559,7 +2724,48 @@ hart0:
priv_mode: M
pmpcfg9:
rv32:
- accessible: false
+ accessible: true
+ pmp36cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp37cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp38cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp39cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp36cfg
+ - pmp37cfg
+ - pmp38cfg
+ - pmp39cfg
rv64:
accessible: false
reset-val: 0
@@ -2568,7 +2774,48 @@ hart0:
priv_mode: M
pmpcfg10:
rv32:
- accessible: false
+ accessible: true
+ pmp40cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp41cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp42cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp43cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp40cfg
+ - pmp41cfg
+ - pmp42cfg
+ - pmp43cfg
rv64:
accessible: false
reset-val: 0
@@ -2577,7 +2824,48 @@ hart0:
priv_mode: M
pmpcfg11:
rv32:
- accessible: false
+ accessible: true
+ pmp44cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp45cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp46cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp47cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp44cfg
+ - pmp45cfg
+ - pmp46cfg
+ - pmp47cfg
rv64:
accessible: false
reset-val: 0
@@ -2586,7 +2874,48 @@ hart0:
priv_mode: M
pmpcfg12:
rv32:
- accessible: false
+ accessible: true
+ pmp48cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp49cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp50cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp51cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp48cfg
+ - pmp49cfg
+ - pmp50cfg
+ - pmp51cfg
rv64:
accessible: false
reset-val: 0
@@ -2595,7 +2924,48 @@ hart0:
priv_mode: M
pmpcfg13:
rv32:
- accessible: false
+ accessible: true
+ pmp52cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp53cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp54cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp55cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp52cfg
+ - pmp53cfg
+ - pmp54cfg
+ - pmp55cfg
rv64:
accessible: false
reset-val: 0
@@ -2604,7 +2974,48 @@ hart0:
priv_mode: M
pmpcfg14:
rv32:
- accessible: false
+ accessible: true
+ pmp56cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp57cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp58cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp59cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp56cfg
+ - pmp57cfg
+ - pmp58cfg
+ - pmp59cfg
rv64:
accessible: false
reset-val: 0
@@ -2613,7 +3024,48 @@ hart0:
priv_mode: M
pmpcfg15:
rv32:
- accessible: false
+ accessible: true
+ pmp60cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 7
+ lsb: 0
+ pmp61cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 15
+ lsb: 8
+ pmp62cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 23
+ lsb: 16
+ pmp63cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ description: pmp configuration bits
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 24
+ fields:
+ - pmp60cfg
+ - pmp61cfg
+ - pmp62cfg
+ - pmp63cfg
rv64:
accessible: false
reset-val: 0
@@ -3004,7 +3456,14 @@ hart0:
priv_mode: M
pmpaddr16:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3013,7 +3472,14 @@ hart0:
priv_mode: M
pmpaddr17:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3022,7 +3488,14 @@ hart0:
priv_mode: M
pmpaddr18:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3031,7 +3504,14 @@ hart0:
priv_mode: M
pmpaddr19:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3040,7 +3520,14 @@ hart0:
priv_mode: M
pmpaddr20:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3049,7 +3536,14 @@ hart0:
priv_mode: M
pmpaddr21:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3058,7 +3552,14 @@ hart0:
priv_mode: M
pmpaddr22:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3067,7 +3568,14 @@ hart0:
priv_mode: M
pmpaddr23:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3076,7 +3584,14 @@ hart0:
priv_mode: M
pmpaddr24:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3085,7 +3600,14 @@ hart0:
priv_mode: M
pmpaddr25:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3094,7 +3616,14 @@ hart0:
priv_mode: M
pmpaddr26:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3103,7 +3632,14 @@ hart0:
priv_mode: M
pmpaddr27:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3112,7 +3648,14 @@ hart0:
priv_mode: M
pmpaddr28:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3121,7 +3664,14 @@ hart0:
priv_mode: M
pmpaddr29:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3130,7 +3680,14 @@ hart0:
priv_mode: M
pmpaddr30:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3139,7 +3696,14 @@ hart0:
priv_mode: M
pmpaddr31:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3148,7 +3712,14 @@ hart0:
priv_mode: M
pmpaddr32:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3157,7 +3728,14 @@ hart0:
priv_mode: M
pmpaddr33:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3166,7 +3744,14 @@ hart0:
priv_mode: M
pmpaddr34:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3175,7 +3760,14 @@ hart0:
priv_mode: M
pmpaddr35:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3184,7 +3776,14 @@ hart0:
priv_mode: M
pmpaddr36:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3193,7 +3792,14 @@ hart0:
priv_mode: M
pmpaddr37:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3202,7 +3808,14 @@ hart0:
priv_mode: M
pmpaddr38:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3211,7 +3824,14 @@ hart0:
priv_mode: M
pmpaddr39:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3220,7 +3840,14 @@ hart0:
priv_mode: M
pmpaddr40:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3229,7 +3856,14 @@ hart0:
priv_mode: M
pmpaddr41:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3238,7 +3872,14 @@ hart0:
priv_mode: M
pmpaddr42:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3247,7 +3888,14 @@ hart0:
priv_mode: M
pmpaddr43:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3256,7 +3904,14 @@ hart0:
priv_mode: M
pmpaddr44:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3265,7 +3920,14 @@ hart0:
priv_mode: M
pmpaddr45:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3274,7 +3936,14 @@ hart0:
priv_mode: M
pmpaddr46:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3283,7 +3952,14 @@ hart0:
priv_mode: M
pmpaddr47:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3292,7 +3968,14 @@ hart0:
priv_mode: M
pmpaddr48:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3301,7 +3984,14 @@ hart0:
priv_mode: M
pmpaddr49:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3310,7 +4000,14 @@ hart0:
priv_mode: M
pmpaddr50:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3319,7 +4016,14 @@ hart0:
priv_mode: M
pmpaddr51:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3328,7 +4032,14 @@ hart0:
priv_mode: M
pmpaddr52:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3337,7 +4048,14 @@ hart0:
priv_mode: M
pmpaddr53:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3346,7 +4064,14 @@ hart0:
priv_mode: M
pmpaddr54:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3355,7 +4080,14 @@ hart0:
priv_mode: M
pmpaddr55:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3364,7 +4096,14 @@ hart0:
priv_mode: M
pmpaddr56:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3373,7 +4112,14 @@ hart0:
priv_mode: M
pmpaddr57:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3382,7 +4128,14 @@ hart0:
priv_mode: M
pmpaddr58:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3391,7 +4144,14 @@ hart0:
priv_mode: M
pmpaddr59:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3400,7 +4160,14 @@ hart0:
priv_mode: M
pmpaddr60:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3409,7 +4176,14 @@ hart0:
priv_mode: M
pmpaddr61:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3418,7 +4192,14 @@ hart0:
priv_mode: M
pmpaddr62:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
@@ -3427,7 +4208,14 @@ hart0:
priv_mode: M
pmpaddr63:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
+ fields: []
+ shadow:
+ shadow_type: rw
+ msb: 31
+ lsb: 0
rv64:
accessible: false
reset-val: 0
diff --git a/config/riscv-config/cv32a65x/spec/isa_spec.yaml b/config/riscv-config/cv32a65x/spec/isa_spec.yaml
index 9b25133aaa..2044cdca4e 100644
--- a/config/riscv-config/cv32a65x/spec/isa_spec.yaml
+++ b/config/riscv-config/cv32a65x/spec/isa_spec.yaml
@@ -998,34 +998,34 @@ hart0: &hart0
warl:
dependency_fields: []
legal:
- - pmp0cfg[7:0] in [0x00:0xFF]
+ - pmp0cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
pmp1cfg:
implemented: true
- type:
+ type:
warl:
dependency_fields: []
legal:
- - pmp1cfg[7:0] in [0x00:0xFF]
+ - pmp1cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
pmp2cfg:
implemented: true
- type:
+ type:
warl:
dependency_fields: []
legal:
- - pmp2cfg[7:0] in [0x00:0xFF]
+ - pmp2cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
pmp3cfg:
implemented: true
- type:
+ type:
warl:
dependency_fields: []
legal:
- - pmp3cfg[7:0] in [0x00:0xFF]
+ - pmp3cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
rv64:
@@ -1036,38 +1036,38 @@ hart0: &hart0
accessible: true
pmp4cfg:
implemented: true
- type:
+ type:
warl:
dependency_fields: []
legal:
- - pmp4cfg[7:0] in [0x00:0xFF]
+ - pmp4cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
pmp5cfg:
implemented: true
- type:
+ type:
warl:
dependency_fields: []
legal:
- - pmp5cfg[7:0] in [0x00:0xFF]
+ - pmp5cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
pmp6cfg:
implemented: true
- type:
+ type:
warl:
dependency_fields: []
legal:
- - pmp6cfg[7:0] in [0x00:0xFF]
+ - pmp6cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
pmp7cfg:
implemented: true
- type:
+ type:
warl:
dependency_fields: []
legal:
- - pmp7cfg[7:0] in [0x00:0xFF]
+ - pmp7cfg[7:0] bitmask [0x8f, 0x0]
wr_illegal:
- unchanged
rv64:
@@ -1078,40 +1078,20 @@ hart0: &hart0
accessible: true
pmp8cfg:
implemented: true
- type:
- warl:
- dependency_fields: []
- legal:
- - pmp8cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ type:
+ ro_constant: 0x0
pmp9cfg:
implemented: true
- type:
- warl:
- dependency_fields: []
- legal:
- - pmp9cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ type:
+ ro_constant: 0x0
pmp10cfg:
implemented: true
- type:
- warl:
- dependency_fields: []
- legal:
- - pmp10cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ type:
+ ro_constant: 0x0
pmp11cfg:
implemented: true
- type:
- warl:
- dependency_fields: []
- legal:
- - pmp11cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
@@ -1120,119 +1100,291 @@ hart0: &hart0
accessible: true
pmp12cfg:
implemented: true
- type:
- warl:
- dependency_fields: []
- legal:
- - pmp12cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ type:
+ ro_constant: 0x0
pmp13cfg:
implemented: true
- type:
- warl:
- dependency_fields: []
- legal:
- - pmp13cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ type:
+ ro_constant: 0x0
pmp14cfg:
implemented: true
- type:
- warl:
- dependency_fields: []
- legal:
- - pmp14cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ type:
+ ro_constant: 0x0
pmp15cfg:
implemented: true
- type:
- warl:
- dependency_fields: []
- legal:
- - pmp15cfg[7:0] in [0x00:0xFF]
- wr_illegal:
- - unchanged
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpcfg4:
rv32:
- accessible: false
+ accessible: true
+ pmp16cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp17cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp18cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp19cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpcfg5:
rv32:
- accessible: false
+ accessible: true
+ pmp20cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp21cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp22cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp23cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpcfg6:
rv32:
- accessible: false
+ accessible: true
+ pmp24cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp25cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp26cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp27cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpcfg7:
rv32:
- accessible: false
+ accessible: true
+ pmp28cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp29cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp30cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp31cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpcfg8:
rv32:
- accessible: false
+ accessible: true
+ pmp32cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp33cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp34cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp35cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpcfg9:
rv32:
- accessible: false
+ accessible: true
+ pmp36cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp37cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp38cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp39cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpcfg10:
rv32:
- accessible: false
+ accessible: true
+ pmp40cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp41cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp42cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp43cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpcfg11:
rv32:
- accessible: false
+ accessible: true
+ pmp44cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp45cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp46cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp47cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpcfg12:
rv32:
- accessible: false
+ accessible: true
+ pmp48cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp49cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp50cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp51cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpcfg13:
rv32:
- accessible: false
+ accessible: true
+ pmp52cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp53cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp54cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp55cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpcfg14:
rv32:
- accessible: false
+ accessible: true
+ pmp56cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp57cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp58cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp59cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpcfg15:
rv32:
- accessible: false
+ accessible: true
+ pmp60cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp61cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp62cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
+ pmp63cfg:
+ implemented: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
mcycle:
rv32:
accessible: true
- type:
+ type:
warl:
dependency_fields: []
legal:
@@ -1245,7 +1397,7 @@ hart0: &hart0
minstret:
rv32:
accessible: true
- type:
+ type:
warl:
dependency_fields: []
legal:
@@ -1258,7 +1410,7 @@ hart0: &hart0
mcycleh:
rv32:
accessible: true
- type:
+ type:
warl:
dependency_fields: []
legal:
@@ -1271,7 +1423,7 @@ hart0: &hart0
minstreth:
rv32:
accessible: true
- type:
+ type:
warl:
dependency_fields: []
legal:
@@ -1284,7 +1436,7 @@ hart0: &hart0
pmpaddr0:
rv32:
accessible: true
- type:
+ type:
warl:
dependency_fields: []
legal:
@@ -1297,7 +1449,7 @@ hart0: &hart0
pmpaddr1:
rv32:
accessible: true
- type:
+ type:
warl:
dependency_fields: []
legal:
@@ -1310,7 +1462,7 @@ hart0: &hart0
pmpaddr2:
rv32:
accessible: true
- type:
+ type:
warl:
dependency_fields: []
legal:
@@ -1323,7 +1475,7 @@ hart0: &hart0
pmpaddr3:
rv32:
accessible: true
- type:
+ type:
warl:
dependency_fields: []
legal:
@@ -1336,7 +1488,7 @@ hart0: &hart0
pmpaddr4:
rv32:
accessible: true
- type:
+ type:
warl:
dependency_fields: []
legal:
@@ -1349,7 +1501,7 @@ hart0: &hart0
pmpaddr5:
rv32:
accessible: true
- type:
+ type:
warl:
dependency_fields: []
legal:
@@ -1362,7 +1514,7 @@ hart0: &hart0
pmpaddr6:
rv32:
accessible: true
- type:
+ type:
warl:
dependency_fields: []
legal:
@@ -1375,7 +1527,7 @@ hart0: &hart0
pmpaddr7:
rv32:
accessible: true
- type:
+ type:
warl:
dependency_fields: []
legal:
@@ -1388,7 +1540,7 @@ hart0: &hart0
pmpaddr8:
rv32:
accessible: true
- type:
+ type:
ro_constant: 0x0
rv64:
accessible: false
@@ -1396,7 +1548,7 @@ hart0: &hart0
pmpaddr9:
rv32:
accessible: true
- type:
+ type:
ro_constant: 0x0
rv64:
accessible: false
@@ -1404,7 +1556,7 @@ hart0: &hart0
pmpaddr10:
rv32:
accessible: true
- type:
+ type:
ro_constant: 0x0
rv64:
accessible: false
@@ -1412,7 +1564,7 @@ hart0: &hart0
pmpaddr11:
rv32:
accessible: true
- type:
+ type:
ro_constant: 0x0
rv64:
accessible: false
@@ -1420,7 +1572,7 @@ hart0: &hart0
pmpaddr12:
rv32:
accessible: true
- type:
+ type:
ro_constant: 0x0
rv64:
accessible: false
@@ -1428,7 +1580,7 @@ hart0: &hart0
pmpaddr13:
rv32:
accessible: true
- type:
+ type:
ro_constant: 0x0
rv64:
accessible: false
@@ -1436,7 +1588,7 @@ hart0: &hart0
pmpaddr14:
rv32:
accessible: true
- type:
+ type:
ro_constant: 0x0
rv64:
accessible: false
@@ -1444,296 +1596,392 @@ hart0: &hart0
pmpaddr15:
rv32:
accessible: true
- type:
+ type:
ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr16:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr17:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr18:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr19:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr20:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr21:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr22:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr23:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr24:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr25:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr26:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr27:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr28:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr29:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr30:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr31:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr32:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr33:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr34:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr35:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr36:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr37:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr38:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr39:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr40:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr41:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr42:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr43:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr44:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr45:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr46:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr47:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr48:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr49:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr50:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr51:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr52:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr53:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr54:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr55:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr56:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr57:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr58:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr59:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr60:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr61:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr62:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
pmpaddr63:
rv32:
- accessible: false
+ accessible: true
+ type:
+ ro_constant: 0x0
rv64:
accessible: false
reset-val: 0
From 211af02e5e8600e9a5aabfc024ad83f801ca12b4 Mon Sep 17 00:00:00 2001
From: Guillaume Chauvon <94678394+Gchauvon@users.noreply.github.com>
Date: Fri, 26 Jul 2024 14:58:18 +0200
Subject: [PATCH 039/183] Separate RAW and WAW process to fix CVXIF with
Superscalar (#2395)
---
.../cvxif_example/compressed_instr_decoder.sv | 13 +-
.../cvxif_example_coprocessor.sv | 3 +
core/cvxif_example/instr_decoder.sv | 26 +--
core/cvxif_issue_register_commit_if_driver.sv | 38 ++---
core/include/build_config_pkg.sv | 2 +-
core/issue_read_operands.sv | 128 +++++++-------
spyglass/reference_summary.rpt | 161 +++++++++---------
7 files changed, 194 insertions(+), 177 deletions(-)
diff --git a/core/cvxif_example/compressed_instr_decoder.sv b/core/cvxif_example/compressed_instr_decoder.sv
index 861f05d5be..de2fbb391c 100644
--- a/core/cvxif_example/compressed_instr_decoder.sv
+++ b/core/cvxif_example/compressed_instr_decoder.sv
@@ -7,13 +7,12 @@
//
// Original Author: Guillaume Chauvon
-module compressed_instr_decoder
- import cvxif_instr_pkg::*;
-#(
- parameter int NbInstr = 1,
- parameter copro_compressed_resp_t CoproInstr [NbInstr] = {0},
- parameter type x_compressed_req_t = logic,
- parameter type x_compressed_resp_t = logic
+module compressed_instr_decoder #(
+ parameter type copro_compressed_resp_t = logic,
+ parameter int NbInstr = 1,
+ parameter copro_compressed_resp_t CoproInstr [NbInstr] = {0},
+ parameter type x_compressed_req_t = logic,
+ parameter type x_compressed_resp_t = logic
) (
input logic clk_i,
input logic rst_ni,
diff --git a/core/cvxif_example/cvxif_example_coprocessor.sv b/core/cvxif_example/cvxif_example_coprocessor.sv
index 6b30e5d833..8cc1b15558 100644
--- a/core/cvxif_example/cvxif_example_coprocessor.sv
+++ b/core/cvxif_example/cvxif_example_coprocessor.sv
@@ -71,6 +71,7 @@ module cvxif_example_coprocessor
assign register_valid = cvxif_req_i.register_valid;
compressed_instr_decoder #(
+ .copro_compressed_resp_t(cvxif_instr_pkg::copro_compressed_resp_t),
.NbInstr(cvxif_instr_pkg::NbCompInstr),
.CoproInstr(cvxif_instr_pkg::CoproCompInstr),
.x_compressed_req_t(x_compressed_req_t),
@@ -85,6 +86,8 @@ module cvxif_example_coprocessor
);
instr_decoder #(
+ .copro_issue_resp_t (cvxif_instr_pkg::copro_issue_resp_t),
+ .opcode_t (cvxif_instr_pkg::opcode_t),
.NbInstr (cvxif_instr_pkg::NbInstr),
.CoproInstr(cvxif_instr_pkg::CoproInstr),
.NrRgprPorts(NrRgprPorts),
diff --git a/core/cvxif_example/instr_decoder.sv b/core/cvxif_example/instr_decoder.sv
index 6f271695f2..8e952b6dfe 100644
--- a/core/cvxif_example/instr_decoder.sv
+++ b/core/cvxif_example/instr_decoder.sv
@@ -7,18 +7,18 @@
//
// Original Author: Guillaume Chauvon
-module instr_decoder
- import cvxif_instr_pkg::*;
-#(
- parameter int NbInstr = 1,
- parameter copro_issue_resp_t CoproInstr [NbInstr] = {0},
- parameter int unsigned NrRgprPorts = 2,
- parameter type hartid_t = logic,
- parameter type id_t = logic,
- parameter type x_issue_req_t = logic,
- parameter type x_issue_resp_t = logic,
- parameter type x_register_t = logic,
- parameter type registers_t = logic
+module instr_decoder #(
+ parameter type copro_issue_resp_t = logic,
+ parameter type opcode_t = logic,
+ parameter int NbInstr = 1,
+ parameter copro_issue_resp_t CoproInstr [NbInstr] = {0},
+ parameter int unsigned NrRgprPorts = 2,
+ parameter type hartid_t = logic,
+ parameter type id_t = logic,
+ parameter type x_issue_req_t = logic,
+ parameter type x_issue_resp_t = logic,
+ parameter type x_register_t = logic,
+ parameter type registers_t = logic
) (
input logic clk_i,
input logic rst_ni,
@@ -53,7 +53,7 @@ module instr_decoder
issue_resp_o.writeback = '0;
issue_resp_o.register_read = '0;
registers_o = '0;
- opcode_o = ILLEGAL;
+ opcode_o = opcode_t'(0); // == ILLEGAL see cvxif_instr_pkg.sv
hartid_o = '0;
id_o = '0;
rd_o = '0;
diff --git a/core/cvxif_issue_register_commit_if_driver.sv b/core/cvxif_issue_register_commit_if_driver.sv
index e550d773d1..2b6ab540d0 100644
--- a/core/cvxif_issue_register_commit_if_driver.sv
+++ b/core/cvxif_issue_register_commit_if_driver.sv
@@ -15,29 +15,29 @@ module cvxif_issue_register_commit_if_driver #(
parameter type x_commit_t = logic
) (
// CVA6 inputs
- input logic clk_i,
- input logic rst_ni,
- input logic flush_i,
- input logic [ CVA6Cfg.XLEN-1:0] hart_id_i,
+ input logic clk_i,
+ input logic rst_ni,
+ input logic flush_i,
+ input logic [CVA6Cfg.XLEN-1:0] hart_id_i,
// CVXIF Issue interface
- input logic issue_ready_i,
- input x_issue_resp_t issue_resp_i,
- output logic issue_valid_o,
- output x_issue_req_t issue_req_o,
+ input logic issue_ready_i,
+ input x_issue_resp_t issue_resp_i,
+ output logic issue_valid_o,
+ output x_issue_req_t issue_req_o,
// CVXIF Register interface
- input logic register_ready_i,
- output logic register_valid_o,
- output x_register_t register_o,
+ input logic register_ready_i,
+ output logic register_valid_o,
+ output x_register_t register_o,
// CVXIF Commit interface
- output logic commit_valid_o,
- output x_commit_t commit_o,
+ output logic commit_valid_o,
+ output x_commit_t commit_o,
// IRO in/out
- input logic valid_i,
- input logic [ 31:0] x_off_instr_i,
- input logic [CVA6Cfg.TRANS_ID_BITS-1:0] x_trans_id_i,
- input logic [ CVA6Cfg.NrRgprPorts-1:0][CVA6Cfg.XLEN-1:0] register_i,
- input logic [ CVA6Cfg.NrRgprPorts-1:0] rs_valid_i,
- output logic cvxif_busy_o
+ input logic valid_i,
+ input logic [31:0] x_off_instr_i,
+ input logic [CVA6Cfg.TRANS_ID_BITS-1:0] x_trans_id_i,
+ input [(CVA6Cfg.NrRgprPorts/CVA6Cfg.NrIssuePorts)-1:0][CVA6Cfg.XLEN-1:0] register_i,
+ input logic [(CVA6Cfg.NrRgprPorts/CVA6Cfg.NrIssuePorts)-1:0] rs_valid_i,
+ output logic cvxif_busy_o
);
// X_ISSUE_REGISTER_SPLIT = 0 : Issue and register transactions are synchrone
// Mandatory assignement
diff --git a/core/include/build_config_pkg.sv b/core/include/build_config_pkg.sv
index 1da077eba5..53ab116c6d 100644
--- a/core/include/build_config_pkg.sv
+++ b/core/include/build_config_pkg.sv
@@ -167,7 +167,7 @@ package build_config_pkg;
cfg.VpnLen = VpnLen;
cfg.PtLevels = PtLevels;
- cfg.X_NUM_RS = cfg.NrRgprPorts;
+ cfg.X_NUM_RS = cfg.NrRgprPorts / cfg.NrIssuePorts;
cfg.X_ID_WIDTH = cfg.TRANS_ID_BITS;
cfg.X_RFR_WIDTH = cfg.XLEN;
cfg.X_RFW_WIDTH = cfg.XLEN;
diff --git a/core/issue_read_operands.sv b/core/issue_read_operands.sv
index 7a37030bf1..9a2ca7a964 100644
--- a/core/issue_read_operands.sv
+++ b/core/issue_read_operands.sv
@@ -149,9 +149,10 @@ module issue_read_operands
logic none, load, store, alu, alu2, ctrl_flow, mult, csr, fpu, fpu_vec, cvxif, accel;
} fus_busy_t;
- logic [CVA6Cfg.NrIssuePorts-1:0] stall, stall_rs1, stall_rs2, stall_rs3;
+ logic [CVA6Cfg.NrIssuePorts-1:0] stall_raw, stall_waw, stall_rs1, stall_rs2, stall_rs3;
logic [CVA6Cfg.NrIssuePorts-1:0] fu_busy; // functional unit is busy
fus_busy_t [CVA6Cfg.NrIssuePorts-1:0] fus_busy; // which functional units are considered busy
+ logic [CVA6Cfg.NrIssuePorts-1:0] issue_ack;
// operands coming from regfile
logic [CVA6Cfg.NrIssuePorts-1:0][CVA6Cfg.XLEN-1:0] operand_a_regfile, operand_b_regfile;
// third operand from fp regfile or gp regfile if NR_RGPR_PORTS == 3
@@ -185,10 +186,10 @@ module issue_read_operands
assign orig_instr = riscv::instruction_t'(orig_instr_i[0]);
// CVXIF Signals
- logic cvxif_busy;
+ logic cvxif_req_allowed;
logic x_transaction_rejected;
- logic [CVA6Cfg.NrRgprPorts-1:0] rs_valid;
- logic [CVA6Cfg.NrRgprPorts-1:0][CVA6Cfg.XLEN-1:0] rs;
+ logic [OPERANDS_PER_INSTR-1:0] rs_valid;
+ logic [OPERANDS_PER_INSTR-1:0][CVA6Cfg.XLEN-1:0] rs;
cvxif_issue_register_commit_if_driver #(
.CVA6Cfg (CVA6Cfg),
@@ -215,7 +216,7 @@ module issue_read_operands
.x_trans_id_i (issue_instr_i[0].trans_id),
.register_i (rs),
.rs_valid_i (rs_valid),
- .cvxif_busy_o (cvxif_busy)
+ .cvxif_busy_o ()
);
if (OPERANDS_PER_INSTR == 3) begin
assign rs_valid = {~stall_rs3[0], ~stall_rs2[0], ~stall_rs1[0]};
@@ -226,7 +227,9 @@ module issue_read_operands
end
// TODO check only for 1st instruction ??
- assign cvxif_instruction_valid = (!issue_instr_i[0].ex.valid && issue_instr_valid_i[0] && (issue_instr_i[0].fu == CVXIF));
+ // Allow a cvxif transaction if we WaW condition are ok.
+ assign cvxif_req_allowed = (issue_instr_i[0].fu == CVXIF) && !stall_waw[0];
+ assign cvxif_instruction_valid = !issue_instr_i[0].ex.valid && issue_instr_valid_i[0] && cvxif_req_allowed;
assign x_transaction_accepted_o = x_issue_valid_o && x_issue_ready_i && x_issue_resp_i.accept;
assign x_transaction_rejected = x_issue_valid_o && x_issue_ready_i && ~x_issue_resp_i.accept;
assign x_issue_writeback_o = x_issue_resp_i.writeback;
@@ -251,7 +254,7 @@ module issue_read_operands
assign alu2_valid_o = alu2_valid_q;
assign cvxif_valid_o = CVA6Cfg.CvxifEn ? cvxif_valid_q : '0;
assign cvxif_off_instr_o = CVA6Cfg.CvxifEn ? cvxif_off_instr_q : '0;
- assign stall_issue_o = stall[0];
+ assign stall_issue_o = stall_raw[0];
assign tinst_o = CVA6Cfg.RVH ? tinst_q : '0;
// ---------------
// Issue Stage
@@ -259,7 +262,10 @@ module issue_read_operands
always_comb begin : structural_hazards
fus_busy = '0;
-
+ // CVXIF is always ready to try a new transaction on 1st issue port
+ // If a transaction is already pending then we stall until the transaction is done.(issue_ack_o[0] = 0)
+ // Since we can not have two CVXIF instruction on 1st issue port, CVXIF is always ready for the pending instruction.
+ fus_busy[0].cvxif = 1'b0;
if (!flu_ready_i) begin
fus_busy[0].alu = 1'b1;
fus_busy[0].ctrl_flow = 1'b1;
@@ -286,15 +292,13 @@ module issue_read_operands
fus_busy[0].store = 1'b1;
end
- if (cvxif_busy) begin
- fus_busy[0].cvxif = 1'b1;
- end
-
if (CVA6Cfg.SuperscalarEn) begin
fus_busy[1] = fus_busy[0];
// Never issue CSR instruction on second issue port.
fus_busy[1].csr = 1'b1;
+ // Never issue CVXIF instruction on second issue port.
+ fus_busy[1].cvxif = 1'b1;
unique case (issue_instr_i[0].fu)
NONE: fus_busy[1].none = 1'b1;
@@ -346,7 +350,7 @@ module issue_read_operands
fus_busy[1].load = 1'b1;
fus_busy[1].store = 1'b1;
end
- CVXIF: fus_busy[1].cvxif = 1'b1;
+ CVXIF: ;
endcase
end
end
@@ -390,7 +394,7 @@ module issue_read_operands
// check that all operands are available, otherwise stall
// forward corresponding register
always_comb begin : operands_available
- stall = '{default: stall_i};
+ stall_raw = '{default: stall_i};
stall_rs1 = '{default: stall_i};
stall_rs2 = '{default: stall_i};
stall_rs3 = '{default: stall_i};
@@ -426,7 +430,7 @@ module issue_read_operands
(CVA6Cfg.RVS && issue_instr_i[i].op == SFENCE_VMA)))) begin
forward_rs1[i] = 1'b1;
end else begin // the operand is not available -> stall
- stall[i] = 1'b1;
+ stall_raw[i] = 1'b1;
stall_rs1[i] = 1'b1;
end
end
@@ -445,7 +449,7 @@ module issue_read_operands
(CVA6Cfg.RVS && issue_instr_i[i].op == SFENCE_VMA)))) begin
forward_rs2[i] = 1'b1;
end else begin // the operand is not available -> stall
- stall[i] = 1'b1;
+ stall_raw[i] = 1'b1;
stall_rs2[i] = 1'b1;
end
end
@@ -456,12 +460,12 @@ module issue_read_operands
)) ? rd_clobber_fpr_i[issue_instr_i[i].result[REG_ADDR_SIZE-1:0]] != NONE : 0) ||
((CVA6Cfg.CvxifEn && OPERANDS_PER_INSTR == 3 &&
x_issue_valid_o && x_issue_resp_i.accept && x_issue_resp_i.register_read[2]) &&
- rd_clobber_gpr_i[issue_instr_i[i].result] != NONE)) begin
+ rd_clobber_gpr_i[issue_instr_i[i].result[REG_ADDR_SIZE-1:0]] != NONE)) begin
// if the operand is available, forward it. CSRs don't write to/from FPR so no need to check
if (rs3_valid_i[i]) begin
forward_rs3[i] = 1'b1;
end else begin // the operand is not available -> stall
- stall[i] = 1'b1;
+ stall_raw[i] = 1'b1;
stall_rs3[i] = 1'b1;
end
end
@@ -473,7 +477,7 @@ module issue_read_operands
) == is_rd_fpr(
issue_instr_i[0].op
))) && issue_instr_i[1].rs1 == issue_instr_i[0].rd && issue_instr_i[1].rs1 != '0) begin
- stall[1] = 1'b1;
+ stall_raw[1] = 1'b1;
end
if ((!CVA6Cfg.FpPresent || (is_rs2_fpr(
@@ -481,7 +485,7 @@ module issue_read_operands
) == is_rd_fpr(
issue_instr_i[0].op
))) && issue_instr_i[1].rs2 == issue_instr_i[0].rd && issue_instr_i[1].rs2 != '0) begin
- stall[1] = 1'b1;
+ stall_raw[1] = 1'b1;
end
// Only check clobbered gpr for OFFLOADED instruction
@@ -492,7 +496,7 @@ module issue_read_operands
) && issue_instr_i[0].rd == issue_instr_i[1].result[REG_ADDR_SIZE-1:0] :
issue_instr_i[1].op == OFFLOAD && OPERANDS_PER_INSTR == 3 ?
issue_instr_i[0].rd == issue_instr_i[1].result[REG_ADDR_SIZE-1:0] : 1'b0) begin
- stall[1] = 1'b1;
+ stall_raw[1] = 1'b1;
end
end
end
@@ -664,43 +668,51 @@ module issue_read_operands
end
end
+
+ always_comb begin : gen_check_waw_dependencies
+ stall_waw = '1;
+ for (int unsigned i = 0; i < CVA6Cfg.NrIssuePorts; i++) begin
+ if (issue_instr_valid_i[i] && !fu_busy[i]) begin
+ // -----------------------------------------
+ // WAW - Write After Write Dependency Check
+ // -----------------------------------------
+ // no other instruction has the same destination register -> issue the instruction
+ if ((CVA6Cfg.FpPresent && ariane_pkg::is_rd_fpr(
+ issue_instr_i[i].op
+ )) ? (rd_clobber_fpr_i[issue_instr_i[i].rd] == NONE) :
+ (rd_clobber_gpr_i[issue_instr_i[i].rd] == NONE)) begin
+ stall_waw[i] = 1'b0;
+ end
+ // or check that the target destination register will be written in this cycle by the
+ // commit stage
+ for (int unsigned c = 0; c < CVA6Cfg.NrCommitPorts; c++) begin
+ if ((CVA6Cfg.FpPresent && ariane_pkg::is_rd_fpr(
+ issue_instr_i[i].op
+ )) ? (we_fpr_i[c] && waddr_i[c] == issue_instr_i[i].rd[4:0]) :
+ (we_gpr_i[c] && waddr_i[c] == issue_instr_i[i].rd[4:0])) begin
+ stall_waw[i] = 1'b0;
+ end
+ end
+ if (i > 0) begin
+ if ((issue_instr_i[i].rd[4:0] == issue_instr_i[i-1].rd[4:0]) && (issue_instr_i[i].rd[4:0] != '0)) begin
+ stall_waw[i] = 1'b1;
+ end
+ end
+ end
+ end
+ end
// We can issue an instruction if we do not detect that any other instruction is writing the same
// destination register.
// We also need to check if there is an unresolved branch in the scoreboard.
always_comb begin : issue_scoreboard
for (int unsigned i = 0; i < CVA6Cfg.NrIssuePorts; i++) begin
// default assignment
- issue_ack_o[i] = 1'b0;
- // check that we didn't stall, that the instruction we got is valid
+ issue_ack[i] = 1'b0;
+ // check that the instruction we got is valid
// and that the functional unit we need is not busy
if (issue_instr_valid_i[i] && !fu_busy[i]) begin
- // check that the corresponding functional unit is not busy
- if (!stall[i]) begin
- // -----------------------------------------
- // WAW - Write After Write Dependency Check
- // -----------------------------------------
- // no other instruction has the same destination register -> issue the instruction
- if ((CVA6Cfg.FpPresent && ariane_pkg::is_rd_fpr(
- issue_instr_i[i].op
- )) ? (rd_clobber_fpr_i[issue_instr_i[i].rd] == NONE) :
- (rd_clobber_gpr_i[issue_instr_i[i].rd] == NONE)) begin
- issue_ack_o[i] = 1'b1;
- end
- // or check that the target destination register will be written in this cycle by the
- // commit stage
- for (int unsigned c = 0; c < CVA6Cfg.NrCommitPorts; c++) begin
- if ((CVA6Cfg.FpPresent && ariane_pkg::is_rd_fpr(
- issue_instr_i[i].op
- )) ? (we_fpr_i[c] && waddr_i[c] == issue_instr_i[i].rd[4:0]) :
- (we_gpr_i[c] && waddr_i[c] == issue_instr_i[i].rd[4:0])) begin
- issue_ack_o[i] = 1'b1;
- end
- end
- if (i > 0) begin
- if ((issue_instr_i[i].rd[4:0] == issue_instr_i[i-1].rd[4:0]) && (issue_instr_i[i].rd[4:0] != '0)) begin
- issue_ack_o[i] = 1'b0;
- end
- end
+ if (!stall_raw[i] && !stall_waw[i]) begin
+ issue_ack[i] = 1'b1;
end
// we can also issue the instruction under the following two circumstances:
// we can do this even if we are stalled or no functional unit is ready (as we don't need one)
@@ -708,23 +720,25 @@ module issue_read_operands
// need any functional unit or if an exception occurred previous to the execute stage.
// 1. we already got an exception
if (issue_instr_i[i].ex.valid) begin
- issue_ack_o[i] = 1'b1;
+ issue_ack[i] = 1'b1;
end
// 2. it is an instruction which does not need any functional unit
if (issue_instr_i[i].fu == NONE) begin
- issue_ack_o[i] = 1'b1;
- end
- if (issue_instr_i[i].fu == CVXIF) begin
- issue_ack_o[i] = (x_transaction_accepted_o || x_transaction_rejected);
+ issue_ack[i] = 1'b1;
end
end
end
if (CVA6Cfg.SuperscalarEn) begin
- if (!issue_ack_o[0]) begin
- issue_ack_o[1] = 1'b0;
+ if (!issue_ack[0]) begin
+ issue_ack[1] = 1'b0;
end
end
+ issue_ack_o = issue_ack;
+ // Do not acknoledge the issued instruction if transaction is not completed.
+ if (issue_instr_i[0].fu == CVXIF && !(x_transaction_accepted_o || x_transaction_rejected)) begin
+ issue_ack_o[0] = 1'b0;
+ end
end
// ----------------------
diff --git a/spyglass/reference_summary.rpt b/spyglass/reference_summary.rpt
index 8988519e4b..84153fe53e 100644
--- a/spyglass/reference_summary.rpt
+++ b/spyglass/reference_summary.rpt
@@ -3,9 +3,9 @@
#
# This file has been generated by SpyGlass:
# Report Name : summary
-# Report Created by: akassimi
-# Report Created on: Tue Jul 16 15:53:46 2024
-# Working Directory: /home/akassimi/rhel8/cva6_synthesis/cva6/spyglass
+# Report Created by: runner_riscv-public
+# Report Created on: Fri Jul 26 00:36:54 2024
+# Working Directory: /gitlab-runner/runner_riscv-public/builds/yD5zmwgi3/0/riscv-ci/cva6/spyglass
# SpyGlass Version : SpyGlass_vS-2021.09-SP2-3
# Policy Name : SpyGlass(SpyGlass_vS-2021.09-SP2-03)
# erc(SpyGlass_vS-2021.09-SP2-03)
@@ -17,9 +17,9 @@
# starc(SpyGlass_vS-2021.09-SP2-03)
# starc2005(SpyGlass_vS-2021.09-SP2-03)
#
-# Total Number of Generated Messages : 1501
+# Total Number of Generated Messages : 1521
# Number of Waived Messages : 2
-# Number of Reported Messages : 1499
+# Number of Reported Messages : 1519
# Number of Overlimit Messages : 0
#
#
@@ -31,102 +31,103 @@ SUMMARY REPORT:
############### BuiltIn -> RuleGroup=Blackbox Resolution ###############
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Severity Rule Name Count Short Help
+Severity Rule Name Count Short Help
===============================================================================
-WARNING WarnAnalyzeBBox 1 Reports black boxes in the design with
- Warn severity.
+WARNING WarnAnalyzeBBox 1 Reports black boxes in the design with
+ Warn severity.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
############### BuiltIn -> RuleGroup=Command-line read ###############
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Severity Rule Name Count Short Help
+Severity Rule Name Count Short Help
===============================================================================
-INFO HdlLibDuCheck_03 1 Reports that 'hdllibdu' is not required
- if no precompiled design unit is used
- in current run.
+INFO HdlLibDuCheck_03 1 Reports that 'hdllibdu' is not required
+ if no precompiled design unit is used
+ in current run.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
############### BuiltIn -> RuleGroup=Design Read ###############
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Severity Rule Name Count Short Help
+Severity Rule Name Count Short Help
===============================================================================
-WARNING SYNTH_12605 5 Used Priority/Unique Type case/if
- statement but all the conditions are
- not covered
-WARNING SYNTH_12608 1 The logic of the always block
- mismatches with the type of Always
- Block
-WARNING SYNTH_12611 2 Property blocks will be ignored for
- synthesis
-WARNING SYNTH_5064 37 Non-synthesizable statements are
- ignored for synthesis.
-WARNING SYNTH_5143 11 Initial block is ignored for synthesis
-WARNING SYNTH_89 4 Initial Assignment at Declaration is
- ignored by synthesis.
-WARNING WRN_1024 3 Signed argument is passed to $signed
- system function call, or unsigned
- argument passed to $unsigned system
- function call.
-INFO DetectTopDesignUnits 1 Identify the top-level design units in
- user design.
-INFO ElabSummary 1 Generates Elaborated design units
- Summary data
+WARNING SYNTH_12605 5 Used Priority/Unique Type case/if
+ statement but all the conditions are
+ not covered
+WARNING SYNTH_12608 1 The logic of the always block
+ mismatches with the type of Always
+ Block
+WARNING SYNTH_12611 2 Property blocks will be ignored for
+ synthesis
+WARNING SYNTH_5064 38 Non-synthesizable statements are
+ ignored for synthesis.
+WARNING SYNTH_5143 11 Initial block is ignored for synthesis
+WARNING SYNTH_89 4 Initial Assignment at Declaration is
+ ignored by synthesis.
+WARNING WRN_1024 3 Signed argument is passed to $signed
+ system function call, or unsigned
+ argument passed to $unsigned system
+ function call.
+WARNING WRN_27 1 Bit-select should not be out-of-range.
+INFO DetectTopDesignUnits 1 Identify the top-level design units in
+ user design.
+INFO ElabSummary 1 Generates Elaborated design units
+ Summary data
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
############### Non-BuiltIn -> Goal=lint/lint_rtl ###############
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Severity Rule Name Count Short Help
+Severity Rule Name Count Short Help
===============================================================================
-ERROR InferLatch 2 Latch inferred
-ERROR UndrivenInTerm-ML 3 Undriven but loaded input terminal of
- an instance detected
-ERROR W123 11 A signal or variable has been read but
- is not set
-ERROR W416 1 Width of return type and return value
- of a function should be same (Verilog)
- Range of return type and return value
- of a function should be same (VHDL)
-WARNING FlopEConst 19 Flip-flop enable pin is permanently
- disabled or enabled
-WARNING ParamWidthMismatch-ML 1 Parameter width does not match with the
- value assigned
-WARNING STARC05-1.3.1.3 1 Asynchronous reset/preset signals must
- not be used as non-reset/preset or
- synchronous reset/preset signals
-WARNING STARC05-2.1.3.1 2 Bit-width of function arguments must
- match bit-width of the corresponding
- function inputs.
-WARNING STARC05-2.1.4.5 1 Bit-wise operators must be used instead
- of logic operators in multi-bit
- operations.
-WARNING STARC05-2.1.5.3 1 Conditional expressions should evaluate
- to a scalar.
-WARNING STARC05-2.2.3.3 14 Do not assign over the same signal in
- an always construct for sequential
- circuits
-WARNING W224 1 Multi-bit expression found when one-bit
- expression expected
-WARNING W240 323 An input has been declared but is not
- read
-WARNING W263 4 A case expression width does not match
- case select expression width
-WARNING W287b 32 Output port of an instance is not
- connected
-WARNING W415a 526 Signal may be multiply assigned (beside
- initialization) in the same scope.
-WARNING W480 3 Loop index is not of type integer
-WARNING W486 2 Shift overflow - some bits may be lost
-WARNING W528 483 A signal or variable is set but never
- read
-INFO W240 1 An input has been declared but is not
- read
-INFO W528 1 A signal or variable is set but never
- read
+ERROR InferLatch 2 Latch inferred
+ERROR UndrivenInTerm-ML 3 Undriven but loaded input terminal of
+ an instance detected
+ERROR W123 11 A signal or variable has been read but
+ is not set
+ERROR W416 1 Width of return type and return value
+ of a function should be same (Verilog)
+ Range of return type and return value
+ of a function should be same (VHDL)
+WARNING FlopEConst 19 Flip-flop enable pin is permanently
+ disabled or enabled
+WARNING ParamWidthMismatch-ML 1 Parameter width does not match with the
+ value assigned
+WARNING STARC05-1.3.1.3 1 Asynchronous reset/preset signals must
+ not be used as non-reset/preset or
+ synchronous reset/preset signals
+WARNING STARC05-2.1.3.1 2 Bit-width of function arguments must
+ match bit-width of the corresponding
+ function inputs.
+WARNING STARC05-2.1.4.5 1 Bit-wise operators must be used instead
+ of logic operators in multi-bit
+ operations.
+WARNING STARC05-2.1.5.3 1 Conditional expressions should evaluate
+ to a scalar.
+WARNING STARC05-2.2.3.3 14 Do not assign over the same signal in
+ an always construct for sequential
+ circuits
+WARNING W224 1 Multi-bit expression found when one-bit
+ expression expected
+WARNING W240 322 An input has been declared but is not
+ read
+WARNING W263 4 A case expression width does not match
+ case select expression width
+WARNING W287b 36 Output port of an instance is not
+ connected
+WARNING W415a 537 Signal may be multiply assigned (beside
+ initialization) in the same scope.
+WARNING W480 3 Loop index is not of type integer
+WARNING W486 2 Shift overflow - some bits may be lost
+WARNING W528 487 A signal or variable is set but never
+ read
+INFO W240 1 An input has been declared but is not
+ read
+INFO W528 1 A signal or variable is set but never
+ read
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
From 934823d89c47a9c682374836d9c060546c5fcd81 Mon Sep 17 00:00:00 2001
From: valentinThomazic
Date: Fri, 26 Jul 2024 13:04:40 +0000
Subject: [PATCH 040/183] Add custom config in gitlab ci (#2405)
---
.gitlab-ci.yml | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c3878b8808..c1368e083d 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -25,6 +25,10 @@ include:
- project: '$CI_PROJECT_NAMESPACE/setup-ci'
ref: '$SETUP_CI_CVV_BRANCH'
file: 'cva6/core-v-verif-cva6.yml'
+ - local: '.gitlab-ci-custom.yml'
+ rules:
+ - exists:
+ - '.gitlab-ci-custom.yml'
workflow:
rules:
@@ -34,6 +38,9 @@ workflow:
- if: $CI_COMMIT_BRANCH == "master"
variables:
CI_KIND: regress
+ - if: $CI_PIPELINE_SOURCE == "merge_request_event"
+ variables:
+ CI_KIND: regress
- if: $CI_COMMIT_BRANCH =~ /.*_PR_.*/
variables:
CI_KIND: dev
From a4583a6e4d3a03b29153829da3ca6d8e4f2e3e20 Mon Sep 17 00:00:00 2001
From: AbdessamiiOukalrazqou
<163409352+AbdessamiiOukalrazqou@users.noreply.github.com>
Date: Fri, 26 Jul 2024 15:25:54 +0200
Subject: [PATCH 041/183] [gen_from_riscv_config] improve readme file to
support debug spec (#2406)
---
config/gen_from_riscv_config/README.md | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/config/gen_from_riscv_config/README.md b/config/gen_from_riscv_config/README.md
index d13a2b6a57..2422c973e0 100644
--- a/config/gen_from_riscv_config/README.md
+++ b/config/gen_from_riscv_config/README.md
@@ -34,7 +34,7 @@ pip3 install -r requirements.txt
```bash
#Generate Restructred-text documentation for Control and Status Registers (CSR)
-python3 .py -s <../riscv-config/Config_Name/generated/isa_gen>.yaml -c <../riscv-config/Config_Name/generated/custom_gen>.yaml -m .yaml -t < Config_Name>
+python3 .py -s <../riscv-config/Config_Name/generated/isa_gen>.yaml -c <../riscv-config/Config_Name/generated/custom_gen>.yaml -d <../riscv-config/Config_Name/generated/debug_gen>.yaml -m .yaml -t < Config_Name>
#Generate Restructred-text documentation for ISA extensions
python3 .py -s <../riscv-config/Config_Name/generated/isa_gen>.yaml -i .yaml -m .yaml -t < Config_Name>
@@ -48,7 +48,7 @@ python3 .py -s <../riscv-config/Config_Name/generated/
```bash
#Generate the Restructred-text documentation for Control and Status Registers (CSR)
-python3 scripts/riscv_config_gen.py -s ../riscv-config/cv32a65x/generated/isa_gen.yaml -c ../riscv-config/cv32a65x/generated/custom_gen.yaml -m updaters/cv32a65x/csr_updater.yaml -t cv32a65x
+python3 scripts/riscv_config_gen.py -s ../riscv-config/cv32a65x/generated/isa_gen.yaml -c ../riscv-config/cv32a65x/generated/custom_gen.yaml -d ../riscv-config/cv32a65x/generated/debug_gen.yaml -m updaters/cv32a65x/csr_updater.yaml -t cv32a65x
#Generate the Restructred-text documentation for ISA extensions
python3 scripts/riscv_config_gen.py -s ../riscv-config/cv32a65x/generated/isa_gen.yaml -i templates/isa_template.yaml -m updaters/cv32a65x/isa_updater.yaml -t cv32a65x
@@ -218,6 +218,8 @@ CSR/ISA Updater read RISC-CONFIG.yaml and update the registers so if you want to
:
- Exemple :
+
+ Bootroom : true
- Exemple :
cores:
From 22492027694b606489a9a4f4ea963eed6bdbcb5e Mon Sep 17 00:00:00 2001
From: slgth <166491525+slgth@users.noreply.github.com>
Date: Fri, 26 Jul 2024 15:27:42 +0200
Subject: [PATCH 042/183] docs: multiple fixes (#2409)
---
.../cv32a65x/csr/csr.adoc | 89 +++++++++++++------
.../cv32a65x/csr/csr.rst | 22 ++---
docs/04_cv32a65x/design/design-cv32a65x.html | 8 +-
.../04_cv32a65x/design/source/parameters.adoc | 2 +-
.../design/source/port_ex_stage.adoc | 4 +-
.../design/source/port_load_store_unit.adoc | 4 +-
.../{riscv/src => config}/config.adoc | 0
...{cv32a6_execute.adoc => cva6_execute.adoc} | 0
...v32a6_frontend.adoc => cva6_frontend.adoc} | 12 +--
.../{cv32a6_glossary.adoc => glossary.adoc} | 1 -
10 files changed, 87 insertions(+), 55 deletions(-)
rename docs/06_cv64a6_mmu/{riscv/src => config}/config.adoc (100%)
rename docs/design/design-manual/source/{cv32a6_execute.adoc => cva6_execute.adoc} (100%)
rename docs/design/design-manual/source/{cv32a6_frontend.adoc => cva6_frontend.adoc} (98%)
rename docs/design/design-manual/source/{cv32a6_glossary.adoc => glossary.adoc} (99%)
diff --git a/config/gen_from_riscv_config/cv32a65x/csr/csr.adoc b/config/gen_from_riscv_config/cv32a65x/csr/csr.adoc
index e390932111..808f53c084 100644
--- a/config/gen_from_riscv_config/cv32a65x/csr/csr.adoc
+++ b/config/gen_from_riscv_config/cv32a65x/csr/csr.adoc
@@ -48,8 +48,10 @@ This allows to clearly represent read-write registers holding a single legal val
|0x342| `<<_MCAUSE,MCAUSE>>`|MRW|The mcause register stores the information regarding the trap.
|0x343| `<<_MTVAL,MTVAL>>`|MRW|The mtval is a warl register that holds the address of the instruction which caused the exception.
|0x344| `<<_MIP,MIP>>`|MRW|The mip register is an MXLEN-bit read/write register containing information on pending interrupts.
-|0x3a0-0x3a3| `<<_PMPCFG0-3,PMPCFG[0-3]>>`|MRW|PMP configuration register
-|0x3b0-0x3bf| `<<_PMPADDR0-15,PMPADDR[0-15]>>`|MRW|Physical memory protection address register
+|0x3a0-0x3a1| `<<_PMPCFG0-1,PMPCFG[0-1]>>`|MRW|PMP configuration register
+|0x3a2-0x3af| `<<_PMPCFG2-15,PMPCFG[2-15]>>`|MRW|PMP configuration register
+|0x3b0-0x3b7| `<<_PMPADDR0-7,PMPADDR[0-7]>>`|MRW|Physical memory protection address register
+|0x3b8-0x3ef| `<<_PMPADDR8-63,PMPADDR[8-63]>>`|MRW|Physical memory protection address register
|0x7c0| `<<_ICACHE,ICACHE>>`|MRW|the register controls the operation of the i-cache unit.
|0x7c1| `<<_DCACHE,DCACHE>>`|MRW|the register controls the operation of the d-cache unit.
|0xb00| `<<_MCYCLE,MCYCLE>>`|MRW|Counts the number of clock cycles executed from an arbitrary point in time.
@@ -81,11 +83,11 @@ Description:: The mstatus register keeps track of and controls the hart's curren
| 0 | UIE | 0x0 | ROCST | 0x0 | Stores the state of the user mode interrupts.
| 1 | SIE | 0x0 | ROCST | 0x0 | Stores the state of the supervisor mode interrupts.
| 2 | RESERVED_2 | 0x0 | WPRI | | *Reserved*
-| 3 | MIE | 0x0 | WLRL | 0 - 1 | Stores the state of the machine mode interrupts.
+| 3 | MIE | 0x0 | WLRL | 0x0 - 0x1 | Stores the state of the machine mode interrupts.
| 4 | UPIE | 0x0 | ROCST | 0x0 | Stores the state of the user mode interrupts prior to the trap.
| 5 | SPIE | 0x0 | ROCST | 0x0 | Stores the state of the supervisor mode interrupts prior to the trap.
| 6 | UBE | 0x0 | ROCST | 0x0 | control the endianness of memory accesses other than instruction fetches for user mode
-| 7 | MPIE | 0x0 | WLRL | 0 - 1 | Stores the state of the machine mode interrupts prior to the trap.
+| 7 | MPIE | 0x0 | WLRL | 0x0 - 0x1 | Stores the state of the machine mode interrupts prior to the trap.
| 8 | SPP | 0x0 | ROCST | 0x0 | Stores the previous priority mode for supervisor.
| [10:9] | RESERVED_9 | 0x0 | WPRI | | *Reserved*
| [12:11] | MPP | 0x3 | WARL | 0x3 | Stores the previous priority mode for machine.
@@ -136,11 +138,11 @@ Description:: The mie register is an MXLEN-bit read/write register containing in
| 4 | UTIE | 0x0 | ROCST | 0x0 | User Timer Interrupt enable.
| 5 | STIE | 0x0 | ROCST | 0x0 | Supervisor Timer Interrupt enable.
| 6 | VSTIE | 0x0 | ROCST | 0x0 | VS-level Timer Interrupt enable.
-| 7 | MTIE | 0x0 | WLRL | 0 - 1 | Machine Timer Interrupt enable.
+| 7 | MTIE | 0x0 | WLRL | 0x0 - 0x1 | Machine Timer Interrupt enable.
| 8 | UEIE | 0x0 | ROCST | 0x0 | User External Interrupt enable.
| 9 | SEIE | 0x0 | ROCST | 0x0 | Supervisor External Interrupt enable.
| 10 | VSEIE | 0x0 | ROCST | 0x0 | VS-level External Interrupt enable.
-| 11 | MEIE | 0x0 | WLRL | 0 - 1 | Machine External Interrupt enable.
+| 11 | MEIE | 0x0 | WLRL | 0x0 - 0x1 | Machine External Interrupt enable.
| 12 | SGEIE | 0x0 | ROCST | 0x0 | HS-level External Interrupt enable.
| [31:13] | RESERVED_13 | 0x0 | WPRI | | *Reserved*
|===
@@ -192,7 +194,7 @@ Description:: The mhpmevent is a MXLEN-bit event register which controls mhpmcou
|===
| Bits | Field Name | Reset Value | Type | Legal Values | Description
-| [31:0] | MHPMEVENT[I] | 0x00000000 | ROCST | 0x00000000 | The mhpmevent is a MXLEN-bit event register which controls mhpmcounter3.
+| [31:0] | MHPMEVENT[I] | 0x00000000 | ROCST | 0x0 | The mhpmevent is a MXLEN-bit event register which controls mhpmcounter3.
|===
[[_MSCRATCH]]
@@ -234,7 +236,7 @@ Description:: The mcause register stores the information regarding the trap.
|===
| Bits | Field Name | Reset Value | Type | Legal Values | Description
-| [30:0] | EXCEPTION_CODE | 0x0 | WLRL | 0 - 15 | Encodes the exception code.
+| [30:0] | EXCEPTION_CODE | 0x0 | WLRL | 0x0 - 0x8, 0xb | Encodes the exception code.
| 31 | INTERRUPT | 0x0 | WLRL | 0x0 - 0x1 | Indicates whether the trap was due to an interrupt.
|===
@@ -249,7 +251,7 @@ Description:: The mtval is a warl register that holds the address of the instruc
|===
| Bits | Field Name | Reset Value | Type | Legal Values | Description
-| [31:0] | MTVAL | 0x00000000 | ROCST | 0x00000000 | The mtval is a warl register that holds the address of the instruction which caused the exception.
+| [31:0] | MTVAL | 0x00000000 | ROCST | 0x0 | The mtval is a warl register that holds the address of the instruction which caused the exception.
|===
[[_MIP]]
@@ -270,19 +272,19 @@ Description:: The mip register is an MXLEN-bit read/write register containing in
| 4 | UTIP | 0x0 | ROCST | 0x0 | User Timer Interrupt Pending.
| 5 | STIP | 0x0 | ROCST | 0x0 | Supervisor Timer Interrupt Pending.
| 6 | VSTIP | 0x0 | ROCST | 0x0 | VS-level Timer Interrupt Pending.
-| 7 | MTIP | 0x0 | ROVAR | 0x1 | Machine Timer Interrupt Pending.
+| 7 | MTIP | 0x0 | ROVAR | 0x0 - 0x1 | Machine Timer Interrupt Pending.
| 8 | UEIP | 0x0 | ROCST | 0x0 | User External Interrupt Pending.
| 9 | SEIP | 0x0 | ROCST | 0x0 | Supervisor External Interrupt Pending.
| 10 | VSEIP | 0x0 | ROCST | 0x0 | VS-level External Interrupt Pending.
-| 11 | MEIP | 0x0 | ROVAR | 0x1 | Machine External Interrupt Pending.
+| 11 | MEIP | 0x0 | ROVAR | 0x0 - 0x1 | Machine External Interrupt Pending.
| 12 | SGEIP | 0x0 | ROCST | 0x0 | HS-level External Interrupt Pending.
| [31:13] | RESERVED_13 | 0x0 | WPRI | | *Reserved*
|===
-[[_PMPCFG0-3]]
-===== PMPCFG[0-3]
+[[_PMPCFG0-1]]
+===== PMPCFG[0-1]
-Address:: 0x3a0-0x3a3
+Address:: 0x3a0-0x3a1
Reset Value:: 0x00000000
Privilege:: MRW
Description:: PMP configuration register
@@ -290,16 +292,33 @@ Description:: PMP configuration register
|===
| Bits | Field Name | Reset Value | Type | Legal Values | Description
-| [7:0] | PMP[I*4 + 0]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits
-| [15:8] | PMP[I*4 + 1]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits
-| [23:16] | PMP[I*4 + 2]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits
-| [31:24] | PMP[I*4 + 3]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits
+| [7:0] | PMP[I*4 +0]CFG | 0x0 | WARL | masked: & 0x8f | 0x0 | pmp configuration bits
+| [15:8] | PMP[I*4 +1]CFG | 0x0 | WARL | masked: & 0x8f | 0x0 | pmp configuration bits
+| [23:16] | PMP[I*4 +2]CFG | 0x0 | WARL | masked: & 0x8f | 0x0 | pmp configuration bits
+| [31:24] | PMP[I*4 +3]CFG | 0x0 | WARL | masked: & 0x8f | 0x0 | pmp configuration bits
|===
-[[_PMPADDR0-15]]
-===== PMPADDR[0-15]
+[[_PMPCFG2-15]]
+===== PMPCFG[2-15]
-Address:: 0x3b0-0x3bf
+Address:: 0x3a2-0x3af
+Reset Value:: 0x00000000
+Privilege:: MRW
+Description:: PMP configuration register
+
+|===
+| Bits | Field Name | Reset Value | Type | Legal Values | Description
+
+| [7:0] | PMP[I*4 +0]CFG | 0x0 | ROCST | 0x0 | pmp configuration bits
+| [15:8] | PMP[I*4 +1]CFG | 0x0 | ROCST | 0x0 | pmp configuration bits
+| [23:16] | PMP[I*4 +2]CFG | 0x0 | ROCST | 0x0 | pmp configuration bits
+| [31:24] | PMP[I*4 +3]CFG | 0x0 | ROCST | 0x0 | pmp configuration bits
+|===
+
+[[_PMPADDR0-7]]
+===== PMPADDR[0-7]
+
+Address:: 0x3b0-0x3b7
Reset Value:: 0x00000000
Privilege:: MRW
Description:: Physical memory protection address register
@@ -310,6 +329,20 @@ Description:: Physical memory protection address register
| [31:0] | PMPADDR[I] | 0x00000000 | WARL | 0x00000000 - 0xFFFFFFFF | Physical memory protection address register
|===
+[[_PMPADDR8-63]]
+===== PMPADDR[8-63]
+
+Address:: 0x3b8-0x3ef
+Reset Value:: 0x00000000
+Privilege:: MRW
+Description:: Physical memory protection address register
+
+|===
+| Bits | Field Name | Reset Value | Type | Legal Values | Description
+
+| [31:0] | PMPADDR[I] | 0x00000000 | ROCST | 0x0 | Physical memory protection address register
+|===
+
[[_ICACHE]]
===== ICACHE
@@ -379,7 +412,7 @@ Description:: The mhpmcounter is a 64-bit counter. Returns lower 32 bits in RV32
|===
| Bits | Field Name | Reset Value | Type | Legal Values | Description
-| [31:0] | MHPMCOUNTER[I] | 0x00000000 | ROCST | 0x00000000 | The mhpmcounter is a 64-bit counter. Returns lower 32 bits in RV32I mode.
+| [31:0] | MHPMCOUNTER[I] | 0x00000000 | ROCST | 0x0 | The mhpmcounter is a 64-bit counter. Returns lower 32 bits in RV32I mode.
|===
[[_MCYCLEH]]
@@ -421,7 +454,7 @@ Description:: The mhpmcounterh returns the upper half word in RV32I systems.
|===
| Bits | Field Name | Reset Value | Type | Legal Values | Description
-| [31:0] | MHPMCOUNTER[I]H | 0x00000000 | ROCST | 0x00000000 | The mhpmcounterh returns the upper half word in RV32I systems.
+| [31:0] | MHPMCOUNTER[I]H | 0x00000000 | ROCST | 0x0 | The mhpmcounterh returns the upper half word in RV32I systems.
|===
[[_MVENDORID]]
@@ -435,7 +468,7 @@ Description:: 32-bit read-only register providing the JEDEC manufacturer ID of t
|===
| Bits | Field Name | Reset Value | Type | Legal Values | Description
-| [31:0] | MVENDORID | 0x00000602 | ROCST | 0x00000602 | 32-bit read-only register providing the JEDEC manufacturer ID of the provider of the core.
+| [31:0] | MVENDORID | 0x00000602 | ROCST | 0x602 | 32-bit read-only register providing the JEDEC manufacturer ID of the provider of the core.
|===
[[_MARCHID]]
@@ -449,7 +482,7 @@ Description:: MXLEN-bit read-only register encoding the base microarchitecture o
|===
| Bits | Field Name | Reset Value | Type | Legal Values | Description
-| [31:0] | MARCHID | 0x00000003 | ROCST | 0x00000003 | MXLEN-bit read-only register encoding the base microarchitecture of the hart.
+| [31:0] | MARCHID | 0x00000003 | ROCST | 0x3 | MXLEN-bit read-only register encoding the base microarchitecture of the hart.
|===
[[_MIMPID]]
@@ -463,7 +496,7 @@ Description:: Provides a unique encoding of the version of the processor impleme
|===
| Bits | Field Name | Reset Value | Type | Legal Values | Description
-| [31:0] | MIMPID | 0x00000000 | ROCST | 0x00000000 | Provides a unique encoding of the version of the processor implementation.
+| [31:0] | MIMPID | 0x00000000 | ROCST | 0x0 | Provides a unique encoding of the version of the processor implementation.
|===
[[_MHARTID]]
@@ -477,7 +510,7 @@ Description:: MXLEN-bit read-only register containing the integer ID of the hard
|===
| Bits | Field Name | Reset Value | Type | Legal Values | Description
-| [31:0] | MHARTID | 0x00000000 | ROCST | 0x00000000 | MXLEN-bit read-only register containing the integer ID of the hardware thread running the code.
+| [31:0] | MHARTID | 0x00000000 | ROCST | 0x0 | MXLEN-bit read-only register containing the integer ID of the hardware thread running the code.
|===
[[_MCONFIGPTR]]
@@ -491,6 +524,6 @@ Description:: MXLEN-bit read-only register that holds the physical address of a
|===
| Bits | Field Name | Reset Value | Type | Legal Values | Description
-| [31:0] | MCONFIGPTR | 0x00000000 | ROCST | 0x00000000 | MXLEN-bit read-only register that holds the physical address of a configuration data structure.
+| [31:0] | MCONFIGPTR | 0x00000000 | ROCST | 0x0 | MXLEN-bit read-only register that holds the physical address of a configuration data structure.
|===
diff --git a/config/gen_from_riscv_config/cv32a65x/csr/csr.rst b/config/gen_from_riscv_config/cv32a65x/csr/csr.rst
index 6083081e1c..7053c1f181 100644
--- a/config/gen_from_riscv_config/cv32a65x/csr/csr.rst
+++ b/config/gen_from_riscv_config/cv32a65x/csr/csr.rst
@@ -415,17 +415,17 @@ PMPCFG[0-1]
:Privilege: MRW
:Description: PMP configuration register
-+---------+----------------+---------------+--------+----------------+------------------------+
-| Bits | Field Name | Reset Value | Type | Legal Values | Description |
-+=========+================+===============+========+================+========================+
-| [7:0] | PMP[I*4 +0]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits |
-+---------+----------------+---------------+--------+----------------+------------------------+
-| [15:8] | PMP[I*4 +1]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits |
-+---------+----------------+---------------+--------+----------------+------------------------+
-| [23:16] | PMP[I*4 +2]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits |
-+---------+----------------+---------------+--------+----------------+------------------------+
-| [31:24] | PMP[I*4 +3]CFG | 0x0 | WARL | 0x00 - 0xFF | pmp configuration bits |
-+---------+----------------+---------------+--------+----------------+------------------------+
++---------+----------------+---------------+--------+----------------------+------------------------+
+| Bits | Field Name | Reset Value | Type | Legal Values | Description |
++=========+================+===============+========+======================+========================+
+| [7:0] | PMP[I*4 +0]CFG | 0x0 | WARL | masked: & 0x8f | 0x0 | pmp configuration bits |
++---------+----------------+---------------+--------+----------------------+------------------------+
+| [15:8] | PMP[I*4 +1]CFG | 0x0 | WARL | masked: & 0x8f | 0x0 | pmp configuration bits |
++---------+----------------+---------------+--------+----------------------+------------------------+
+| [23:16] | PMP[I*4 +2]CFG | 0x0 | WARL | masked: & 0x8f | 0x0 | pmp configuration bits |
++---------+----------------+---------------+--------+----------------------+------------------------+
+| [31:24] | PMP[I*4 +3]CFG | 0x0 | WARL | masked: & 0x8f | 0x0 | pmp configuration bits |
++---------+----------------+---------------+--------+----------------------+------------------------+
.. .. _PMPCFG[2-15]:::
diff --git a/docs/04_cv32a65x/design/design-cv32a65x.html b/docs/04_cv32a65x/design/design-cv32a65x.html
index a191b6a607..82598ba3ae 100644
--- a/docs/04_cv32a65x/design/design-cv32a65x.html
+++ b/docs/04_cv32a65x/design/design-cv32a65x.html
@@ -1184,7 +1184,7 @@