rename FixedType->StaticType, fixed_type()->static_type(), hdl(fixed_type)->hdl(static), IsFixedLen->IsStaticLen
This commit is contained in:
parent
c19a6821cf
commit
2dce478d48
20 changed files with 165 additions and 164 deletions
|
@ -11,7 +11,7 @@
|
|||
//! ```
|
||||
//! # use fayalite::{hdl_module, int::UInt, array::Array, ty::Value};
|
||||
//! #[derive(Value, Clone, PartialEq, Eq, Hash, Debug)]
|
||||
//! #[hdl(fixed_type)]
|
||||
//! #[hdl(static)]
|
||||
//! pub struct MyStruct {
|
||||
//! pub a: UInt<8>,
|
||||
//! pub b: UInt<16>,
|
||||
|
|
|
@ -14,7 +14,7 @@ use crate::{
|
|||
source_location::SourceLocation,
|
||||
ty::{
|
||||
CanonicalType, CanonicalTypeKind, CanonicalValue, Connect, DynCanonicalType,
|
||||
DynCanonicalValue, DynType, DynValueTrait, FixedType, MatchVariantWithoutScope, Type,
|
||||
DynCanonicalValue, DynType, DynValueTrait, MatchVariantWithoutScope, StaticType, Type,
|
||||
TypeEnum, Value, ValueEnum,
|
||||
},
|
||||
util::{ConstBool, GenericConstBool, MakeMutSlice},
|
||||
|
@ -66,7 +66,7 @@ pub trait ValueArrayOrSlice:
|
|||
LenType = Self::LenType,
|
||||
MaskVA = Self::MaskVA,
|
||||
> + ?Sized;
|
||||
type IsFixedLen: GenericConstBool;
|
||||
type IsStaticLen: GenericConstBool;
|
||||
const FIXED_LEN_TYPE: Option<Self::LenType>;
|
||||
fn make_match(array: Expr<Array<Self>>) -> Self::Match;
|
||||
fn len_from_len_type(v: Self::LenType) -> usize;
|
||||
|
@ -94,7 +94,7 @@ where
|
|||
type LenType = usize;
|
||||
type Match = Box<[Expr<V>]>;
|
||||
type MaskVA = [<Self::ElementType as Type>::MaskValue];
|
||||
type IsFixedLen = ConstBool<false>;
|
||||
type IsStaticLen = ConstBool<false>;
|
||||
const FIXED_LEN_TYPE: Option<Self::LenType> = None;
|
||||
|
||||
fn make_match(array: Expr<Array<Self>>) -> Self::Match {
|
||||
|
@ -147,7 +147,7 @@ where
|
|||
type LenType = ();
|
||||
type Match = [Expr<V>; N];
|
||||
type MaskVA = [<Self::ElementType as Type>::MaskValue; N];
|
||||
type IsFixedLen = ConstBool<true>;
|
||||
type IsStaticLen = ConstBool<true>;
|
||||
const FIXED_LEN_TYPE: Option<Self::LenType> = Some(());
|
||||
|
||||
fn make_match(array: Expr<Array<Self>>) -> Self::Match {
|
||||
|
@ -311,12 +311,12 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
impl<V: Value, const N: usize> FixedType for ArrayType<[V; N]>
|
||||
impl<V: Value, const N: usize> StaticType for ArrayType<[V; N]>
|
||||
where
|
||||
V::Type: FixedType<Value = V>,
|
||||
V::Type: StaticType<Value = V>,
|
||||
{
|
||||
fn fixed_type() -> Self {
|
||||
Self::new_array(FixedType::fixed_type())
|
||||
fn static_type() -> Self {
|
||||
Self::new_array(StaticType::static_type())
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -514,18 +514,18 @@ impl<VA: ValueArrayOrSlice + ?Sized> Array<VA> {
|
|||
|
||||
impl<VA: ValueArrayOrSlice + ?Sized, T: Into<Arc<VA>>> From<T> for Array<VA>
|
||||
where
|
||||
VA::ElementType: FixedType,
|
||||
VA::ElementType: StaticType,
|
||||
{
|
||||
fn from(value: T) -> Self {
|
||||
Self::new(FixedType::fixed_type(), value.into())
|
||||
Self::new(StaticType::static_type(), value.into())
|
||||
}
|
||||
}
|
||||
|
||||
impl<E: ToExpr<Type = T>, T: FixedType> ToExpr for [E] {
|
||||
impl<E: ToExpr<Type = T>, T: StaticType> ToExpr for [E] {
|
||||
type Type = ArrayType<[T::Value]>;
|
||||
|
||||
fn ty(&self) -> Self::Type {
|
||||
ArrayType::new_with_len_type(FixedType::fixed_type(), self.len())
|
||||
ArrayType::new_with_len_type(StaticType::static_type(), self.len())
|
||||
}
|
||||
|
||||
fn to_expr(&self) -> Expr<<Self::Type as Type>::Value> {
|
||||
|
@ -536,7 +536,7 @@ impl<E: ToExpr<Type = T>, T: FixedType> ToExpr for [E] {
|
|||
}
|
||||
}
|
||||
|
||||
impl<E: ToExpr<Type = T>, T: FixedType> ToExpr for Vec<E> {
|
||||
impl<E: ToExpr<Type = T>, T: StaticType> ToExpr for Vec<E> {
|
||||
type Type = ArrayType<[T::Value]>;
|
||||
|
||||
fn ty(&self) -> Self::Type {
|
||||
|
@ -548,11 +548,11 @@ impl<E: ToExpr<Type = T>, T: FixedType> ToExpr for Vec<E> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<E: ToExpr<Type = T>, T: FixedType, const N: usize> ToExpr for [E; N] {
|
||||
impl<E: ToExpr<Type = T>, T: StaticType, const N: usize> ToExpr for [E; N] {
|
||||
type Type = ArrayType<[T::Value; N]>;
|
||||
|
||||
fn ty(&self) -> Self::Type {
|
||||
ArrayType::new_with_len_type(FixedType::fixed_type(), ())
|
||||
ArrayType::new_with_len_type(StaticType::static_type(), ())
|
||||
}
|
||||
|
||||
fn to_expr(&self) -> Expr<<Self::Type as Type>::Value> {
|
||||
|
|
|
@ -9,7 +9,7 @@ use crate::{
|
|||
source_location::SourceLocation,
|
||||
ty::{
|
||||
CanonicalType, CanonicalTypeKind, CanonicalValue, Connect, DynCanonicalType,
|
||||
DynCanonicalValue, DynType, FixedType, MatchVariantWithoutScope, Type, TypeEnum,
|
||||
DynCanonicalValue, DynType, MatchVariantWithoutScope, StaticType, Type, TypeEnum,
|
||||
TypeWithDeref, Value, ValueEnum,
|
||||
},
|
||||
};
|
||||
|
@ -755,13 +755,13 @@ macro_rules! impl_tuple {
|
|||
}
|
||||
}
|
||||
|
||||
impl<$($T: FixedType,)*> FixedType for ($($T,)*)
|
||||
impl<$($T: StaticType,)*> StaticType for ($($T,)*)
|
||||
where
|
||||
$($T::Value: Value<Type = $T>,)*
|
||||
{
|
||||
#[allow(clippy::unused_unit)]
|
||||
fn fixed_type() -> Self {
|
||||
($($T::fixed_type(),)*)
|
||||
fn static_type() -> Self {
|
||||
($($T::static_type(),)*)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ use crate::{
|
|||
source_location::SourceLocation,
|
||||
ty::{
|
||||
impl_match_values_as_self, CanonicalType, CanonicalTypeKind, CanonicalValue, Connect,
|
||||
DynCanonicalType, FixedType, Type, TypeEnum, Value, ValueEnum,
|
||||
DynCanonicalType, StaticType, Type, TypeEnum, Value, ValueEnum,
|
||||
},
|
||||
util::interned_bit,
|
||||
};
|
||||
|
@ -63,8 +63,8 @@ impl CanonicalType for ClockType {
|
|||
const CANONICAL_TYPE_KIND: CanonicalTypeKind = CanonicalTypeKind::Clock;
|
||||
}
|
||||
|
||||
impl FixedType for ClockType {
|
||||
fn fixed_type() -> Self {
|
||||
impl StaticType for ClockType {
|
||||
fn static_type() -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ impl CanonicalValue for Clock {
|
|||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Eq, PartialEq, Hash, Value)]
|
||||
#[hdl(fixed_type, outline_generated)]
|
||||
#[hdl(static, outline_generated)]
|
||||
pub struct ClockDomain {
|
||||
pub clk: Clock,
|
||||
pub rst: Reset,
|
||||
|
|
|
@ -4,7 +4,7 @@ use crate::{
|
|||
array::ArrayType,
|
||||
bundle::{BundleType, BundleValue, DynBundle, DynBundleType, FieldType},
|
||||
enum_::{DynEnumType, EnumType, EnumValue},
|
||||
int::{DynSIntType, DynUInt, DynUIntType, FixedOrDynIntType, IntValue, UInt, UIntType},
|
||||
int::{DynSIntType, DynUInt, DynUIntType, IntValue, StaticOrDynIntType, UInt, UIntType},
|
||||
intern::{Intern, Interned, InternedCompare, PtrEqWithTypeId, SupportsPtrEqWithTypeId},
|
||||
memory::{DynPortType, MemPort, PortType},
|
||||
module::{
|
||||
|
@ -288,7 +288,7 @@ impl<T> Hash for Expr<T> {
|
|||
|
||||
impl<T> Expr<IntValue<T>>
|
||||
where
|
||||
T: FixedOrDynIntType<
|
||||
T: StaticOrDynIntType<
|
||||
1,
|
||||
Signed = ConstBool<false>,
|
||||
CanonicalType = DynUIntType,
|
||||
|
|
|
@ -10,7 +10,7 @@ use crate::{
|
|||
TargetPathDynArrayElement, TargetPathElement, ToExpr,
|
||||
},
|
||||
int::{
|
||||
DynInt, DynIntType, DynSInt, DynSIntType, DynUInt, DynUIntType, FixedOrDynIntType, Int,
|
||||
DynInt, DynIntType, DynSInt, DynSIntType, DynUInt, DynUIntType, StaticOrDynIntType, Int,
|
||||
IntCmp, IntType, IntTypeTrait, IntValue, UInt, UIntType,
|
||||
},
|
||||
intern::{Intern, Interned},
|
||||
|
@ -726,7 +726,7 @@ macro_rules! cmp_op {
|
|||
CanonicalType = DynIntType<<RhsType as IntTypeTrait>::Signed>,
|
||||
CanonicalValue = DynInt<<RhsType as IntTypeTrait>::Signed>,
|
||||
>,
|
||||
Output: FixedOrDynIntType<
|
||||
Output: StaticOrDynIntType<
|
||||
1,
|
||||
Signed = ConstBool<false>,
|
||||
CanonicalType = DynUIntType,
|
||||
|
@ -737,7 +737,7 @@ macro_rules! cmp_op {
|
|||
pub lhs: Expr<LhsType::CanonicalValue>,
|
||||
pub rhs: Expr<RhsType::CanonicalValue>,
|
||||
#[type]
|
||||
ty: Output = FixedOrDynIntType::new(),
|
||||
ty: Output = StaticOrDynIntType::new(),
|
||||
#[cache]
|
||||
literal_bits: Result<Interned<BitSlice>, ()> = {
|
||||
lhs.to_literal_bits()
|
||||
|
@ -1098,7 +1098,7 @@ macro_rules! reduce_bit_op {
|
|||
fixed_ary_op! {
|
||||
pub struct $name<Output,>
|
||||
where (
|
||||
Output: FixedOrDynIntType<
|
||||
Output: StaticOrDynIntType<
|
||||
1,
|
||||
Signed = ConstBool<false>,
|
||||
CanonicalType = DynUIntType,
|
||||
|
@ -1108,7 +1108,7 @@ macro_rules! reduce_bit_op {
|
|||
{
|
||||
pub arg: Expr<DynUInt>,
|
||||
#[type]
|
||||
ty: Output = FixedOrDynIntType::new(),
|
||||
ty: Output = StaticOrDynIntType::new(),
|
||||
#[cache]
|
||||
literal_bits: Result<Interned<BitSlice>, ()> = {
|
||||
arg.to_literal_bits().map(|$bits| interned_bit($literal_bits_bool))
|
||||
|
@ -1503,7 +1503,7 @@ where
|
|||
}
|
||||
}
|
||||
|
||||
cast_bit_to_typed_bit!(pub struct CastClockToBit<ToType: FixedOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>; ClockType => ToType);
|
||||
cast_bit_to_typed_bit!(pub struct CastClockToBit<ToType: StaticOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>; ClockType => ToType);
|
||||
|
||||
impl ToBit for Clock {
|
||||
fn to_bit(v: Expr<Self>) -> Expr<UInt<1>> {
|
||||
|
@ -1511,7 +1511,7 @@ impl ToBit for Clock {
|
|||
}
|
||||
}
|
||||
|
||||
cast_bit_to_typed_bit!(pub struct CastSyncResetToBit<ToType: FixedOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>; SyncResetType => ToType);
|
||||
cast_bit_to_typed_bit!(pub struct CastSyncResetToBit<ToType: StaticOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>; SyncResetType => ToType);
|
||||
|
||||
impl ToBit for SyncReset {
|
||||
fn to_bit(v: Expr<Self>) -> Expr<UInt<1>> {
|
||||
|
@ -1519,7 +1519,7 @@ impl ToBit for SyncReset {
|
|||
}
|
||||
}
|
||||
|
||||
cast_bit_to_typed_bit!(pub struct CastAsyncResetToBit<ToType: FixedOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>; AsyncResetType => ToType);
|
||||
cast_bit_to_typed_bit!(pub struct CastAsyncResetToBit<ToType: StaticOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>; AsyncResetType => ToType);
|
||||
|
||||
impl ToBit for AsyncReset {
|
||||
fn to_bit(v: Expr<Self>) -> Expr<UInt<1>> {
|
||||
|
@ -1527,7 +1527,7 @@ impl ToBit for AsyncReset {
|
|||
}
|
||||
}
|
||||
|
||||
cast_bit_to_typed_bit!(pub struct CastResetToBit<ToType: FixedOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>; ResetType => ToType);
|
||||
cast_bit_to_typed_bit!(pub struct CastResetToBit<ToType: StaticOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>; ResetType => ToType);
|
||||
|
||||
impl ToBit for Reset {
|
||||
fn to_bit(v: Expr<Self>) -> Expr<UInt<1>> {
|
||||
|
|
|
@ -6,7 +6,7 @@ use crate::{
|
|||
source_location::SourceLocation,
|
||||
ty::{
|
||||
impl_match_values_as_self, CanonicalType, CanonicalTypeKind, CanonicalValue, Connect,
|
||||
DynCanonicalType, FixedType, Type, TypeEnum, Value, ValueEnum,
|
||||
DynCanonicalType, StaticType, Type, TypeEnum, Value, ValueEnum,
|
||||
},
|
||||
util::{ConstBool, GenericConstBool},
|
||||
valueless::Valueless,
|
||||
|
@ -825,7 +825,7 @@ impl_int!(i64, true);
|
|||
impl_int!(i128, true);
|
||||
|
||||
impl<
|
||||
T: FixedOrDynIntType<
|
||||
T: StaticOrDynIntType<
|
||||
1,
|
||||
Signed = ConstBool<false>,
|
||||
CanonicalType = DynUIntType,
|
||||
|
@ -1000,7 +1000,7 @@ pub trait IntTypeTrait:
|
|||
}
|
||||
}
|
||||
|
||||
pub trait FixedOrDynIntType<const WIDTH: usize>: IntTypeTrait {
|
||||
pub trait StaticOrDynIntType<const WIDTH: usize>: IntTypeTrait {
|
||||
fn new() -> Self;
|
||||
}
|
||||
|
||||
|
@ -1203,7 +1203,7 @@ impl<Signed: GenericConstBool> IntTypeTrait for DynIntType<Signed> {
|
|||
}
|
||||
}
|
||||
|
||||
impl<Signed: GenericConstBool, const WIDTH: usize> FixedOrDynIntType<WIDTH> for DynIntType<Signed> {
|
||||
impl<Signed: GenericConstBool, const WIDTH: usize> StaticOrDynIntType<WIDTH> for DynIntType<Signed> {
|
||||
fn new() -> Self {
|
||||
DynIntType::new(WIDTH)
|
||||
}
|
||||
|
@ -1264,8 +1264,8 @@ impl<Signed: GenericConstBool, const WIDTH: usize> Type for IntType<Signed, WIDT
|
|||
}
|
||||
}
|
||||
|
||||
impl<Signed: GenericConstBool, const WIDTH: usize> FixedType for IntType<Signed, WIDTH> {
|
||||
fn fixed_type() -> Self {
|
||||
impl<Signed: GenericConstBool, const WIDTH: usize> StaticType for IntType<Signed, WIDTH> {
|
||||
fn static_type() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
@ -1292,7 +1292,7 @@ impl<Signed: GenericConstBool, const WIDTH: usize> IntTypeTrait for IntType<Sign
|
|||
}
|
||||
}
|
||||
|
||||
impl<Signed: GenericConstBool, const WIDTH: usize> FixedOrDynIntType<WIDTH>
|
||||
impl<Signed: GenericConstBool, const WIDTH: usize> StaticOrDynIntType<WIDTH>
|
||||
for IntType<Signed, WIDTH>
|
||||
{
|
||||
fn new() -> Self {
|
||||
|
|
|
@ -11,13 +11,13 @@ use crate::{
|
|||
ops::VariantAccess, Expr, Flow, Target, TargetBase, TargetPathArrayElement,
|
||||
TargetPathBundleField, TargetPathElement, ToExpr,
|
||||
},
|
||||
int::{DynUInt, DynUIntType, FixedOrDynIntType, IntValue, UInt},
|
||||
int::{DynUInt, DynUIntType, IntValue, StaticOrDynIntType, UInt},
|
||||
intern::{Intern, Interned},
|
||||
memory::{Mem, MemBuilder, MemBuilderTarget, PortName},
|
||||
reg::Reg,
|
||||
source_location::SourceLocation,
|
||||
ty::{
|
||||
CanonicalType, Connect, DynCanonicalType, DynCanonicalValue, DynType, FixedType, Type,
|
||||
CanonicalType, Connect, DynCanonicalType, DynCanonicalValue, DynType, StaticType, Type,
|
||||
TypeEnum, Value,
|
||||
},
|
||||
util::ConstBool,
|
||||
|
@ -1829,7 +1829,7 @@ impl<'a, CD> RegBuilder<'a, CD, (), ()> {
|
|||
}
|
||||
pub fn reset_default<V: Value + Default>(self) -> RegBuilder<'a, CD, Option<Expr<V>>, V>
|
||||
where
|
||||
V::Type: FixedType<Value = V>,
|
||||
V::Type: StaticType<Value = V>,
|
||||
{
|
||||
self.reset(V::default().to_expr())
|
||||
}
|
||||
|
@ -2264,7 +2264,7 @@ where
|
|||
#[track_caller]
|
||||
pub fn if_<Ty>(&mut self, cond: Expr<IntValue<Ty>>) -> IfScope
|
||||
where
|
||||
Ty: FixedOrDynIntType<
|
||||
Ty: StaticOrDynIntType<
|
||||
1,
|
||||
Signed = ConstBool<false>,
|
||||
CanonicalType = DynUIntType,
|
||||
|
@ -2279,7 +2279,7 @@ where
|
|||
source_location: SourceLocation,
|
||||
) -> IfScope
|
||||
where
|
||||
Ty: FixedOrDynIntType<
|
||||
Ty: StaticOrDynIntType<
|
||||
1,
|
||||
Signed = ConstBool<false>,
|
||||
CanonicalType = DynUIntType,
|
||||
|
|
|
@ -12,7 +12,7 @@ use crate::{
|
|||
TargetPathBundleField, TargetPathDynArrayElement, TargetPathElement, ToExpr,
|
||||
},
|
||||
int::{
|
||||
DynInt, DynIntType, DynSInt, DynSIntType, DynUInt, DynUIntType, FixedOrDynIntType, IntType,
|
||||
DynInt, DynIntType, DynSInt, DynSIntType, DynUInt, DynUIntType, StaticOrDynIntType, IntType,
|
||||
IntTypeTrait,
|
||||
},
|
||||
intern::{Intern, Interned},
|
||||
|
|
|
@ -7,13 +7,13 @@ use crate::{
|
|||
source_location::SourceLocation,
|
||||
ty::{
|
||||
impl_match_values_as_self, CanonicalType, CanonicalTypeKind, CanonicalValue, Connect,
|
||||
DynCanonicalType, FixedType, Type, TypeEnum, Value, ValueEnum,
|
||||
DynCanonicalType, StaticType, Type, TypeEnum, Value, ValueEnum,
|
||||
},
|
||||
util::interned_bit,
|
||||
};
|
||||
use bitvec::slice::BitSlice;
|
||||
|
||||
pub trait ResetTypeTrait: CanonicalType + FixedType {}
|
||||
pub trait ResetTypeTrait: CanonicalType + StaticType {}
|
||||
|
||||
#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Default)]
|
||||
pub struct AsyncResetType;
|
||||
|
@ -64,8 +64,8 @@ impl CanonicalType for AsyncResetType {
|
|||
const CANONICAL_TYPE_KIND: CanonicalTypeKind = CanonicalTypeKind::AsyncReset;
|
||||
}
|
||||
|
||||
impl FixedType for AsyncResetType {
|
||||
fn fixed_type() -> Self {
|
||||
impl StaticType for AsyncResetType {
|
||||
fn static_type() -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
@ -154,8 +154,8 @@ impl CanonicalType for SyncResetType {
|
|||
const CANONICAL_TYPE_KIND: CanonicalTypeKind = CanonicalTypeKind::SyncReset;
|
||||
}
|
||||
|
||||
impl FixedType for SyncResetType {
|
||||
fn fixed_type() -> Self {
|
||||
impl StaticType for SyncResetType {
|
||||
fn static_type() -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
@ -244,8 +244,8 @@ impl CanonicalType for ResetType {
|
|||
const CANONICAL_TYPE_KIND: CanonicalTypeKind = CanonicalTypeKind::Reset;
|
||||
}
|
||||
|
||||
impl FixedType for ResetType {
|
||||
fn fixed_type() -> Self {
|
||||
impl StaticType for ResetType {
|
||||
fn static_type() -> Self {
|
||||
Self
|
||||
}
|
||||
}
|
||||
|
|
|
@ -625,8 +625,8 @@ pub trait CanonicalType:
|
|||
|
||||
impl<T: CanonicalType> DynCanonicalType for T {}
|
||||
|
||||
pub trait FixedType: Type {
|
||||
fn fixed_type() -> Self;
|
||||
pub trait StaticType: Type {
|
||||
fn static_type() -> Self;
|
||||
}
|
||||
|
||||
pub trait DynValueTrait: fmt::Debug + Send + Sync + Any {
|
||||
|
|
|
@ -13,7 +13,7 @@ use fayalite::{
|
|||
module::transform::simplify_enums::{simplify_enums, SimplifyEnumsKind},
|
||||
reset::{SyncReset, ToReset},
|
||||
source_location::SourceLocation,
|
||||
ty::{FixedType, Value},
|
||||
ty::{StaticType, Value},
|
||||
};
|
||||
use serde_json::json;
|
||||
|
||||
|
@ -195,7 +195,7 @@ circuit check_array_repeat_1:
|
|||
#[hdl_module(outline_generated)]
|
||||
pub fn check_skipped_generics<T, #[hdl(skip)] U, const N: usize, #[hdl(skip)] const M: usize>(v: U)
|
||||
where
|
||||
T: Value<Type: FixedType<Value = T>>,
|
||||
T: Value<Type: StaticType<Value = T>>,
|
||||
U: std::fmt::Display,
|
||||
{
|
||||
dbg!(M);
|
||||
|
@ -377,18 +377,18 @@ circuit check_written_inside_both_if_else:
|
|||
}
|
||||
|
||||
#[derive(Value, Clone, PartialEq, Eq, Hash, Debug)]
|
||||
#[hdl(fixed_type, outline_generated)]
|
||||
#[hdl(static, outline_generated)]
|
||||
pub struct TestStruct<T> {
|
||||
pub a: T,
|
||||
pub b: UInt<8>,
|
||||
}
|
||||
|
||||
#[derive(Value, Clone, PartialEq, Eq, Hash, Debug)]
|
||||
#[hdl(fixed_type, outline_generated)]
|
||||
#[hdl(static, outline_generated)]
|
||||
pub struct TestStruct2(pub UInt<8>);
|
||||
|
||||
#[derive(Value, Clone, PartialEq, Eq, Hash, Debug)]
|
||||
#[hdl(fixed_type, outline_generated)]
|
||||
#[hdl(static, outline_generated)]
|
||||
pub struct TestStruct3;
|
||||
|
||||
#[hdl_module(outline_generated)]
|
||||
|
|
|
@ -501,7 +501,7 @@
|
|||
"lhs": "Visible",
|
||||
"rhs": "Visible"
|
||||
},
|
||||
"generics": "<LhsType: IntTypeTrait<CanonicalType = DynIntType<<LhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<LhsType as IntTypeTrait>::Signed>>, RhsType: IntTypeTrait<Signed = LhsType::Signed, CanonicalType = DynIntType<<RhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<RhsType as IntTypeTrait>::Signed>>, Output: FixedOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
"generics": "<LhsType: IntTypeTrait<CanonicalType = DynIntType<<LhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<LhsType as IntTypeTrait>::Signed>>, RhsType: IntTypeTrait<Signed = LhsType::Signed, CanonicalType = DynIntType<<RhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<RhsType as IntTypeTrait>::Signed>>, Output: StaticOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
},
|
||||
"ops::CmpLe": {
|
||||
"data": {
|
||||
|
@ -510,7 +510,7 @@
|
|||
"lhs": "Visible",
|
||||
"rhs": "Visible"
|
||||
},
|
||||
"generics": "<LhsType: IntTypeTrait<CanonicalType = DynIntType<<LhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<LhsType as IntTypeTrait>::Signed>>, RhsType: IntTypeTrait<Signed = LhsType::Signed, CanonicalType = DynIntType<<RhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<RhsType as IntTypeTrait>::Signed>>, Output: FixedOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
"generics": "<LhsType: IntTypeTrait<CanonicalType = DynIntType<<LhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<LhsType as IntTypeTrait>::Signed>>, RhsType: IntTypeTrait<Signed = LhsType::Signed, CanonicalType = DynIntType<<RhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<RhsType as IntTypeTrait>::Signed>>, Output: StaticOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
},
|
||||
"ops::CmpGt": {
|
||||
"data": {
|
||||
|
@ -519,7 +519,7 @@
|
|||
"lhs": "Visible",
|
||||
"rhs": "Visible"
|
||||
},
|
||||
"generics": "<LhsType: IntTypeTrait<CanonicalType = DynIntType<<LhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<LhsType as IntTypeTrait>::Signed>>, RhsType: IntTypeTrait<Signed = LhsType::Signed, CanonicalType = DynIntType<<RhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<RhsType as IntTypeTrait>::Signed>>, Output: FixedOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
"generics": "<LhsType: IntTypeTrait<CanonicalType = DynIntType<<LhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<LhsType as IntTypeTrait>::Signed>>, RhsType: IntTypeTrait<Signed = LhsType::Signed, CanonicalType = DynIntType<<RhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<RhsType as IntTypeTrait>::Signed>>, Output: StaticOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
},
|
||||
"ops::CmpGe": {
|
||||
"data": {
|
||||
|
@ -528,7 +528,7 @@
|
|||
"lhs": "Visible",
|
||||
"rhs": "Visible"
|
||||
},
|
||||
"generics": "<LhsType: IntTypeTrait<CanonicalType = DynIntType<<LhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<LhsType as IntTypeTrait>::Signed>>, RhsType: IntTypeTrait<Signed = LhsType::Signed, CanonicalType = DynIntType<<RhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<RhsType as IntTypeTrait>::Signed>>, Output: FixedOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
"generics": "<LhsType: IntTypeTrait<CanonicalType = DynIntType<<LhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<LhsType as IntTypeTrait>::Signed>>, RhsType: IntTypeTrait<Signed = LhsType::Signed, CanonicalType = DynIntType<<RhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<RhsType as IntTypeTrait>::Signed>>, Output: StaticOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
},
|
||||
"ops::CmpEq": {
|
||||
"data": {
|
||||
|
@ -537,7 +537,7 @@
|
|||
"lhs": "Visible",
|
||||
"rhs": "Visible"
|
||||
},
|
||||
"generics": "<LhsType: IntTypeTrait<CanonicalType = DynIntType<<LhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<LhsType as IntTypeTrait>::Signed>>, RhsType: IntTypeTrait<Signed = LhsType::Signed, CanonicalType = DynIntType<<RhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<RhsType as IntTypeTrait>::Signed>>, Output: FixedOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
"generics": "<LhsType: IntTypeTrait<CanonicalType = DynIntType<<LhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<LhsType as IntTypeTrait>::Signed>>, RhsType: IntTypeTrait<Signed = LhsType::Signed, CanonicalType = DynIntType<<RhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<RhsType as IntTypeTrait>::Signed>>, Output: StaticOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
},
|
||||
"ops::CmpNe": {
|
||||
"data": {
|
||||
|
@ -546,7 +546,7 @@
|
|||
"lhs": "Visible",
|
||||
"rhs": "Visible"
|
||||
},
|
||||
"generics": "<LhsType: IntTypeTrait<CanonicalType = DynIntType<<LhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<LhsType as IntTypeTrait>::Signed>>, RhsType: IntTypeTrait<Signed = LhsType::Signed, CanonicalType = DynIntType<<RhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<RhsType as IntTypeTrait>::Signed>>, Output: FixedOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
"generics": "<LhsType: IntTypeTrait<CanonicalType = DynIntType<<LhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<LhsType as IntTypeTrait>::Signed>>, RhsType: IntTypeTrait<Signed = LhsType::Signed, CanonicalType = DynIntType<<RhsType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<RhsType as IntTypeTrait>::Signed>>, Output: StaticOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
},
|
||||
"ops::CastInt": {
|
||||
"data": {
|
||||
|
@ -574,7 +574,7 @@
|
|||
"$constructor": "ops::ReduceBitAnd::new_unchecked",
|
||||
"arg": "Visible"
|
||||
},
|
||||
"generics": "<Output: FixedOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
"generics": "<Output: StaticOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
},
|
||||
"ops::ReduceBitOr": {
|
||||
"data": {
|
||||
|
@ -582,7 +582,7 @@
|
|||
"$constructor": "ops::ReduceBitOr::new_unchecked",
|
||||
"arg": "Visible"
|
||||
},
|
||||
"generics": "<Output: FixedOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
"generics": "<Output: StaticOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
},
|
||||
"ops::ReduceBitXor": {
|
||||
"data": {
|
||||
|
@ -590,7 +590,7 @@
|
|||
"$constructor": "ops::ReduceBitXor::new_unchecked",
|
||||
"arg": "Visible"
|
||||
},
|
||||
"generics": "<Output: FixedOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
"generics": "<Output: StaticOrDynIntType<1, Signed = ConstBool<false>, CanonicalType = DynUIntType, CanonicalValue = DynUInt>>"
|
||||
},
|
||||
"ops::FieldAccess": {
|
||||
"data": {
|
||||
|
@ -696,7 +696,7 @@
|
|||
"$constructor": "ops::CastClockToBit::new_unchecked",
|
||||
"value": "Visible"
|
||||
},
|
||||
"generics": "<ToType: FixedOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>"
|
||||
"generics": "<ToType: StaticOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>"
|
||||
},
|
||||
"ops::CastSyncResetToBit": {
|
||||
"data": {
|
||||
|
@ -704,7 +704,7 @@
|
|||
"$constructor": "ops::CastSyncResetToBit::new_unchecked",
|
||||
"value": "Visible"
|
||||
},
|
||||
"generics": "<ToType: FixedOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>"
|
||||
"generics": "<ToType: StaticOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>"
|
||||
},
|
||||
"ops::CastAsyncResetToBit": {
|
||||
"data": {
|
||||
|
@ -712,7 +712,7 @@
|
|||
"$constructor": "ops::CastAsyncResetToBit::new_unchecked",
|
||||
"value": "Visible"
|
||||
},
|
||||
"generics": "<ToType: FixedOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>"
|
||||
"generics": "<ToType: StaticOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>"
|
||||
},
|
||||
"ops::CastResetToBit": {
|
||||
"data": {
|
||||
|
@ -720,7 +720,7 @@
|
|||
"$constructor": "ops::CastResetToBit::new_unchecked",
|
||||
"value": "Visible"
|
||||
},
|
||||
"generics": "<ToType: FixedOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>"
|
||||
"generics": "<ToType: StaticOrDynIntType<1, CanonicalType = DynIntType<<ToType as IntTypeTrait>::Signed>, CanonicalValue = DynInt<<ToType as IntTypeTrait>::Signed>>>"
|
||||
},
|
||||
"BlockId": {
|
||||
"data": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue