@@ -446,7 +446,7 @@ Machine ISA (``misa``)
446
446
447
447
CSR Address: 0x301
448
448
449
- Reset Value: defined (based on ``A_EXT ``, ``M_EXT ``, ``X_EXT ``, ``X_MISA ``)
449
+ Reset Value: defined (based on ``RV32 ``, `` A_EXT ``, ``M_EXT ``, ``X_EXT ``, ``X_MISA ``)
450
450
451
451
Detailed:
452
452
@@ -599,18 +599,17 @@ Detailed:
599
599
+---------+------------------+---------------------------------------------------------------------------------------------------------------+
600
600
| Bit # | R/W | Description |
601
601
+=========+==================+===============================================================================================================+
602
- | 31:12 | RW | **BASE[31:12 ] **: Trap-handler base address, always aligned to 4096 bytes. |
602
+ | 31:7 | RW | **BASE[31:7 ] **: Trap-handler base address, always aligned to 128 bytes. |
603
603
+---------+------------------+---------------------------------------------------------------------------------------------------------------+
604
- | 11 :2 | WARL (0x0) | **BASE[11 :2] **: Trap-handler base address, always aligned to 4096 bytes. ``mtvec[11 :2] `` is hardwired to 0x0. |
604
+ | 6 :2 | WARL (0x0) | **BASE[6 :2] **: Trap-handler base address, always aligned to 128 bytes. ``mtvec[6 :2] `` is hardwired to 0x0. |
605
605
+---------+------------------+---------------------------------------------------------------------------------------------------------------+
606
606
| 1:0 | WARL (0x0*, 0x1) | **MODE[0] **: Interrupt handling mode. 0x0 = non-vectored basic mode, 0x1 = vectored basic mode. |
607
607
+---------+------------------+---------------------------------------------------------------------------------------------------------------+
608
608
609
- The initial value of ``mtvec `` is equal to {**mtvec_addr_i[31:12 ] **, 10 'b0, 2'b01}.
609
+ The initial value of ``mtvec `` is equal to {**mtvec_addr_i[31:7 ] **, 5 'b0, 2'b01}.
610
610
611
611
When an exception or an interrupt is encountered, the core jumps to the corresponding
612
- handler using the content of the ``mtvec[31:8] `` as base address. Only
613
- 8-byte aligned addresses are allowed. Both direct mode and vectored mode
612
+ handler using the content of the ``mtvec[31:7] `` as base address. Both direct mode and vectored mode
614
613
are supported.
615
614
616
615
.. _csr-mtvec-smclic :
@@ -627,14 +626,14 @@ Detailed:
627
626
+---------+------------------+---------------------------------------------------------------------------------------------------------------+
628
627
| Bit # | R/W | Description |
629
628
+=========+==================+===============================================================================================================+
630
- | 31:12 | RW | **BASE[31:12 ] **: Trap-handler base address, always aligned to 4096 bytes. |
629
+ | 31:7 | RW | **BASE[31:7 ] **: Trap-handler base address, always aligned to 128 bytes. |
631
630
+---------+------------------+---------------------------------------------------------------------------------------------------------------+
632
- | 11 :2 | WARL (0x0) | **BASE[11 :2] **: Trap-handler base address, always aligned to 4096 bytes. ``mtvec[11 :2] `` is hardwired to 0x0. |
631
+ | 6 :2 | WARL (0x0) | **BASE[6 :2] **: Trap-handler base address, always aligned to 128 bytes. ``mtvec[6 :2] `` is hardwired to 0x0. |
633
632
+---------+------------------+---------------------------------------------------------------------------------------------------------------+
634
633
| 1:0 | WARL (0x3) | **MODE **: Interrupt handling mode. Always CLIC mode. |
635
634
+---------+------------------+---------------------------------------------------------------------------------------------------------------+
636
635
637
- The initial value of ``mtvec `` is equal to {**mtvec_addr_i[31:12 ] **, 10 'b0, 2'b11}.
636
+ The initial value of ``mtvec `` is equal to {**mtvec_addr_i[31:7 ] **, 5 'b0, 2'b11}.
638
637
639
638
.. _csr-mtvt :
640
639
@@ -652,13 +651,18 @@ Detailed:
652
651
+-------------+------------+-----------------------------------------------------------------------+
653
652
| Bit # | R/W | Description |
654
653
+=============+============+=======================================================================+
655
- | 31:6 | RW | **BASE **: Trap-handler vector table base address, 64 byte aligned. |
654
+ | 31:8 | WARL | **BASE[31:8] **: Trap-handler vector table base address. |
655
+ | | | See note below for alignment restrictions. |
656
656
+-------------+------------+-----------------------------------------------------------------------+
657
- | 5:0 | R (0x0) | Reserved. Hardwired to 0. |
657
+ | 7:6 | WARL (0x0) | **BASE[7:6] **: Trap-handler vector table base address. |
658
+ +-------------+------------+-----------------------------------------------------------------------+
659
+ | 5:0 | R (0x0) | Reserved. Hardwired to 0. |
658
660
+-------------+------------+-----------------------------------------------------------------------+
659
661
660
- The ``mtvt `` CSR holds the base address of the trap vector table, aligned on a 64-byte or greater
661
- power-of-two boundary.
662
+ .. note ::
663
+ The ``mtvt `` CSR holds the base address of the trap vector table, aligned on a ``2^(2+SMCLIC_ID_WIDTH) `` bytes or greater
664
+ power-of-two boundary. For example if ``SMCLIC_ID_WIDTH `` = 8, then 256 CLIC interrupts are supported and the trap vector table
665
+ is aligned to 1024 bytes, and therefore **BASE[9:8] ** will be WARL (0x0).
662
666
663
667
Machine Status (``mstatush ``)
664
668
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -756,11 +760,10 @@ Machine Counter-Inhibit Register (``mcountinhibit``)
756
760
757
761
CSR Address: 0x320
758
762
759
- Reset Value: 0x0000_000D
763
+ Reset Value: Defined
760
764
761
- The performance counter inhibit control register. The default value is to inihibit counters out of reset.
762
- The bit returns a read value of 0 for non implemented counters. This reset value
763
- shows the result using the default number of performance counters to be 1.
765
+ The performance counter inhibit control register. The default value is to inihibit all implemented counters out of reset.
766
+ The bit returns a read value of 0 for non implemented counters.
764
767
765
768
Detailed:
766
769
@@ -845,14 +848,14 @@ Reset Value: 0x0000_0000
845
848
+=============+============+==================================================================================+
846
849
| 31 | RW | **INTERRUPT: ** This bit is set when the exception was triggered by an interrupt. |
847
850
+-------------+------------+----------------------------------------------------------------------------------+
848
- | 30:10 | WLRL (0x0) | **EXCCODE[30:10 ] **. Hardwired to 0. |
851
+ | 30:11 | WLRL (0x0) | **EXCCODE[30:11 ] **. Hardwired to 0. |
849
852
+-------------+------------+----------------------------------------------------------------------------------+
850
- | 9 :0 | WLRL | **EXCCODE[30:10 ] ** ( See note below) |
853
+ | 10 :0 | WLRL | **EXCCODE[10:0 ] **. See note below. |
851
854
+-------------+------------+----------------------------------------------------------------------------------+
852
855
853
856
.. note ::
854
857
855
- Software accesses to `mcause[7 :0] ` must be sensitive to the WLRL field specification of this CSR. For example,
858
+ Software accesses to `mcause[10 :0] ` must be sensitive to the WLRL field specification of this CSR. For example,
856
859
when `mcause[31] ` is set, writing 0x1 to `mcause[1] ` (Supervisor software interrupt) will result in UNDEFINED behavior.
857
860
858
861
Machine Cause (``mcause ``) - ``SMCLIC `` == 1
@@ -880,11 +883,16 @@ Reset Value: 0x0000_0000
880
883
+-------------+------------+----------------------------------------------------------------------------------+
881
884
| 15:12 | WARL (0x0) | Reserved. Hardwired to 0. |
882
885
+-------------+------------+----------------------------------------------------------------------------------+
883
- | 11:10 | WLRL (0x0) | **EXCCODE[11:10 ] ** |
886
+ | 11 | WLRL (0x0) | **EXCCODE[11] ** |
884
887
+-------------+------------+----------------------------------------------------------------------------------+
885
- | 9 :0 | WLRL | **EXCCODE[9 :0] ** |
888
+ | 10 :0 | WLRL | **EXCCODE[10 :0] ** |
886
889
+-------------+------------+----------------------------------------------------------------------------------+
887
890
891
+ .. note ::
892
+
893
+ ``mcause.MPP `` and ``mstatus.MPP `` mirror each other. ``mcause.MPIE `` and ``mstatus.MPIE `` mirror each other. Reading or writing the
894
+ fields ``MPP ``/``MPIE `` in ``mcause `` is equivalent to reading or writing the homonymous field in ``mstatus ``.
895
+
888
896
Machine Trap Value (``mtval ``)
889
897
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
890
898
0 commit comments