Add XNOR logic device

This commit is contained in:
Nick Gasson 2008-08-05 10:45:01 +01:00
parent 8d7b03576c
commit c849dfeec4
3 changed files with 4 additions and 1 deletions

View File

@ -124,6 +124,8 @@ static vhdl_expr *translate_logic_inputs(vhdl_scope *scope, ivl_net_logic_t log)
return inputs_to_expr(scope, VHDL_BINOP_NOR, log); return inputs_to_expr(scope, VHDL_BINOP_NOR, log);
case IVL_LO_XOR: case IVL_LO_XOR:
return inputs_to_expr(scope, VHDL_BINOP_XOR, log); return inputs_to_expr(scope, VHDL_BINOP_XOR, log);
case IVL_LO_XNOR:
return inputs_to_expr(scope, VHDL_BINOP_XNOR, log);
case IVL_LO_BUF: case IVL_LO_BUF:
case IVL_LO_BUFZ: case IVL_LO_BUFZ:
return nexus_to_var_ref(scope, ivl_logic_pin(log, 1)); return nexus_to_var_ref(scope, ivl_logic_pin(log, 1));

View File

@ -725,7 +725,7 @@ void vhdl_binop_expr::emit(std::ostream &of, int level) const
const char* ops[] = { const char* ops[] = {
"and", "or", "=", "/=", "+", "-", "*", "<", "and", "or", "=", "/=", "+", "-", "*", "<",
">", "<=", ">=", "sll", "srl", "xor", "&", ">", "<=", ">=", "sll", "srl", "xor", "&",
"nand", "nor", NULL "nand", "nor", "xnor", NULL
}; };
of << " " << ops[op_] << " "; of << " " << ops[op_] << " ";

View File

@ -83,6 +83,7 @@ enum vhdl_binop_t {
VHDL_BINOP_CONCAT, VHDL_BINOP_CONCAT,
VHDL_BINOP_NAND, VHDL_BINOP_NAND,
VHDL_BINOP_NOR, VHDL_BINOP_NOR,
VHDL_BINOP_XNOR,
}; };
/* /*