Enum moore_svlog::mir::RvalueKind [−][src]
pub enum RvalueKind<'a> {
Show 31 variants
CastValueDomain {
from: Domain,
to: Domain,
value: &'a Rvalue<'a>,
},
Transmute(&'a Rvalue<'a>),
CastSign(Sign, &'a Rvalue<'a>),
CastToBool(&'a Rvalue<'a>),
Truncate(usize, &'a Rvalue<'a>),
ZeroExtend(usize, &'a Rvalue<'a>),
SignExtend(usize, &'a Rvalue<'a>),
ConstructArray(HashMap<usize, &'a Rvalue<'a>>),
ConstructStruct(Vec<&'a Rvalue<'a>>),
Const(Value<'a>),
UnaryBitwise {
op: UnaryBitwiseOp,
arg: &'a Rvalue<'a>,
},
BinaryBitwise {
op: BinaryBitwiseOp,
lhs: &'a Rvalue<'a>,
rhs: &'a Rvalue<'a>,
},
IntUnaryArith {
op: IntUnaryArithOp,
sign: Sign,
domain: Domain,
arg: &'a Rvalue<'a>,
},
IntBinaryArith {
op: IntBinaryArithOp,
sign: Sign,
domain: Domain,
lhs: &'a Rvalue<'a>,
rhs: &'a Rvalue<'a>,
},
IntComp {
op: IntCompOp,
sign: Sign,
domain: Domain,
lhs: &'a Rvalue<'a>,
rhs: &'a Rvalue<'a>,
},
Concat(Vec<&'a Rvalue<'a>>),
Repeat(usize, &'a Rvalue<'a>),
Var(NodeId),
Port(NodeId),
Intf(NodeId),
IntfSignal(&'a Rvalue<'a>, NodeId),
Index {
value: &'a Rvalue<'a>,
base: &'a Rvalue<'a>,
length: usize,
},
Member {
value: &'a Rvalue<'a>,
field: usize,
},
Ternary {
cond: &'a Rvalue<'a>,
true_value: &'a Rvalue<'a>,
false_value: &'a Rvalue<'a>,
},
Shift {
op: ShiftOp,
arith: bool,
value: &'a Rvalue<'a>,
amount: &'a Rvalue<'a>,
},
Reduction {
op: BinaryBitwiseOp,
arg: &'a Rvalue<'a>,
},
Assignment {
lvalue: &'a Lvalue<'a>,
rvalue: &'a Rvalue<'a>,
result: &'a Rvalue<'a>,
},
PackString(&'a Rvalue<'a>),
UnpackString(&'a Rvalue<'a>),
StringComp {
op: StringCompOp,
lhs: &'a Rvalue<'a>,
rhs: &'a Rvalue<'a>,
},
Error,
}
Expand description
The different forms an rvalue expression may take.
Variants
A cast from a four-valued type to a two-valued type, or vice versa.
E.g. integer
to int
, or int
to integer
.
Transmute(&'a Rvalue<'a>)
A type cast which does not incur any operation. For example, going from
bit [31:0]
to int
, or vice versa.
Tuple Fields of Transmute
0: &'a Rvalue<'a>
A cast from one sign to another. E.g. logic signed
to
logic unsigned
.
CastToBool(&'a Rvalue<'a>)
A cast from a simple bit type to a boolean.
Tuple Fields of CastToBool
0: &'a Rvalue<'a>
Shrink the width of a vector type. E.g. bit [31:0]
to bit [7:0]
.
Increase the width of a vector by zero extension. E.g. bit [7:0]
to
bit [31:0]
.
Increase the width of a vector by sign extension. E.g. bit signed [7:0]
to bit signed [31:0]
.
Constructor for an array.
Constructor for a struct.
Const(Value<'a>)
A constant value.
Tuple Fields of Const
0: Value<'a>
A unary bitwise operator.
Fields of UnaryBitwise
op: UnaryBitwiseOp
arg: &'a Rvalue<'a>
A binary bitwise operator.
Fields of BinaryBitwise
An integral unary arithmetic operator.
If any bit of the operand is x/z, the entire result is x.
Fields of IntUnaryArith
An integral binary arithmetic operator.
If any bit of the operands are x/z, the entire result is x.
Fields of IntBinaryArith
An integral comparison operator.
If any bit of the operands are x/z, the entire result is x.
Concatenate multiple values.
The values are cast to and treated as packed bit vectors, and the result is yet another packed bit vector. The lowest index corresponds to the left-most item in the concatenation, which is at the MSB end of the final packed bit vector.
Repeat a value multiple times.
The value is cast to and treated as a packed bit vector, and the result is yet another packed bit vector.
Var(NodeId)
A reference to a variable declaration.
Tuple Fields of Var
0: NodeId
Port(NodeId)
A reference to a port declaration.
Tuple Fields of Port
0: NodeId
Intf(NodeId)
A reference to an interface.
Tuple Fields of Intf
0: NodeId
A reference to a locally instantiated interface signal.
A bit- or part-select.
Fields of Index
A struct field access.
The ternary operator.
A shift operation.
A reduction operator.
Fields of Reduction
op: BinaryBitwiseOp
arg: &'a Rvalue<'a>
An assignment operator.
Fields of Assignment
PackString(&'a Rvalue<'a>)
Pack a string value into a fixed-size packed bit vector.
Tuple Fields of PackString
0: &'a Rvalue<'a>
UnpackString(&'a Rvalue<'a>)
Unpack a string value from a fixed-size packed bit vector.
Tuple Fields of UnpackString
0: &'a Rvalue<'a>
A string comparison operator.
Fields of StringComp
An error occurred during lowering.
Implementations
Trait Implementations
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for RvalueKind<'a>
impl<'a> Send for RvalueKind<'a>
impl<'a> Sync for RvalueKind<'a>
impl<'a> Unpin for RvalueKind<'a>
impl<'a> !UnwindSafe for RvalueKind<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more