23 lines
455 B
Rust
23 lines
455 B
Rust
use super::{types::Type, Context};
|
|
|
|
/// an abstract element that performs some kind of computation on inputs
|
|
#[derive(Debug)]
|
|
pub struct Expr<'ty> {
|
|
pub id: u32,
|
|
pub inputs: Vec<Expr<'ty>>,
|
|
pub typ: Type<'ty>,
|
|
}
|
|
|
|
#[derive(Debug)]
|
|
pub struct Signal<'ty> {
|
|
pub id: u32,
|
|
pub typ: Type<'ty>,
|
|
}
|
|
|
|
/// A block of HDL code, e.g. comb block
|
|
#[derive(Debug)]
|
|
pub struct Block<'ty> {
|
|
pub signals: Vec<Signal<'ty>>,
|
|
pub expr: Expr<'ty>,
|
|
}
|