Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added custom WFE instruction plus related wu_i pin. Made misa.X always 1 #639

Merged
merged 3 commits into from
Aug 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/user_manual/source/control_status_registers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,7 @@ Detailed:
+-------------+------------+------------------------------------------------------------------------+
| 24 | WARL (0x0) | **Y** (Reserved). |
+-------------+------------+------------------------------------------------------------------------+
| 23 | WARL | **X** (Non-standard extensions present). |
| 23 | WARL (0x1) | **X** (Non-standard extensions present). |
+-------------+------------+------------------------------------------------------------------------+
| 22 | WARL (0x0) | **W** (Reserved). |
+-------------+------------+------------------------------------------------------------------------+
Expand Down Expand Up @@ -569,6 +569,7 @@ All bitfields in the ``misa`` CSR read as 0 except for the following:
* **E** = 1 if ``RV32`` == RV32E
* **M** = 1 if ``M_EXT`` == M
* **MXL** = 1 (i.e. XLEN = 32)
* **X** = 1
* If ``X_EXT`` == 1, then the value of ``X_MISA`` is ORed into the ``misa`` CSR.

.. note::
Expand Down
7 changes: 5 additions & 2 deletions docs/user_manual/source/integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,8 @@ Instantiation Template

// Special control signals
.fetch_enable_i (),
.core_sleep_o ()
.core_sleep_o (),
.wu_wfe_i ()
);

Parameters
Expand Down Expand Up @@ -157,7 +158,7 @@ Parameters
+--------------------------------+----------------+---------------+--------------------------------------------------------------------+
| ``X_MISA`` | logic [31:0] | 32'h0 | MISA extensions implemented on the eXtension interface, |
| | | | see :ref:`csr-misa`. X_MISA can only be used to set a subset of |
| | | | the following: {P, V, F, X, M}. |
| | | | the following: {P, V, F, M}. |
+--------------------------------+----------------+---------------+--------------------------------------------------------------------+
| ``X_ECS_XS`` | logic [1:0] | 2'b0 | Default value for ``mstatus.XS`` if X_EXT = 1, |
| | | | see :ref:`csr-mstatus`. |
Expand Down Expand Up @@ -255,6 +256,8 @@ Interfaces
+-------------------------+-------------------------+-----+--------------------------------------------+
| ``core_sleep_o`` | 1 | out | Core is sleeping, see :ref:`sleep_unit`. |
+-------------------------+-------------------------+-----+--------------------------------------------+
| ``wu_wfe_i`` | 1 | in | Wake-up for ``wfe``, see :ref:`sleep_unit`.|
+-------------------------+-------------------------+-----+--------------------------------------------+
| ``xif_compressed_if`` | eXtension compressed interface, see :ref:`x_compressed_if` |
+-------------------------+----------------------------------------------------------------------------+
| ``xif_issue_if`` | eXtension issue interface, see :ref:`x_issue_if` |
Expand Down
18 changes: 16 additions & 2 deletions docs/user_manual/source/sleep.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ The clock gating in the Sleep Unit is impacted by the following:
* ``rst_ni``
* ``fetch_enable_i``
* **wfi** instruction
* **wfe** instruction

:numref:`Sleep Unit interface signals` describes the Sleep Unit interface.

Expand All @@ -26,11 +27,14 @@ The clock gating in the Sleep Unit is impacted by the following:
| Signal | Direction | Description |
+======================================+===========+==================================================+
| ``core_sleep_o`` | output | Core is sleeping because |
| | | of a **wfi** instruction. If |
| | | of a **wfi** or **wfe** instruction. If |
| | | ``core_sleep_o`` = 1, then ``clk_i`` is gated |
| | | off internally and it is allowed to gate off |
| | | ``clk_i`` externally as well. See |
| | | :ref:`wfi` for details. |
| | | :ref:`wfi` and :ref:`wfe` for details. |
+--------------------------------------+-----------+--------------------------------------------------+
| ``wu_wfe_i`` | input | Wake-up signal for custom **wfe** instruction. |
| | | See :ref:`wfe` for details. |
+--------------------------------------+-----------+--------------------------------------------------+

Startup behavior
Expand Down Expand Up @@ -78,3 +82,13 @@ will not become 1.
:align: center

**wfi** example

.. _wfe:

WFE
---

The custom **wfe** instruction behaves exactly as the **wfi** instruction, except that a wake-up can additionally be triggered
by asserting ``wu_wfe_i``.

The **wfe** instruction is encoded as a custom SYSTEM instruction with opcode ``0x8C00_0073``.