use core::marker::PhantomData;
use hdl_cat::signal::ClockDomain;
use crate::width::csa_out_width;
#[must_use]
pub struct RegisteredCompressor<
const M: usize,
const W: usize,
const OUT_W: usize,
D: ClockDomain,
> {
_phantom: PhantomData<D>,
}
impl<const M: usize, const W: usize, const OUT_W: usize, D: ClockDomain>
RegisteredCompressor<M, W, OUT_W, D>
{
pub const fn new() -> Self {
Self {
_phantom: PhantomData,
}
}
#[must_use]
pub const fn is_consistent() -> bool {
OUT_W == csa_out_width(M, W)
}
}
impl<const M: usize, const W: usize, const OUT_W: usize, D: ClockDomain> Default
for RegisteredCompressor<M, W, OUT_W, D>
{
fn default() -> Self {
Self::new()
}
}