tfhe_hpu_backend/interface/
mod.rs

1mod backend;
2mod cmd;
3pub use cmd::{HpuCmd, HpuImm};
4mod config;
5mod device;
6mod memory;
7pub mod rtl;
8mod variable;
9
10#[cfg(feature = "io-dump")]
11pub mod io_dump;
12
13use thiserror::Error;
14
15// Publicly export some types
16pub const ACKQ_EMPTY: u32 = 0xdeadc0de;
17pub const FW_TABLE_ENTRY: usize = 128;
18pub use config::{BoardConfig, FFIMode, HpuConfig, ShellString};
19pub use device::HpuDevice;
20pub use memory::page_align;
21pub use variable::HpuVarWrapped;
22
23/// Common error type reported by Hpu
24#[derive(Error, Debug, Clone, PartialEq, Eq)]
25pub(crate) enum HpuInternalError {
26    #[error("Couldn't sync uninitialized variable.")]
27    UninitData,
28
29    // Recoreverable errors
30    #[error("Couldn't sync yet. Operation is pending")]
31    OperationPending,
32}
33
34/// Common error type exposed to user
35#[derive(Error, Clone, Debug)]
36pub enum HpuError {
37    // Recoreverable errors
38    #[error("Couldn't sync yet. Operation is pending")]
39    SyncPending(variable::HpuVarWrapped),
40}