fix handling of const and size type generics when generating Index impls

This commit is contained in:
Jacob Lifshay 2024-09-19 18:45:04 -07:00
parent 2c1afd1cd6
commit 9887d70f41
Signed by: programmerjake
SSH key fingerprint: SHA256:B1iRVvUJkvd7upMIiMqn6OyxvD2SgJkAH3ZnUOj6z+c
5 changed files with 519 additions and 212 deletions

View file

@ -1,16 +1,22 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
// See Notices.txt for copyright information
use fayalite::{
array::ArrayType,
hdl,
int::{IntType, Size, UInt},
};
use fayalite::prelude::*;
#[hdl(outline_generated)]
pub struct S<T: IntType, Len: Size> {
pub struct S<T, Len: Size, T2> {
pub a: T,
b: UInt<3>,
pub(crate) c: ArrayType<UInt<1>, Len>,
pub d: T2,
}
//#[cfg(todo)]
#[hdl(outline_generated)]
pub struct S3<const LEN: usize, T> {
pub a: T,
b: UInt<3>,
pub(crate) c: Array<UInt<1>, LEN>,
pub d: S<T, ConstUsize<LEN>, ()>,
}
#[hdl(outline_generated)]