From 1b2fa39cdc5c3d5e75380f8aa520e9b55ced3b15 Mon Sep 17 00:00:00 2001 From: Stephen Williams Date: Thu, 25 Jul 2013 20:38:00 -0700 Subject: [PATCH] Add some more basic logic gates to blif target. --- tgt-blif/logic_gate.cc | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/tgt-blif/logic_gate.cc b/tgt-blif/logic_gate.cc index df9bed350..fae00ca75 100644 --- a/tgt-blif/logic_gate.cc +++ b/tgt-blif/logic_gate.cc @@ -59,8 +59,34 @@ int print_logic_gate(FILE*fd, ivl_net_logic_t net) fprintf(fd, "10 1\n"); fprintf(fd, "01 1\n"); break; + + case IVL_LO_NAND: + assert(ivl_logic_pins(net)==3); + fprintf(fd, "0- 1\n"); + fprintf(fd, "-0 1\n"); + break; + case IVL_LO_NOR: + for (unsigned idx = 1 ; idx < ivl_logic_pins(net) ; idx += 1) + fprintf(fd, "0"); + fprintf(fd, " 1\n"); + break; + case IVL_LO_XNOR: + assert(ivl_logic_pins(net)==3); + fprintf(fd, "00 1\n"); + fprintf(fd, "11 1\n"); + break; + + case IVL_LO_BUF: + assert(ivl_logic_pins(net)==2); + fprintf(fd, "1 1\n"); + break; + case IVL_LO_NOT: + assert(ivl_logic_pins(net)==2); + fprintf(fd, "0 1\n"); + break; + default: - fprintf(fd, "# ERROR: Logic type not handled\n"); + fprintf(fd, "# ERROR: Logic type %d not handled\n", ivl_logic_type(net)); rc += 1; break; }