Sensor Control Technical Specification

Overview

This document specifies the functionality of the sensor control module. The sensor control module is a comportable front-end to the analog sensor top.

It provides basic alert functionality, pad debug hook ups, and a small amount of open source visible status readback. Long term, this is a module that can be absorbed directly into the analog sensor top.

Features

  • Alert hand-shake with analog sensor top
  • Alert forwarding to alert handler
  • Status readback for analog sensor top
  • Pad debug hook up for analog sensor top
  • Wakeup based on alert events

Theory of Operations

Block Diagram

The diagram below shows how sensor control helps analog sensor top integration into the overall design.

Recoverable and Fatal Alerts

The analog sensor top sends alert requests in independent, differential form to the sensor control. Each alert request consists of a pair of signals, one active high and one active low. The active polarity of each signal is independent, due to the imprecise sensor timing that drives the alert. This means that the sensor control recognizes an active alert as long as one of the lines is active, and not the pair of signals being in a particular state. Each signal in the differential pair is thus a separate dedicated alert indicator.

Once an alert request is detected as active, the sensor control formulates a proper alert event through the prim_alert_sender and sends a notification to the alert handler.

The sensor control can optionally generate alert acknowledgements back to the analog sensor top.

For each incoming alert, it can be programmed as fatal or recoverable through FATAL_ALERT_EN. If set to recoverable, an alert will be registered in RECOV_ALERT and the original analog sensor top event acknowledged. The acknowledgement prevents alerts from constantly being sent.

If set to fatal, an alert will be registered in FATAL_ALERT but the original analog sensor top event will not be acknowledged. This causes the alert to constantly send until the system escalates in some form.

Wakeup Requests

In addition to forwarding events to the alert handler, incoming events can also be aggregated into a wakeup request to the system. The sensor control does not make assumptions about its power domains and thus it is up to the integrating system to decide which power modes allow alert event wakeups.

As an example, if the sensor control is not placed in an always on domain, then it cannot send alert based wakeups if the system is in a deep low power state. It will only be able to send wakeups when the system is powered and the clk_aon_i input is available.

Hardware Interfaces

Signals

Referring to the Comportable guideline for peripheral device functionality, the module SENSOR_CTRL has the following hardware interfaces defined.

Primary Clock: clk_i

Other Clocks: clk_aon_i

Bus Device Interfaces (TL-UL): tl

Bus Host Interfaces (TL-UL): none

Peripheral Pins for Chip IO:

Pin namedirectionDescription
ast_debug_out[8:0]output

ast debug outputs to pinmux

Inter-Module Signals: Reference

Inter-Module Signals
Port Name Package::Struct Type Act Width Description
ast_alert ast_pkg::ast_alert req_rsp rsp 1
ast_status ast_pkg::ast_status uni rcv 1
ast_init_done prim_mubi_pkg::mubi4 uni rcv 1
ast2pinmux logic uni rcv 9
wkup_req logic uni req 1
tl tlul_pkg::tl req_rsp rsp 1

Interrupts:

Interrupt NameTypeDescription
io_status_changeEvent

io power status has changed

init_status_changeEvent

ast init status has changed

Security Alerts:

Alert NameDescription
recov_alert

recoverable sensor_ctrl alerts

fatal_alert

fatal sensor_ctrl alerts

Security Countermeasures: none

Programmer’s Guide

Each available alert has a corresponding fatality configuration. If an alert event is set to 1 in FATAL_ALERT_EN, sensor control treats it as a fatal event instead of a recoverable event. Fatal events are not acknowledged, and continuously send alert events in the system until some kind of escalation is seen.

Device Interface Functions (DIFs)

To use this DIF, include the following C header:

#include "sw/device/lib/dif/dif_sensor_ctrl.h"

This header provides the following device interface functions:

Register Table

Summary
Name Offset Length Description
SENSOR_CTRL.INTR_STATE 0x0 4

Interrupt State Register

SENSOR_CTRL.INTR_ENABLE 0x4 4

Interrupt Enable Register

SENSOR_CTRL.INTR_TEST 0x8 4

Interrupt Test Register

SENSOR_CTRL.ALERT_TEST 0xc 4

Alert Test Register

SENSOR_CTRL.CFG_REGWEN 0x10 4

Controls the configurability of FATAL_ALERT_EN register.

SENSOR_CTRL.ALERT_TRIG 0x14 4

Alert trigger test

SENSOR_CTRL.FATAL_ALERT_EN 0x18 4

Each bit marks a corresponding alert as fatal or recoverable.

SENSOR_CTRL.RECOV_ALERT 0x1c 4

Each bit represents a recoverable alert that has been triggered by AST. Since these are recoverable alerts, they can be cleared by software.

SENSOR_CTRL.FATAL_ALERT 0x20 4

Each bit represents a fatal alert that has been triggered by AST. Since these registers represent fatal alerts, they cannot be cleared.

SENSOR_CTRL.STATUS 0x24 4

Status readback for ast

SENSOR_CTRL.INTR_STATE @ 0x0

Interrupt State Register

Reset default = 0x0, mask 0x3
31302928272625242322212019181716
 
1514131211109876543210
  init_status_change io_status_change
BitsTypeResetNameDescription
0rw1c0x0io_status_change

io power status has changed

1rw1c0x0init_status_change

ast init status has changed


SENSOR_CTRL.INTR_ENABLE @ 0x4

Interrupt Enable Register

Reset default = 0x0, mask 0x3
31302928272625242322212019181716
 
1514131211109876543210
  init_status_change io_status_change
BitsTypeResetNameDescription
0rw0x0io_status_change

Enable interrupt when INTR_STATE.io_status_change is set.

1rw0x0init_status_change

Enable interrupt when INTR_STATE.init_status_change is set.


SENSOR_CTRL.INTR_TEST @ 0x8

Interrupt Test Register

Reset default = 0x0, mask 0x3
31302928272625242322212019181716
 
1514131211109876543210
  init_status_change io_status_change
BitsTypeResetNameDescription
0wo0x0io_status_change

Write 1 to force INTR_STATE.io_status_change to 1.

1wo0x0init_status_change

Write 1 to force INTR_STATE.init_status_change to 1.


SENSOR_CTRL.ALERT_TEST @ 0xc

Alert Test Register

Reset default = 0x0, mask 0x3
31302928272625242322212019181716
 
1514131211109876543210
  fatal_alert recov_alert
BitsTypeResetNameDescription
0wo0x0recov_alert

Write 1 to trigger one alert event of this kind.

1wo0x0fatal_alert

Write 1 to trigger one alert event of this kind.


SENSOR_CTRL.CFG_REGWEN @ 0x10

Controls the configurability of FATAL_ALERT_EN register.

Reset default = 0x1, mask 0x1
31302928272625242322212019181716
 
1514131211109876543210
  EN
BitsTypeResetNameDescription
0rw0c0x1EN

Configuration enable.


SENSOR_CTRL.ALERT_TRIG @ 0x14

Alert trigger test

Reset default = 0x0, mask 0x7ff
31302928272625242322212019181716
 
1514131211109876543210
  VAL_10 VAL_9 VAL_8 VAL_7 VAL_6 VAL_5 VAL_4 VAL_3 VAL_2 VAL_1 VAL_0
BitsTypeResetNameDescription
0rw0x0VAL_0

Alert trigger for testing 0 No alerts triggered 1 Continuously trigger alert until disabled For bit mapping, please see ALERT_TEST

1rw0x0VAL_1

Alert trigger for testing 0 No alerts triggered 1 Continuously trigger alert until disabled For bit mapping, please see ALERT_TEST

2rw0x0VAL_2

Alert trigger for testing 0 No alerts triggered 1 Continuously trigger alert until disabled For bit mapping, please see ALERT_TEST

3rw0x0VAL_3

Alert trigger for testing 0 No alerts triggered 1 Continuously trigger alert until disabled For bit mapping, please see ALERT_TEST

4rw0x0VAL_4

Alert trigger for testing 0 No alerts triggered 1 Continuously trigger alert until disabled For bit mapping, please see ALERT_TEST

5rw0x0VAL_5

Alert trigger for testing 0 No alerts triggered 1 Continuously trigger alert until disabled For bit mapping, please see ALERT_TEST

6rw0x0VAL_6

Alert trigger for testing 0 No alerts triggered 1 Continuously trigger alert until disabled For bit mapping, please see ALERT_TEST

7rw0x0VAL_7

Alert trigger for testing 0 No alerts triggered 1 Continuously trigger alert until disabled For bit mapping, please see ALERT_TEST

8rw0x0VAL_8

Alert trigger for testing 0 No alerts triggered 1 Continuously trigger alert until disabled For bit mapping, please see ALERT_TEST

9rw0x0VAL_9

Alert trigger for testing 0 No alerts triggered 1 Continuously trigger alert until disabled For bit mapping, please see ALERT_TEST

10rw0x0VAL_10

Alert trigger for testing 0 No alerts triggered 1 Continuously trigger alert until disabled For bit mapping, please see ALERT_TEST


SENSOR_CTRL.FATAL_ALERT_EN @ 0x18

Each bit marks a corresponding alert as fatal or recoverable.

Reset default = 0x0, mask 0x7ff
Register enable = CFG_REGWEN
31302928272625242322212019181716
 
1514131211109876543210
  VAL_10 VAL_9 VAL_8 VAL_7 VAL_6 VAL_5 VAL_4 VAL_3 VAL_2 VAL_1 VAL_0
BitsTypeResetNameDescription
0rw0x0VAL_0

1 - An alert event is fatal. 0 - An alert event is recoverable.

1rw0x0VAL_1

1 - An alert event is fatal. 0 - An alert event is recoverable.

2rw0x0VAL_2

1 - An alert event is fatal. 0 - An alert event is recoverable.

3rw0x0VAL_3

1 - An alert event is fatal. 0 - An alert event is recoverable.

4rw0x0VAL_4

1 - An alert event is fatal. 0 - An alert event is recoverable.

5rw0x0VAL_5

1 - An alert event is fatal. 0 - An alert event is recoverable.

6rw0x0VAL_6

1 - An alert event is fatal. 0 - An alert event is recoverable.

7rw0x0VAL_7

1 - An alert event is fatal. 0 - An alert event is recoverable.

8rw0x0VAL_8

1 - An alert event is fatal. 0 - An alert event is recoverable.

9rw0x0VAL_9

1 - An alert event is fatal. 0 - An alert event is recoverable.

10rw0x0VAL_10

1 - An alert event is fatal. 0 - An alert event is recoverable.


SENSOR_CTRL.RECOV_ALERT @ 0x1c

Each bit represents a recoverable alert that has been triggered by AST. Since these are recoverable alerts, they can be cleared by software.

Reset default = 0x0, mask 0x7ff
31302928272625242322212019181716
 
1514131211109876543210
  VAL_10 VAL_9 VAL_8 VAL_7 VAL_6 VAL_5 VAL_4 VAL_3 VAL_2 VAL_1 VAL_0
BitsTypeResetNameDescription
0rw1c0x0VAL_0

1 - An alert event has been set 0 - No alert event has been set

1rw1c0x0VAL_1

1 - An alert event has been set 0 - No alert event has been set

2rw1c0x0VAL_2

1 - An alert event has been set 0 - No alert event has been set

3rw1c0x0VAL_3

1 - An alert event has been set 0 - No alert event has been set

4rw1c0x0VAL_4

1 - An alert event has been set 0 - No alert event has been set

5rw1c0x0VAL_5

1 - An alert event has been set 0 - No alert event has been set

6rw1c0x0VAL_6

1 - An alert event has been set 0 - No alert event has been set

7rw1c0x0VAL_7

1 - An alert event has been set 0 - No alert event has been set

8rw1c0x0VAL_8

1 - An alert event has been set 0 - No alert event has been set

9rw1c0x0VAL_9

1 - An alert event has been set 0 - No alert event has been set

10rw1c0x0VAL_10

1 - An alert event has been set 0 - No alert event has been set


SENSOR_CTRL.FATAL_ALERT @ 0x20

Each bit represents a fatal alert that has been triggered by AST. Since these registers represent fatal alerts, they cannot be cleared.

Reset default = 0x0, mask 0xfff

The lower bits are used for ast alert events. The upper bits are used for local events.

31302928272625242322212019181716
 
1514131211109876543210
  VAL_11 VAL_10 VAL_9 VAL_8 VAL_7 VAL_6 VAL_5 VAL_4 VAL_3 VAL_2 VAL_1 VAL_0
BitsTypeResetNameDescription
0ro0x0VAL_0

1 - An alert event has been set 0 - No alert event has been set

1ro0x0VAL_1

1 - An alert event has been set 0 - No alert event has been set

2ro0x0VAL_2

1 - An alert event has been set 0 - No alert event has been set

3ro0x0VAL_3

1 - An alert event has been set 0 - No alert event has been set

4ro0x0VAL_4

1 - An alert event has been set 0 - No alert event has been set

5ro0x0VAL_5

1 - An alert event has been set 0 - No alert event has been set

6ro0x0VAL_6

1 - An alert event has been set 0 - No alert event has been set

7ro0x0VAL_7

1 - An alert event has been set 0 - No alert event has been set

8ro0x0VAL_8

1 - An alert event has been set 0 - No alert event has been set

9ro0x0VAL_9

1 - An alert event has been set 0 - No alert event has been set

10ro0x0VAL_10

1 - An alert event has been set 0 - No alert event has been set

11ro0x0VAL_11

1 - An alert event has been set 0 - No alert event has been set


SENSOR_CTRL.STATUS @ 0x24

Status readback for ast

Reset default = 0x0, mask 0x7
31302928272625242322212019181716
 
1514131211109876543210
  io_pok ast_init_done
BitsTypeResetNameDescription
0ro0x0ast_init_done

AST has finished initializing

2:1ro0x0io_pok

IO power is ready