pub enum ChiselExpr {
ULit(u64, u32),
SLit(i64, u32),
BoolLit(bool),
Var(String),
Io(String),
RegField(String),
BinOp(Box<ChiselExpr>, String, Box<ChiselExpr>),
UnOp(String, Box<ChiselExpr>),
Mux(Box<ChiselExpr>, Box<ChiselExpr>, Box<ChiselExpr>),
BitSlice(Box<ChiselExpr>, u32, u32),
Cat(Vec<ChiselExpr>),
MethodCall(Box<ChiselExpr>, String, Vec<ChiselExpr>),
}Expand description
A Chisel hardware expression.
Variants§
ULit(u64, u32)
Integer literal: value.U(width.W)
SLit(i64, u32)
Signed literal: value.S(width.W)
BoolLit(bool)
true.B or false.B
Var(String)
Signal reference
Io(String)
io.name
RegField(String)
reg.name (Register field)
BinOp(Box<ChiselExpr>, String, Box<ChiselExpr>)
Binary operation: lhs op rhs
UnOp(String, Box<ChiselExpr>)
Unary operation: op(operand)
Mux(Box<ChiselExpr>, Box<ChiselExpr>, Box<ChiselExpr>)
Mux: Mux(sel, t, f)
BitSlice(Box<ChiselExpr>, u32, u32)
Bit extraction: expr(hi, lo)
Cat(Vec<ChiselExpr>)
Cat: Cat(a, b, ...)
MethodCall(Box<ChiselExpr>, String, Vec<ChiselExpr>)
Method call: receiver.method(args...)
Trait Implementations§
Source§impl Clone for ChiselExpr
impl Clone for ChiselExpr
Source§fn clone(&self) -> ChiselExpr
fn clone(&self) -> ChiselExpr
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChiselExpr
impl Debug for ChiselExpr
Source§impl Display for ChiselExpr
impl Display for ChiselExpr
Source§impl PartialEq for ChiselExpr
impl PartialEq for ChiselExpr
impl StructuralPartialEq for ChiselExpr
Auto Trait Implementations§
impl Freeze for ChiselExpr
impl RefUnwindSafe for ChiselExpr
impl Send for ChiselExpr
impl Sync for ChiselExpr
impl Unpin for ChiselExpr
impl UnsafeUnpin for ChiselExpr
impl UnwindSafe for ChiselExpr
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more