Pavona Software APIs
acc.h File Reference

Device Tables (DT) for IP acc and top dragonfly. More...

#include "hw/top/dt/api.h"
#include <stdint.h>

Go to the source code of this file.

Macros

#define OPENTITAN_ACC_HAS_MEM_SCRAMBLE   1
 List of supported hardware features.
 

Typedefs

typedef enum dt_acc dt_acc_t
 List of instances.
 
typedef enum dt_acc_reg_block dt_acc_reg_block_t
 List of register blocks.
 
typedef enum dt_acc_irq dt_acc_irq_t
 List of IRQs.
 
typedef enum dt_acc_alert dt_acc_alert_t
 List of Alerts.
 
typedef enum dt_acc_clock dt_acc_clock_t
 List of clock ports.
 
typedef enum dt_acc_reset dt_acc_reset_t
 List of reset ports.
 

Enumerations

enum  dt_acc {
  kDtAccFirst = 0 ,
  kDtAcc = 0
}
 List of instances. More...
 
enum  { kDtAccCount = 1 }
 
enum  dt_acc_reg_block { kDtAccRegBlockCore = 0 }
 List of register blocks. More...
 
enum  { kDtAccRegBlockCount = 1 }
 
enum  dt_acc_irq { kDtAccIrqDone = 0 }
 List of IRQs. More...
 
enum  { kDtAccIrqCount = 1 }
 
enum  dt_acc_alert {
  kDtAccAlertFatal = 0 ,
  kDtAccAlertRecov = 1
}
 List of Alerts. More...
 
enum  { kDtAccAlertCount = 2 }
 
enum  dt_acc_clock {
  kDtAccClockClk = 0 ,
  kDtAccClockEdn = 1 ,
  kDtAccClockOtp = 2
}
 List of clock ports. More...
 
enum  { kDtAccClockCount = 3 }
 
enum  dt_acc_reset {
  kDtAccResetRst = 0 ,
  kDtAccResetEdn = 1 ,
  kDtAccResetOtp = 2
}
 List of reset ports. More...
 
enum  { kDtAccResetCount = 3 }
 

Functions

dt_acc_t dt_acc_from_instance_id (dt_instance_id_t inst_id)
 Get the acc instance from an instance ID.
 
dt_instance_id_t dt_acc_instance_id (dt_acc_t dt)
 Get the instance ID of an instance.
 
uint32_t dt_acc_reg_block (dt_acc_t dt, dt_acc_reg_block_t reg_block)
 Get the register base address of an instance.
 
dt_plic_irq_id_t dt_acc_irq_to_plic_id (dt_acc_t dt, dt_acc_irq_t irq)
 Get the PLIC ID of a acc IRQ for a given instance.
 
dt_acc_irq_t dt_acc_irq_from_plic_id (dt_acc_t dt, dt_plic_irq_id_t irq)
 Convert a global IRQ ID to a local acc IRQ type.
 
dt_alert_id_t dt_acc_alert_to_alert_id (dt_acc_t dt, dt_acc_alert_t alert)
 Get the alert ID of a acc alert for a given instance.
 
dt_acc_alert_t dt_acc_alert_from_alert_id (dt_acc_t dt, dt_alert_id_t alert)
 Convert a global alert ID to a local acc alert type.
 
dt_clock_t dt_acc_clock (dt_acc_t dt, dt_acc_clock_t clk)
 Get the clock signal connected to a clock port of an instance.
 
dt_reset_t dt_acc_reset (dt_acc_t dt, dt_acc_reset_t rst)
 Get the reset signal connected to a reset port of an instance.
 

Detailed Description

Device Tables (DT) for IP acc and top dragonfly.

This file contains the type definitions and global functions of the acc.

Definition in file acc.h.

Macro Definition Documentation

◆ OPENTITAN_ACC_HAS_MEM_SCRAMBLE

#define OPENTITAN_ACC_HAS_MEM_SCRAMBLE   1

List of supported hardware features.

Definition at line 120 of file acc.h.

Typedef Documentation

◆ dt_acc_alert_t

List of Alerts.

Alerts are guaranteed to be numbered consecutively from 0.

◆ dt_acc_clock_t

List of clock ports.

Clock ports are guaranteed to be numbered consecutively from 0.

◆ dt_acc_irq_t

typedef enum dt_acc_irq dt_acc_irq_t

List of IRQs.

IRQs are guaranteed to be numbered consecutively from 0.

◆ dt_acc_reg_block_t

List of register blocks.

Register blocks are guaranteed to start at 0 and to be consecutively numbered.

◆ dt_acc_reset_t

List of reset ports.

Reset ports are guaranteed to be numbered consecutively from 0.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
kDtAccResetCount 

Number of reset ports.

Definition at line 112 of file acc.h.

◆ anonymous enum

anonymous enum
Enumerator
kDtAccCount 

Number of instances.

Definition at line 34 of file acc.h.

◆ anonymous enum

anonymous enum
Enumerator
kDtAccClockCount 

Number of clock ports.

Definition at line 96 of file acc.h.

◆ anonymous enum

anonymous enum
Enumerator
kDtAccRegBlockCount 

Number of register blocks.

Definition at line 48 of file acc.h.

◆ anonymous enum

anonymous enum
Enumerator
kDtAccAlertCount 

Number of Alerts.

Definition at line 80 of file acc.h.

◆ anonymous enum

anonymous enum
Enumerator
kDtAccIrqCount 

Number of IRQs.

Definition at line 65 of file acc.h.

◆ dt_acc

enum dt_acc

List of instances.

Enumerator
kDtAccFirst 

First instance.

kDtAcc 

acc

Definition at line 29 of file acc.h.

◆ dt_acc_alert

List of Alerts.

Alerts are guaranteed to be numbered consecutively from 0.

Enumerator
kDtAccAlertFatal 

A fatal error.

Fatal alerts are non-recoverable and will be asserted until a hard reset.

kDtAccAlertRecov 

A recoverable error.

Just sent once (as the processor stops).

Definition at line 75 of file acc.h.

◆ dt_acc_clock

List of clock ports.

Clock ports are guaranteed to be numbered consecutively from 0.

Enumerator
kDtAccClockClk 

Clock port clk_i.

kDtAccClockEdn 

Clock port clk_edn_i.

kDtAccClockOtp 

Clock port clk_otp_i.

Definition at line 90 of file acc.h.

◆ dt_acc_irq

enum dt_acc_irq

List of IRQs.

IRQs are guaranteed to be numbered consecutively from 0.

Enumerator
kDtAccIrqDone 

ACC has completed the operation.

Definition at line 61 of file acc.h.

◆ dt_acc_reg_block

List of register blocks.

Register blocks are guaranteed to start at 0 and to be consecutively numbered.

Definition at line 44 of file acc.h.

◆ dt_acc_reset

List of reset ports.

Reset ports are guaranteed to be numbered consecutively from 0.

Enumerator
kDtAccResetRst 

Reset port rst_ni.

kDtAccResetEdn 

Reset port rst_edn_ni.

kDtAccResetOtp 

Reset port rst_otp_ni.

Definition at line 106 of file acc.h.

Function Documentation

◆ dt_acc_alert_from_alert_id()

dt_acc_alert_t dt_acc_alert_from_alert_id ( dt_acc_t dt,
dt_alert_id_t alert )

Convert a global alert ID to a local acc alert type.

Parameters
dtInstance of acc.
alertA global alert ID that belongs to this instance.
Returns
The acc alert, or kDtAccAlertCount.

Note: This function assumes that the global alert ID belongs to the instance of acc passed in parameter. In other words, it must be the case that dt_acc_instance_id(dt) == dt_alert_id_to_instance_id(alert). Otherwise, this function will return kDtAccAlertCount.

Definition at line 119 of file acc.c.

◆ dt_acc_alert_to_alert_id()

dt_alert_id_t dt_acc_alert_to_alert_id ( dt_acc_t dt,
dt_acc_alert_t alert )

Get the alert ID of a acc alert for a given instance.

Note: This function only makes sense if the instance is connected to the Alert Handler. For any instances where the instance is not connected, the return value is unspecified.

Parameters
dtInstance of acc.
alertA acc alert.
Returns
The Alert Handler alert ID of the alert of this instance.

Definition at line 113 of file acc.c.

◆ dt_acc_clock()

Get the clock signal connected to a clock port of an instance.

Parameters
dtInstance of acc.
clkClock port.
Returns
Clock signal.

Definition at line 131 of file acc.c.

◆ dt_acc_from_instance_id()

dt_acc_t dt_acc_from_instance_id ( dt_instance_id_t inst_id)

Get the acc instance from an instance ID.

For example, dt_uart_from_instance_id(kDtInstanceIdUart3) == kDtUart3.

Parameters
inst_idInstance ID.
Returns
A acc instance.

Note: This function only makes sense if the instance ID has device type acc, otherwise the returned value is unspecified.

Definition at line 69 of file acc.c.

◆ dt_acc_instance_id()

dt_instance_id_t dt_acc_instance_id ( dt_acc_t dt)

Get the instance ID of an instance.

Parameters
dtInstance of acc.
Returns
The instance ID of that instance.

Definition at line 76 of file acc.c.

◆ dt_acc_irq_from_plic_id()

dt_acc_irq_t dt_acc_irq_from_plic_id ( dt_acc_t dt,
dt_plic_irq_id_t irq )

Convert a global IRQ ID to a local acc IRQ type.

Parameters
dtInstance of acc.
irqA PLIC ID that belongs to this instance.
Returns
The acc IRQ, or kDtAccIrqCount.

Note: This function assumes that the PLIC ID belongs to the instance of acc passed in parameter. In other words, it must be the case that dt_acc_instance_id(dt) == dt_plic_id_to_instance_id(irq). Otherwise, this function will return kDtAccIrqCount.

Definition at line 98 of file acc.c.

◆ dt_acc_irq_to_plic_id()

dt_plic_irq_id_t dt_acc_irq_to_plic_id ( dt_acc_t dt,
dt_acc_irq_t irq )

Get the PLIC ID of a acc IRQ for a given instance.

If the instance is not connected to the PLIC, this function will return kDtPlicIrqIdNone.

Parameters
dtInstance of acc.
irqA acc IRQ.
Returns
The PLIC ID of the IRQ of this instance.

Definition at line 88 of file acc.c.

◆ dt_acc_reg_block()

uint32_t dt_acc_reg_block ( dt_acc_t dt,
dt_acc_reg_block_t reg_block )

Get the register base address of an instance.

Parameters
dtInstance of acc.
reg_blockThe register block requested.
Returns
The register base address of the requested block.

Definition at line 81 of file acc.c.

◆ dt_acc_reset()

Get the reset signal connected to a reset port of an instance.

Parameters
dtInstance of acc.
rstReset port.
Returns
Reset signal.

Definition at line 138 of file acc.c.