Add binary NAND and NOR operators
This commit is contained in:
parent
3f73c9bb54
commit
a26d91557b
|
|
@ -296,6 +296,12 @@ static vhdl_expr *translate_binary(ivl_expr_t e)
|
||||||
case 'a': // Logical AND
|
case 'a': // Logical AND
|
||||||
result = translate_logical(lhs, rhs, VHDL_BINOP_AND);
|
result = translate_logical(lhs, rhs, VHDL_BINOP_AND);
|
||||||
break;
|
break;
|
||||||
|
case 'A': // Bitwise NAND
|
||||||
|
result = translate_numeric(lhs, rhs, VHDL_BINOP_NAND);
|
||||||
|
break;
|
||||||
|
case 'O': // Bitwise NOR
|
||||||
|
result = translate_numeric(lhs, rhs, VHDL_BINOP_NOR);
|
||||||
|
break;
|
||||||
case '|': // Bitwise OR
|
case '|': // Bitwise OR
|
||||||
result = translate_numeric(lhs, rhs, VHDL_BINOP_OR);
|
result = translate_numeric(lhs, rhs, VHDL_BINOP_OR);
|
||||||
break;
|
break;
|
||||||
|
|
|
||||||
|
|
@ -719,7 +719,8 @@ void vhdl_binop_expr::emit(std::ostream &of, int level) const
|
||||||
while (++it != operands_.end()) {
|
while (++it != operands_.end()) {
|
||||||
const char* ops[] = {
|
const char* ops[] = {
|
||||||
"and", "or", "=", "/=", "+", "-", "*", "<",
|
"and", "or", "=", "/=", "+", "-", "*", "<",
|
||||||
">", "<=", ">=", "sll", "srl", "xor", "&"
|
">", "<=", ">=", "sll", "srl", "xor", "&",
|
||||||
|
"nand", "nor", NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
of << " " << ops[op_] << " ";
|
of << " " << ops[op_] << " ";
|
||||||
|
|
|
||||||
|
|
@ -81,6 +81,8 @@ enum vhdl_binop_t {
|
||||||
VHDL_BINOP_SR,
|
VHDL_BINOP_SR,
|
||||||
VHDL_BINOP_XOR,
|
VHDL_BINOP_XOR,
|
||||||
VHDL_BINOP_CONCAT,
|
VHDL_BINOP_CONCAT,
|
||||||
|
VHDL_BINOP_NAND,
|
||||||
|
VHDL_BINOP_NOR,
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue