|
ra8-firmware 0.1.0
Bare-metal firmware for the Renesas RA8 family (RA8D2 / RA8P1)
|
Module Stop Control (MSTPCRA..E) register block for ra8_emulator. More...
#include <stdint.h>#include <stdio.h>#include "board_periph_block.h"#include "board_periph_mstp_internal.h"#include "emu_host_io_internal.h"#include "ra8_attributes.h"Go to the source code of this file.
Enumerations | |
| enum | mstp_order_t : uint32_t { k_mstp_block_order = 168U } |
| Per-tick order slot for the MSTP block (just before SYSC-PRCR). More... | |
Functions | |
| static uint64_t | internal_mstp_read (uc_engine *uc, uint64_t addr, unsigned size) |
| MMIO read of MSTPCRA..E: answer from the tracked shadow. | |
| static void | internal_mstp_write (uc_engine *uc, uint64_t addr, unsigned size, uint64_t value) |
| MMIO write of MSTPCRA..E: fold into the shadow (ungate/re-gate). | |
| static void | internal_mstp_report (void) |
| End-of-run section: make any access to an unclocked block LOUD. | |
| static void | internal_mstp_block_register (void) |
| Register the MSTP block before main (host constructor). | |
Variables | |
| static const board_periph_block_t | s_k_mstp_block |
| MSTP block descriptor (owns MSTPCRA..E; self-registered). | |
Module Stop Control (MSTPCRA..E) register block for ra8_emulator.
The board_periph block that owns the R_MSTP window (0x4020_3000, HUM Ch 11.2.6..11.2.10 p 443-450): it answers firmware reads/writes of MSTPCRA..MSTPCRE from the tracked shadow in board_periph_mstp_model.c, so the mandated read-back after an ungate settles deterministically and the shadow the address->bit gate table consults stays current.
The gate ENFORCEMENT lives in the board_periph core: before dispatching an MMIO access to any owning block, board_periph.c calls priv_board_mstp_addr_stopped and – when the peripheral is module-stopped – reads 0 / drops the write, matching the silicon (a stopped module is unclocked and does not respond). This file is only the register window plus the reset hook and the end-of-run "you touched an unclocked peripheral" report; the model half is engine-free so it can be unit-tested on the host.
Splitting the model out of this file is what lets the gate table be tested without Unicorn (tests/misc/src/test_ra8_emulator_mstp_gate.c); this glue is the thin part that the core registry needs and that pulls in board_periph_block.h.
Definition in file board_periph_mstp.c.
| enum mstp_order_t : uint32_t |
Per-tick order slot for the MSTP block (just before SYSC-PRCR).
| Enumerator | |
|---|---|
| k_mstp_block_order | Groups with the PRCR / power-domain blocks. |
Definition at line 38 of file board_periph_mstp.c.
|
static |
Register the MSTP block before main (host constructor).
Definition at line 118 of file board_periph_mstp.c.
References board_periph_register_block(), priv_board_mstp_reset(), RA8_INTERNAL, and s_k_mstp_block.
|
static |
MMIO read of MSTPCRA..E: answer from the tracked shadow.
MMIO read of mstpcra..e: answer from the tracked shadow; this step is contained within the board periph module-stop model and uses bounded caller or module-owned storage.
| [in,out] | uc | Unicorn engine whose emulated state is read or updated. |
| [in] | addr | Guest address involved in the operation. |
| [in] | size | Size of the requested region or access in bytes. |
| value | The operation-specific module-stop read value. |
Definition at line 55 of file board_periph_mstp.c.
References k_board_mstp_win_base, priv_board_mstp_read_reg(), and RA8_INTERNAL.
|
static |
End-of-run section: make any access to an unclocked block LOUD.
End-of-run section: make any access to an unclocked block loud; this step is contained within the board periph module-stop model and uses bounded caller or module-owned storage.
Definition at line 88 of file board_periph_mstp.c.
References priv_board_mstp_gated_read_count(), priv_board_mstp_gated_write_count(), priv_board_mstp_last_gated_name(), priv_emu_io_errf(), and RA8_INTERNAL.
|
static |
MMIO write of MSTPCRA..E: fold into the shadow (ungate/re-gate).
MMIO write of mstpcra..e: fold into the shadow (ungate/re-gate); this step is contained within the board periph module-stop model and uses bounded caller or module-owned storage.
| [in,out] | uc | Unicorn engine whose emulated state is read or updated. |
| [in] | addr | Guest address involved in the operation. |
| [in] | size | Size of the requested region or access in bytes. |
| [in] | value | Register or payload value involved in the operation. |
Definition at line 74 of file board_periph_mstp.c.
References k_board_mstp_win_base, and priv_board_mstp_apply_write().
|
static |
MSTP block descriptor (owns MSTPCRA..E; self-registered).
Definition at line 105 of file board_periph_mstp.c.
Referenced by internal_mstp_block_register().