From a84873161f4a2e0665bb24bd77f6a7db69fc3fa0 Mon Sep 17 00:00:00 2001 From: Jordi Baylina Date: Sat, 21 Nov 2020 20:40:11 +0100 Subject: [PATCH] FIX discard unused signals --- src/compiler.js | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/src/compiler.js b/src/compiler.js index 169d294..f7b8066 100644 --- a/src/compiler.js +++ b/src/compiler.js @@ -183,28 +183,36 @@ function classifySignals(ctx) { function priorize(t1, t2) { if ((t1 == ERROR) || (t2==ERROR)) return ERROR; - if (t1 == ctx.stINTERNAL) { - return t2; - } else if (t2==ctx.stINTERNAL) { - return t1; - } if ((t1 == ctx.stONE) || (t2 == ctx.stONE)) return ctx.stONE; if ((t1 == ctx.stOUTPUT) || (t2 == ctx.stOUTPUT)) return ctx.stOUTPUT; + if ((t1 == ctx.stPUBINPUT) || (t2 == ctx.stPUBINPUT)) return ctx.stPUBINPUT; + if ((t1 == ctx.stPRVINPUT) || (t2 == ctx.stPRVINPUT)) return ctx.stPRVINPUT; + if ((t1 == ctx.stINTERNAL) || (t2 == ctx.stINTERNAL)) return ctx.stINTERNAL; if ((t1 == ctx.stCONSTANT) || (t2 == ctx.stCONSTANT)) return ctx.stCONSTANT; if ((t1 == ctx.stDISCARDED) || (t2 == ctx.stDISCARDED)) return ctx.stDISCARDED; if (t1!=t2) return ERROR; return t1; } + for (let i=0; i