summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2012-10-10 10:33:40 +0000
committerGravatarGravatar Miodrag Milanovic <mmicko@gmail.com>2012-10-10 10:33:40 +0000
commitc8658c8379665de867f0d1e5412fbfda94933c89 (patch) (github)
treeb69a73cdf07de494c3e44207638f85355e756069
parentdb939b8f51ea5560430ec38852309ba3eaa74dc4 (diff)
downloadmame-c8658c8379665de867f0d1e5412fbfda94933c89.tar.bz2
mame-c8658c8379665de867f0d1e5412fbfda94933c89.zip
Refactored the code in jedutil to support the viewing of a GAL16V8 device
and added a new command line option of "-viewlist" which will print out a list of all the devices that can be viewed in human readable logic equations. Also updated the jedutil regression test to support passing in an additional argument of "debug" to print out a detailed log. Also moved the jedutil regression test data into separate directories composed of the device's name to make things more organized. [Kevin Eshbach]
-rw-r--r--.gitattributes111
-rw-r--r--src/regtests/jedutil/baseline/gal16v8/pal10h8-to-gal16v8.txt32
-rw-r--r--src/regtests/jedutil/baseline/gal16v8/pal10l8-to-gal16v8.txt32
-rw-r--r--src/regtests/jedutil/baseline/gal16v8/pal12h6-to-gal16v8.txt28
-rw-r--r--src/regtests/jedutil/baseline/gal16v8/pal12l6-to-gal16v8.txt28
-rw-r--r--src/regtests/jedutil/baseline/gal16v8/pal14h4-to-gal16v8.txt24
-rw-r--r--src/regtests/jedutil/baseline/gal16v8/pal14l4-to-gal16v8.txt24
-rw-r--r--src/regtests/jedutil/baseline/gal16v8/pal16h2-to-gal16v8.txt20
-rw-r--r--src/regtests/jedutil/baseline/gal16v8/pal16l2-to-gal16v8.txt20
-rw-r--r--src/regtests/jedutil/baseline/gal16v8/pal16l8-to-gal16v8.txt72
-rw-r--r--src/regtests/jedutil/baseline/gal16v8/pal16r4-to-gal16v8.txt76
-rw-r--r--src/regtests/jedutil/baseline/gal16v8/pal16r6-to-gal16v8.txt78
-rw-r--r--src/regtests/jedutil/baseline/gal16v8/pal16r8-to-gal16v8.txt80
-rw-r--r--src/regtests/jedutil/baseline/pal10h8/pal10h8.txt (renamed from src/regtests/jedutil/baseline/pal10h8.txt)1
-rw-r--r--src/regtests/jedutil/baseline/pal10l8/pal10l8.txt (renamed from src/regtests/jedutil/baseline/pal10l8.txt)1
-rw-r--r--src/regtests/jedutil/baseline/pal12h6/pal12h6.txt (renamed from src/regtests/jedutil/baseline/pal12h6.txt)1
-rw-r--r--src/regtests/jedutil/baseline/pal12l6/pal12l6.txt (renamed from src/regtests/jedutil/baseline/pal12l6.txt)1
-rw-r--r--src/regtests/jedutil/baseline/pal14h4/pal14h4.txt (renamed from src/regtests/jedutil/baseline/pal14h4.txt)1
-rw-r--r--src/regtests/jedutil/baseline/pal14l4/pal14l4.txt (renamed from src/regtests/jedutil/baseline/pal14l4.txt)1
-rw-r--r--src/regtests/jedutil/baseline/pal16c1/pal16c1.txt36
-rw-r--r--src/regtests/jedutil/baseline/pal16h2/pal16h2.txt (renamed from src/regtests/jedutil/baseline/pal16h2.txt)1
-rw-r--r--src/regtests/jedutil/baseline/pal16l2/pal16l2.txt (renamed from src/regtests/jedutil/baseline/pal16l2.txt)1
-rw-r--r--src/regtests/jedutil/baseline/pal16l8/pal16l8.txt (renamed from src/regtests/jedutil/baseline/pal16l8.txt)1
-rw-r--r--src/regtests/jedutil/baseline/pal16r4/pal16r4.txt76
-rw-r--r--src/regtests/jedutil/baseline/pal16r6/pal16r6.txt78
-rw-r--r--src/regtests/jedutil/baseline/pal16r8/pal16r8.txt80
-rw-r--r--src/regtests/jedutil/baseline/pal20l10/pal20l10.txt (renamed from src/regtests/jedutil/baseline/pal20l10.txt)1
-rw-r--r--src/regtests/jedutil/baseline/pal20l8/pal20l8.txt (renamed from src/regtests/jedutil/baseline/pal20l8.txt)1
-rw-r--r--src/regtests/jedutil/baseline/pal20r4/pal20r4.txt76
-rw-r--r--src/regtests/jedutil/baseline/pal20r6/pal20r6.txt78
-rw-r--r--src/regtests/jedutil/baseline/pal20r8/pal20r8.txt80
-rw-r--r--src/regtests/jedutil/eqns/pal10h8/pal10h8.eqn (renamed from src/regtests/jedutil/eqns/pal10h8.eqn)0
-rw-r--r--src/regtests/jedutil/eqns/pal10l8/pal10l8.eqn (renamed from src/regtests/jedutil/eqns/pal10l8.eqn)0
-rw-r--r--src/regtests/jedutil/eqns/pal12h6/pal12h6.eqn (renamed from src/regtests/jedutil/eqns/pal12h6.eqn)0
-rw-r--r--src/regtests/jedutil/eqns/pal12l6/pal12l6.eqn (renamed from src/regtests/jedutil/eqns/pal12l6.eqn)0
-rw-r--r--src/regtests/jedutil/eqns/pal14h4/pal14h4.eqn (renamed from src/regtests/jedutil/eqns/pal14h4.eqn)0
-rw-r--r--src/regtests/jedutil/eqns/pal14l4/pal14l4.eqn (renamed from src/regtests/jedutil/eqns/pal14l4.eqn)0
-rw-r--r--src/regtests/jedutil/eqns/pal16c1/pal16c1.eqn23
-rw-r--r--src/regtests/jedutil/eqns/pal16h2/pal16h2.eqn (renamed from src/regtests/jedutil/eqns/pal16h2.eqn)0
-rw-r--r--src/regtests/jedutil/eqns/pal16l2/pal16l2.eqn (renamed from src/regtests/jedutil/eqns/pal16l2.eqn)0
-rw-r--r--src/regtests/jedutil/eqns/pal16l8/pal16l8.eqn (renamed from src/regtests/jedutil/eqns/pal16l8.eqn)0
-rw-r--r--src/regtests/jedutil/eqns/pal16r4/pal16r4.eqn82
-rw-r--r--src/regtests/jedutil/eqns/pal16r6/pal16r6.eqn84
-rw-r--r--src/regtests/jedutil/eqns/pal16r8/pal16r8.eqn86
-rw-r--r--src/regtests/jedutil/eqns/pal20l10/pal20l10.eqn (renamed from src/regtests/jedutil/eqns/pal20l10.eqn)0
-rw-r--r--src/regtests/jedutil/eqns/pal20l8/pal20l8.eqn (renamed from src/regtests/jedutil/eqns/pal20l8.eqn)0
-rw-r--r--src/regtests/jedutil/eqns/pal20r4/pal20r4.eqn82
-rw-r--r--src/regtests/jedutil/eqns/pal20r6/pal20r6.eqn84
-rw-r--r--src/regtests/jedutil/eqns/pal20r8/pal20r8.eqn86
-rw-r--r--src/regtests/jedutil/jeds/gal16v8/pal10h8-to-gal16v8.jed106
-rw-r--r--src/regtests/jedutil/jeds/gal16v8/pal10l8-to-gal16v8.jed106
-rw-r--r--src/regtests/jedutil/jeds/gal16v8/pal12h6-to-gal16v8.jed106
-rw-r--r--src/regtests/jedutil/jeds/gal16v8/pal12l6-to-gal16v8.jed106
-rw-r--r--src/regtests/jedutil/jeds/gal16v8/pal14h4-to-gal16v8.jed106
-rw-r--r--src/regtests/jedutil/jeds/gal16v8/pal14l4-to-gal16v8.jed106
-rw-r--r--src/regtests/jedutil/jeds/gal16v8/pal16h2-to-gal16v8.jed106
-rw-r--r--src/regtests/jedutil/jeds/gal16v8/pal16l2-to-gal16v8.jed106
-rw-r--r--src/regtests/jedutil/jeds/gal16v8/pal16l8-to-gal16v8.jed107
-rw-r--r--src/regtests/jedutil/jeds/gal16v8/pal16r4-to-gal16v8.jed106
-rw-r--r--src/regtests/jedutil/jeds/gal16v8/pal16r6-to-gal16v8.jed106
-rw-r--r--src/regtests/jedutil/jeds/gal16v8/pal16r8-to-gal16v8.jed106
-rw-r--r--src/regtests/jedutil/jeds/pal10h8/pal10h8.jed (renamed from src/regtests/jedutil/jeds/pal10h8.jed)0
-rw-r--r--src/regtests/jedutil/jeds/pal10l8/pal10l8.jed (renamed from src/regtests/jedutil/jeds/pal10l8.jed)0
-rw-r--r--src/regtests/jedutil/jeds/pal12h6/pal12h6.jed (renamed from src/regtests/jedutil/jeds/pal12h6.jed)0
-rw-r--r--src/regtests/jedutil/jeds/pal12l6/pal12l6.jed (renamed from src/regtests/jedutil/jeds/pal12l6.jed)0
-rw-r--r--src/regtests/jedutil/jeds/pal14h4/pal14h4.jed (renamed from src/regtests/jedutil/jeds/pal14h4.jed)0
-rw-r--r--src/regtests/jedutil/jeds/pal14l4/pal14l4.jed (renamed from src/regtests/jedutil/jeds/pal14l4.jed)0
-rw-r--r--src/regtests/jedutil/jeds/pal16c1/pal16c1.jed29
-rw-r--r--src/regtests/jedutil/jeds/pal16h2/pal16h2.jed (renamed from src/regtests/jedutil/jeds/pal16h2.jed)0
-rw-r--r--src/regtests/jedutil/jeds/pal16l2/pal16l2.jed (renamed from src/regtests/jedutil/jeds/pal16l2.jed)0
-rw-r--r--src/regtests/jedutil/jeds/pal16l8/pal16l8.jed (renamed from src/regtests/jedutil/jeds/pal16l8.jed)0
-rw-r--r--src/regtests/jedutil/jeds/pal16r4/pal16r4.jed84
-rw-r--r--src/regtests/jedutil/jeds/pal16r6/pal16r6.jed84
-rw-r--r--src/regtests/jedutil/jeds/pal16r8/pal16r8.jed84
-rw-r--r--src/regtests/jedutil/jeds/pal20l10/pal20l10.jed (renamed from src/regtests/jedutil/jeds/pal20l10.jed)0
-rw-r--r--src/regtests/jedutil/jeds/pal20l8/pal20l8.jed (renamed from src/regtests/jedutil/jeds/pal20l8.jed)0
-rw-r--r--src/regtests/jedutil/jeds/pal20r4/pal20r4.jed84
-rw-r--r--src/regtests/jedutil/jeds/pal20r6/pal20r6.jed84
-rw-r--r--src/regtests/jedutil/jeds/pal20r8/pal20r8.jed84
-rw-r--r--src/regtests/jedutil/jedtest.wsf250
-rw-r--r--src/tools/jedutil.c1775
81 files changed, 5035 insertions, 463 deletions
diff --git a/.gitattributes b/.gitattributes
index 014f096732d..7fca1b1e0b1 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -7728,40 +7728,85 @@ src/osd/windows/winutf8.h svneol=native#text/plain
src/osd/windows/winutil.c svneol=native#text/plain
src/osd/windows/winutil.h svneol=native#text/plain
src/osd/windows/winwork.c svneol=native#text/plain
-src/regtests/jedutil/baseline/pal10h8.txt svneol=native#text/plain
-src/regtests/jedutil/baseline/pal10l8.txt svneol=native#text/plain
-src/regtests/jedutil/baseline/pal12h6.txt svneol=native#text/plain
-src/regtests/jedutil/baseline/pal12l6.txt svneol=native#text/plain
-src/regtests/jedutil/baseline/pal14h4.txt svneol=native#text/plain
-src/regtests/jedutil/baseline/pal14l4.txt svneol=native#text/plain
-src/regtests/jedutil/baseline/pal16h2.txt svneol=native#text/plain
-src/regtests/jedutil/baseline/pal16l2.txt svneol=native#text/plain
-src/regtests/jedutil/baseline/pal16l8.txt svneol=native#text/plain
-src/regtests/jedutil/baseline/pal20l10.txt svneol=native#text/plain
-src/regtests/jedutil/baseline/pal20l8.txt svneol=native#text/plain
-src/regtests/jedutil/eqns/pal10h8.eqn svneol=native#text/plain
-src/regtests/jedutil/eqns/pal10l8.eqn svneol=native#text/plain
-src/regtests/jedutil/eqns/pal12h6.eqn svneol=native#text/plain
-src/regtests/jedutil/eqns/pal12l6.eqn svneol=native#text/plain
-src/regtests/jedutil/eqns/pal14h4.eqn svneol=native#text/plain
-src/regtests/jedutil/eqns/pal14l4.eqn svneol=native#text/plain
-src/regtests/jedutil/eqns/pal16h2.eqn svneol=native#text/plain
-src/regtests/jedutil/eqns/pal16l2.eqn svneol=native#text/plain
-src/regtests/jedutil/eqns/pal16l8.eqn svneol=native#text/plain
-src/regtests/jedutil/eqns/pal20l10.eqn svneol=native#text/plain
-src/regtests/jedutil/eqns/pal20l8.eqn svneol=native#text/plain
+src/regtests/jedutil/baseline/gal16v8/pal10h8-to-gal16v8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/gal16v8/pal10l8-to-gal16v8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/gal16v8/pal12h6-to-gal16v8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/gal16v8/pal12l6-to-gal16v8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/gal16v8/pal14h4-to-gal16v8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/gal16v8/pal14l4-to-gal16v8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/gal16v8/pal16h2-to-gal16v8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/gal16v8/pal16l2-to-gal16v8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/gal16v8/pal16l8-to-gal16v8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/gal16v8/pal16r4-to-gal16v8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/gal16v8/pal16r6-to-gal16v8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/gal16v8/pal16r8-to-gal16v8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal10h8/pal10h8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal10l8/pal10l8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal12h6/pal12h6.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal12l6/pal12l6.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal14h4/pal14h4.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal14l4/pal14l4.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal16c1/pal16c1.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal16h2/pal16h2.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal16l2/pal16l2.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal16l8/pal16l8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal16r4/pal16r4.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal16r6/pal16r6.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal16r8/pal16r8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal20l10/pal20l10.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal20l8/pal20l8.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal20r4/pal20r4.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal20r6/pal20r6.txt svneol=native#text/plain
+src/regtests/jedutil/baseline/pal20r8/pal20r8.txt svneol=native#text/plain
+src/regtests/jedutil/eqns/pal10h8/pal10h8.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal10l8/pal10l8.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal12h6/pal12h6.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal12l6/pal12l6.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal14h4/pal14h4.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal14l4/pal14l4.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal16c1/pal16c1.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal16h2/pal16h2.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal16l2/pal16l2.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal16l8/pal16l8.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal16r4/pal16r4.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal16r6/pal16r6.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal16r8/pal16r8.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal20l10/pal20l10.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal20l8/pal20l8.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal20r4/pal20r4.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal20r6/pal20r6.eqn svneol=native#text/plain
+src/regtests/jedutil/eqns/pal20r8/pal20r8.eqn svneol=native#text/plain
src/regtests/jedutil/eqns/readme.txt svneol=native#text/plain
-src/regtests/jedutil/jeds/pal10h8.jed svneol=native#text/plain
-src/regtests/jedutil/jeds/pal10l8.jed svneol=native#text/plain
-src/regtests/jedutil/jeds/pal12h6.jed svneol=native#text/plain
-src/regtests/jedutil/jeds/pal12l6.jed svneol=native#text/plain
-src/regtests/jedutil/jeds/pal14h4.jed svneol=native#text/plain
-src/regtests/jedutil/jeds/pal14l4.jed svneol=native#text/plain
-src/regtests/jedutil/jeds/pal16h2.jed svneol=native#text/plain
-src/regtests/jedutil/jeds/pal16l2.jed svneol=native#text/plain
-src/regtests/jedutil/jeds/pal16l8.jed svneol=native#text/plain
-src/regtests/jedutil/jeds/pal20l10.jed svneol=native#text/plain
-src/regtests/jedutil/jeds/pal20l8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/gal16v8/pal10h8-to-gal16v8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/gal16v8/pal10l8-to-gal16v8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/gal16v8/pal12h6-to-gal16v8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/gal16v8/pal12l6-to-gal16v8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/gal16v8/pal14h4-to-gal16v8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/gal16v8/pal14l4-to-gal16v8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/gal16v8/pal16h2-to-gal16v8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/gal16v8/pal16l2-to-gal16v8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/gal16v8/pal16l8-to-gal16v8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/gal16v8/pal16r4-to-gal16v8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/gal16v8/pal16r6-to-gal16v8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/gal16v8/pal16r8-to-gal16v8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal10h8/pal10h8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal10l8/pal10l8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal12h6/pal12h6.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal12l6/pal12l6.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal14h4/pal14h4.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal14l4/pal14l4.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal16c1/pal16c1.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal16h2/pal16h2.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal16l2/pal16l2.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal16l8/pal16l8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal16r4/pal16r4.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal16r6/pal16r6.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal16r8/pal16r8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal20l10/pal20l10.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal20l8/pal20l8.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal20r4/pal20r4.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal20r6/pal20r6.jed svneol=native#text/plain
+src/regtests/jedutil/jeds/pal20r8/pal20r8.jed svneol=native#text/plain
src/regtests/jedutil/jedtest.wsf svneol=native#text/plain
src/tools/chdman.c svneol=native#text/plain
src/tools/jedutil.c svneol=native#text/plain
diff --git a/src/regtests/jedutil/baseline/gal16v8/pal10h8-to-gal16v8.txt b/src/regtests/jedutil/baseline/gal16v8/pal10h8-to-gal16v8.txt
new file mode 100644
index 00000000000..ee5a96c35dc
--- /dev/null
+++ b/src/regtests/jedutil/baseline/gal16v8/pal10h8-to-gal16v8.txt
@@ -0,0 +1,32 @@
+o12 = /i1 & i2 & i3 & i4 & i5 & i6 & i7 & i8 +
+ i9 & i11
+o12.oe = vcc
+
+o13 = i1 & /i2 & i3 & i4 & i5 & i6 & i7 & i8 +
+ /i9 & i11
+o13.oe = vcc
+
+o14 = i1 & i2 & /i3 & i4 & i5 & i6 & i7 & i8 +
+ i9 & /i11
+o14.oe = vcc
+
+o15 = i1 & i2 & i3 & /i4 & i5 & i6 & i7 & i8 +
+ /i9 & /i11
+o15.oe = vcc
+
+o16 = i1 & i2 & i3 & i4 & /i5 & i6 & i7 & i8 +
+ /i9 & /i11
+o16.oe = vcc
+
+o17 = i1 & i2 & i3 & i4 & i5 & /i6 & i7 & i8 +
+ i9 & /i11
+o17.oe = vcc
+
+o18 = i1 & i2 & i3 & i4 & i5 & i6 & /i7 & i8 +
+ /i9 & i11
+o18.oe = vcc
+
+o19 = i1 & i2 & i3 & i4 & i5 & i6 & i7 & /i8 +
+ i11
+o19.oe = vcc
+
diff --git a/src/regtests/jedutil/baseline/gal16v8/pal10l8-to-gal16v8.txt b/src/regtests/jedutil/baseline/gal16v8/pal10l8-to-gal16v8.txt
new file mode 100644
index 00000000000..eb5b456f150
--- /dev/null
+++ b/src/regtests/jedutil/baseline/gal16v8/pal10l8-to-gal16v8.txt
@@ -0,0 +1,32 @@
+/o12 = /i1 & i2 & i3 & i4 & i5 & i6 & i7 & i8 +
+ i9 & i11
+o12.oe = vcc
+
+/o13 = i1 & /i2 & i3 & i4 & i5 & i6 & i7 & i8 +
+ /i9 & i11
+o13.oe = vcc
+
+/o14 = i1 & i2 & /i3 & i4 & i5 & i6 & i7 & i8 +
+ i9 & /i11
+o14.oe = vcc
+
+/o15 = i1 & i2 & i3 & /i4 & i5 & i6 & i7 & i8 +
+ /i9 & /i11
+o15.oe = vcc
+
+/o16 = i1 & i2 & i3 & i4 & /i5 & i6 & i7 & i8 +
+ /i9 & /i11
+o16.oe = vcc
+
+/o17 = i1 & i2 & i3 & i4 & i5 & /i6 & i7 & i8 +
+ i9 & /i11
+o17.oe = vcc
+
+/o18 = i1 & i2 & i3 & i4 & i5 & i6 & /i7 & i8 +
+ i11
+o18.oe = vcc
+
+/o19 = i1 & i2 & i3 & i4 & i5 & i6 & i7 & /i8 +
+ /i9
+o19.oe = vcc
+
diff --git a/src/regtests/jedutil/baseline/gal16v8/pal12h6-to-gal16v8.txt b/src/regtests/jedutil/baseline/gal16v8/pal12h6-to-gal16v8.txt
new file mode 100644
index 00000000000..35bc596f5f8
--- /dev/null
+++ b/src/regtests/jedutil/baseline/gal16v8/pal12h6-to-gal16v8.txt
@@ -0,0 +1,28 @@
+o13 = /i1 & i2 & i3 & i4 & i5 & i6 & i7 & i8 +
+ i9 & i11 +
+ /i19 +
+ i12
+o13.oe = vcc
+
+o14 = i1 & /i2 & i3 & i4 & i5 & i6 & i7 & i8 +
+ /i9 & i11
+o14.oe = vcc
+
+o15 = i1 & i2 & i3 & /i4 & i5 & i6 & i7 & i8 +
+ /i9 & /i11
+o15.oe = vcc
+
+o16 = i1 & i2 & i3 & i4 & i5 & i6 & /i7 & i8 +
+ i9 & /i11
+o16.oe = vcc
+
+o17 = i1 & i2 & i3 & i4 & /i5 & i6 & i7 & i8 +
+ /i9 & /i11
+o17.oe = vcc
+
+o18 = i1 & i2 & i3 & i4 & i5 & /i6 & i7 & i8 +
+ /i9 & i11 +
+ i19 +
+ /i12
+o18.oe = vcc
+
diff --git a/src/regtests/jedutil/baseline/gal16v8/pal12l6-to-gal16v8.txt b/src/regtests/jedutil/baseline/gal16v8/pal12l6-to-gal16v8.txt
new file mode 100644
index 00000000000..361c3178972
--- /dev/null
+++ b/src/regtests/jedutil/baseline/gal16v8/pal12l6-to-gal16v8.txt
@@ -0,0 +1,28 @@
+/o13 = /i1 & i2 & i3 & i4 & i5 & i6 & i7 & i8 +
+ i9 & i11 +
+ /i19 +
+ i12
+o13.oe = vcc
+
+/o14 = i1 & /i2 & i3 & i4 & i5 & i6 & i7 & i8 +
+ /i9 & i11
+o14.oe = vcc
+
+/o15 = i1 & i2 & /i3 & i4 & i5 & i6 & i7 & i8 +
+ i9 & i11
+o15.oe = vcc
+
+/o16 = i1 & i2 & i3 & /i4 & i5 & i6 & i7 & i8 +
+ /i9 & /i11
+o16.oe = vcc
+
+/o17 = i1 & i2 & i3 & i4 & /i5 & i6 & i7 & i8 +
+ /i9 & /i11
+o17.oe = vcc
+
+/o18 = i1 & i2 & i3 & i4 & i5 & /i6 & i7 & i8 +
+ /i9 & i11 +
+ i19 +
+ /i12
+o18.oe = vcc
+
diff --git a/src/regtests/jedutil/baseline/gal16v8/pal14h4-to-gal16v8.txt b/src/regtests/jedutil/baseline/gal16v8/pal14h4-to-gal16v8.txt
new file mode 100644
index 00000000000..52ce0d9bfc2
--- /dev/null
+++ b/src/regtests/jedutil/baseline/gal16v8/pal14h4-to-gal16v8.txt
@@ -0,0 +1,24 @@
+o14 = /i1 & i2 & i3 & i4 & i5 & i6 & i7 & i8 +
+ i9 & i11 +
+ /i12 & /i13 +
+ i18 & /i19
+o14.oe = vcc
+
+o15 = i1 & /i2 & i3 & i4 & i5 & i6 & i7 & i8 +
+ i9 & /i11 +
+ i12 & i13 +
+ /i18 & i19
+o15.oe = vcc
+
+o16 = i1 & i2 & /i3 & i4 & i5 & i6 & i7 & i8 +
+ /i9 & i11 +
+ i12 & /i13 +
+ /i18 & /i19
+o16.oe = vcc
+
+o17 = i1 & i2 & i3 & /i4 & i5 & i6 & i7 & i8 +
+ i9 & i11 +
+ /i12 & i13 +
+ i18 & i19
+o17.oe = vcc
+
diff --git a/src/regtests/jedutil/baseline/gal16v8/pal14l4-to-gal16v8.txt b/src/regtests/jedutil/baseline/gal16v8/pal14l4-to-gal16v8.txt
new file mode 100644
index 00000000000..c17cae37706
--- /dev/null
+++ b/src/regtests/jedutil/baseline/gal16v8/pal14l4-to-gal16v8.txt
@@ -0,0 +1,24 @@
+/o14 = i1 & /i2 & i3 & i4 & i5 & i6 & i7 & i8 +
+ /i9 & i11 +
+ i12 & /i13 +
+ i18 & i19
+o14.oe = vcc
+
+/o15 = i1 & i2 & i3 & /i4 & i5 & i6 & i7 & i8 +
+ /i9 & /i11 +
+ /i12 & i13 +
+ /i18 & i19
+o15.oe = vcc
+
+/o16 = i1 & i2 & i3 & i4 & /i5 & i6 & i7 & i8 +
+ /i9 & /i11 +
+ i12 & i13 +
+ i18 & /i19
+o16.oe = vcc
+
+/o17 = i1 & i2 & i3 & i4 & i5 & /i6 & i7 & i8 +
+ /i9 & i11 +
+ /i12 & /i13 +
+ /i18 & /i19
+o17.oe = vcc
+
diff --git a/src/regtests/jedutil/baseline/gal16v8/pal16h2-to-gal16v8.txt b/src/regtests/jedutil/baseline/gal16v8/pal16h2-to-gal16v8.txt
new file mode 100644
index 00000000000..61cbfcbbeac
--- /dev/null
+++ b/src/regtests/jedutil/baseline/gal16v8/pal16h2-to-gal16v8.txt
@@ -0,0 +1,20 @@
+o15 = i1 & i2 & i3 & /i4 & i5 & /i6 & i7 & i8 +
+ i9 +
+ /i11 +
+ i12 +
+ /i13 +
+ i14 +
+ /i17 +
+ i18 & /i19
+o15.oe = vcc
+
+o16 = i1 & i2 & /i3 & i4 & /i5 & i6 & i7 & i8 +
+ /i9 +
+ i11 +
+ /i12 +
+ i13 +
+ /i14 +
+ i17 +
+ /i18 & i19
+o16.oe = vcc
+
diff --git a/src/regtests/jedutil/baseline/gal16v8/pal16l2-to-gal16v8.txt b/src/regtests/jedutil/baseline/gal16v8/pal16l2-to-gal16v8.txt
new file mode 100644
index 00000000000..26c0052e20b
--- /dev/null
+++ b/src/regtests/jedutil/baseline/gal16v8/pal16l2-to-gal16v8.txt
@@ -0,0 +1,20 @@
+/o15 = i1 & i2 & i3 & /i4 & i5 & i6 & i7 & i8 +
+ /i9 +
+ /i11 +
+ /i12 +
+ i13 +
+ i14 +
+ i17 +
+ i18 & i19
+o15.oe = vcc
+
+/o16 = i1 & i2 & i3 & i4 & i5 & i6 & /i7 & i8 +
+ i9 +
+ i11 +
+ i12 +
+ /i13 +
+ /i14 +
+ /i17 +
+ /i18 & /i19
+o16.oe = vcc
+
diff --git a/src/regtests/jedutil/baseline/gal16v8/pal16l8-to-gal16v8.txt b/src/regtests/jedutil/baseline/gal16v8/pal16l8-to-gal16v8.txt
new file mode 100644
index 00000000000..c6cf49bc84d
--- /dev/null
+++ b/src/regtests/jedutil/baseline/gal16v8/pal16l8-to-gal16v8.txt
@@ -0,0 +1,72 @@
+/o12 = i3 & i7 & /i9 +
+ i1 & o13 +
+ i3 +
+ /i6 +
+ i8 +
+ /i9 +
+ i7 & /o13
+o12.oe = vcc
+
+/o13 = i11 & /o14 +
+ /i9 +
+ i8 +
+ /i7 +
+ /i6 & o14 +
+ i5 +
+ i4
+o13.oe = i2 & o14
+
+/o14 = i1 & /o15 +
+ /i8 +
+ i1 & /i8 +
+ i1 & /i2 & /o15 +
+ /i2 +
+ i2 & /i8 & o15 +
+ i3
+o14.oe = vcc
+
+/o15 = i3 & i6 & i7 & /i11 +
+ i6 & o16 +
+ i3 & /o16 +
+ i7 +
+ /i11 +
+ i6 & i7 +
+ i7 & /i11
+o15.oe = vcc
+
+/o16 = /i3 & /o17 +
+ /i4 & /i11 +
+ /i3 & /i4 +
+ /i3 & i4 +
+ /i7 & o17 +
+ /i7 & /i11 +
+ i4
+o16.oe = vcc
+
+/o17 = i2 & i5 & i6 & /i7 +
+ i2 & /o18 +
+ i5 +
+ i6 +
+ /i7 & o18 +
+ i2 & /i7 +
+ i5 & i6
+o17.oe = /o16
+
+/o18 = /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 & i11 +
+ i3 +
+ /i2 & /i7 +
+ i3 & i11 +
+ i5 & i6 & /i7 +
+ i7 & i11
+o18.oe = vcc
+
+/o19 = i5 & i6 & /i7 & i11 +
+ i3 & i6 & i7 +
+ i5 +
+ i6 +
+ i7 +
+ i11 +
+ /i7
+o19.oe = vcc
+
diff --git a/src/regtests/jedutil/baseline/gal16v8/pal16r4-to-gal16v8.txt b/src/regtests/jedutil/baseline/gal16v8/pal16r4-to-gal16v8.txt
new file mode 100644
index 00000000000..601701c2d4d
--- /dev/null
+++ b/src/regtests/jedutil/baseline/gal16v8/pal16r4-to-gal16v8.txt
@@ -0,0 +1,76 @@
+/o12 = /i2 & /i3 +
+ i4 & o13 +
+ i3 +
+ /i6 +
+ i8 +
+ /i9 +
+ i7 & /o13
+o12.oe = rf14
+
+/o13 = /rf14 +
+ /i9 +
+ i8 +
+ /i7 +
+ /i6 & /rf14 +
+ i5 +
+ i4
+o13.oe = i2 & rf14
+
+/rf14 := /rf15 +
+ /i8 +
+ i8 +
+ /i2 & /rf15 +
+ /i2 +
+ i2 & /i8 & rf15 +
+ /i4 +
+ i3
+rf14.oe = OE
+
+/rf15 := i3 & i6 & i7 +
+ i6 & rf16 +
+ i3 & /rf16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7 +
+ /i2 & /i7
+rf15.oe = OE
+
+/rf16 := /i3 & /rf17 +
+ /i4 +
+ /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4 +
+ i2 & i3
+rf16.oe = OE
+
+/rf17 := i2 & i5 & i6 & /i7 +
+ i2 & /o18 +
+ i5 +
+ i6 +
+ /i7 & o18 +
+ i2 & /i7 +
+ i5 & i6 +
+ /i3
+rf17.oe = OE
+
+/o18 = /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 +
+ /i2 & /i7 +
+ /i3 +
+ i5 & i6 & /i7 +
+ i7
+o18.oe = vcc
+
+/o19 = i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 +
+ i6 +
+ i7 +
+ /i4 +
+ /i7
+o19.oe = vcc
+
diff --git a/src/regtests/jedutil/baseline/gal16v8/pal16r6-to-gal16v8.txt b/src/regtests/jedutil/baseline/gal16v8/pal16r6-to-gal16v8.txt
new file mode 100644
index 00000000000..15c0373dbdf
--- /dev/null
+++ b/src/regtests/jedutil/baseline/gal16v8/pal16r6-to-gal16v8.txt
@@ -0,0 +1,78 @@
+/o12 = /i2 & /i3 +
+ i4 & rf13 +
+ i3 +
+ /i6 +
+ i8 +
+ /i9 +
+ i7 & /rf13
+o12.oe = rf14
+
+/rf13 := /rf14 +
+ /i9 +
+ i8 +
+ /i7 +
+ /i6 & /rf14 +
+ i5 & rf14 +
+ i4 +
+ /i2
+rf13.oe = OE
+
+/rf14 := /rf15 +
+ /i8 +
+ i8 +
+ /i2 & /rf15 +
+ /i2 +
+ i2 & /i8 & rf15 +
+ /i4 +
+ i3
+rf14.oe = OE
+
+/rf15 := i3 & i6 & i7 +
+ i6 & rf16 +
+ i3 & /rf16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7 +
+ /i2 & /i7
+rf15.oe = OE
+
+/rf16 := /i3 & /rf17 +
+ /i4 +
+ /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4 +
+ i2 & i3
+rf16.oe = OE
+
+/rf17 := i2 & i5 & i6 & /i7 +
+ i2 & /rf18 +
+ i5 +
+ i6 +
+ /i7 & rf18 +
+ i2 & /i7 +
+ i5 & i6 +
+ /i3
+rf17.oe = OE
+
+/rf18 := /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 +
+ /i2 & /i7 +
+ /i3 +
+ i5 & i6 & /i7 +
+ i7 +
+ i4
+rf18.oe = OE
+
+/o19 = i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 +
+ i6 +
+ i7 +
+ /i4 +
+ /i7
+o19.oe = vcc
+
diff --git a/src/regtests/jedutil/baseline/gal16v8/pal16r8-to-gal16v8.txt b/src/regtests/jedutil/baseline/gal16v8/pal16r8-to-gal16v8.txt
new file mode 100644
index 00000000000..0e6570d3a63
--- /dev/null
+++ b/src/regtests/jedutil/baseline/gal16v8/pal16r8-to-gal16v8.txt
@@ -0,0 +1,80 @@
+/rf12 := /i2 & /i3 +
+ i4 & rf13 +
+ i3 +
+ /i6 +
+ i8 +
+ /i9 +
+ i7 & /rf13 +
+ i5
+rf12.oe = OE
+
+/rf13 := /rf14 +
+ /i9 +
+ i8 +
+ /i7 +
+ /i6 & rf14 +
+ i5 +
+ i4 +
+ /i3
+rf13.oe = OE
+
+/rf14 := /rf15 +
+ /i8 +
+ i8 +
+ /i2 & /rf15 +
+ /i2 +
+ i2 & /i8 & rf15 +
+ /i4 +
+ i3
+rf14.oe = OE
+
+/rf15 := i3 & i6 & i7 +
+ i6 & rf16 +
+ i3 & /rf16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7 +
+ /i2 & /i7
+rf15.oe = OE
+
+/rf16 := /i3 & /rf17 +
+ /i4 +
+ /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4 +
+ i2 & i3
+rf16.oe = OE
+
+/rf17 := i2 & i5 & i6 & /i7 +
+ i2 & /rf18 +
+ i5 +
+ i6 +
+ /i7 & rf18 +
+ i2 & /i7 +
+ i5 & i6 +
+ /i3
+rf17.oe = OE
+
+/rf18 := /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 & rf19 +
+ /i2 & /i7 +
+ /i3 & /rf19 +
+ i5 & i6 & /i7 +
+ i7 +
+ /i4
+rf18.oe = OE
+
+/rf19 := i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 & rf12 +
+ i6 +
+ i7 +
+ /i4 & /rf12 +
+ /i7 +
+ i2
+rf19.oe = OE
+
diff --git a/src/regtests/jedutil/baseline/pal10h8.txt b/src/regtests/jedutil/baseline/pal10h8/pal10h8.txt
index 25e7c611d65..ee5a96c35dc 100644
--- a/src/regtests/jedutil/baseline/pal10h8.txt
+++ b/src/regtests/jedutil/baseline/pal10h8/pal10h8.txt
@@ -30,4 +30,3 @@ o19 = i1 & i2 & i3 & i4 & i5 & i6 & i7 & /i8 +
i11
o19.oe = vcc
-
diff --git a/src/regtests/jedutil/baseline/pal10l8.txt b/src/regtests/jedutil/baseline/pal10l8/pal10l8.txt
index 74a47cfe5c0..eb5b456f150 100644
--- a/src/regtests/jedutil/baseline/pal10l8.txt
+++ b/src/regtests/jedutil/baseline/pal10l8/pal10l8.txt
@@ -30,4 +30,3 @@ o18.oe = vcc
/i9
o19.oe = vcc
-
diff --git a/src/regtests/jedutil/baseline/pal12h6.txt b/src/regtests/jedutil/baseline/pal12h6/pal12h6.txt
index 3ba3b54cc6c..35bc596f5f8 100644
--- a/src/regtests/jedutil/baseline/pal12h6.txt
+++ b/src/regtests/jedutil/baseline/pal12h6/pal12h6.txt
@@ -26,4 +26,3 @@ o18 = i1 & i2 & i3 & i4 & i5 & /i6 & i7 & i8 +
/i12
o18.oe = vcc
-
diff --git a/src/regtests/jedutil/baseline/pal12l6.txt b/src/regtests/jedutil/baseline/pal12l6/pal12l6.txt
index 1ad002f171b..361c3178972 100644
--- a/src/regtests/jedutil/baseline/pal12l6.txt
+++ b/src/regtests/jedutil/baseline/pal12l6/pal12l6.txt
@@ -26,4 +26,3 @@ o17.oe = vcc
/i12
o18.oe = vcc
-
diff --git a/src/regtests/jedutil/baseline/pal14h4.txt b/src/regtests/jedutil/baseline/pal14h4/pal14h4.txt
index 7e3c7cb05bd..52ce0d9bfc2 100644
--- a/src/regtests/jedutil/baseline/pal14h4.txt
+++ b/src/regtests/jedutil/baseline/pal14h4/pal14h4.txt
@@ -22,4 +22,3 @@ o17 = i1 & i2 & i3 & /i4 & i5 & i6 & i7 & i8 +
i18 & i19
o17.oe = vcc
-
diff --git a/src/regtests/jedutil/baseline/pal14l4.txt b/src/regtests/jedutil/baseline/pal14l4/pal14l4.txt
index 26b9cc817b1..c17cae37706 100644
--- a/src/regtests/jedutil/baseline/pal14l4.txt
+++ b/src/regtests/jedutil/baseline/pal14l4/pal14l4.txt
@@ -22,4 +22,3 @@ o16.oe = vcc
/i18 & /i19
o17.oe = vcc
-
diff --git a/src/regtests/jedutil/baseline/pal16c1/pal16c1.txt b/src/regtests/jedutil/baseline/pal16c1/pal16c1.txt
new file mode 100644
index 00000000000..9b5918d3bbe
--- /dev/null
+++ b/src/regtests/jedutil/baseline/pal16c1/pal16c1.txt
@@ -0,0 +1,36 @@
+/o15 = i1 & i2 +
+ i3 & i4 +
+ i5 & i6 +
+ i7 & i8 +
+ i9 & i11 +
+ i12 & i13 +
+ i14 & i17 +
+ i18 & i19 +
+ /i1 & /i2 +
+ /i3 & /i4 +
+ /i5 & /i6 +
+ /i7 & /i8 +
+ /i9 & /i11 +
+ /i12 & /i13 +
+ /i14 & /i17 +
+ /i18 & /i19
+o15.oe = vcc
+
+o16 = i1 & i2 +
+ i3 & i4 +
+ i5 & i6 +
+ i7 & i8 +
+ i9 & i11 +
+ i12 & i13 +
+ i14 & i17 +
+ i18 & i19 +
+ /i1 & /i2 +
+ /i3 & /i4 +
+ /i5 & /i6 +
+ /i7 & /i8 +
+ /i9 & /i11 +
+ /i12 & /i13 +
+ /i14 & /i17 +
+ /i18 & /i19
+o16.oe = vcc
+
diff --git a/src/regtests/jedutil/baseline/pal16h2.txt b/src/regtests/jedutil/baseline/pal16h2/pal16h2.txt
index ab5aa6656ee..61cbfcbbeac 100644
--- a/src/regtests/jedutil/baseline/pal16h2.txt
+++ b/src/regtests/jedutil/baseline/pal16h2/pal16h2.txt
@@ -18,4 +18,3 @@ o16 = i1 & i2 & /i3 & i4 & /i5 & i6 & i7 & i8 +
/i18 & i19
o16.oe = vcc
-
diff --git a/src/regtests/jedutil/baseline/pal16l2.txt b/src/regtests/jedutil/baseline/pal16l2/pal16l2.txt
index 7db39f9fe3e..26c0052e20b 100644
--- a/src/regtests/jedutil/baseline/pal16l2.txt
+++ b/src/regtests/jedutil/baseline/pal16l2/pal16l2.txt
@@ -18,4 +18,3 @@ o15.oe = vcc
/i18 & /i19
o16.oe = vcc
-
diff --git a/src/regtests/jedutil/baseline/pal16l8.txt b/src/regtests/jedutil/baseline/pal16l8/pal16l8.txt
index e591b1004eb..c6cf49bc84d 100644
--- a/src/regtests/jedutil/baseline/pal16l8.txt
+++ b/src/regtests/jedutil/baseline/pal16l8/pal16l8.txt
@@ -70,4 +70,3 @@ o18.oe = vcc
/i7
o19.oe = vcc
-
diff --git a/src/regtests/jedutil/baseline/pal16r4/pal16r4.txt b/src/regtests/jedutil/baseline/pal16r4/pal16r4.txt
new file mode 100644
index 00000000000..601701c2d4d
--- /dev/null
+++ b/src/regtests/jedutil/baseline/pal16r4/pal16r4.txt
@@ -0,0 +1,76 @@
+/o12 = /i2 & /i3 +
+ i4 & o13 +
+ i3 +
+ /i6 +
+ i8 +
+ /i9 +
+ i7 & /o13
+o12.oe = rf14
+
+/o13 = /rf14 +
+ /i9 +
+ i8 +
+ /i7 +
+ /i6 & /rf14 +
+ i5 +
+ i4
+o13.oe = i2 & rf14
+
+/rf14 := /rf15 +
+ /i8 +
+ i8 +
+ /i2 & /rf15 +
+ /i2 +
+ i2 & /i8 & rf15 +
+ /i4 +
+ i3
+rf14.oe = OE
+
+/rf15 := i3 & i6 & i7 +
+ i6 & rf16 +
+ i3 & /rf16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7 +
+ /i2 & /i7
+rf15.oe = OE
+
+/rf16 := /i3 & /rf17 +
+ /i4 +
+ /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4 +
+ i2 & i3
+rf16.oe = OE
+
+/rf17 := i2 & i5 & i6 & /i7 +
+ i2 & /o18 +
+ i5 +
+ i6 +
+ /i7 & o18 +
+ i2 & /i7 +
+ i5 & i6 +
+ /i3
+rf17.oe = OE
+
+/o18 = /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 +
+ /i2 & /i7 +
+ /i3 +
+ i5 & i6 & /i7 +
+ i7
+o18.oe = vcc
+
+/o19 = i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 +
+ i6 +
+ i7 +
+ /i4 +
+ /i7
+o19.oe = vcc
+
diff --git a/src/regtests/jedutil/baseline/pal16r6/pal16r6.txt b/src/regtests/jedutil/baseline/pal16r6/pal16r6.txt
new file mode 100644
index 00000000000..15c0373dbdf
--- /dev/null
+++ b/src/regtests/jedutil/baseline/pal16r6/pal16r6.txt
@@ -0,0 +1,78 @@
+/o12 = /i2 & /i3 +
+ i4 & rf13 +
+ i3 +
+ /i6 +
+ i8 +
+ /i9 +
+ i7 & /rf13
+o12.oe = rf14
+
+/rf13 := /rf14 +
+ /i9 +
+ i8 +
+ /i7 +
+ /i6 & /rf14 +
+ i5 & rf14 +
+ i4 +
+ /i2
+rf13.oe = OE
+
+/rf14 := /rf15 +
+ /i8 +
+ i8 +
+ /i2 & /rf15 +
+ /i2 +
+ i2 & /i8 & rf15 +
+ /i4 +
+ i3
+rf14.oe = OE
+
+/rf15 := i3 & i6 & i7 +
+ i6 & rf16 +
+ i3 & /rf16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7 +
+ /i2 & /i7
+rf15.oe = OE
+
+/rf16 := /i3 & /rf17 +
+ /i4 +
+ /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4 +
+ i2 & i3
+rf16.oe = OE
+
+/rf17 := i2 & i5 & i6 & /i7 +
+ i2 & /rf18 +
+ i5 +
+ i6 +
+ /i7 & rf18 +
+ i2 & /i7 +
+ i5 & i6 +
+ /i3
+rf17.oe = OE
+
+/rf18 := /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 +
+ /i2 & /i7 +
+ /i3 +
+ i5 & i6 & /i7 +
+ i7 +
+ i4
+rf18.oe = OE
+
+/o19 = i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 +
+ i6 +
+ i7 +
+ /i4 +
+ /i7
+o19.oe = vcc
+
diff --git a/src/regtests/jedutil/baseline/pal16r8/pal16r8.txt b/src/regtests/jedutil/baseline/pal16r8/pal16r8.txt
new file mode 100644
index 00000000000..0e6570d3a63
--- /dev/null
+++ b/src/regtests/jedutil/baseline/pal16r8/pal16r8.txt
@@ -0,0 +1,80 @@
+/rf12 := /i2 & /i3 +
+ i4 & rf13 +
+ i3 +
+ /i6 +
+ i8 +
+ /i9 +
+ i7 & /rf13 +
+ i5
+rf12.oe = OE
+
+/rf13 := /rf14 +
+ /i9 +
+ i8 +
+ /i7 +
+ /i6 & rf14 +
+ i5 +
+ i4 +
+ /i3
+rf13.oe = OE
+
+/rf14 := /rf15 +
+ /i8 +
+ i8 +
+ /i2 & /rf15 +
+ /i2 +
+ i2 & /i8 & rf15 +
+ /i4 +
+ i3
+rf14.oe = OE
+
+/rf15 := i3 & i6 & i7 +
+ i6 & rf16 +
+ i3 & /rf16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7 +
+ /i2 & /i7
+rf15.oe = OE
+
+/rf16 := /i3 & /rf17 +
+ /i4 +
+ /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4 +
+ i2 & i3
+rf16.oe = OE
+
+/rf17 := i2 & i5 & i6 & /i7 +
+ i2 & /rf18 +
+ i5 +
+ i6 +
+ /i7 & rf18 +
+ i2 & /i7 +
+ i5 & i6 +
+ /i3
+rf17.oe = OE
+
+/rf18 := /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 & rf19 +
+ /i2 & /i7 +
+ /i3 & /rf19 +
+ i5 & i6 & /i7 +
+ i7 +
+ /i4
+rf18.oe = OE
+
+/rf19 := i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 & rf12 +
+ i6 +
+ i7 +
+ /i4 & /rf12 +
+ /i7 +
+ i2
+rf19.oe = OE
+
diff --git a/src/regtests/jedutil/baseline/pal20l10.txt b/src/regtests/jedutil/baseline/pal20l10/pal20l10.txt
index 20292efa87c..3dbc917c1ee 100644
--- a/src/regtests/jedutil/baseline/pal20l10.txt
+++ b/src/regtests/jedutil/baseline/pal20l10/pal20l10.txt
@@ -48,4 +48,3 @@ o22.oe = i3 & /i7
/i13
o23.oe = vcc
-
diff --git a/src/regtests/jedutil/baseline/pal20l8.txt b/src/regtests/jedutil/baseline/pal20l8/pal20l8.txt
index 5a824490618..6cf68531f5b 100644
--- a/src/regtests/jedutil/baseline/pal20l8.txt
+++ b/src/regtests/jedutil/baseline/pal20l8/pal20l8.txt
@@ -70,4 +70,3 @@ o21.oe = i5 & i6
/i11
o22.oe = i3 & /i7
-
diff --git a/src/regtests/jedutil/baseline/pal20r4/pal20r4.txt b/src/regtests/jedutil/baseline/pal20r4/pal20r4.txt
new file mode 100644
index 00000000000..b1eb4620277
--- /dev/null
+++ b/src/regtests/jedutil/baseline/pal20r4/pal20r4.txt
@@ -0,0 +1,76 @@
+/o15 = i2 & i6 & i7 +
+ i6 & o16 +
+ i3 & /o16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7
+o15.oe = /i23
+
+/o16 = /i3 & /rf17 +
+ /i4 +
+ /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4
+o16.oe = i23
+
+/rf17 := /i2 +
+ /rf18 +
+ i5 +
+ i6 +
+ rf18 +
+ i4 +
+ /i10 +
+ /i23
+rf17.oe = OE
+
+/rf18 := /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 & rf19 +
+ /i2 & /i7 +
+ /i3 & /rf19 +
+ i5 & i6 & /i7 +
+ i7 +
+ /i11
+rf18.oe = OE
+
+/rf19 := i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 & rf20 +
+ i6 +
+ i7 +
+ /i4 & /rf20 +
+ /i7 +
+ i10
+rf19.oe = OE
+
+/rf20 := i10 & rf17 +
+ /i11 +
+ i4 & /rf17 +
+ i2 +
+ /i6 & /i7 +
+ i8 +
+ /i9 +
+ o22
+rf20.oe = OE
+
+/o21 = /i8 +
+ /i2 & rf17 +
+ i11 +
+ /i10 +
+ o15 +
+ /i14 +
+ /i3
+o21.oe = i8 & i9 & /o22
+
+/o22 = i14 +
+ /o15 +
+ i3 & /o21 +
+ i7 +
+ /i8 & o21 +
+ i10 +
+ /i9
+o22.oe = i14 & /o15
+
diff --git a/src/regtests/jedutil/baseline/pal20r6/pal20r6.txt b/src/regtests/jedutil/baseline/pal20r6/pal20r6.txt
new file mode 100644
index 00000000000..4a468c30935
--- /dev/null
+++ b/src/regtests/jedutil/baseline/pal20r6/pal20r6.txt
@@ -0,0 +1,78 @@
+/o15 = i2 & i6 & i7 +
+ i6 & rf16 +
+ i3 & /rf16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7
+o15.oe = /i23
+
+/rf16 := /i3 & /rf17 +
+ /i4 & /i23 +
+ /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4 +
+ i23
+rf16.oe = OE
+
+/rf17 := /i2 +
+ /rf18 +
+ i5 +
+ i6 +
+ rf18 +
+ i4 +
+ /i10 +
+ /i23
+rf17.oe = OE
+
+/rf18 := /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 & rf19 +
+ /i2 & /i7 +
+ /i3 & /rf19 +
+ i5 & i6 & /i7 +
+ i7 +
+ /i11
+rf18.oe = OE
+
+/rf19 := i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 & rf20 +
+ i6 +
+ i7 +
+ /i4 & /rf20 +
+ /i7 +
+ i10
+rf19.oe = OE
+
+/rf20 := i10 & rf17 +
+ /i11 +
+ i4 & /rf17 +
+ i2 +
+ /i6 & /i7 +
+ i8 +
+ /i9 +
+ o22
+rf20.oe = OE
+
+/rf21 := /i8 +
+ /i2 & rf17 +
+ i11 +
+ /i10 +
+ o15 +
+ /i14 & /o22 +
+ /i3 +
+ /i5
+rf21.oe = OE
+
+/o22 = i14 +
+ /o15 +
+ i3 & /rf21 +
+ i7 +
+ /i8 & rf21 +
+ i10 +
+ /i9
+o22.oe = i14 & /o15
+
diff --git a/src/regtests/jedutil/baseline/pal20r8/pal20r8.txt b/src/regtests/jedutil/baseline/pal20r8/pal20r8.txt
new file mode 100644
index 00000000000..732e3f89044
--- /dev/null
+++ b/src/regtests/jedutil/baseline/pal20r8/pal20r8.txt
@@ -0,0 +1,80 @@
+/rf15 := i2 & i6 & i7 +
+ i6 & rf16 +
+ i3 & /rf16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7 +
+ /i23
+rf15.oe = OE
+
+/rf16 := /i3 & /rf17 +
+ /i4 +
+ /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4 +
+ i23
+rf16.oe = OE
+
+/rf17 := /i2 +
+ /rf18 +
+ i5 +
+ i6 +
+ rf18 +
+ i4 +
+ /i10 +
+ /i23
+rf17.oe = OE
+
+/rf18 := /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 & rf19 +
+ /i2 & /i7 +
+ /i3 & /rf19 +
+ i5 & i6 & /i7 +
+ i7 +
+ /i11
+rf18.oe = OE
+
+/rf19 := i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 & rf20 +
+ i6 +
+ i7 +
+ /i4 & /rf20 +
+ /i7 +
+ i10
+rf19.oe = OE
+
+/rf20 := i10 & rf17 +
+ /i11 +
+ i4 & /rf17 +
+ i2 +
+ /i6 & /i7 +
+ i8 +
+ /i9 +
+ rf22
+rf20.oe = OE
+
+/rf21 := /i8 +
+ /i2 & rf17 +
+ i11 +
+ /i10 +
+ rf15 +
+ /i14 +
+ /i3 +
+ i8 & i9 & /rf22
+rf21.oe = OE
+
+/rf22 := i14 +
+ /rf15 +
+ i3 & /rf21 +
+ i7 +
+ /i8 & rf21 +
+ i10 +
+ /i9 +
+ i14 & /rf15
+rf22.oe = OE
+
diff --git a/src/regtests/jedutil/eqns/pal10h8.eqn b/src/regtests/jedutil/eqns/pal10h8/pal10h8.eqn
index 690cdcf090a..690cdcf090a 100644
--- a/src/regtests/jedutil/eqns/pal10h8.eqn
+++ b/src/regtests/jedutil/eqns/pal10h8/pal10h8.eqn
diff --git a/src/regtests/jedutil/eqns/pal10l8.eqn b/src/regtests/jedutil/eqns/pal10l8/pal10l8.eqn
index b316ec32d26..b316ec32d26 100644
--- a/src/regtests/jedutil/eqns/pal10l8.eqn
+++ b/src/regtests/jedutil/eqns/pal10l8/pal10l8.eqn
diff --git a/src/regtests/jedutil/eqns/pal12h6.eqn b/src/regtests/jedutil/eqns/pal12h6/pal12h6.eqn
index 43b72ca6dc3..43b72ca6dc3 100644
--- a/src/regtests/jedutil/eqns/pal12h6.eqn
+++ b/src/regtests/jedutil/eqns/pal12h6/pal12h6.eqn
diff --git a/src/regtests/jedutil/eqns/pal12l6.eqn b/src/regtests/jedutil/eqns/pal12l6/pal12l6.eqn
index a1867dd827a..a1867dd827a 100644
--- a/src/regtests/jedutil/eqns/pal12l6.eqn
+++ b/src/regtests/jedutil/eqns/pal12l6/pal12l6.eqn
diff --git a/src/regtests/jedutil/eqns/pal14h4.eqn b/src/regtests/jedutil/eqns/pal14h4/pal14h4.eqn
index 7db1b42ee27..7db1b42ee27 100644
--- a/src/regtests/jedutil/eqns/pal14h4.eqn
+++ b/src/regtests/jedutil/eqns/pal14h4/pal14h4.eqn
diff --git a/src/regtests/jedutil/eqns/pal14l4.eqn b/src/regtests/jedutil/eqns/pal14l4/pal14l4.eqn
index 0e63b68c612..0e63b68c612 100644
--- a/src/regtests/jedutil/eqns/pal14l4.eqn
+++ b/src/regtests/jedutil/eqns/pal14l4/pal14l4.eqn
diff --git a/src/regtests/jedutil/eqns/pal16c1/pal16c1.eqn b/src/regtests/jedutil/eqns/pal16c1/pal16c1.eqn
new file mode 100644
index 00000000000..d2566d34cb4
--- /dev/null
+++ b/src/regtests/jedutil/eqns/pal16c1/pal16c1.eqn
@@ -0,0 +1,23 @@
+chip 2000 PAL16C1
+
+i1=1 i2=2 i3=3 i4=4 i5=5 i6=6 i7=7 i8=8 i9=9 GND=10 i11=11
+i12=12 i13=13 i14=14 o15=15 o16=16 i17=17 i18=18 i19=19 VCC=20
+
+equations
+
+/o15 = i1 & i2 +
+ i3 & i4 +
+ i5 & i6 +
+ i7 & i8 +
+ i9 & i11 +
+ i12 & i13 +
+ i14 & i17 +
+ i18 & i19 +
+ /i1 & /i2 +
+ /i3 & /i4 +
+ /i5 & /i6 +
+ /i7 & /i8 +
+ /i9 & /i11 +
+ /i12 & /i13 +
+ /i14 & /i17 +
+ /i18 & /i19
diff --git a/src/regtests/jedutil/eqns/pal16h2.eqn b/src/regtests/jedutil/eqns/pal16h2/pal16h2.eqn
index cd597b209c2..cd597b209c2 100644
--- a/src/regtests/jedutil/eqns/pal16h2.eqn
+++ b/src/regtests/jedutil/eqns/pal16h2/pal16h2.eqn
diff --git a/src/regtests/jedutil/eqns/pal16l2.eqn b/src/regtests/jedutil/eqns/pal16l2/pal16l2.eqn
index d68a83e9173..d68a83e9173 100644
--- a/src/regtests/jedutil/eqns/pal16l2.eqn
+++ b/src/regtests/jedutil/eqns/pal16l2/pal16l2.eqn
diff --git a/src/regtests/jedutil/eqns/pal16l8.eqn b/src/regtests/jedutil/eqns/pal16l8/pal16l8.eqn
index 6daddee92dd..6daddee92dd 100644
--- a/src/regtests/jedutil/eqns/pal16l8.eqn
+++ b/src/regtests/jedutil/eqns/pal16l8/pal16l8.eqn
diff --git a/src/regtests/jedutil/eqns/pal16r4/pal16r4.eqn b/src/regtests/jedutil/eqns/pal16r4/pal16r4.eqn
new file mode 100644
index 00000000000..9a62f9ec02a
--- /dev/null
+++ b/src/regtests/jedutil/eqns/pal16r4/pal16r4.eqn
@@ -0,0 +1,82 @@
+chip pal16r4 PAL16R4
+
+CLK=1 i2=2 i3=3 i4=4 i5=5 i6=6 i7=7 i8=8 i9=9 GND=10
+/OE=11 o12=12 o13=13 rf14=14 rf15=15 rf16=16 rf17=17 o18=18 o19=19 VCC=20
+
+equations
+
+/o12 = /i2 & /i3 +
+ i4 & o13 +
+ i3 +
+ /i6 +
+ i8 +
+ /i9 +
+ i7 & /o13
+o12.oe = rf14
+
+/o13 = /rf14 +
+ /i9 +
+ i8 +
+ /i7 +
+ /i6 & /rf14 +
+ i5 +
+ i4
+o13.oe = i2 & rf14
+
+/rf14 := /rf15 +
+ /i8 +
+ i8 +
+ /i2 & /rf15 +
+ /i2 +
+ i2 & /i8 & rf15 +
+ /i4 +
+ i3
+rf14.oe = OE
+
+/rf15 := i3 & i6 & i7 +
+ i6 & rf16 +
+ i3 & /rf16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7 +
+ /i2 & /i7
+rf15.oe = OE
+
+/rf16 := /i3 & /rf17 +
+ /i4 +
+ /i3 & /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4 +
+ i2 & i3
+rf16.oe = OE
+
+/rf17 := i2 & i5 & i6 & /i7 +
+ i2 & /o18 +
+ i5 +
+ i6 +
+ /i7 & o18 +
+ i2 & /i7 +
+ i5 & i6 +
+ /i3
+rf17.oe = OE
+
+/o18 = /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 +
+ /i2 & /i7 +
+ /i3 +
+ i5 & i6 & /i7 +
+ i7
+o18.oe = vcc
+
+/o19 = i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 +
+ i6 +
+ i7 +
+ /i4 +
+ /i7
+o19.oe = vcc
diff --git a/src/regtests/jedutil/eqns/pal16r6/pal16r6.eqn b/src/regtests/jedutil/eqns/pal16r6/pal16r6.eqn
new file mode 100644
index 00000000000..42f444f5e24
--- /dev/null
+++ b/src/regtests/jedutil/eqns/pal16r6/pal16r6.eqn
@@ -0,0 +1,84 @@
+chip pal16r6 PAL16R6
+
+CLK=1 i2=2 i3=3 i4=4 i5=5 i6=6 i7=7 i8=8 i9=9 GND=10
+/OE=11 o12=12 rf13=13 rf14=14 rf15=15 rf16=16 rf17=17 rf18=18 o19=19 VCC=20
+
+equations
+
+/o12 = /i2 & /i3 +
+ i4 & rf13 +
+ i3 +
+ /i6 +
+ i8 +
+ /i9 +
+ i7 & /rf13
+o12.oe = rf14
+
+/rf13 := /rf14 +
+ /i9 +
+ i8 +
+ /i7 +
+ /i6 & /rf14 +
+ i5 & rf14 +
+ i4 +
+ /i2
+rf13.oe = OE
+
+/rf14 := /rf15 +
+ /i8 +
+ i8 +
+ /i2 & /rf15 +
+ /i2 +
+ i2 & /i8 & rf15 +
+ /i4 +
+ i3
+rf14.oe = OE
+
+/rf15 := i3 & i6 & i7 +
+ i6 & rf16 +
+ i3 & /rf16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7 +
+ /i2 & /i7
+rf15.oe = OE
+
+/rf16 := /i3 & /rf17 +
+ /i4 +
+ /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4 +
+ i2 & i3
+rf16.oe = OE
+
+/rf17 := i2 & i5 & i6 & /i7 +
+ i2 & /rf18 +
+ i5 +
+ i6 +
+ /i7 & rf18 +
+ i2 & /i7 +
+ i5 & i6 +
+ /i3
+rf17.oe = OE
+
+/rf18 := /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 +
+ /i2 & /i7 +
+ /i3 +
+ i5 & i6 & /i7 +
+ i7 +
+ i4
+rf18.oe = OE
+
+/o19 = i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 +
+ i6 +
+ i7 +
+ /i4 +
+ /i7
+o19.oe = vcc
diff --git a/src/regtests/jedutil/eqns/pal16r8/pal16r8.eqn b/src/regtests/jedutil/eqns/pal16r8/pal16r8.eqn
new file mode 100644
index 00000000000..5987e81c2dc
--- /dev/null
+++ b/src/regtests/jedutil/eqns/pal16r8/pal16r8.eqn
@@ -0,0 +1,86 @@
+chip pal16r8 PAL16R8
+
+CLK=1 i2=2 i3=3 i4=4 i5=5 i6=6 i7=7 i8=8 i9=9 GND=10
+/OE=11 rf12=12 rf13=13 rf14=14 rf15=15 rf16=16 rf17=17 rf18=18 rf19=19 VCC=20
+
+equations
+
+/rf12 := /i2 & /i3 +
+ i4 & rf13 +
+ i3 +
+ /i6 +
+ i8 +
+ /i9 +
+ i7 & /rf13 +
+ i5
+rf12.oe = OE
+
+/rf13 := /rf14 +
+ /i9 +
+ i8 +
+ /i7 +
+ /i6 & rf14 +
+ i5 +
+ i4 +
+ /i3
+rf13.oe = OE
+
+/rf14 := /rf15 +
+ /i8 +
+ i8 +
+ /i2 & /rf15 +
+ /i2 +
+ i2 & /i8 & rf15 +
+ /i4 +
+ i3
+rf14.oe = OE
+
+/rf15 := i3 & i6 & i7 +
+ i6 & rf16 +
+ i3 & /rf16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7 +
+ /i2 & /i7
+rf15.oe = OE
+
+/rf16 := /i3 & /rf17 +
+ /i4 +
+ /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4 +
+ i2 & i3
+rf16.oe = OE
+
+/rf17 := i2 & i5 & i6 & /i7 +
+ i2 & /rf18 +
+ i5 +
+ i6 +
+ /i7 & rf18 +
+ i2 & /i7 +
+ i5 & i6 +
+ /i3
+rf17.oe = OE
+
+/rf18 := /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 & rf19 +
+ /i2 & /i7 +
+ /i3 & /rf19 +
+ i5 & i6 & /i7 +
+ i7 +
+ /i4
+rf18.oe = OE
+
+/rf19 := i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 & rf12 +
+ i6 +
+ i7 +
+ /i4 & /rf12 +
+ /i7 +
+ i2
+rf19.oe = OE
diff --git a/src/regtests/jedutil/eqns/pal20l10.eqn b/src/regtests/jedutil/eqns/pal20l10/pal20l10.eqn
index d6639bdf9f4..d6639bdf9f4 100644
--- a/src/regtests/jedutil/eqns/pal20l10.eqn
+++ b/src/regtests/jedutil/eqns/pal20l10/pal20l10.eqn
diff --git a/src/regtests/jedutil/eqns/pal20l8.eqn b/src/regtests/jedutil/eqns/pal20l8/pal20l8.eqn
index f7280b6150f..f7280b6150f 100644
--- a/src/regtests/jedutil/eqns/pal20l8.eqn
+++ b/src/regtests/jedutil/eqns/pal20l8/pal20l8.eqn
diff --git a/src/regtests/jedutil/eqns/pal20r4/pal20r4.eqn b/src/regtests/jedutil/eqns/pal20r4/pal20r4.eqn
new file mode 100644
index 00000000000..ace68eae24f
--- /dev/null
+++ b/src/regtests/jedutil/eqns/pal20r4/pal20r4.eqn
@@ -0,0 +1,82 @@
+chip pal20r4 PAL20R4
+
+CLK=1 i2=2 i3=3 i4=4 i5=5 i6=6 i7=7 i8=8 i9=9 i10=10 i11=11 GND=12
+/OE=13 i14=14 o15=15 o16=16 rf17=17 rf18=18 rf19=19 rf20=20 o21=21 o22=22 i23=23 VCC=24
+
+equations
+
+/o15 = i2 & i6 & i7 +
+ i6 & o16 +
+ i3 & /o16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7
+o15.oe = /i23
+
+/o16 = /i3 & /rf17 +
+ /i4 +
+ /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4
+o16.oe = i23
+
+/rf17 := /i2 +
+ /rf18 +
+ i5 +
+ i6 +
+ rf18 +
+ i4 +
+ /i10 +
+ /i23
+rf17.oe = OE
+
+/rf18 := /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 & rf19 +
+ /i2 & /i7 +
+ /i3 & /rf19 +
+ i5 & i6 & /i7 +
+ i7 +
+ /i11
+rf18.oe = OE
+
+/rf19 := i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 & rf20 +
+ i6 +
+ i7 +
+ /i4 & /rf20 +
+ /i7 +
+ i10
+rf19.oe = OE
+
+/rf20 := i10 & rf17 +
+ /i11 +
+ i4 & /rf17 +
+ i2 +
+ /i6 & /i7 +
+ i8 +
+ /i9 +
+ o22
+rf20.oe = OE
+
+/o21 = /i8 +
+ /i2 & rf17 +
+ i11 +
+ /i10 +
+ o15 +
+ /i14 +
+ /i3
+o21.oe = i8 & i9 & /o22
+
+/o22 = i14 +
+ /o15 +
+ i3 & /o21 +
+ i7 +
+ /i8 & o21 +
+ i10 +
+ /i9
+o22.oe = i14 & /o15 \ No newline at end of file
diff --git a/src/regtests/jedutil/eqns/pal20r6/pal20r6.eqn b/src/regtests/jedutil/eqns/pal20r6/pal20r6.eqn
new file mode 100644
index 00000000000..dca4b545ee4
--- /dev/null
+++ b/src/regtests/jedutil/eqns/pal20r6/pal20r6.eqn
@@ -0,0 +1,84 @@
+chip pal20r6 PAL20R6
+
+CLK=1 i2=2 i3=3 i4=4 i5=5 i6=6 i7=7 i8=8 i9=9 i10=10 i11=11 GND=12
+/OE=13 i14=14 o15=15 rf16=16 rf17=17 rf18=18 rf19=19 rf20=20 rf21=21 o22=22 i23=23 VCC=24
+
+equations
+
+/o15 = i2 & i6 & i7 +
+ i6 & rf16 +
+ i3 & /rf16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7
+o15.oe = /i23
+
+/rf16 := /i3 & /rf17 +
+ /i4 & /i23 +
+ /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4 +
+ i23
+rf16.oe = OE
+
+/rf17 := /i2 +
+ /rf18 +
+ i5 +
+ i6 +
+ rf18 +
+ i4 +
+ /i10 +
+ /i23
+rf17.oe = OE
+
+/rf18 := /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 & rf19 +
+ /i2 & /i7 +
+ /i3 & /rf19 +
+ i5 & i6 & /i7 +
+ i7 +
+ /i11
+rf18.oe = OE
+
+/rf19 := i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 & rf20 +
+ i6 +
+ i7 +
+ /i4 & /rf20 +
+ /i7 +
+ i10
+rf19.oe = OE
+
+/rf20 := i10 & rf17 +
+ /i11 +
+ i4 & /rf17 +
+ i2 +
+ /i6 & /i7 +
+ i8 +
+ /i9 +
+ o22
+rf20.oe = OE
+
+/rf21 := /i8 +
+ /i2 & rf17 +
+ i11 +
+ /i10 +
+ o15 +
+ /i14 & /o22 +
+ /i3 +
+ /i5
+rf21.oe = OE
+
+/o22 = i14 +
+ /o15 +
+ i3 & /rf21 +
+ i7 +
+ /i8 & rf21 +
+ i10 +
+ /i9
+o22.oe = i14 & /o15 \ No newline at end of file
diff --git a/src/regtests/jedutil/eqns/pal20r8/pal20r8.eqn b/src/regtests/jedutil/eqns/pal20r8/pal20r8.eqn
new file mode 100644
index 00000000000..c777a21d495
--- /dev/null
+++ b/src/regtests/jedutil/eqns/pal20r8/pal20r8.eqn
@@ -0,0 +1,86 @@
+chip pal20r8 PAL20R8
+
+CLK=1 i2=2 i3=3 i4=4 i5=5 i6=6 i7=7 i8=8 i9=9 i10=10 i11=11 GND=12
+/OE=13 i14=14 rf15=15 rf16=16 rf17=17 rf18=18 rf19=19 rf20=20 rf21=21 rf22=22 i23=23 VCC=24
+
+equations
+
+/rf15 := i2 & i6 & i7 +
+ i6 & rf16 +
+ i3 & /rf16 +
+ i7 +
+ /i4 +
+ i6 & i7 +
+ i4 & i7 +
+ /i23
+rf15.oe = OE
+
+/rf16 := /i3 & /rf17 +
+ /i4 +
+ /i3 +
+ /i3 & i4 +
+ /i7 & rf17 +
+ /i7 +
+ i4 +
+ i23
+rf16.oe = OE
+
+/rf17 := /i2 +
+ /rf18 +
+ i5 +
+ i6 +
+ rf18 +
+ i4 +
+ /i10 +
+ /i23
+rf17.oe = OE
+
+/rf18 := /i2 & i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i3 & rf19 +
+ /i2 & /i7 +
+ /i3 & /rf19 +
+ i5 & i6 & /i7 +
+ i7 +
+ /i11
+rf18.oe = OE
+
+/rf19 := i5 & i6 & /i7 +
+ i3 & i6 & i7 +
+ i5 & rf20 +
+ i6 +
+ i7 +
+ /i4 & /rf20 +
+ /i7 +
+ i10
+rf19.oe = OE
+
+/rf20 := i10 & rf17 +
+ /i11 +
+ i4 & /rf17 +
+ i2 +
+ /i6 & /i7 +
+ i8 +
+ /i9 +
+ rf22
+rf20.oe = OE
+
+/rf21 := /i8 +
+ /i2 & rf17 +
+ i11 +
+ /i10 +
+ rf15 +
+ /i14 +
+ /i3 +
+ i8 & i9 & /rf22
+rf21.oe = OE
+
+/rf22 := i14 +
+ /rf15 +
+ i3 & /rf21 +
+ i7 +
+ /i8 & rf21 +
+ i10 +
+ /i9 +
+ i14 & /rf15
+rf22.oe = OE \ No newline at end of file
diff --git a/src/regtests/jedutil/jeds/gal16v8/pal10h8-to-gal16v8.jed b/src/regtests/jedutil/jeds/gal16v8/pal10h8-to-gal16v8.jed
new file mode 100644
index 00000000000..0fd244e59ce
--- /dev/null
+++ b/src/regtests/jedutil/jeds/gal16v8/pal10h8-to-gal16v8.jed
@@ -0,0 +1,106 @@
+
+Device G16V8 converted from PAL10H8 JEDEC map.
+PAL to GAL JEDEC conversion utility - paltogal v3.12 17 November 1992
+Copyright (c) by LATTICE Semiconductor Corp. 1990, 1991, 1992.
+Input File: pal10h8.jed
+Output File: gal.jed
+The Date: Wed Sep 12 22:32:02 2012
+
+
+PAL10H8
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "pal10h8.eqn". Date: 8-27-112
+*
+NOTE PINS i1:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS i11:11 o12:12 o13:13 o14:14 o15:15 o16:16 o17:17 o18:18*
+NOTE PINS o19:19 VCC:20*
+QF2194*QP20*F0*
+
+L00000 01010111011101110111011110111111*
+L00032 11111111111111111111111111111101*
+L00064 00000011001100110011001100110000*
+L00096 00000011001100110011001100110000*
+L00128 00000011001100110011001100110000*
+L00160 00000011001100110011001100110000*
+L00192 00000011001100110011001100110000*
+L00224 00000011001100110011001100110000*
+
+L00256 01010111011101110111101101111111*
+L00288 11111111111111111111111111111001*
+L00320 00000011001100110011001100110000*
+L00352 00000011001100110011001100110000*
+L00384 00000011001100110011001100110000*
+L00416 00000011001100110011001100110000*
+L00448 00000011001100110011001100110000*
+L00480 00000011001100110011001100110000*
+
+L00512 01010111011101111011011101111111*
+L00544 11111111111111111111111111110110*
+L00576 00000011001100110011001100110000*
+L00608 00000011001100110011001100110000*
+L00640 00000011001100110011001100110000*
+L00672 00000011001100110011001100110000*
+L00704 00000011001100110011001100110000*
+L00736 00000011001100110011001100110000*
+
+L00768 01010111011110110111011101111111*
+L00800 11111111111111111111111111111010*
+L00832 00000011001100110011001100110000*
+L00864 00000011001100110011001100110000*
+L00896 00000011001100110011001100110000*
+L00928 00000011001100110011001100110000*
+L00960 00000011001100110011001100110000*
+L00992 00000011001100110011001100110000*
+
+L01024 01010111101101110111011101111111*
+L01056 11111111111111111111111111111010*
+L01088 00000011001100110011001100110000*
+L01120 00000011001100110011001100110000*
+L01152 00000011001100110011001100110000*
+L01184 00000011001100110011001100110000*
+L01216 00000011001100110011001100110000*
+L01248 00000011001100110011001100110000*
+
+L01280 01011011011101110111011101111111*
+L01312 11111111111111111111111111110110*
+L01344 00000011001100110011001100110000*
+L01376 00000011001100110011001100110000*
+L01408 00000011001100110011001100110000*
+L01440 00000011001100110011001100110000*
+L01472 00000011001100110011001100110000*
+L01504 00000011001100110011001100110000*
+
+L01536 10010111011101110111011101111111*
+L01568 11111111111111111111111111111001*
+L01600 00000011001100110011001100110000*
+L01632 00000011001100110011001100110000*
+L01664 00000011001100110011001100110000*
+L01696 00000011001100110011001100110000*
+L01728 00000011001100110011001100110000*
+L01760 00000011001100110011001100110000*
+
+L01792 01100111011101110111011101111111*
+L01824 11111111111111111111111111110101*
+L01856 00000011001100110011001100110000*
+L01888 00000011001100110011001100110000*
+L01920 00000011001100110011001100110000*
+L01952 00000011001100110011001100110000*
+L01984 00000011001100110011001100110000*
+L02016 00000011001100110011001100110000*
+
+N ==> XOR *
+L02048 11111111*
+N ==> Signature is "" *
+L02056 00000000000000000000000000000000*
+L02088 00000000000000000000000000000000*
+N ==> AC1 *
+L02120 00000000*
+N ==> PTD *
+L02128 11000000110000001100000011000000*
+L02160 11000000110000001100000011000000*
+N ==> SYN 2192, AC0 2193 *
+L02192 10*
+CADF0*
+
+0000
diff --git a/src/regtests/jedutil/jeds/gal16v8/pal10l8-to-gal16v8.jed b/src/regtests/jedutil/jeds/gal16v8/pal10l8-to-gal16v8.jed
new file mode 100644
index 00000000000..8edabbcea4a
--- /dev/null
+++ b/src/regtests/jedutil/jeds/gal16v8/pal10l8-to-gal16v8.jed
@@ -0,0 +1,106 @@
+
+Device G16V8 converted from PAL10L8 JEDEC map.
+PAL to GAL JEDEC conversion utility - paltogal v3.12 17 November 1992
+Copyright (c) by LATTICE Semiconductor Corp. 1990, 1991, 1992.
+Input File: pal10l8.jed
+Output File: gal.jed
+The Date: Sun Sep 16 22:18:49 2012
+
+
+PAL10L8
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "pal10l8.eqn". Date: 8-27-112
+*
+NOTE PINS i1:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS i11:11 o12:12 o13:13 o14:14 o15:15 o16:16 o17:17 o18:18*
+NOTE PINS o19:19 VCC:20*
+QF2194*QP20*F0*
+
+L00000 01010111011101110111011110111111*
+L00032 11111111111111111111111111111011*
+L00064 00000011001100110011001100110000*
+L00096 00000011001100110011001100110000*
+L00128 00000011001100110011001100110000*
+L00160 00000011001100110011001100110000*
+L00192 00000011001100110011001100110000*
+L00224 00000011001100110011001100110000*
+
+L00256 01010111011101110111101101111111*
+L00288 11111111111111111111111111111101*
+L00320 00000011001100110011001100110000*
+L00352 00000011001100110011001100110000*
+L00384 00000011001100110011001100110000*
+L00416 00000011001100110011001100110000*
+L00448 00000011001100110011001100110000*
+L00480 00000011001100110011001100110000*
+
+L00512 01010111011101111011011101111111*
+L00544 11111111111111111111111111110110*
+L00576 00000011001100110011001100110000*
+L00608 00000011001100110011001100110000*
+L00640 00000011001100110011001100110000*
+L00672 00000011001100110011001100110000*
+L00704 00000011001100110011001100110000*
+L00736 00000011001100110011001100110000*
+
+L00768 01010111011110110111011101111111*
+L00800 11111111111111111111111111111010*
+L00832 00000011001100110011001100110000*
+L00864 00000011001100110011001100110000*
+L00896 00000011001100110011001100110000*
+L00928 00000011001100110011001100110000*
+L00960 00000011001100110011001100110000*
+L00992 00000011001100110011001100110000*
+
+L01024 01010111101101110111011101111111*
+L01056 11111111111111111111111111111010*
+L01088 00000011001100110011001100110000*
+L01120 00000011001100110011001100110000*
+L01152 00000011001100110011001100110000*
+L01184 00000011001100110011001100110000*
+L01216 00000011001100110011001100110000*
+L01248 00000011001100110011001100110000*
+
+L01280 01011011011101110111011101111111*
+L01312 11111111111111111111111111110110*
+L01344 00000011001100110011001100110000*
+L01376 00000011001100110011001100110000*
+L01408 00000011001100110011001100110000*
+L01440 00000011001100110011001100110000*
+L01472 00000011001100110011001100110000*
+L01504 00000011001100110011001100110000*
+
+L01536 10010111011101110111011101111111*
+L01568 11111111111111111111111111111001*
+L01600 00000011001100110011001100110000*
+L01632 00000011001100110011001100110000*
+L01664 00000011001100110011001100110000*
+L01696 00000011001100110011001100110000*
+L01728 00000011001100110011001100110000*
+L01760 00000011001100110011001100110000*
+
+L01792 01100111011101110111011101111111*
+L01824 11111111111111111111111111110101*
+L01856 00000011001100110011001100110000*
+L01888 00000011001100110011001100110000*
+L01920 00000011001100110011001100110000*
+L01952 00000011001100110011001100110000*
+L01984 00000011001100110011001100110000*
+L02016 00000011001100110011001100110000*
+
+N ==> XOR *
+L02048 00000000*
+N ==> Signature is "" *
+L02056 00000000000000000000000000000000*
+L02088 00000000000000000000000000000000*
+N ==> AC1 *
+L02120 00000000*
+N ==> PTD *
+L02128 11000000110000001100000011000000*
+L02160 11000000110000001100000011000000*
+N ==> SYN 2192, AC0 2193 *
+L02192 10*
+CAD31*
+
+0000
diff --git a/src/regtests/jedutil/jeds/gal16v8/pal12h6-to-gal16v8.jed b/src/regtests/jedutil/jeds/gal16v8/pal12h6-to-gal16v8.jed
new file mode 100644
index 00000000000..530aa85cd33
--- /dev/null
+++ b/src/regtests/jedutil/jeds/gal16v8/pal12h6-to-gal16v8.jed
@@ -0,0 +1,106 @@
+
+Device G16V8 converted from PAL12H6 JEDEC map.
+PAL to GAL JEDEC conversion utility - paltogal v3.12 17 November 1992
+Copyright (c) by LATTICE Semiconductor Corp. 1990, 1991, 1992.
+Input File: pal12h6.jed
+Output File: gal.jed
+The Date: Sun Sep 16 22:20:22 2012
+
+
+PAL12H6
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "pal12h6.eqn". Date: 8-27-112
+*
+NOTE PINS i1:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS i11:11 i12:12 o13:13 o14:14 o15:15 o16:16 o17:17 o18:18*
+NOTE PINS i19:19 VCC:20*
+QF2194*QP20*F0*
+
+L00000 00000000001100110011001100000000*
+L00032 00000000001100110011001100000000*
+L00064 00000000001100110011001100000000*
+L00096 00000000001100110011001100000000*
+L00128 00000000001100110011001100000000*
+L00160 00000000001100110011001100000000*
+L00192 00000000001100110011001100000000*
+L00224 00000000001100110011001100000000*
+
+L00256 01010111011101111011011101111111*
+L00288 11111111111111111111111111111001*
+L00320 11111101111111111111111111111111*
+L00352 11111111111111111111111111101111*
+L00384 00000000001100110011001100000000*
+L00416 00000000001100110011001100000000*
+L00448 00000000001100110011001100000000*
+L00480 00000000001100110011001100000000*
+
+L00512 01010111011110110111011101111111*
+L00544 11111111111111111111111111111010*
+L00576 00000000001100110011001100000000*
+L00608 00000000001100110011001100000000*
+L00640 00000000001100110011001100000000*
+L00672 00000000001100110011001100000000*
+L00704 00000000001100110011001100000000*
+L00736 00000000001100110011001100000000*
+
+L00768 01010111011101110111101101111111*
+L00800 11111111111111111111111111110110*
+L00832 00000000001100110011001100000000*
+L00864 00000000001100110011001100000000*
+L00896 00000000001100110011001100000000*
+L00928 00000000001100110011001100000000*
+L00960 00000000001100110011001100000000*
+L00992 00000000001100110011001100000000*
+
+L01024 01010111101101110111011101111111*
+L01056 11111111111111111111111111111010*
+L01088 00000000001100110011001100000000*
+L01120 00000000001100110011001100000000*
+L01152 00000000001100110011001100000000*
+L01184 00000000001100110011001100000000*
+L01216 00000000001100110011001100000000*
+L01248 00000000001100110011001100000000*
+
+L01280 10010111011101110111011101111111*
+L01312 11111111111111111111111111111001*
+L01344 00000000001100110011001100000000*
+L01376 00000000001100110011001100000000*
+L01408 00000000001100110011001100000000*
+L01440 00000000001100110011001100000000*
+L01472 00000000001100110011001100000000*
+L01504 00000000001100110011001100000000*
+
+L01536 01100111011101110111011101111111*
+L01568 11111111111111111111111111110101*
+L01600 11111110111111111111111111111111*
+L01632 11111111111111111111111111011111*
+L01664 00000000001100110011001100000000*
+L01696 00000000001100110011001100000000*
+L01728 00000000001100110011001100000000*
+L01760 00000000001100110011001100000000*
+
+L01792 00000000001100110011001100000000*
+L01824 00000000001100110011001100000000*
+L01856 00000000001100110011001100000000*
+L01888 00000000001100110011001100000000*
+L01920 00000000001100110011001100000000*
+L01952 00000000001100110011001100000000*
+L01984 00000000001100110011001100000000*
+L02016 00000000001100110011001100000000*
+
+N ==> XOR *
+L02048 11111111*
+N ==> Signature is "" *
+L02056 00000000000000000000000000000000*
+L02088 00000000000000000000000000000000*
+N ==> AC1 *
+L02120 10000001*
+N ==> PTD *
+L02128 00000000111100001100000011000000*
+L02160 11000000110000001111000000000000*
+N ==> SYN 2192, AC0 2193 *
+L02192 10*
+C88C8*
+
+0000
diff --git a/src/regtests/jedutil/jeds/gal16v8/pal12l6-to-gal16v8.jed b/src/regtests/jedutil/jeds/gal16v8/pal12l6-to-gal16v8.jed
new file mode 100644
index 00000000000..6f9f0e1c94b
--- /dev/null
+++ b/src/regtests/jedutil/jeds/gal16v8/pal12l6-to-gal16v8.jed
@@ -0,0 +1,106 @@
+
+Device G16V8 converted from PAL12L6 JEDEC map.
+PAL to GAL JEDEC conversion utility - paltogal v3.12 17 November 1992
+Copyright (c) by LATTICE Semiconductor Corp. 1990, 1991, 1992.
+Input File: pal12l6.jed
+Output File: gal.jed
+The Date: Sun Sep 16 22:21:32 2012
+
+
+PAL12L6
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "pal12l6.eqn". Date: 8-27-112
+*
+NOTE PINS i1:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS i11:11 i12:12 o13:13 o14:14 o15:15 o16:16 o17:17 o18:18*
+NOTE PINS i19:19 VCC:20*
+QF2194*QP20*F0*
+
+L00000 00000000001100110011001100000000*
+L00032 00000000001100110011001100000000*
+L00064 00000000001100110011001100000000*
+L00096 00000000001100110011001100000000*
+L00128 00000000001100110011001100000000*
+L00160 00000000001100110011001100000000*
+L00192 00000000001100110011001100000000*
+L00224 00000000001100110011001100000000*
+
+L00256 01010111011101111011011101111111*
+L00288 11111111111111111111111111111001*
+L00320 11111101111111111111111111111111*
+L00352 11111111111111111111111111101111*
+L00384 00000000001100110011001100000000*
+L00416 00000000001100110011001100000000*
+L00448 00000000001100110011001100000000*
+L00480 00000000001100110011001100000000*
+
+L00512 01010111011110110111011101111111*
+L00544 11111111111111111111111111111010*
+L00576 00000000001100110011001100000000*
+L00608 00000000001100110011001100000000*
+L00640 00000000001100110011001100000000*
+L00672 00000000001100110011001100000000*
+L00704 00000000001100110011001100000000*
+L00736 00000000001100110011001100000000*
+
+L00768 01010111101101110111011101111111*
+L00800 11111111111111111111111111111010*
+L00832 00000000001100110011001100000000*
+L00864 00000000001100110011001100000000*
+L00896 00000000001100110011001100000000*
+L00928 00000000001100110011001100000000*
+L00960 00000000001100110011001100000000*
+L00992 00000000001100110011001100000000*
+
+L01024 01011011011101110111011101111111*
+L01056 11111111111111111111111111110101*
+L01088 00000000001100110011001100000000*
+L01120 00000000001100110011001100000000*
+L01152 00000000001100110011001100000000*
+L01184 00000000001100110011001100000000*
+L01216 00000000001100110011001100000000*
+L01248 00000000001100110011001100000000*
+
+L01280 10010111011101110111011101111111*
+L01312 11111111111111111111111111111001*
+L01344 00000000001100110011001100000000*
+L01376 00000000001100110011001100000000*
+L01408 00000000001100110011001100000000*
+L01440 00000000001100110011001100000000*
+L01472 00000000001100110011001100000000*
+L01504 00000000001100110011001100000000*
+
+L01536 01100111011101110111011101111111*
+L01568 11111111111111111111111111110101*
+L01600 11111110111111111111111111111111*
+L01632 11111111111111111111111111011111*
+L01664 00000000001100110011001100000000*
+L01696 00000000001100110011001100000000*
+L01728 00000000001100110011001100000000*
+L01760 00000000001100110011001100000000*
+
+L01792 00000000001100110011001100000000*
+L01824 00000000001100110011001100000000*
+L01856 00000000001100110011001100000000*
+L01888 00000000001100110011001100000000*
+L01920 00000000001100110011001100000000*
+L01952 00000000001100110011001100000000*
+L01984 00000000001100110011001100000000*
+L02016 00000000001100110011001100000000*
+
+N ==> XOR *
+L02048 00000000*
+N ==> Signature is "" *
+L02056 00000000000000000000000000000000*
+L02088 00000000000000000000000000000000*
+N ==> AC1 *
+L02120 10000001*
+N ==> PTD *
+L02128 00000000111100001100000011000000*
+L02160 11000000110000001111000000000000*
+N ==> SYN 2192, AC0 2193 *
+L02192 10*
+C8809*
+
+0000
diff --git a/src/regtests/jedutil/jeds/gal16v8/pal14h4-to-gal16v8.jed b/src/regtests/jedutil/jeds/gal16v8/pal14h4-to-gal16v8.jed
new file mode 100644
index 00000000000..47021af7dc7
--- /dev/null
+++ b/src/regtests/jedutil/jeds/gal16v8/pal14h4-to-gal16v8.jed
@@ -0,0 +1,106 @@
+
+Device G16V8 converted from PAL14H4 JEDEC map.
+PAL to GAL JEDEC conversion utility - paltogal v3.12 17 November 1992
+Copyright (c) by LATTICE Semiconductor Corp. 1990, 1991, 1992.
+Input File: pal14h4.jed
+Output File: gal16v8.jed
+The Date: Fri Sep 28 22:11:50 2012
+
+
+PAL14H4
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "PAL14H4.eqn". Date: 8-24-112
+*
+NOTE PINS i1:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS i11:11 i12:12 i13:13 o14:14 o15:15 o16:16 o17:17 i18:18*
+NOTE PINS i19:19 VCC:20*
+QF2194*QP20*F0*
+
+L00000 00000000000000110011000000000000*
+L00032 00000000000000110011000000000000*
+L00064 00000000000000110011000000000000*
+L00096 00000000000000110011000000000000*
+L00128 00000000000000110011000000000000*
+L00160 00000000000000110011000000000000*
+L00192 00000000000000110011000000000000*
+L00224 00000000000000110011000000000000*
+
+L00256 00000000000000110011000000000000*
+L00288 00000000000000110011000000000000*
+L00320 00000000000000110011000000000000*
+L00352 00000000000000110011000000000000*
+L00384 00000000000000110011000000000000*
+L00416 00000000000000110011000000000000*
+L00448 00000000000000110011000000000000*
+L00480 00000000000000110011000000000000*
+
+L00512 01010111101101110111011101111111*
+L00544 11111111111111111111111111110101*
+L00576 11111111111111111111110111101111*
+L00608 11111101110111111111111111111111*
+L00640 00000000000000110011000000000000*
+L00672 00000000000000110011000000000000*
+L00704 00000000000000110011000000000000*
+L00736 00000000000000110011000000000000*
+
+L00768 01011011011101110111011101111111*
+L00800 11111111111111111111111111111001*
+L00832 11111111111111111111111011011111*
+L00864 11111110111011111111111111111111*
+L00896 00000000000000110011000000000000*
+L00928 00000000000000110011000000000000*
+L00960 00000000000000110011000000000000*
+L00992 00000000000000110011000000000000*
+
+L01024 10010111011101110111011101111111*
+L01056 11111111111111111111111111110110*
+L01088 11111111111111111111110111011111*
+L01120 11111101111011111111111111111111*
+L01152 00000000000000110011000000000000*
+L01184 00000000000000110011000000000000*
+L01216 00000000000000110011000000000000*
+L01248 00000000000000110011000000000000*
+
+L01280 01100111011101110111011101111111*
+L01312 11111111111111111111111111110101*
+L01344 11111111111111111111111011101111*
+L01376 11111110110111111111111111111111*
+L01408 00000000000000110011000000000000*
+L01440 00000000000000110011000000000000*
+L01472 00000000000000110011000000000000*
+L01504 00000000000000110011000000000000*
+
+L01536 00000000000000110011000000000000*
+L01568 00000000000000110011000000000000*
+L01600 00000000000000110011000000000000*
+L01632 00000000000000110011000000000000*
+L01664 00000000000000110011000000000000*
+L01696 00000000000000110011000000000000*
+L01728 00000000000000110011000000000000*
+L01760 00000000000000110011000000000000*
+
+L01792 00000000000000110011000000000000*
+L01824 00000000000000110011000000000000*
+L01856 00000000000000110011000000000000*
+L01888 00000000000000110011000000000000*
+L01920 00000000000000110011000000000000*
+L01952 00000000000000110011000000000000*
+L01984 00000000000000110011000000000000*
+L02016 00000000000000110011000000000000*
+
+N ==> XOR *
+L02048 11111111*
+N ==> Signature is "" *
+L02056 00000000000000000000000000000000*
+L02088 00000000000000000000000000000000*
+N ==> AC1 *
+L02120 11000011*
+N ==> PTD *
+L02128 00000000000000001111000011110000*
+L02160 11110000111100000000000000000000*
+N ==> SYN 2192, AC0 2193 *
+L02192 10*
+C6249*
+
+0000
diff --git a/src/regtests/jedutil/jeds/gal16v8/pal14l4-to-gal16v8.jed b/src/regtests/jedutil/jeds/gal16v8/pal14l4-to-gal16v8.jed
new file mode 100644
index 00000000000..8bbbee92a83
--- /dev/null
+++ b/src/regtests/jedutil/jeds/gal16v8/pal14l4-to-gal16v8.jed
@@ -0,0 +1,106 @@
+
+Device G16V8 converted from PAL14L4 JEDEC map.
+PAL to GAL JEDEC conversion utility - paltogal v3.12 17 November 1992
+Copyright (c) by LATTICE Semiconductor Corp. 1990, 1991, 1992.
+Input File: pal14l4.jed
+Output File: gal16v8.jed
+The Date: Fri Sep 28 22:14:09 2012
+
+
+PAL14L4
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "PAL14L4.eqn". Date: 8-24-112
+*
+NOTE PINS i1:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS i11:11 i12:12 i13:13 o14:14 o15:15 o16:16 o17:17 i18:18*
+NOTE PINS i19:19 VCC:20*
+QF2194*QP20*F0*
+
+L00000 00000000000000110011000000000000*
+L00032 00000000000000110011000000000000*
+L00064 00000000000000110011000000000000*
+L00096 00000000000000110011000000000000*
+L00128 00000000000000110011000000000000*
+L00160 00000000000000110011000000000000*
+L00192 00000000000000110011000000000000*
+L00224 00000000000000110011000000000000*
+
+L00256 00000000000000110011000000000000*
+L00288 00000000000000110011000000000000*
+L00320 00000000000000110011000000000000*
+L00352 00000000000000110011000000000000*
+L00384 00000000000000110011000000000000*
+L00416 00000000000000110011000000000000*
+L00448 00000000000000110011000000000000*
+L00480 00000000000000110011000000000000*
+
+L00512 01010111011101111011011101111111*
+L00544 11111111111111111111111111111001*
+L00576 11111111111111111111111011101111*
+L00608 11111110111011111111111111111111*
+L00640 00000000000000110011000000000000*
+L00672 00000000000000110011000000000000*
+L00704 00000000000000110011000000000000*
+L00736 00000000000000110011000000000000*
+
+L00768 01010111011110110111011101111111*
+L00800 11111111111111111111111111111010*
+L00832 11111111111111111111110111011111*
+L00864 11111110110111111111111111111111*
+L00896 00000000000000110011000000000000*
+L00928 00000000000000110011000000000000*
+L00960 00000000000000110011000000000000*
+L00992 00000000000000110011000000000000*
+
+L01024 01010111101101110111011101111111*
+L01056 11111111111111111111111111111010*
+L01088 11111111111111111111110111101111*
+L01120 11111101111011111111111111111111*
+L01152 00000000000000110011000000000000*
+L01184 00000000000000110011000000000000*
+L01216 00000000000000110011000000000000*
+L01248 00000000000000110011000000000000*
+
+L01280 10010111011101110111011101111111*
+L01312 11111111111111111111111111111001*
+L01344 11111111111111111111111011011111*
+L01376 11111101110111111111111111111111*
+L01408 00000000000000110011000000000000*
+L01440 00000000000000110011000000000000*
+L01472 00000000000000110011000000000000*
+L01504 00000000000000110011000000000000*
+
+L01536 00000000000000110011000000000000*
+L01568 00000000000000110011000000000000*
+L01600 00000000000000110011000000000000*
+L01632 00000000000000110011000000000000*
+L01664 00000000000000110011000000000000*
+L01696 00000000000000110011000000000000*
+L01728 00000000000000110011000000000000*
+L01760 00000000000000110011000000000000*
+
+L01792 00000000000000110011000000000000*
+L01824 00000000000000110011000000000000*
+L01856 00000000000000110011000000000000*
+L01888 00000000000000110011000000000000*
+L01920 00000000000000110011000000000000*
+L01952 00000000000000110011000000000000*
+L01984 00000000000000110011000000000000*
+L02016 00000000000000110011000000000000*
+
+N ==> XOR *
+L02048 00000000*
+N ==> Signature is "" *
+L02056 00000000000000000000000000000000*
+L02088 00000000000000000000000000000000*
+N ==> AC1 *
+L02120 11000011*
+N ==> PTD *
+L02128 00000000000000001111000011110000*
+L02160 11110000111100000000000000000000*
+N ==> SYN 2192, AC0 2193 *
+L02192 10*
+C60DD*
+
+0000
diff --git a/src/regtests/jedutil/jeds/gal16v8/pal16h2-to-gal16v8.jed b/src/regtests/jedutil/jeds/gal16v8/pal16h2-to-gal16v8.jed
new file mode 100644
index 00000000000..2aef46b0c33
--- /dev/null
+++ b/src/regtests/jedutil/jeds/gal16v8/pal16h2-to-gal16v8.jed
@@ -0,0 +1,106 @@
+
+Device G16V8 converted from PAL16H2 JEDEC map.
+PAL to GAL JEDEC conversion utility - paltogal v3.12 17 November 1992
+Copyright (c) by LATTICE Semiconductor Corp. 1990, 1991, 1992.
+Input File: pal16h2.jed
+Output File: gal16v8.jed
+The Date: Fri Sep 28 22:25:49 2012
+
+
+PAL16H2
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "PAL16H2.eqn". Date: 8-24-112
+*
+NOTE PINS i1:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS i11:11 i12:12 i13:13 i14:14 o15:15 o16:16 i17:17 i18:18*
+NOTE PINS i19:19 VCC:20*
+QF2194*QP20*F0*
+
+L00000 00000000000000000000000000000000*
+L00032 00000000000000000000000000000000*
+L00064 00000000000000000000000000000000*
+L00096 00000000000000000000000000000000*
+L00128 00000000000000000000000000000000*
+L00160 00000000000000000000000000000000*
+L00192 00000000000000000000000000000000*
+L00224 00000000000000000000000000000000*
+
+L00256 00000000000000000000000000000000*
+L00288 00000000000000000000000000000000*
+L00320 00000000000000000000000000000000*
+L00352 00000000000000000000000000000000*
+L00384 00000000000000000000000000000000*
+L00416 00000000000000000000000000000000*
+L00448 00000000000000000000000000000000*
+L00480 00000000000000000000000000000000*
+
+L00512 00000000000000000000000000000000*
+L00544 00000000000000000000000000000000*
+L00576 00000000000000000000000000000000*
+L00608 00000000000000000000000000000000*
+L00640 00000000000000000000000000000000*
+L00672 00000000000000000000000000000000*
+L00704 00000000000000000000000000000000*
+L00736 00000000000000000000000000000000*
+
+L00768 01011011011110110111011101111111*
+L00800 11111111111111111111111111111011*
+L00832 11111111111111111111111111111101*
+L00864 11111111111111111111111111101111*
+L00896 11111111111111111111110111111111*
+L00928 11111111111111111110111111111111*
+L00960 11111111111111011111111111111111*
+L00992 11111101111011111111111111111111*
+
+L01024 01010111101101111011011101111111*
+L01056 11111111111111111111111111110111*
+L01088 11111111111111111111111111111110*
+L01120 11111111111111111111111111011111*
+L01152 11111111111111111111111011111111*
+L01184 11111111111111111101111111111111*
+L01216 11111111111111101111111111111111*
+L01248 11111110110111111111111111111111*
+
+L01280 00000000000000000000000000000000*
+L01312 00000000000000000000000000000000*
+L01344 00000000000000000000000000000000*
+L01376 00000000000000000000000000000000*
+L01408 00000000000000000000000000000000*
+L01440 00000000000000000000000000000000*
+L01472 00000000000000000000000000000000*
+L01504 00000000000000000000000000000000*
+
+L01536 00000000000000000000000000000000*
+L01568 00000000000000000000000000000000*
+L01600 00000000000000000000000000000000*
+L01632 00000000000000000000000000000000*
+L01664 00000000000000000000000000000000*
+L01696 00000000000000000000000000000000*
+L01728 00000000000000000000000000000000*
+L01760 00000000000000000000000000000000*
+
+L01792 00000000000000000000000000000000*
+L01824 00000000000000000000000000000000*
+L01856 00000000000000000000000000000000*
+L01888 00000000000000000000000000000000*
+L01920 00000000000000000000000000000000*
+L01952 00000000000000000000000000000000*
+L01984 00000000000000000000000000000000*
+L02016 00000000000000000000000000000000*
+
+N ==> XOR *
+L02048 11111111*
+N ==> Signature is "" *
+L02056 00000000000000000000000000000000*
+L02088 00000000000000000000000000000000*
+N ==> AC1 *
+L02120 11100111*
+N ==> PTD *
+L02128 00000000000000000000000011111111*
+L02160 11111111000000000000000000000000*
+N ==> SYN 2192, AC0 2193 *
+L02192 10*
+C3FBF*
+
+0000
diff --git a/src/regtests/jedutil/jeds/gal16v8/pal16l2-to-gal16v8.jed b/src/regtests/jedutil/jeds/gal16v8/pal16l2-to-gal16v8.jed
new file mode 100644
index 00000000000..bf1e9902e74
--- /dev/null
+++ b/src/regtests/jedutil/jeds/gal16v8/pal16l2-to-gal16v8.jed
@@ -0,0 +1,106 @@
+
+Device G16V8 converted from PAL16L2 JEDEC map.
+PAL to GAL JEDEC conversion utility - paltogal v3.12 17 November 1992
+Copyright (c) by LATTICE Semiconductor Corp. 1990, 1991, 1992.
+Input File: pal16l2.jed
+Output File: gal16v8.jed
+The Date: Fri Sep 28 22:28:15 2012
+
+
+PAL16L2
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "PAL16L2.eqn". Date: 8-24-112
+*
+NOTE PINS i1:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS i11:11 i12:12 i13:13 i14:14 o15:15 o16:16 i17:17 i18:18*
+NOTE PINS i19:19 VCC:20*
+QF2194*QP20*F0*
+
+L00000 00000000000000000000000000000000*
+L00032 00000000000000000000000000000000*
+L00064 00000000000000000000000000000000*
+L00096 00000000000000000000000000000000*
+L00128 00000000000000000000000000000000*
+L00160 00000000000000000000000000000000*
+L00192 00000000000000000000000000000000*
+L00224 00000000000000000000000000000000*
+
+L00256 00000000000000000000000000000000*
+L00288 00000000000000000000000000000000*
+L00320 00000000000000000000000000000000*
+L00352 00000000000000000000000000000000*
+L00384 00000000000000000000000000000000*
+L00416 00000000000000000000000000000000*
+L00448 00000000000000000000000000000000*
+L00480 00000000000000000000000000000000*
+
+L00512 00000000000000000000000000000000*
+L00544 00000000000000000000000000000000*
+L00576 00000000000000000000000000000000*
+L00608 00000000000000000000000000000000*
+L00640 00000000000000000000000000000000*
+L00672 00000000000000000000000000000000*
+L00704 00000000000000000000000000000000*
+L00736 00000000000000000000000000000000*
+
+L00768 01010111011101110111101101111111*
+L00800 11111111111111111111111111110111*
+L00832 11111111111111111111111111111101*
+L00864 11111111111111111111111111011111*
+L00896 11111111111111111111111011111111*
+L00928 11111111111111111110111111111111*
+L00960 11111111111111101111111111111111*
+L00992 11111110111011111111111111111111*
+
+L01024 01010111101101110111011101111111*
+L01056 11111111111111111111111111111011*
+L01088 11111111111111111111111111111110*
+L01120 11111111111111111111111111101111*
+L01152 11111111111111111111110111111111*
+L01184 11111111111111111101111111111111*
+L01216 11111111111111011111111111111111*
+L01248 11111101110111111111111111111111*
+
+L01280 00000000000000000000000000000000*
+L01312 00000000000000000000000000000000*
+L01344 00000000000000000000000000000000*
+L01376 00000000000000000000000000000000*
+L01408 00000000000000000000000000000000*
+L01440 00000000000000000000000000000000*
+L01472 00000000000000000000000000000000*
+L01504 00000000000000000000000000000000*
+
+L01536 00000000000000000000000000000000*
+L01568 00000000000000000000000000000000*
+L01600 00000000000000000000000000000000*
+L01632 00000000000000000000000000000000*
+L01664 00000000000000000000000000000000*
+L01696 00000000000000000000000000000000*
+L01728 00000000000000000000000000000000*
+L01760 00000000000000000000000000000000*
+
+L01792 00000000000000000000000000000000*
+L01824 00000000000000000000000000000000*
+L01856 00000000000000000000000000000000*
+L01888 00000000000000000000000000000000*
+L01920 00000000000000000000000000000000*
+L01952 00000000000000000000000000000000*
+L01984 00000000000000000000000000000000*
+L02016 00000000000000000000000000000000*
+
+N ==> XOR *
+L02048 00000000*
+N ==> Signature is "" *
+L02056 00000000000000000000000000000000*
+L02088 00000000000000000000000000000000*
+N ==> AC1 *
+L02120 11100111*
+N ==> PTD *
+L02128 00000000000000000000000011111111*
+L02160 11111111000000000000000000000000*
+N ==> SYN 2192, AC0 2193 *
+L02192 10*
+C3ED1*
+
+0000
diff --git a/src/regtests/jedutil/jeds/gal16v8/pal16l8-to-gal16v8.jed b/src/regtests/jedutil/jeds/gal16v8/pal16l8-to-gal16v8.jed
new file mode 100644
index 00000000000..daeacef7fee
--- /dev/null
+++ b/src/regtests/jedutil/jeds/gal16v8/pal16l8-to-gal16v8.jed
@@ -0,0 +1,107 @@
+
+Device G16V8 converted from PAL16L8 JEDEC map.
+PAL to GAL JEDEC conversion utility - paltogal v3.12 17 November 1992
+Copyright (c) by LATTICE Semiconductor Corp. 1990, 1991, 1992.
+Input File: pal16l8.jed
+Output File: gal16v8.jed
+The Date: Fri Sep 28 22:29:50 2012
+
+
+PAL16L8
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "pal16l8.eqn". Date: 8-29-112
+md
+*
+NOTE PINS i1:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS i11:11 o12:12 o13:13 o14:14 o15:15 o16:16 o17:17 o18:18*
+NOTE PINS o19:19 VCC:20*
+QF2194*QP20*F0*
+
+L00000 11111111111111111111111111111111*
+L00032 11111111111101110111101111111101*
+L00064 11110111111111110111011111111111*
+L00096 11111111111101111111111111111111*
+L00128 11111111111111110111111111111111*
+L00160 11111111111111111111011111111111*
+L00192 11111111111111111111111111111101*
+L00224 11111111111111111111101111111111*
+
+L00256 11111111111111111111111111111111*
+L00288 10111111111101110111101111111111*
+L00320 11110111111111110111011111111101*
+L00352 11110111111111111111111111111111*
+L00384 10111111111111111111101111111111*
+L00416 11110111111111111111111111111101*
+L00448 11111111111101110111101111111111*
+L00480 11111111111111111111011111111101*
+
+L00512 11111111111111101111111111111111*
+L00544 01111111111101110111101111111111*
+L00576 01111110111111111111111111111111*
+L00608 11111111111101111111111111111111*
+L00640 11111111111111110111111111111111*
+L00672 11111101111111111111101111111111*
+L00704 01111111111111111111101111111111*
+L00736 11111111111101110111111111111111*
+
+L00768 11111111111111111111111111111111*
+L00800 11111011111011111111111111111111*
+L00832 11111111101111111111111111111110*
+L00864 11111011101111111111111111111111*
+L00896 11111011011111111111111111111111*
+L00928 11111111110111111111101111111111*
+L00960 11111111111111111111101111111110*
+L00992 11111111011111111111111111111111*
+
+L01024 11111111111111111111111111111111*
+L01056 11110111111111110111011111111110*
+L01088 11111111111111010111111111111111*
+L01120 11110111111111101111111111111111*
+L01152 11111111111111111111011111111111*
+L01184 11111111111111111111111111111110*
+L01216 11111111111111110111011111111111*
+L01248 11111111111111111111011111111110*
+
+L01280 11111111111111111111111111111111*
+L01312 11011111111111111110111111111111*
+L01344 11111111111111111111111110111111*
+L01376 11011111111111111111111110111111*
+L01408 10011111111111111110111111111111*
+L01440 10111111111111111111111111111111*
+L01472 01111111111111111101111110111111*
+L01504 11110111111111111111111111111111*
+
+L01536 01111111111111111111110111111111*
+L01568 11111111111111111111111011111101*
+L01600 11111111111111111111111111111011*
+L01632 11111111111111111111111101111111*
+L01664 11111111111111111111101111111111*
+L01696 11111111111111111011110111111111*
+L01728 11111111111101111111111111111111*
+L01760 11111111011111111111111111111111*
+
+L01792 11111111111111111111111111111111*
+L01824 11110111111111111111011111111011*
+L01856 11011111111111111111111111011111*
+L01888 11110111111111111111111111111111*
+L01920 11111111111111111011111111111111*
+L01952 11111111111111111111111101111111*
+L01984 11111111111111111111111111111011*
+L02016 11111111111111111111011111101111*
+
+N ==> XOR *
+L02048 00000000*
+N ==> Signature is "" *
+L02056 00000000000000000000000000000000*
+L02088 00000000000000000000000000000000*
+N ==> AC1 *
+L02120 11111111*
+N ==> PTD *
+L02128 11111111111111111111111111111111*
+L02160 11111111111111111111111111111111*
+N ==> SYN 2192, AC0 2193 *
+L02192 11*
+CFCC2*
+
+0000
diff --git a/src/regtests/jedutil/jeds/gal16v8/pal16r4-to-gal16v8.jed b/src/regtests/jedutil/jeds/gal16v8/pal16r4-to-gal16v8.jed
new file mode 100644
index 00000000000..74a81b551ed
--- /dev/null
+++ b/src/regtests/jedutil/jeds/gal16v8/pal16r4-to-gal16v8.jed
@@ -0,0 +1,106 @@
+
+Device G16V8 converted from PAL16R4 JEDEC map.
+PAL to GAL JEDEC conversion utility - paltogal v3.12 17 November 1992
+Copyright (c) by LATTICE Semiconductor Corp. 1990, 1991, 1992.
+Input File: pal16r4.jed
+Output File: gal16v8.jed
+The Date: Sun Sep 30 22:07:16 2012
+
+
+PAL16R4
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "pal16r4.eqn". Date: 9-6-112
+*
+NOTE PINS CLK:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS /OE:11 o12:12 o13:13 rf14:14 rf15:15 rf16:16 rf17:17*
+NOTE PINS o18:18 o19:19 VCC:20*
+QF2194*QP20*F0*
+
+L00000 11111111111111111111111111111111*
+L00032 11111111111101110111101111111111*
+L00064 11110111111111110111011111111111*
+L00096 11111111111101111111111111111111*
+L00128 11111111111111110111111111111111*
+L00160 11111111111111111111011111111111*
+L00192 11111111101111111111111111111111*
+L00224 11111111111111111111101111111111*
+
+L00256 11111111111111111111111111111111*
+L00288 10111111111101110111101111111111*
+L00320 11110111111111110111011111111111*
+L00352 11110111111111111111111111111111*
+L00384 10111111111111111111101111111111*
+L00416 11111011111111111111111111111111*
+L00448 11111111111101110111101111111111*
+L00480 11111111111111111111011111111111*
+
+L00512 01111111111101110111101111111111*
+L00544 01111110111111111111111111111111*
+L00576 11111111111101111111111111111111*
+L00608 11111111111111110111111111111111*
+L00640 11111101111111111111101111111111*
+L00672 01111111111111111111101111111111*
+L00704 11111111111101110111111111111111*
+L00736 11111011111111111111111111111111*
+
+L00768 11111011111011111111111111111111*
+L00800 11111111101111111111111111111111*
+L00832 11111011111111111111111111111111*
+L00864 11111011011111111111111111111111*
+L00896 11111111110111111111101111111111*
+L00928 11111111111111111111101111111111*
+L00960 11111111011111111111111111111111*
+L00992 01110111111111111111111111111111*
+
+L01024 11110111111111110111011111111111*
+L01056 11111111111111010111111111111111*
+L01088 11110111111111101111111111111111*
+L01120 11111111111111111111011111111111*
+L01152 11111111101111111111111111111111*
+L01184 11111111111111110111011111111111*
+L01216 11111111011111111111011111111111*
+L01248 10111111111111111111101111111111*
+
+L01280 11111111111111111110111111111111*
+L01312 11111111111111111111111110111111*
+L01344 11111111111111111111111101111111*
+L01376 10111111111111111110111111111111*
+L01408 10111111111111111111111111111111*
+L01440 01111111111111111101111110111111*
+L01472 11111111101111111111111111111111*
+L01504 11110111111111111111111111111111*
+
+L01536 01111111111111111111110111111111*
+L01568 11111111111111111111111011111111*
+L01600 11111111111111111111111111111011*
+L01632 11111111111111111111111101111111*
+L01664 11111111111111111111101111111111*
+L01696 11111111111111111011111011111111*
+L01728 11111111111101111111111111111111*
+L01760 11111111011111111111111111111111*
+
+L01792 11111111111111111111110111111111*
+L01824 10111011111111111111111111111111*
+L01856 11111111011111111111111111011111*
+L01888 11110111111111111111111111111111*
+L01920 11111111111111111011111111111111*
+L01952 11111111111111111111111101111111*
+L01984 11111111111111111111111111111011*
+L02016 11111111111111111111011111101111*
+
+N ==> XOR *
+L02048 00000000*
+N ==> Signature is "" *
+L02056 00000000000000000000000000000000*
+L02088 00000000000000000000000000000000*
+N ==> AC1 *
+L02120 11000011*
+N ==> PTD *
+L02128 11111111111111111111111111111111*
+L02160 11111111111111111111111111111111*
+N ==> SYN 2192, AC0 2193 *
+L02192 01*
+C004B*
+
+0000
diff --git a/src/regtests/jedutil/jeds/gal16v8/pal16r6-to-gal16v8.jed b/src/regtests/jedutil/jeds/gal16v8/pal16r6-to-gal16v8.jed
new file mode 100644
index 00000000000..4e59f69cdb8
--- /dev/null
+++ b/src/regtests/jedutil/jeds/gal16v8/pal16r6-to-gal16v8.jed
@@ -0,0 +1,106 @@
+
+Device G16V8 converted from PAL16R6 JEDEC map.
+PAL to GAL JEDEC conversion utility - paltogal v3.12 17 November 1992
+Copyright (c) by LATTICE Semiconductor Corp. 1990, 1991, 1992.
+Input File: pal16r6.jed
+Output File: gal16v8.jed
+The Date: Sun Sep 30 22:09:28 2012
+
+
+PAL16R6
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "pal16r6.eqn". Date: 9-10-112
+*
+NOTE PINS CLK:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS /OE:11 o12:12 rf13:13 rf14:14 rf15:15 rf16:16 rf17:17*
+NOTE PINS rf18:18 o19:19 VCC:20*
+QF2194*QP20*F0*
+
+L00000 11111111111111111111111111111111*
+L00032 11111111111101110111101111111111*
+L00064 11110111111111110111011111111111*
+L00096 11111111111101111111111111111111*
+L00128 11111111111111110111111111111111*
+L00160 11111111111111111111011111111111*
+L00192 11111111101111111111111111111111*
+L00224 11111111111111111111101111111111*
+
+L00256 10111111111101110111101111111111*
+L00288 11110111111111110111011111111111*
+L00320 11110111111111111111111111111111*
+L00352 10111111111111111111101111111111*
+L00384 11111011111111111111111111111111*
+L00416 11111111111101110111101111111111*
+L00448 11111111111111111111011111111111*
+L00480 11111111011111111111111111111111*
+
+L00512 01111111111101110111101111111111*
+L00544 01111110111111111111111111111111*
+L00576 11111111111101111111111111111111*
+L00608 11111111111111110111111111111111*
+L00640 11111101111111111111101111111111*
+L00672 01111111111111111111101111111111*
+L00704 11111111111101110111111111111111*
+L00736 11111011111111111111111111111111*
+
+L00768 11111011111011111111111111111111*
+L00800 11111111101111111111111111111111*
+L00832 11111011111111111111111111111111*
+L00864 11111011011111111111111111111111*
+L00896 11111111110111111111101111111111*
+L00928 11111111111111111111101111111111*
+L00960 11111111011111111111111111111111*
+L00992 01110111111111111111111111111111*
+
+L01024 11110111111111110111011111111111*
+L01056 11111111111111010111111111111111*
+L01088 11110111111111101111111111111111*
+L01120 11111111111111111111011111111111*
+L01152 11111111101111111111111111111111*
+L01184 11111111111111110111011111111111*
+L01216 11111111011111111111011111111111*
+L01248 10111111111111111111101111111111*
+
+L01280 11111111111111111110111111111111*
+L01312 11111111111111111111111110111111*
+L01344 11111111111111111111111101111111*
+L01376 10111111111111111110111111111111*
+L01408 10111111111111111111111111111111*
+L01440 01111111111111111101111110111111*
+L01472 11111111101111111111111111111111*
+L01504 11110111111111111111111111111111*
+
+L01536 11111111111111111111111011111111*
+L01568 11111111111111111111111111111011*
+L01600 11111111111111111111111101111111*
+L01632 11111111111111111111101111111111*
+L01664 11111111111111111011111011111111*
+L01696 11111111111101111111110111111111*
+L01728 11111111011111111111111111111111*
+L01760 10111111111111111111111111111111*
+
+L01792 11111111111111111111110111111111*
+L01824 10111011111111111111111111111111*
+L01856 11111111011111111111111111011111*
+L01888 11110111111111111111111111111111*
+L01920 11111111111111111011111111111111*
+L01952 11111111111111111111111101111111*
+L01984 11111111111111111111111111111011*
+L02016 11111111111111111111011111101111*
+
+N ==> XOR *
+L02048 00000000*
+N ==> Signature is "" *
+L02056 00000000000000000000000000000000*
+L02088 00000000000000000000000000000000*
+N ==> AC1 *
+L02120 10000001*
+N ==> PTD *
+L02128 11111111111111111111111111111111*
+L02160 11111111111111111111111111111111*
+N ==> SYN 2192, AC0 2193 *
+L02192 01*
+C0007*
+
+0000
diff --git a/src/regtests/jedutil/jeds/gal16v8/pal16r8-to-gal16v8.jed b/src/regtests/jedutil/jeds/gal16v8/pal16r8-to-gal16v8.jed
new file mode 100644
index 00000000000..4354b1c9996
--- /dev/null
+++ b/src/regtests/jedutil/jeds/gal16v8/pal16r8-to-gal16v8.jed
@@ -0,0 +1,106 @@
+
+Device G16V8 converted from PAL16R8 JEDEC map.
+PAL to GAL JEDEC conversion utility - paltogal v3.12 17 November 1992
+Copyright (c) by LATTICE Semiconductor Corp. 1990, 1991, 1992.
+Input File: pal16r8.jed
+Output File: gal16v8.jed
+The Date: Sun Sep 30 22:10:55 2012
+
+
+PAL16R8
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "pal16r8.eqn". Date: 9-10-112
+*
+NOTE PINS CLK:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS /OE:11 rf12:12 rf13:13 rf14:14 rf15:15 rf16:16 rf17:17*
+NOTE PINS rf18:18 rf19:19 VCC:20*
+QF2194*QP20*F0*
+
+L00000 11111111111101110111101111111111*
+L00032 11110111111111110111011111111111*
+L00064 11111111111101111111111111111101*
+L00096 11111111111111110111111111111111*
+L00128 11111111111111111111011111111111*
+L00160 11111111101111111111111111111110*
+L00192 11111111111111111111101111111111*
+L00224 01111111111111111111111111111111*
+
+L00256 10111111111101110111101111111111*
+L00288 11110111111111110111011111111111*
+L00320 11010111111111111111111111111111*
+L00352 10111111111111111111101111111111*
+L00384 11101011111111111111111111111111*
+L00416 11111111111101110111101111111111*
+L00448 11111111111111111111011111111111*
+L00480 11111111101111111111111111111111*
+
+L00512 01111111111101110111101111111111*
+L00544 01111110111111111111111111111111*
+L00576 11111111111101111111111111111111*
+L00608 11111111111111110111111111111111*
+L00640 11111101111111111111101111111111*
+L00672 01111111111111111111101111111111*
+L00704 11111111111101110111111111111111*
+L00736 11111011111111111111111111111111*
+
+L00768 11111011111011111111111111111111*
+L00800 11111111101111111111111111111111*
+L00832 11111011111111111111111111111111*
+L00864 11111011011111111111111111111111*
+L00896 11111111110111111111101111111111*
+L00928 11111111111111111111101111111111*
+L00960 11111111011111111111111111111111*
+L00992 01110111111111111111111111111111*
+
+L01024 11110111111111110111011111111111*
+L01056 11111111111111010111111111111111*
+L01088 11110111111111101111111111111111*
+L01120 11111111111111111111011111111111*
+L01152 11111111101111111111111111111111*
+L01184 11111111111111110111011111111111*
+L01216 11111111011111111111011111111111*
+L01248 10111111111111111111101111111111*
+
+L01280 11111111111111111110111111111111*
+L01312 11111111111111111111111110111111*
+L01344 11111111111111111111111101111111*
+L01376 10111111111111111110111111111111*
+L01408 10111111111111111111111111111111*
+L01440 01111111111111111101111110111111*
+L01472 11111111101111111111111111111111*
+L01504 11110111111111111111111111111111*
+
+L01536 11111111111111111111111011111111*
+L01568 11111111111111111111111111111011*
+L01600 11111111111111111111111101111111*
+L01632 11111111111111111111101111111111*
+L01664 11111111111111111011110111111111*
+L01696 11111111111101111111111111111111*
+L01728 11111111011111111111111111111111*
+L01760 11111011111111111111111111111111*
+
+L01792 10111011111111111111111111111111*
+L01824 11111111011111111111111111011111*
+L01856 11110111111111111111111111111111*
+L01888 11111111111111111011111111111111*
+L01920 11111111111111111111111101111111*
+L01952 11111111111111111111111111111011*
+L01984 11111111111111111111011111101111*
+L02016 11111111111101111111111111111111*
+
+N ==> XOR *
+L02048 00000000*
+N ==> Signature is "" *
+L02056 00000000000000000000000000000000*
+L02088 00000000000000000000000000000000*
+N ==> AC1 *
+L02120 00000000*
+N ==> PTD *
+L02128 11111111111111111111111111111111*
+L02160 11111111111111111111111111111111*
+N ==> SYN 2192, AC0 2193 *
+L02192 01*
+CFF4A*
+
+0000
diff --git a/src/regtests/jedutil/jeds/pal10h8.jed b/src/regtests/jedutil/jeds/pal10h8/pal10h8.jed
index 96ffb7005dc..96ffb7005dc 100644
--- a/src/regtests/jedutil/jeds/pal10h8.jed
+++ b/src/regtests/jedutil/jeds/pal10h8/pal10h8.jed
diff --git a/src/regtests/jedutil/jeds/pal10l8.jed b/src/regtests/jedutil/jeds/pal10l8/pal10l8.jed
index a5293c4e893..a5293c4e893 100644
--- a/src/regtests/jedutil/jeds/pal10l8.jed
+++ b/src/regtests/jedutil/jeds/pal10l8/pal10l8.jed
diff --git a/src/regtests/jedutil/jeds/pal12h6.jed b/src/regtests/jedutil/jeds/pal12h6/pal12h6.jed
index b6b3948455c..b6b3948455c 100644
--- a/src/regtests/jedutil/jeds/pal12h6.jed
+++ b/src/regtests/jedutil/jeds/pal12h6/pal12h6.jed
diff --git a/src/regtests/jedutil/jeds/pal12l6.jed b/src/regtests/jedutil/jeds/pal12l6/pal12l6.jed
index 58a6cecf02f..58a6cecf02f 100644
--- a/src/regtests/jedutil/jeds/pal12l6.jed
+++ b/src/regtests/jedutil/jeds/pal12l6/pal12l6.jed
diff --git a/src/regtests/jedutil/jeds/pal14h4.jed b/src/regtests/jedutil/jeds/pal14h4/pal14h4.jed
index f673ba3d820..f673ba3d820 100644
--- a/src/regtests/jedutil/jeds/pal14h4.jed
+++ b/src/regtests/jedutil/jeds/pal14h4/pal14h4.jed
diff --git a/src/regtests/jedutil/jeds/pal14l4.jed b/src/regtests/jedutil/jeds/pal14l4/pal14l4.jed
index d01cfd872e9..d01cfd872e9 100644
--- a/src/regtests/jedutil/jeds/pal14l4.jed
+++ b/src/regtests/jedutil/jeds/pal14l4/pal14l4.jed
diff --git a/src/regtests/jedutil/jeds/pal16c1/pal16c1.jed b/src/regtests/jedutil/jeds/pal16c1/pal16c1.jed
new file mode 100644
index 00000000000..8395c2982ed
--- /dev/null
+++ b/src/regtests/jedutil/jeds/pal16c1/pal16c1.jed
@@ -0,0 +1,29 @@
+
+PAL16C1
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "PAL16C1.eqn". Date: 9-4-112
+*
+NOTE PINS i1:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS i11:11 i12:12 i13:13 i14:14 /o15:15 /o16:16 i17:17 i18:18*
+NOTE PINS i19:19 VCC:20*
+QF0512*QP20*F0*
+L0000
+01011111111111111111111111111111
+11110111011111111111111111111111
+11111111111101110111111111111111
+11111111111111111111011101111111
+11111111111111111111111111110101
+11111111111111111111110111011111
+11111111111111011101111111111111
+11111101110111111111111111111111
+10101111111111111111111111111111
+11111011101111111111111111111111
+11111111111110111011111111111111
+11111111111111111111101110111111
+11111111111111111111111111111010
+11111111111111111111111011101111
+11111111111111101110111111111111
+11111110111011111111111111111111*
+C3BC4*
+0000
diff --git a/src/regtests/jedutil/jeds/pal16h2.jed b/src/regtests/jedutil/jeds/pal16h2/pal16h2.jed
index df7112dfaed..df7112dfaed 100644
--- a/src/regtests/jedutil/jeds/pal16h2.jed
+++ b/src/regtests/jedutil/jeds/pal16h2/pal16h2.jed
diff --git a/src/regtests/jedutil/jeds/pal16l2.jed b/src/regtests/jedutil/jeds/pal16l2/pal16l2.jed
index 855019dd8e2..855019dd8e2 100644
--- a/src/regtests/jedutil/jeds/pal16l2.jed
+++ b/src/regtests/jedutil/jeds/pal16l2/pal16l2.jed
diff --git a/src/regtests/jedutil/jeds/pal16l8.jed b/src/regtests/jedutil/jeds/pal16l8/pal16l8.jed
index 80940fac0a4..80940fac0a4 100644
--- a/src/regtests/jedutil/jeds/pal16l8.jed
+++ b/src/regtests/jedutil/jeds/pal16l8/pal16l8.jed
diff --git a/src/regtests/jedutil/jeds/pal16r4/pal16r4.jed b/src/regtests/jedutil/jeds/pal16r4/pal16r4.jed
new file mode 100644
index 00000000000..13ccbcd528a
--- /dev/null
+++ b/src/regtests/jedutil/jeds/pal16r4/pal16r4.jed
@@ -0,0 +1,84 @@
+
+PAL16R4
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "pal16r4.eqn". Date: 9-6-112
+*
+NOTE PINS CLK:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS /OE:11 o12:12 o13:13 rf14:14 rf15:15 rf16:16 rf17:17*
+NOTE PINS o18:18 o19:19 VCC:20*
+QF2048*QP20*F0*
+L0000
+11111111111111111111111111111111
+11111111111101110111101111111111
+11110111111111110111011111111111
+11111111111101111111111111111111
+11111111111111110111111111111111
+11111111111111111111011111111111
+11111111101111111111111111111111
+11111111111111111111101111111111*
+L0256
+11111111111111111111111111111111
+10111111111101110111101111111111
+11110111111111110111011111111111
+11110111111111111111111111111111
+10111111111111111111101111111111
+11111011111111111111111111111111
+11111111111101110111101111111111
+11111111111111111111011111111111*
+L0512
+01111111111101110111101111111111
+01111110111111111111111111111111
+11111111111101111111111111111111
+11111111111111110111111111111111
+11111101111111111111101111111111
+01111111111111111111101111111111
+11111111111101110111111111111111
+11111011111111111111111111111111*
+L0768
+11111011111011111111111111111111
+11111111101111111111111111111111
+11111011111111111111111111111111
+11111011011111111111111111111111
+11111111110111111111101111111111
+11111111111111111111101111111111
+11111111011111111111111111111111
+01110111111111111111111111111111*
+L1024
+11110111111111110111011111111111
+11111111111111010111111111111111
+11110111111111101111111111111111
+11111111111111111111011111111111
+11111111101111111111111111111111
+11111111111111110111011111111111
+11111111011111111111011111111111
+10111111111111111111101111111111*
+L1280
+11111111111111111110111111111111
+11111111111111111111111110111111
+11111111111111111111111101111111
+10111111111111111110111111111111
+10111111111111111111111111111111
+01111111111111111101111110111111
+11111111101111111111111111111111
+11110111111111111111111111111111*
+L1536
+01111111111111111111110111111111
+11111111111111111111111011111111
+11111111111111111111111111111011
+11111111111111111111111101111111
+11111111111111111111101111111111
+11111111111111111011111011111111
+11111111111101111111111111111111
+11111111011111111111111111111111*
+L1792
+11111111111111111111110111111111
+10111011111111111111111111111111
+11111111011111111111111111011111
+11110111111111111111111111111111
+11111111111111111011111111111111
+11111111111111111111111101111111
+11111111111111111111111111111011
+11111111111111111111011111101111*
+CF78E*
+0000
diff --git a/src/regtests/jedutil/jeds/pal16r6/pal16r6.jed b/src/regtests/jedutil/jeds/pal16r6/pal16r6.jed
new file mode 100644
index 00000000000..1d400852080
--- /dev/null
+++ b/src/regtests/jedutil/jeds/pal16r6/pal16r6.jed
@@ -0,0 +1,84 @@
+
+PAL16R6
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "pal16r6.eqn". Date: 9-10-112
+*
+NOTE PINS CLK:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS /OE:11 o12:12 rf13:13 rf14:14 rf15:15 rf16:16 rf17:17*
+NOTE PINS rf18:18 o19:19 VCC:20*
+QF2048*QP20*F0*
+L0000
+11111111111111111111111111111111
+11111111111101110111101111111111
+11110111111111110111011111111111
+11111111111101111111111111111111
+11111111111111110111111111111111
+11111111111111111111011111111111
+11111111101111111111111111111111
+11111111111111111111101111111111*
+L0256
+10111111111101110111101111111111
+11110111111111110111011111111111
+11110111111111111111111111111111
+10111111111111111111101111111111
+11111011111111111111111111111111
+11111111111101110111101111111111
+11111111111111111111011111111111
+11111111011111111111111111111111*
+L0512
+01111111111101110111101111111111
+01111110111111111111111111111111
+11111111111101111111111111111111
+11111111111111110111111111111111
+11111101111111111111101111111111
+01111111111111111111101111111111
+11111111111101110111111111111111
+11111011111111111111111111111111*
+L0768
+11111011111011111111111111111111
+11111111101111111111111111111111
+11111011111111111111111111111111
+11111011011111111111111111111111
+11111111110111111111101111111111
+11111111111111111111101111111111
+11111111011111111111111111111111
+01110111111111111111111111111111*
+L1024
+11110111111111110111011111111111
+11111111111111010111111111111111
+11110111111111101111111111111111
+11111111111111111111011111111111
+11111111101111111111111111111111
+11111111111111110111011111111111
+11111111011111111111011111111111
+10111111111111111111101111111111*
+L1280
+11111111111111111110111111111111
+11111111111111111111111110111111
+11111111111111111111111101111111
+10111111111111111110111111111111
+10111111111111111111111111111111
+01111111111111111101111110111111
+11111111101111111111111111111111
+11110111111111111111111111111111*
+L1536
+11111111111111111111111011111111
+11111111111111111111111111111011
+11111111111111111111111101111111
+11111111111111111111101111111111
+11111111111111111011111011111111
+11111111111101111111110111111111
+11111111011111111111111111111111
+10111111111111111111111111111111*
+L1792
+11111111111111111111110111111111
+10111011111111111111111111111111
+11111111011111111111111111011111
+11110111111111111111111111111111
+11111111111111111011111111111111
+11111111111111111111111101111111
+11111111111111111111111111111011
+11111111111111111111011111101111*
+CF78C*
+0000
diff --git a/src/regtests/jedutil/jeds/pal16r8/pal16r8.jed b/src/regtests/jedutil/jeds/pal16r8/pal16r8.jed
new file mode 100644
index 00000000000..c4b2541b825
--- /dev/null
+++ b/src/regtests/jedutil/jeds/pal16r8/pal16r8.jed
@@ -0,0 +1,84 @@
+
+PAL16R8
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "pal16r8.eqn". Date: 9-10-112
+*
+NOTE PINS CLK:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 GND:10*
+NOTE PINS /OE:11 rf12:12 rf13:13 rf14:14 rf15:15 rf16:16 rf17:17*
+NOTE PINS rf18:18 rf19:19 VCC:20*
+QF2048*QP20*F0*
+L0000
+11111111111101110111101111111111
+11110111111111110111011111111111
+11111111111101111111111111111101
+11111111111111110111111111111111
+11111111111111111111011111111111
+11111111101111111111111111111110
+11111111111111111111101111111111
+01111111111111111111111111111111*
+L0256
+10111111111101110111101111111111
+11110111111111110111011111111111
+11010111111111111111111111111111
+10111111111111111111101111111111
+11101011111111111111111111111111
+11111111111101110111101111111111
+11111111111111111111011111111111
+11111111101111111111111111111111*
+L0512
+01111111111101110111101111111111
+01111110111111111111111111111111
+11111111111101111111111111111111
+11111111111111110111111111111111
+11111101111111111111101111111111
+01111111111111111111101111111111
+11111111111101110111111111111111
+11111011111111111111111111111111*
+L0768
+11111011111011111111111111111111
+11111111101111111111111111111111
+11111011111111111111111111111111
+11111011011111111111111111111111
+11111111110111111111101111111111
+11111111111111111111101111111111
+11111111011111111111111111111111
+01110111111111111111111111111111*
+L1024
+11110111111111110111011111111111
+11111111111111010111111111111111
+11110111111111101111111111111111
+11111111111111111111011111111111
+11111111101111111111111111111111
+11111111111111110111011111111111
+11111111011111111111011111111111
+10111111111111111111101111111111*
+L1280
+11111111111111111110111111111111
+11111111111111111111111110111111
+11111111111111111111111101111111
+10111111111111111110111111111111
+10111111111111111111111111111111
+01111111111111111101111110111111
+11111111101111111111111111111111
+11110111111111111111111111111111*
+L1536
+11111111111111111111111011111111
+11111111111111111111111111111011
+11111111111111111111111101111111
+11111111111111111111101111111111
+11111111111111111011110111111111
+11111111111101111111111111111111
+11111111011111111111111111111111
+11111011111111111111111111111111*
+L1792
+10111011111111111111111111111111
+11111111011111111111111111011111
+11110111111111111111111111111111
+11111111111111111011111111111111
+11111111111111111111111101111111
+11111111111111111111111111111011
+11111111111111111111011111101111
+11111111111101111111111111111111*
+CF750*
+0000
diff --git a/src/regtests/jedutil/jeds/pal20l10.jed b/src/regtests/jedutil/jeds/pal20l10/pal20l10.jed
index 4019ea407dd..4019ea407dd 100644
--- a/src/regtests/jedutil/jeds/pal20l10.jed
+++ b/src/regtests/jedutil/jeds/pal20l10/pal20l10.jed
diff --git a/src/regtests/jedutil/jeds/pal20l8.jed b/src/regtests/jedutil/jeds/pal20l8/pal20l8.jed
index 4ab694fefea..4ab694fefea 100644
--- a/src/regtests/jedutil/jeds/pal20l8.jed
+++ b/src/regtests/jedutil/jeds/pal20l8/pal20l8.jed
diff --git a/src/regtests/jedutil/jeds/pal20r4/pal20r4.jed b/src/regtests/jedutil/jeds/pal20r4/pal20r4.jed
new file mode 100644
index 00000000000..1425f37ba00
--- /dev/null
+++ b/src/regtests/jedutil/jeds/pal20r4/pal20r4.jed
@@ -0,0 +1,84 @@
+
+PAL20R4
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "pal20r4.eqn". Date: 9-10-112
+*
+NOTE PINS CLK:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 i10:10*
+NOTE PINS i11:11 GND:12 /OE:13 i14:14 o15:15 o16:16 rf17:17 rf18:18*
+NOTE PINS rf19:19 rf20:20 o21:21 o22:22 i23:23 VCC:24*
+QF2560*QP24*F0*
+L0000
+1111111111111111111111111111111111101101
+1111111111111111111111111111111111111101
+1111111111111111111111111111111111101111
+1111011111101111111111111111111111111111
+1111111111111111111101111111111111111111
+1111111111011111111111111011111111111111
+1111111111111111111111111111111101111111
+1111111111111111111111111111101111111111*
+L0320
+1111111011111111111111110111011111111111
+1111111111111111111111111011111111111111
+1011111111111111111111111101111111111111
+1111111111111111111111111111111111110111
+1111111111111111111111111111111110111111
+1111111111111111111111111111111111011111
+1111111111111111111111111111111111111110
+1111101111111111111111111111111111111111*
+L0640
+1111111111111111111111111101111101111111
+1111111111111111111111111111111111111011
+1111111101111111111111111110111111111111
+0111111111111111111111111111111111111111
+1111111111111111101110111111111111111111
+1111111111111111111111110111111111111111
+1111111111111111111111111111101111111111
+1111110111111111111111111111111111111111*
+L0960
+1111111111110111011110111111111111111111
+1111011111111111011101111111111111111111
+1111111111110101111111111111111111111111
+1111111111111111011111111111111111111111
+1111111111111111111101111111111111111111
+1111111110111110111111111111111111111111
+1111111111111111111110111111111111111111
+1111111111111111111111111111111101111111*
+L1280
+1011111111110111011110111111111111111111
+1111011111111111011101111111111111111111
+1111011111111111110111111111111111111111
+1011111111111111111110111111111111111111
+1111101111111111111011111111111111111111
+1111111111110111011110111111111111111111
+1111111111111111111101111111111111111111
+1111111111111111111111111111111111111011*
+L1600
+1011111111111111111111111111111111111111
+1111111111111111111111101111111111111111
+1111111111110111111111111111111111111111
+1111111111111111011111111111111111111111
+1111111111111111111111011111111111111111
+1111111101111111111111111111111111111111
+1111111111111111111111111111111110111111
+1110111111111111111111111111111111111111*
+L1920
+1101111111111111111111111111111111111111
+1111101111111111111111111110111111111111
+1111111110111111111111111111111111111111
+1111101111111111111111111111111111111111
+1111101101111111111111111111111111111111
+1111111111111111111110111101111111111111
+1111111111111111111110111111111111111111
+1111111101111111111111111111111111111111*
+L2240
+1110111111111111111111111111111111111111
+0111111111111111011101111111111111111111
+1111111111111111011111111111110111111111
+1111011111111111111111111111111011111111
+1111111111111111111101111111111111111111
+1111111110111111111111111111111111111111
+1111111111111111011101111111111111111111
+1111111101111111111101111111111111111111*
+C36C6*
+0000
diff --git a/src/regtests/jedutil/jeds/pal20r6/pal20r6.jed b/src/regtests/jedutil/jeds/pal20r6/pal20r6.jed
new file mode 100644
index 00000000000..d81be09178b
--- /dev/null
+++ b/src/regtests/jedutil/jeds/pal20r6/pal20r6.jed
@@ -0,0 +1,84 @@
+
+PAL20R6
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "pal20r6.eqn". Date: 9-11-112
+*
+NOTE PINS CLK:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 i10:10*
+NOTE PINS i11:11 GND:12 /OE:13 i14:14 o15:15 rf16:16 rf17:17 rf18:18*
+NOTE PINS rf19:19 rf20:20 rf21:21 o22:22 i23:23 VCC:24*
+QF2560*QP24*F0*
+L0000
+1111111111111111111111111111111111101101
+1111111111111111111111111111111111111101
+1111111111111111111111111111111111101111
+1111011111101111111111111111111111111111
+1111111111111111111101111111111111111111
+1111111111011111111111111011111111111111
+1111111111111111111111111111111101111111
+1111111111111111111111111111101111111111*
+L0320
+1111111111111111111111111011111111111111
+1011111111111111111111111101111111111111
+1111111111111111111111111111111111110111
+1111111111111111111111111111111110111111
+1111111111111111111111111111111111011111
+1111111011111111111111111111111111111110
+1111101111111111111111111111111111111111
+1111111111111011111111111111111111111111*
+L0640
+1111111111111111111111111101111101111111
+1111111111111111111111111111111111111011
+1111111101111111111111111110111111111111
+0111111111111111111111111111111111111111
+1111111111111111101110111111111111111111
+1111111111111111111111110111111111111111
+1111111111111111111111111111101111111111
+1111110111111111111111111111111111111111*
+L0960
+1111111111110111011110111111111111111111
+1111011111111111011101111111111111111111
+1111111111110101111111111111111111111111
+1111111111111111011111111111111111111111
+1111111111111111111101111111111111111111
+1111111110111110111111111111111111111111
+1111111111111111111110111111111111111111
+1111111111111111111111111111111101111111*
+L1280
+1011111111110111011110111111111111111111
+1111011111111111011101111111111111111111
+1111011111111111110111111111111111111111
+1011111111111111111110111111111111111111
+1111101111111111111011111111111111111111
+1111111111110111011110111111111111111111
+1111111111111111111101111111111111111111
+1111111111111111111111111111111111111011*
+L1600
+1011111111111111111111111111111111111111
+1111111111111111111111101111111111111111
+1111111111110111111111111111111111111111
+1111111111111111011111111111111111111111
+1111111111111111111111011111111111111111
+1111111101111111111111111111111111111111
+1111111111111111111111111111111110111111
+1110111111111111111111111111111111111111*
+L1920
+1111101111111111111111111110111111111111
+1110111110111111111111111111111111111111
+1111101111111111111111111111111111111111
+1111101101111111111111111111111111111111
+1111111111111111111110111101111111111111
+1111111111111111111110111111111111111111
+1111111101111111111111111111111111111111
+1101111111111111111111111111111111111111*
+L2240
+1110111111111111111111111111111111111111
+0111111111111111011101111111111111111111
+1111111111111111011111111111110111111111
+1111011111111111111111111111111011111111
+1111111111111111111101111111111111111111
+1111111110111111111111111111111111111111
+1111111111111111011101111111111111111111
+1111111101111111111101111111111111111111*
+C36AF*
+0000
diff --git a/src/regtests/jedutil/jeds/pal20r8/pal20r8.jed b/src/regtests/jedutil/jeds/pal20r8/pal20r8.jed
new file mode 100644
index 00000000000..0b88760b740
--- /dev/null
+++ b/src/regtests/jedutil/jeds/pal20r8/pal20r8.jed
@@ -0,0 +1,84 @@
+
+PAL20R8
+EQN2JED - Boolean Equations to JEDEC file assembler (Version V101)
+Copyright (c) National Semiconductor Corporation 1990-1993
+Assembled from "pal20r8.eqn". Date: 9-11-112
+*
+NOTE PINS CLK:1 i2:2 i3:3 i4:4 i5:5 i6:6 i7:7 i8:8 i9:9 i10:10*
+NOTE PINS i11:11 GND:12 /OE:13 i14:14 rf15:15 rf16:16 rf17:17*
+NOTE PINS rf18:18 rf19:19 rf20:20 rf21:21 rf22:22 i23:23 VCC:24*
+QF2560*QP24*F0*
+L0000
+1111111111111111111111111111111111111101
+1111111111111111111111111111111111101111
+1111011111101111111111111111111111111111
+1111111111111111111101111111111111111111
+1111111111011111111111111011111111111111
+1111111111111111111111111111111101111111
+1111111111111111111111111111101111111111
+1111111111111111111111111111111111101101*
+L0320
+1111111111111111111111111011111111111111
+1011111111111111111111111101111111111111
+1111111111111111111111111111111111110111
+1111111111111111111111111111111110111111
+1111111111111111111111111111111111011111
+1111111111111111111111111111111111111110
+1111101111111111111111111111111111111111
+1111111011111111111111110111011111111111*
+L0640
+1111111111111111111111111101111101111111
+1111111111111111111111111111111111111011
+1111111101111111111111111110111111111111
+0111111111111111111111111111111111111111
+1111111111111111101110111111111111111111
+1111111111111111111111110111111111111111
+1111111111111111111111111111101111111111
+1111110111111111111111111111111111111111*
+L0960
+1111111111110111011110111111111111111111
+1111011111111111011101111111111111111111
+1111111111110101111111111111111111111111
+1111111111111111011111111111111111111111
+1111111111111111111101111111111111111111
+1111111110111110111111111111111111111111
+1111111111111111111110111111111111111111
+1111111111111111111111111111111101111111*
+L1280
+1011111111110111011110111111111111111111
+1111011111111111011101111111111111111111
+1111011111111111110111111111111111111111
+1011111111111111111110111111111111111111
+1111101111111111111011111111111111111111
+1111111111110111011110111111111111111111
+1111111111111111111101111111111111111111
+1111111111111111111111111111111111111011*
+L1600
+1011111111111111111111111111111111111111
+1111111111111111111111101111111111111111
+1111111111110111111111111111111111111111
+1111111111111111011111111111111111111111
+1111111111111111111111011111111111111111
+1111111101111111111111111111111111111111
+1111111111111111111111111111111110111111
+1110111111111111111111111111111111111111*
+L1920
+1111101111111111111111111110111111111111
+1111111110111111111111111111111111111111
+1111101111111111111111111111111111111111
+1111101101111111111111111111111111111111
+1111111111111111111110111101111111111111
+1111111111111111111110111111111111111111
+1111111101111111111111111111111111111111
+1101111111111111111111111111111111111111*
+L2240
+0111111111111111011101111111111111111111
+1111111111111111011111111111110111111111
+1111011111111111111111111111111011111111
+1111111111111111111101111111111111111111
+1111111110111111111111111111111111111111
+1111111111111111011101111111111111111111
+1111111101111111111101111111111111111111
+1110111111111111111111111111111111111111*
+C36C6*
+0000
diff --git a/src/regtests/jedutil/jedtest.wsf b/src/regtests/jedutil/jedtest.wsf
index cb2e47b509f..1a6d6d8ad64 100644
--- a/src/regtests/jedutil/jedtest.wsf
+++ b/src/regtests/jedutil/jedtest.wsf
@@ -1,127 +1,248 @@
<?xml version="1.0"?>
<package>
- <job id="Test"><?job debug="true" error="true"?>
+ <job id="JEDTest"><?job debug="true" error="true"?>
<runtime>
<description>This script runs regresion tests on the jedutil tool.</description>
+
+ <named name="verbose" type="boolean" helpstring="Generate a detailed log." required="false"/>
</runtime>
<script language="JScript">
<![CDATA[
var g_Verbose = false;
- function diffFiles(file1, file2)
+ function runAndCaptureOutput(command, outputFile)
{
+ var fso = new ActiveXObject("Scripting.FileSystemObject");
var WshShell = WScript.CreateObject("WScript.Shell");
- var oExec;
+ var file, oExec;
if (g_Verbose)
{
- WScript.Echo("Diff File 1: " + file1);
- WScript.Echo("Diff File 2: " + file2);
+ WScript.Echo("Command: " + command);
+ WScript.Echo("Output File: " + outputFile);
WScript.Echo();
}
- oExec = WshShell.Exec("diff " + file1 + " " + file2);
+ file = fso.CreateTextFile(outputFile, false, false);
+
+ oExec = WshShell.Exec(command);
+
+ if (!oExec.StdOut.AtEndOfStream)
+ {
+ file.Write(oExec.StdOut.ReadAll());
+ }
- while (!oExec.Status)
+ if (!oExec.StdErr.AtEndOfStream)
{
- WScript.Sleep(100);
+ file.Write(oExec.StdErr.ReadAll());
}
- if (g_Verbose)
+ file.Close();
+
+ while (!oExec.Status)
{
- WScript.StdOut.WriteLine(oExec.StdOut.ReadAll());
- WScript.StdErr.WriteLine(oExec.StdErr.ReadAll());
+ WScript.Sleep(100);
}
-
+
return oExec.ExitCode;
}
- function runCommandAndCaptureOutput(command, outputFile)
+ function diffFiles(file1, file2, outputFile)
{
- var WshShell = WScript.CreateObject("WScript.Shell");
- var fullCommand;
-
- fullCommand = "%comspec% /c ";
- fullCommand += command;
- fullCommand += " > ";
- fullCommand += outputFile;
- fullCommand += " 2>&1";
+ var fso = new ActiveXObject("Scripting.FileSystemObject");
+ var command;
if (g_Verbose)
- {
- WScript.Echo("Running the command : " + command);
- WScript.Echo("Output File: " + outputFile);
+ {
+ WScript.Echo("Diff File 1: " + file1);
+ WScript.Echo("Diff File 2: " + file2);
+ WScript.Echo("Output File: " + outputFile);
WScript.Echo();
}
- WshShell.Run(fullCommand, 0, true);
+ if (!fso.FileExists(file1))
+ {
+ if (g_Verbose)
+ {
+ WScript.Echo("Diff File 1 does not exist.");
+ WScript.Echo();
+ }
+
+ return 1;
+ }
+
+ if (!fso.FileExists(file2))
+ {
+ if (g_Verbose)
+ {
+ WScript.Echo("Diff File 2 does not exist.");
+ WScript.Echo();
+ }
+
+ return 1;
+ }
+
+ command = "diff \"" + file1 + "\" \"" + file2 + "\"";
+
+ return runAndCaptureOutput(command, outputFile);
+ }
+
+ function getFilesInFolder(folder)
+ {
+ var fso = new ActiveXObject("Scripting.FileSystemObject");
+ var filesCollection = new Enumerator(folder.files);
+ var filesArray = new Array();
+
+ while (!filesCollection.atEnd())
+ {
+ ++filesArray.length;
+
+ filesArray[filesArray.length - 1] = new Object();
+
+ filesArray[filesArray.length - 1].name = fso.GetBaseName(filesCollection.item().name);
+
+ filesCollection.moveNext();
+ }
+
+ return filesArray;
}
function findJedTests(jedsPath, baselinePath, outputPath)
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var folder = fso.GetFolder(jedsPath)
- var folderCollection = new Enumerator(folder.files);
+ var folderCollection = new Enumerator(folder.Subfolders);
var jedArray = new Array();
-
+ var filesArray, file;
+
while (!folderCollection.atEnd())
{
++jedArray.length;
jedArray[jedArray.length - 1] = new Object;
+
+ jedArray[jedArray.length - 1].type = folderCollection.item().name;
+ jedArray[jedArray.length - 1].files = new Array;
+
+ filesArray = getFilesInFolder(
+ fso.GetFolder(
+ fso.BuildPath(jedsPath,
+ folderCollection.item().name)));
+
+ jedArray[jedArray.length - 1].files.length = filesArray.length;
+
+ for (index = 0; index < filesArray.length; ++index)
+ {
+ file = new Object;
+
+ file.jedFile = fso.BuildPath(jedsPath,
+ folderCollection.item().name);
+ file.jedFile = fso.BuildPath(file.jedFile,
+ filesArray[index].name);
+ file.jedFile = file.jedFile + ".jed";
+
+ file.baselineFile = fso.BuildPath(baselinePath,
+ folderCollection.item().name);
+ file.baselineFile = fso.BuildPath(file.baselineFile,
+ filesArray[index].name);
+ file.baselineFile = file.baselineFile + ".txt";
+
+ file.outputFile = fso.BuildPath(outputPath,
+ folderCollection.item().name);
+ file.outputFile = fso.BuildPath(file.outputFile,
+ filesArray[index].name);
+ file.outputFile = file.outputFile + ".txt";
+
+ file.diffFile = fso.BuildPath(outputPath,
+ folderCollection.item().name);
+ file.diffFile = fso.BuildPath(file.diffFile,
+ filesArray[index].name);
+ file.diffFile = file.diffFile + ".diff";
+
+ jedArray[jedArray.length - 1].files[index] = file;
+ }
- jedArray[jedArray.length - 1].name = fso.GetBaseName(folderCollection.item().name);
- jedArray[jedArray.length - 1].jedfile = folderCollection.item().path;
- jedArray[jedArray.length - 1].baselineFile = baselinePath + "\\" +
- jedArray[jedArray.length - 1].name +
- ".txt";
- jedArray[jedArray.length - 1].outputFile = outputPath + "\\" +
- jedArray[jedArray.length - 1].name +
- ".txt";
-
folderCollection.moveNext();
}
-
+
return jedArray;
}
+
+ function createJedOutputFolders(outputPath, jedArray)
+ {
+ var fso = new ActiveXObject("Scripting.FileSystemObject");
+
+ for (index = 0; index < jedArray.length; ++index)
+ {
+ fso.CreateFolder(fso.BuildPath(outputPath,
+ jedArray[index].type));
+ }
+ }
function runViewJedTests(jedArray, jedUtilApp)
{
- var command;
+ var files, file, command;
- for (i = 0; i < jedArray.length; ++i)
+ for (testIndex = 0; testIndex < jedArray.length; ++testIndex)
{
- command = jedUtilApp + " -view " + jedArray[i].jedfile + " " +
- jedArray[i].name;
-
if (g_Verbose)
{
- WScript.Echo("Viewing the JED file: " + jedArray[i].jedfile);
+ WScript.Echo("Running the view command on the type \"" +
+ jedArray[testIndex].type + "\"");
WScript.Echo();
}
-
- runCommandAndCaptureOutput(command, jedArray[i].outputFile);
+
+ files = jedArray[testIndex].files;
+
+ for (fileIndex = 0; fileIndex < files.length; ++fileIndex)
+ {
+ file = files[fileIndex];
+
+ if (g_Verbose)
+ {
+ WScript.Echo(" JED File: " + file.jedFile);
+ WScript.Echo(" Baseline File: " + file.baselineFile);
+ WScript.Echo(" Output File: " + file.outputFile);
+ WScript.Echo(" Diff File: " + file.diffFile);
+ WScript.Echo();
+ }
+
+ command = jedUtilApp + " -view \"" + file.jedFile + "\" " +
+ jedArray[testIndex].type;
+
+ runAndCaptureOutput(command, file.outputFile);
+ }
}
}
function runDiffJedTests(jedArray)
{
var result = true;
+ var files, file;
- for (i = 0; i < jedArray.length; ++i)
+ for (testIndex = 0; testIndex < jedArray.length; ++testIndex)
{
if (g_Verbose)
{
- WScript.Echo("Diffing the output from viewing the JED file: " + jedArray[i].jedfile);
+ WScript.Echo("Running the diffs on the type \"" +
+ jedArray[testIndex].type + "\"");
+ WScript.Echo();
}
+
+ files = jedArray[testIndex].files;
- if (diffFiles(jedArray[i].baselineFile, jedArray[i].outputFile))
+ for (fileIndex = 0; fileIndex < files.length; ++fileIndex)
{
- WScript.Echo("Results are different for " + jedArray[i].name);
- WScript.Echo();
+ file = files[fileIndex];
- result = false;
+ if (diffFiles(file.baselineFile, file.outputFile, file.diffFile))
+ {
+ WScript.Echo("Results are different for " + file.jedFile);
+ WScript.Echo();
+
+ result = false;
+ }
}
}
@@ -139,6 +260,11 @@
var jedUtilApp = WshShell.CurrentDirectory + "\\..\\..\\..\\jedutil.exe";
var jedArray = new Array();
+ if (WScript.Arguments.Count() > 0)
+ {
+ g_Verbose = true;
+ }
+
if (g_Verbose)
{
WScript.Echo("JED Path: " + jedsPath);
@@ -152,27 +278,27 @@
{
if (g_Verbose)
{
- WScript.Echo("Emptying the output directory");
+ WScript.Echo("Removing the existing the output directory");
WScript.Echo();
}
- fso.DeleteFile(outputPath + "\\*.*");
+ fso.DeleteFolder(outputPath);
}
- else
+
+ if (g_Verbose)
{
- if (g_Verbose)
- {
- WScript.Echo("Creating the output directory");
- WScript.Echo();
- }
-
- fso.CreateFolder(outputPath);
+ WScript.Echo("Creating the root output directory");
+ WScript.Echo();
}
+ fso.CreateFolder(outputPath);
+
jedArray = findJedTests(jedsPath, baselinePath, outputPath);
- runViewJedTests(jedArray, jedUtilApp);
+ createJedOutputFolders(outputPath, jedArray);
+ runViewJedTests(jedArray, jedUtilApp);
+
if (!runDiffJedTests(jedArray))
{
result = 1;
diff --git a/src/tools/jedutil.c b/src/tools/jedutil.c
index 3521db99218..425eed24bfd 100644
--- a/src/tools/jedutil.c
+++ b/src/tools/jedutil.c
@@ -106,12 +106,33 @@
/***************************************************************************
+ CONSTANTS
+***************************************************************************/
+
+#define ARRAY_LEN(_array) (sizeof(_array) / sizeof(_array[0]))
+
+#define NO_OUTPUT_ENABLE_FUSE_ROW 0xFFFF
+
+/* Output pin flags */
+#define OUTPUT_ACTIVELOW 0x00000001
+#define OUTPUT_ACTIVEHIGH 0x00000002
+#define OUTPUT_COMBINATORIAL 0x00000004
+#define OUTPUT_REGISTERED 0x00000008
+
+/* Fuse state flag */
+#define LOW_FUSE_BLOWN 0x00000001
+#define HIGH_FUSE_BLOWN 0x00000002
+#define LOWHIGH_FUSE_BLOWN 0x00000004
+#define NO_FUSE_BLOWN 0x00000008
+
+/***************************************************************************
TYPE DEFINITIONS
***************************************************************************/
typedef int (*command_func_type)(int argc, char *argv[]);
-struct command_entry
+typedef struct _command_entry command_entry;
+struct _command_entry
{
const char *command;
command_func_type command_func;
@@ -120,14 +141,10 @@ struct command_entry
/* Pin fuse row configuration */
-#define CNoOutputEnableFuseRow (UINT16)~0
-
-
-
-/* Pin fuse row configuration */
-struct pin_fuse_rows
+typedef struct _pin_fuse_rows pin_fuse_rows;
+struct _pin_fuse_rows
{
- UINT16 pin; /* Pin number */
+ UINT16 pin; /* Pin number */
UINT16 fuserowoutputenable; /* Fuse row for the output enable */
UINT16 fuserowtermstart; /* Fuse row for the first term */
UINT16 fuserowtermend; /* Fuse row for the last term */
@@ -136,19 +153,22 @@ struct pin_fuse_rows
/* Pin fuse column configuration */
-struct pin_fuse_columns
+typedef struct _pin_fuse_columns pin_fuse_columns;
+struct _pin_fuse_columns
{
- UINT16 pin; /* Pin number */
+ UINT16 pin; /* Pin number */
UINT16 lowfusecolumn; /* Column number for low output */
UINT16 highfusecolumn; /* Column number for high output */
};
-struct pal_data;
+typedef struct _pal_data pal_data;
typedef void (*print_product_terms_func)(const pal_data* pal, const jed_data* jed);
+typedef void (*config_pins_func)(const pal_data* pal, const jed_data* jed);
+typedef int (*is_product_term_enabled_func)(const pal_data* pal, const jed_data* jed, UINT16 fuserow);
-struct pal_data
+struct _pal_data
{
const char *name;
const pin_fuse_rows *pinfuserows;
@@ -156,10 +176,21 @@ struct pal_data
const pin_fuse_columns *pinfusecolumns;
UINT16 pinfusecolumnscount;
print_product_terms_func print_product_terms;
+ config_pins_func config_pins;
+ is_product_term_enabled_func is_product_term_enabled;
};
+/* Pin output configuration */
+typedef struct _pin_output_config pin_output_config;
+struct _pin_output_config
+{
+ UINT16 pin;
+ UINT16 flags;
+};
+
+
/***************************************************************************
FUNCTION PROTOTYPES
***************************************************************************/
@@ -177,7 +208,8 @@ static void print_pal16l8_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal16r4_product_terms(const pal_data* pal, const jed_data* jed);
static void print_pal16r6_product_terms(const pal_data* pal, const jed_data* jed);
static void print_pal16r8_product_terms(const pal_data* pal, const jed_data* jed);
-static void print_gal18v10_product_terms(const pal_data* pal, const jed_data* jed);
+static void print_gal16v8_product_terms(const pal_data* pal, const jed_data* jed);
+/*static void print_gal18v10_product_terms(const pal_data* pal, const jed_data* jed);*/
static void print_pal20l8_product_terms(const pal_data* pal, const jed_data* jed);
static void print_pal20l10_product_terms(const pal_data* pal, const jed_data* jed);
static void print_pal20r4_product_terms(const pal_data* pal, const jed_data* jed);
@@ -186,6 +218,33 @@ static void print_pal20r8_product_terms(const pal_data* pal, const jed_data* jed
+static void config_pal10l8_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal10h8_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal12l6_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal12h6_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal14l4_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal14h4_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal16l2_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal16h2_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal16c1_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal16l8_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal16r4_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal16r6_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal16r8_pins(const pal_data* pal, const jed_data* jed);
+static void config_gal16v8_pins(const pal_data* pal, const jed_data* jed);
+/*static void config_gal18v10_pins(const pal_data* pal, const jed_data* jed);*/
+static void config_pal20l8_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal20l10_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal20r4_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal20r6_pins(const pal_data* pal, const jed_data* jed);
+static void config_pal20r8_pins(const pal_data* pal, const jed_data* jed);
+
+
+
+static int is_gal16v8_product_term_enabled(const pal_data* pal, const jed_data* jed, UINT16 fuserow);
+
+
+
/***************************************************************************
GLOBAL VARIABLES
***************************************************************************/
@@ -199,68 +258,68 @@ static size_t dstbuflen;
static UINT16 inputpins[26];
static UINT16 inputpinscount;
-static UINT16 outputpins[26];
+static pin_output_config outputpins[26];
static UINT16 outputpinscount;
static pin_fuse_rows pal10l8pinfuserows[] = {
- {12, CNoOutputEnableFuseRow, 280, 300},
- {13, CNoOutputEnableFuseRow, 240, 260},
- {14, CNoOutputEnableFuseRow, 200, 220},
- {15, CNoOutputEnableFuseRow, 160, 180},
- {16, CNoOutputEnableFuseRow, 120, 140},
- {17, CNoOutputEnableFuseRow, 80, 100},
- {18, CNoOutputEnableFuseRow, 40, 60},
- {19, CNoOutputEnableFuseRow, 0, 20}};
+ {12, NO_OUTPUT_ENABLE_FUSE_ROW, 280, 300},
+ {13, NO_OUTPUT_ENABLE_FUSE_ROW, 240, 260},
+ {14, NO_OUTPUT_ENABLE_FUSE_ROW, 200, 220},
+ {15, NO_OUTPUT_ENABLE_FUSE_ROW, 160, 180},
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 120, 140},
+ {17, NO_OUTPUT_ENABLE_FUSE_ROW, 80, 100},
+ {18, NO_OUTPUT_ENABLE_FUSE_ROW, 40, 60},
+ {19, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 20}};
static pin_fuse_rows pal10h8pinfuserows[] = {
- {12, CNoOutputEnableFuseRow, 280, 300},
- {13, CNoOutputEnableFuseRow, 240, 260},
- {14, CNoOutputEnableFuseRow, 200, 220},
- {15, CNoOutputEnableFuseRow, 160, 180},
- {16, CNoOutputEnableFuseRow, 120, 140},
- {17, CNoOutputEnableFuseRow, 80, 100},
- {18, CNoOutputEnableFuseRow, 40, 60},
- {19, CNoOutputEnableFuseRow, 0, 20}};
+ {12, NO_OUTPUT_ENABLE_FUSE_ROW, 280, 300},
+ {13, NO_OUTPUT_ENABLE_FUSE_ROW, 240, 260},
+ {14, NO_OUTPUT_ENABLE_FUSE_ROW, 200, 220},
+ {15, NO_OUTPUT_ENABLE_FUSE_ROW, 160, 180},
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 120, 140},
+ {17, NO_OUTPUT_ENABLE_FUSE_ROW, 80, 100},
+ {18, NO_OUTPUT_ENABLE_FUSE_ROW, 40, 60},
+ {19, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 20}};
static pin_fuse_rows pal12l6pinfuserows[] = {
- {13, CNoOutputEnableFuseRow, 288, 360},
- {14, CNoOutputEnableFuseRow, 240, 264},
- {15, CNoOutputEnableFuseRow, 192, 216},
- {16, CNoOutputEnableFuseRow, 144, 168},
- {17, CNoOutputEnableFuseRow, 96, 120},
- {18, CNoOutputEnableFuseRow, 0, 72}};
+ {13, NO_OUTPUT_ENABLE_FUSE_ROW, 288, 360},
+ {14, NO_OUTPUT_ENABLE_FUSE_ROW, 240, 264},
+ {15, NO_OUTPUT_ENABLE_FUSE_ROW, 192, 216},
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 144, 168},
+ {17, NO_OUTPUT_ENABLE_FUSE_ROW, 96, 120},
+ {18, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 72}};
static pin_fuse_rows pal12h6pinfuserows[] = {
- {13, CNoOutputEnableFuseRow, 288, 360},
- {14, CNoOutputEnableFuseRow, 240, 264},
- {15, CNoOutputEnableFuseRow, 192, 216},
- {16, CNoOutputEnableFuseRow, 144, 168},
- {17, CNoOutputEnableFuseRow, 96, 120},
- {18, CNoOutputEnableFuseRow, 0, 72}};
+ {13, NO_OUTPUT_ENABLE_FUSE_ROW, 288, 360},
+ {14, NO_OUTPUT_ENABLE_FUSE_ROW, 240, 264},
+ {15, NO_OUTPUT_ENABLE_FUSE_ROW, 192, 216},
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 144, 168},
+ {17, NO_OUTPUT_ENABLE_FUSE_ROW, 96, 120},
+ {18, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 72}};
static pin_fuse_rows pal14l4pinfuserows[] = {
- {14, CNoOutputEnableFuseRow, 336, 420},
- {15, CNoOutputEnableFuseRow, 224, 308},
- {16, CNoOutputEnableFuseRow, 112, 196},
- {17, CNoOutputEnableFuseRow, 0, 84}};
+ {14, NO_OUTPUT_ENABLE_FUSE_ROW, 336, 420},
+ {15, NO_OUTPUT_ENABLE_FUSE_ROW, 224, 308},
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 112, 196},
+ {17, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 84}};
static pin_fuse_rows pal14h4pinfuserows[] = {
- {14, CNoOutputEnableFuseRow, 336, 420},
- {15, CNoOutputEnableFuseRow, 224, 308},
- {16, CNoOutputEnableFuseRow, 112, 196},
- {17, CNoOutputEnableFuseRow, 0, 84}};
+ {14, NO_OUTPUT_ENABLE_FUSE_ROW, 336, 420},
+ {15, NO_OUTPUT_ENABLE_FUSE_ROW, 224, 308},
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 112, 196},
+ {17, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 84}};
static pin_fuse_rows pal16l2pinfuserows[] = {
- {15, CNoOutputEnableFuseRow, 256, 480},
- {16, CNoOutputEnableFuseRow, 0, 224}};
+ {15, NO_OUTPUT_ENABLE_FUSE_ROW, 256, 480},
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 224}};
static pin_fuse_rows pal16h2pinfuserows[] = {
- {15, CNoOutputEnableFuseRow, 256, 480},
- {16, CNoOutputEnableFuseRow, 0, 224}};
+ {15, NO_OUTPUT_ENABLE_FUSE_ROW, 256, 480},
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 224}};
static pin_fuse_rows pal16c1pinfuserows[] = {
- {15, CNoOutputEnableFuseRow, 256, 480},
- {16, CNoOutputEnableFuseRow, 0, 224}};
+ {15, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 480},
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 480}};
static pin_fuse_rows pal16l8pinfuserows[] = {
{12, 1792, 1824, 2016},
@@ -275,34 +334,44 @@ static pin_fuse_rows pal16l8pinfuserows[] = {
static pin_fuse_rows pal16r4pinfuserows[] = {
{12, 1792, 1824, 2016},
{13, 1536, 1568, 1760},
- {14, CNoOutputEnableFuseRow, 1280, 1504}, /* Registered Output */
- {15, CNoOutputEnableFuseRow, 1024, 1248}, /* Registered Output */
- {16, CNoOutputEnableFuseRow, 768, 992}, /* Registered Output */
- {17, CNoOutputEnableFuseRow, 512, 736}, /* Registered Output */
+ {14, NO_OUTPUT_ENABLE_FUSE_ROW, 1280, 1504}, /* Registered Output */
+ {15, NO_OUTPUT_ENABLE_FUSE_ROW, 1024, 1248}, /* Registered Output */
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 768, 992}, /* Registered Output */
+ {17, NO_OUTPUT_ENABLE_FUSE_ROW, 512, 736}, /* Registered Output */
{18, 256, 288, 480},
{19, 0, 32, 224}};
static pin_fuse_rows pal16r6pinfuserows[] = {
{12, 1792, 1824, 2016},
- {13, CNoOutputEnableFuseRow, 1536, 1760}, /* Registered Output */
- {14, CNoOutputEnableFuseRow, 1280, 1504}, /* Registered Output */
- {15, CNoOutputEnableFuseRow, 1024, 1248}, /* Registered Output */
- {16, CNoOutputEnableFuseRow, 768, 992}, /* Registered Output */
- {17, CNoOutputEnableFuseRow, 512, 736}, /* Registered Output */
- {18, CNoOutputEnableFuseRow, 256, 480}, /* Registered Output */
+ {13, NO_OUTPUT_ENABLE_FUSE_ROW, 1536, 1760}, /* Registered Output */
+ {14, NO_OUTPUT_ENABLE_FUSE_ROW, 1280, 1504}, /* Registered Output */
+ {15, NO_OUTPUT_ENABLE_FUSE_ROW, 1024, 1248}, /* Registered Output */
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 768, 992}, /* Registered Output */
+ {17, NO_OUTPUT_ENABLE_FUSE_ROW, 512, 736}, /* Registered Output */
+ {18, NO_OUTPUT_ENABLE_FUSE_ROW, 256, 480}, /* Registered Output */
{19, 0, 32, 224}};
static pin_fuse_rows pal16r8pinfuserows[] = {
- {12, CNoOutputEnableFuseRow, 1792, 2016}, /* Registered Output */
- {13, CNoOutputEnableFuseRow, 1536, 1760}, /* Registered Output */
- {14, CNoOutputEnableFuseRow, 1280, 1504}, /* Registered Output */
- {15, CNoOutputEnableFuseRow, 1024, 1248}, /* Registered Output */
- {16, CNoOutputEnableFuseRow, 768, 992}, /* Registered Output */
- {17, CNoOutputEnableFuseRow, 512, 736}, /* Registered Output */
- {18, CNoOutputEnableFuseRow, 256, 480}, /* Registered Output */
- {19, CNoOutputEnableFuseRow, 0, 224}}; /* Registered Output */
-
-static pin_fuse_rows gal18v10pinfuserows[] = {
+ {12, NO_OUTPUT_ENABLE_FUSE_ROW, 1792, 2016}, /* Registered Output */
+ {13, NO_OUTPUT_ENABLE_FUSE_ROW, 1536, 1760}, /* Registered Output */
+ {14, NO_OUTPUT_ENABLE_FUSE_ROW, 1280, 1504}, /* Registered Output */
+ {15, NO_OUTPUT_ENABLE_FUSE_ROW, 1024, 1248}, /* Registered Output */
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 768, 992}, /* Registered Output */
+ {17, NO_OUTPUT_ENABLE_FUSE_ROW, 512, 736}, /* Registered Output */
+ {18, NO_OUTPUT_ENABLE_FUSE_ROW, 256, 480}, /* Registered Output */
+ {19, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 224}}; /* Registered Output */
+
+static pin_fuse_rows gal16v8pinfuserows[] = {
+ {12, 0, 0, 0},
+ {13, 0, 0, 0},
+ {14, 0, 0, 0},
+ {15, 0, 0, 0},
+ {16, 0, 0, 0},
+ {17, 0, 0, 0},
+ {18, 0, 0, 0},
+ {19, 0, 0, 0}};
+
+/*static pin_fuse_rows gal18v10pinfuserows[] = {
{9, 3096, 3132, 3384},
{11, 2772, 2808, 3060},
{12, 2448, 2484, 2736},
@@ -312,7 +381,7 @@ static pin_fuse_rows gal18v10pinfuserows[] = {
{16, 1008, 1044, 1296},
{17, 684, 720, 972},
{18, 360, 396, 648},
- {19, 36, 72, 324}};
+ {19, 36, 72, 324}};*/
static pin_fuse_rows pal20l8pinfuserows[] = {
{15, 2240, 2280, 2520},
@@ -339,32 +408,32 @@ static pin_fuse_rows pal20l10pinfuserows[] = {
static pin_fuse_rows pal20r4pinfuserows[] = {
{15, 2240, 2280, 2520},
{16, 1920, 1960, 2200},
- {17, 1600, 1640, 1840},
- {18, 1280, 1320, 1560},
- {19, 960, 1000, 1240},
- {20, 640, 680, 920},
+ {17, NO_OUTPUT_ENABLE_FUSE_ROW, 1600, 1880}, /* Registered Output */
+ {18, NO_OUTPUT_ENABLE_FUSE_ROW, 1280, 1560}, /* Registered Output */
+ {19, NO_OUTPUT_ENABLE_FUSE_ROW, 960, 1240}, /* Registered Output */
+ {20, NO_OUTPUT_ENABLE_FUSE_ROW, 640, 920}, /* Registered Output */
{21, 320, 360, 600},
{22, 0, 40, 280}};
static pin_fuse_rows pal20r6pinfuserows[] = {
{15, 2240, 2280, 2520},
- {16, 1920, 1960, 2200},
- {17, 1600, 1640, 1840},
- {18, 1280, 1320, 1560},
- {19, 960, 1000, 1240},
- {20, 640, 680, 920},
- {21, 320, 360, 600},
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 1920, 2200}, /* Registered Output */
+ {17, NO_OUTPUT_ENABLE_FUSE_ROW, 1600, 1880}, /* Registered Output */
+ {18, NO_OUTPUT_ENABLE_FUSE_ROW, 1280, 1560}, /* Registered Output */
+ {19, NO_OUTPUT_ENABLE_FUSE_ROW, 960, 1240}, /* Registered Output */
+ {20, NO_OUTPUT_ENABLE_FUSE_ROW, 640, 920}, /* Registered Output */
+ {21, NO_OUTPUT_ENABLE_FUSE_ROW, 320, 600}, /* Registered Output */
{22, 0, 40, 280}};
static pin_fuse_rows pal20r8pinfuserows[] = {
- {15, 2240, 2280, 2520},
- {16, 1920, 1960, 2200},
- {17, 1600, 1640, 1840},
- {18, 1280, 1320, 1560},
- {19, 960, 1000, 1240},
- {20, 640, 680, 920},
- {21, 320, 360, 600},
- {22, 0, 40, 280}};
+ {15, NO_OUTPUT_ENABLE_FUSE_ROW, 2240, 2520}, /* Registered Output */
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 1920, 2200}, /* Registered Output */
+ {17, NO_OUTPUT_ENABLE_FUSE_ROW, 1600, 1880}, /* Registered Output */
+ {18, NO_OUTPUT_ENABLE_FUSE_ROW, 1280, 1560}, /* Registered Output */
+ {19, NO_OUTPUT_ENABLE_FUSE_ROW, 960, 1240}, /* Registered Output */
+ {20, NO_OUTPUT_ENABLE_FUSE_ROW, 640, 920}, /* Registered Output */
+ {21, NO_OUTPUT_ENABLE_FUSE_ROW, 320, 600}, /* Registered Output */
+ {22, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 280}}; /* Registered Output */
static pin_fuse_columns pal10l8pinfusecolumns[] = {
{1, 3, 2},
@@ -576,7 +645,25 @@ static pin_fuse_columns pal16r8pinfusecolumns[] = {
{18, 7, 6}, /* Registered Output */
{19, 3, 2}}; /* Registered Output */
-static pin_fuse_columns gal18v10pinfusecolumns[] = {
+static pin_fuse_columns gal16v8pinfusecolumns[] = {
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0},
+ {0, 0, 0}};
+
+/*static pin_fuse_columns gal18v10pinfusecolumns[] = {
{1, 1, 0},
{2, 5, 4},
{3, 9, 8},
@@ -594,7 +681,7 @@ static pin_fuse_columns gal18v10pinfusecolumns[] = {
{16, 15, 14},
{17, 11, 10},
{18, 7, 6},
- {19, 3, 2}};
+ {19, 3, 2}};*/
static pin_fuse_columns pal20l8pinfusecolumns[] = {
{1, 3, 2},
@@ -708,133 +795,137 @@ static pin_fuse_columns pal20r8pinfusecolumns[] = {
static pal_data paldata[] = {
{"PAL10L8",
- pal10l8pinfuserows,
- sizeof(pal10l8pinfuserows) / sizeof(pal10l8pinfuserows[0]),
- pal10l8pinfusecolumns,
- sizeof(pal10l8pinfusecolumns) / sizeof(pal10l8pinfusecolumns[0]),
- print_pal10l8_product_terms},
+ pal10l8pinfuserows, ARRAY_LEN(pal10l8pinfuserows),
+ pal10l8pinfusecolumns, ARRAY_LEN(pal10l8pinfusecolumns),
+ print_pal10l8_product_terms,
+ config_pal10l8_pins,
+ NULL},
{"PAL10H8",
- pal10h8pinfuserows,
- sizeof(pal10h8pinfuserows) / sizeof(pal10h8pinfuserows[0]),
- pal10h8pinfusecolumns,
- sizeof(pal10h8pinfusecolumns) / sizeof(pal10h8pinfusecolumns[0]),
- print_pal10h8_product_terms},
+ pal10h8pinfuserows, ARRAY_LEN(pal10h8pinfuserows),
+ pal10h8pinfusecolumns, ARRAY_LEN(pal10h8pinfusecolumns),
+ print_pal10h8_product_terms,
+ config_pal10h8_pins,
+ NULL},
{"PAL12H6",
- pal12h6pinfuserows,
- sizeof(pal12h6pinfuserows) / sizeof(pal12h6pinfuserows[0]),
- pal12h6pinfusecolumns,
- sizeof(pal12h6pinfusecolumns) / sizeof(pal12h6pinfusecolumns[0]),
- print_pal12h6_product_terms},
+ pal12h6pinfuserows, ARRAY_LEN(pal12h6pinfuserows),
+ pal12h6pinfusecolumns, ARRAY_LEN(pal12h6pinfusecolumns),
+ print_pal12h6_product_terms,
+ config_pal12h6_pins,
+ NULL},
{"PAL14H4",
- pal14h4pinfuserows,
- sizeof(pal14h4pinfuserows) / sizeof(pal14h4pinfuserows[0]),
- pal14h4pinfusecolumns,
- sizeof(pal14h4pinfusecolumns) / sizeof(pal14h4pinfusecolumns[0]),
- print_pal14h4_product_terms},
+ pal14h4pinfuserows, ARRAY_LEN(pal14h4pinfuserows),
+ pal14h4pinfusecolumns, ARRAY_LEN(pal14h4pinfusecolumns),
+ print_pal14h4_product_terms,
+ config_pal14h4_pins,
+ NULL},
{"PAL16H2",
- pal16h2pinfuserows,
- sizeof(pal16h2pinfuserows) / sizeof(pal16h2pinfuserows[0]),
- pal16h2pinfusecolumns,
- sizeof(pal16h2pinfusecolumns) / sizeof(pal16h2pinfusecolumns[0]),
- print_pal16h2_product_terms},
+ pal16h2pinfuserows, ARRAY_LEN(pal16h2pinfuserows),
+ pal16h2pinfusecolumns, ARRAY_LEN(pal16h2pinfusecolumns),
+ print_pal16h2_product_terms,
+ config_pal16h2_pins,
+ NULL},
{"PAL16C1",
- pal16c1pinfuserows,
- sizeof(pal16c1pinfuserows) / sizeof(pal16c1pinfuserows[0]),
- pal16c1pinfusecolumns,
- sizeof(pal16c1pinfusecolumns) / sizeof(pal16c1pinfusecolumns[0]),
- print_pal16c1_product_terms},
+ pal16c1pinfuserows, ARRAY_LEN(pal16c1pinfuserows),
+ pal16c1pinfusecolumns, ARRAY_LEN(pal16c1pinfusecolumns),
+ print_pal16c1_product_terms,
+ config_pal16c1_pins,
+ NULL},
{"PAL12L6",
- pal12l6pinfuserows,
- sizeof(pal12l6pinfuserows) / sizeof(pal12l6pinfuserows[0]),
- pal12l6pinfusecolumns,
- sizeof(pal12l6pinfusecolumns) / sizeof(pal12l6pinfusecolumns[0]),
- print_pal12l6_product_terms},
+ pal12l6pinfuserows, ARRAY_LEN(pal12l6pinfuserows),
+ pal12l6pinfusecolumns, ARRAY_LEN(pal12l6pinfusecolumns),
+ print_pal12l6_product_terms,
+ config_pal12l6_pins,
+ NULL},
{"PAL14L4",
- pal14l4pinfuserows,
- sizeof(pal14l4pinfuserows) / sizeof(pal14l4pinfuserows[0]),
- pal14l4pinfusecolumns,
- sizeof(pal14l4pinfusecolumns) / sizeof(pal14l4pinfusecolumns[0]),
- print_pal14l4_product_terms},
+ pal14l4pinfuserows, ARRAY_LEN(pal14l4pinfuserows),
+ pal14l4pinfusecolumns, ARRAY_LEN(pal14l4pinfusecolumns),
+ print_pal14l4_product_terms,
+ config_pal14l4_pins,
+ NULL},
{"PAL16L2",
- pal16l2pinfuserows,
- sizeof(pal16l2pinfuserows) / sizeof(pal16l2pinfuserows[0]),
- pal16l2pinfusecolumns,
- sizeof(pal16l2pinfusecolumns) / sizeof(pal16l2pinfusecolumns[0]),
- print_pal16l2_product_terms},
- {"15S8", NULL, 0, NULL, 0, NULL},
- {"PLS153", NULL, 0, NULL, 0, NULL},
+ pal16l2pinfuserows, ARRAY_LEN(pal16l2pinfuserows),
+ pal16l2pinfusecolumns, ARRAY_LEN(pal16l2pinfusecolumns),
+ print_pal16l2_product_terms,
+ config_pal16l2_pins,
+ NULL},
+ /*{"15S8", NULL, 0, NULL, 0, NULL, NULL, NULL},
+ {"PLS153", NULL, 0, NULL, 0, NULL, NULL, NULL},*/
{"PAL16L8",
- pal16l8pinfuserows,
- sizeof(pal16l8pinfuserows) / sizeof(pal16l8pinfuserows[0]),
- pal16l8pinfusecolumns,
- sizeof(pal16l8pinfusecolumns) / sizeof(pal16l8pinfusecolumns[0]),
- print_pal16l8_product_terms},
+ pal16l8pinfuserows, ARRAY_LEN(pal16l8pinfuserows),
+ pal16l8pinfusecolumns, ARRAY_LEN(pal16l8pinfusecolumns),
+ print_pal16l8_product_terms,
+ config_pal16l8_pins,
+ NULL},
{"PAL16R4",
- pal16r4pinfuserows,
- sizeof(pal16r4pinfuserows) / sizeof(pal16r4pinfuserows[0]),
- pal16r4pinfusecolumns,
- sizeof(pal16r4pinfusecolumns) / sizeof(pal16r4pinfusecolumns),
- print_pal16r4_product_terms},
+ pal16r4pinfuserows, ARRAY_LEN(pal16r4pinfuserows),
+ pal16r4pinfusecolumns, ARRAY_LEN(pal16r4pinfusecolumns),
+ print_pal16r4_product_terms,
+ config_pal16r4_pins,
+ NULL},
{"PAL16R6",
- pal16r6pinfuserows,
- sizeof(pal16r6pinfuserows) / sizeof(pal16r6pinfuserows[0]),
- pal16r6pinfusecolumns,
- sizeof(pal16r6pinfusecolumns) / sizeof(pal16r6pinfusecolumns),
- print_pal16r6_product_terms},
+ pal16r6pinfuserows, ARRAY_LEN(pal16r6pinfuserows),
+ pal16r6pinfusecolumns, ARRAY_LEN(pal16r6pinfusecolumns),
+ print_pal16r6_product_terms,
+ config_pal16r6_pins,
+ NULL},
{"PAL16R8",
- pal16r8pinfuserows,
- sizeof(pal16r8pinfuserows) / sizeof(pal16r8pinfuserows[0]),
- pal16r8pinfusecolumns,
- sizeof(pal16r8pinfusecolumns) / sizeof(pal16r8pinfusecolumns),
- print_pal16r8_product_terms},
- {"PAL16RA8", NULL, 0, NULL, 0, NULL},
- {"PAL16V8R", NULL, 0, NULL, 0, NULL},
- {"PALCE16V8", NULL, 0, NULL, 0, NULL},
- {"GAL16V8A", NULL, 0, NULL, 0, NULL},
- {"18CV8", NULL, 0, NULL, 0, NULL},
+ pal16r8pinfuserows, ARRAY_LEN(pal16r8pinfuserows),
+ pal16r8pinfusecolumns, ARRAY_LEN(pal16r8pinfusecolumns),
+ print_pal16r8_product_terms,
+ config_pal16r8_pins,
+ NULL},
+ /*{"PAL16RA8", NULL, 0, NULL, 0, NULL, NULL, NULL},
+ {"PAL16V8R", NULL, 0, NULL, 0, NULL, NULL, NULL},
+ {"PALCE16V8", NULL, 0, NULL, 0, NULL, NULL, NULL},*/
+ {"GAL16V8",
+ gal16v8pinfuserows, ARRAY_LEN(gal16v8pinfuserows),
+ gal16v8pinfusecolumns, ARRAY_LEN(gal16v8pinfusecolumns),
+ print_gal16v8_product_terms,
+ config_gal16v8_pins,
+ is_gal16v8_product_term_enabled},
+ /*{"18CV8", NULL, 0, NULL, 0, NULL},
{"GAL18V10",
- gal18v10pinfuserows,
- sizeof(gal18v10pinfuserows) / sizeof(gal18v10pinfuserows[0]),
- gal18v10pinfusecolumns,
- sizeof(gal18v10pinfusecolumns) / sizeof(gal18v10pinfusecolumns),
- print_gal18v10_product_terms},
+ gal18v10pinfuserows, ARRAY_LEN(gal18v10pinfuserows),
+ gal18v10pinfusecolumns, ARRAY_LEN(gal18v10pinfusecolumns),
+ print_gal18v10_product_terms,
+ config_gal18v10_pins,
+ NULL},*/
{"PAL20L8",
- pal20l8pinfuserows,
- sizeof(pal20l8pinfuserows) / sizeof(pal20l8pinfuserows[0]),
- pal20l8pinfusecolumns,
- sizeof(pal20l8pinfusecolumns) / sizeof(pal20l8pinfusecolumns[0]),
- print_pal20l8_product_terms},
+ pal20l8pinfuserows, ARRAY_LEN(pal20l8pinfuserows),
+ pal20l8pinfusecolumns, ARRAY_LEN(pal20l8pinfusecolumns),
+ print_pal20l8_product_terms,
+ config_pal20l8_pins,
+ NULL},
{"PAL20L10",
- pal20l10pinfuserows,
- sizeof(pal20l10pinfuserows) / sizeof(pal20l10pinfuserows[0]),
- pal20l10pinfusecolumns,
- sizeof(pal20l10pinfusecolumns) / sizeof(pal20l10pinfusecolumns[0]),
- print_pal20l10_product_terms},
+ pal20l10pinfuserows, ARRAY_LEN(pal20l10pinfuserows),
+ pal20l10pinfusecolumns, ARRAY_LEN(pal20l10pinfusecolumns),
+ print_pal20l10_product_terms,
+ config_pal20l10_pins,
+ NULL},
{"PAL20R4",
- pal20r4pinfuserows,
- sizeof(pal20r4pinfuserows) / sizeof(pal20r4pinfuserows[0]),
- pal20r4pinfusecolumns,
- sizeof(pal20r4pinfusecolumns) / sizeof(pal20r4pinfusecolumns[0]),
- print_pal20r4_product_terms},
+ pal20r4pinfuserows, ARRAY_LEN(pal20r4pinfuserows),
+ pal20r4pinfusecolumns, ARRAY_LEN(pal20r4pinfusecolumns),
+ print_pal20r4_product_terms,
+ config_pal20r4_pins,
+ NULL},
{"PAL20R6",
- pal20r6pinfuserows,
- sizeof(pal20r6pinfuserows) / sizeof(pal20r6pinfuserows[0]),
- pal20r6pinfusecolumns,
- sizeof(pal20r6pinfusecolumns) / sizeof(pal20r6pinfusecolumns[0]),
- print_pal20r6_product_terms},
+ pal20r6pinfuserows, ARRAY_LEN(pal20r6pinfuserows),
+ pal20r6pinfusecolumns, ARRAY_LEN(pal20r6pinfusecolumns),
+ print_pal20r6_product_terms,
+ config_pal20r6_pins,
+ NULL},
{"PAL20R8",
- pal20r8pinfuserows,
- sizeof(pal20r8pinfuserows) / sizeof(pal20r8pinfuserows[0]),
- pal20r8pinfusecolumns,
- sizeof(pal20r8pinfusecolumns) / sizeof(pal20r8pinfusecolumns[0]),
- print_pal20r8_product_terms},
- {"PAL20X4", NULL, 0, NULL, 0, NULL},
- {"PAL20X8", NULL, 0, NULL, 0, NULL},
- {"PAL20X10", NULL, 0, NULL, 0, NULL},
- {"PAL22V10", NULL, 0, NULL, 0, NULL},
- {"GAL20V8A", NULL, 0, NULL, 0, NULL},
- {"GAL22V10", NULL, 0, NULL, 0, NULL},
- {"PLS100", NULL, 0, NULL, 0, NULL}};
+ pal20r8pinfuserows, ARRAY_LEN(pal20r8pinfuserows),
+ pal20r8pinfusecolumns, ARRAY_LEN(pal20r8pinfusecolumns),
+ print_pal20r8_product_terms,
+ config_pal20r8_pins, NULL}/*,
+ {"PAL20X4", NULL, 0, NULL, 0, NULL, NULL, NULL},
+ {"PAL20X8", NULL, 0, NULL, 0, NULL, NULL, NULL},
+ {"PAL20X10", NULL, 0, NULL, 0, NULL, NULL, NULL},
+ {"PAL22V10", NULL, 0, NULL, 0, NULL, NULL, NULL},
+ {"GAL20V8A", NULL, 0, NULL, 0, NULL, NULL, NULL},
+ {"GAL22V10", NULL, 0, NULL, 0, NULL, NULL, NULL},
+ {"PLS100", NULL, 0, NULL, 0, NULL, NULL, NULL}*/};
@@ -867,12 +958,11 @@ static int is_jed_file(const char *file)
with a pal name
-------------------------------------------------*/
-static pal_data* find_pal_data(const char *name)
+static const pal_data* find_pal_data(const char *name)
{
int index;
- for (index = 0; index < sizeof(paldata) / sizeof(paldata[0]);
- ++index)
+ for (index = 0; index < ARRAY_LEN(paldata); ++index)
{
if (!core_stricmp(name, paldata[index].name))
{
@@ -886,6 +976,50 @@ static pal_data* find_pal_data(const char *name)
/*-------------------------------------------------
+ find_fuse_rows - finds the fuse row data for
+ an output pin.
+-------------------------------------------------*/
+
+static const pin_fuse_rows* find_fuse_rows(const pal_data* pal, UINT16 pin)
+{
+ UINT16 index;
+
+ for (index = 0; index < pal->pinfuserowscount; ++index)
+ {
+ if (pal->pinfuserows[index].pin == pin)
+ {
+ return &pal->pinfuserows[index];
+ }
+ }
+
+ return NULL;
+}
+
+
+
+/*-------------------------------------------------
+ find_fuse_columns - finds the fuse column
+ data for an input pin.
+-------------------------------------------------*/
+
+static const pin_fuse_columns* find_fuse_columns(const pal_data* pal, UINT16 pin)
+{
+ UINT16 index;
+
+ for (index = 0; index < pal->pinfusecolumnscount; ++index)
+ {
+ if (pal->pinfusecolumns[index].pin == pin)
+ {
+ return &pal->pinfusecolumns[index];
+ }
+ }
+
+ return NULL;
+}
+
+
+
+/*-------------------------------------------------
calc_fuse_column_count - calculates the total
columns of a pal
-------------------------------------------------*/
@@ -898,11 +1032,11 @@ static UINT16 calc_fuse_column_count(const pal_data* pal)
/*-------------------------------------------------
- is_fuse_row_blown - checks if a fuse row is
- all blown
+ all_fuses_in_row_blown - checks if a fuse row
+ is all blown
-------------------------------------------------*/
-static int is_fuse_row_blown(const pal_data* pal, const jed_data* jed, UINT16 fuserow)
+static int all_fuses_in_row_blown(const pal_data* pal, const jed_data* jed, UINT16 fuserow)
{
UINT16 columncount = calc_fuse_column_count(pal);
UINT16 column;
@@ -921,17 +1055,18 @@ static int is_fuse_row_blown(const pal_data* pal, const jed_data* jed, UINT16 fu
/*-------------------------------------------------
- is_output_pin - determines if the pin is an
- output pin
+ any_fuses_in_row_blown - checks if any fuses in
+ a row have been blown.
-------------------------------------------------*/
-static int is_output_pin(UINT16 pin)
+static int any_fuses_in_row_blown(const pal_data* pal, const jed_data* jed, UINT16 fuserow)
{
- UINT16 index;
+ UINT16 columncount = calc_fuse_column_count(pal);
+ UINT16 column;
- for (index = 0; index < outputpinscount; ++index)
+ for (column = 0; column < columncount; ++column)
{
- if (outputpins[index] == pin)
+ if (jed_get_fuse(jed, fuserow + column))
{
return 1;
}
@@ -943,88 +1078,79 @@ static int is_output_pin(UINT16 pin)
/*-------------------------------------------------
- find_input_pins - finds the input pins of a
- pal
+ set_input_pins - saves the pins that can be
+ used by a product term
-------------------------------------------------*/
-static void find_input_pins(const pal_data* pal, const jed_data* jed)
+static void set_input_pins(const UINT16* pins, UINT16 pin_count)
{
- UINT16 column;
-
- inputpinscount = 0;
+ UINT16 index;
- for (column = 0; column < pal->pinfusecolumnscount; ++column)
+ for (index = 0; index < pin_count; ++index)
{
- if (!is_output_pin(pal->pinfusecolumns[column].pin))
- {
- inputpins[inputpinscount] = pal->pinfusecolumns[column].pin;
+ inputpins[index] = pins[index];
- ++inputpinscount;
- }
+ ++inputpinscount;
}
}
/*-------------------------------------------------
- find_output_pins - finds the output pins of a
- pal
+ set_output_pins - saves the output pins
-------------------------------------------------*/
-static void find_output_pins(const pal_data* pal, const jed_data* jed)
+static void set_output_pins(const pin_output_config* pin_output_configs, UINT16 pin_count)
{
- UINT16 column, columncount, index;
- int fuseblown;
-
- outputpinscount = 0;
- columncount = calc_fuse_column_count(pal);
+ UINT16 index;
- for (index = 0; index < pal->pinfuserowscount; ++index)
+ for (index = 0; index < pin_count; ++index)
{
- fuseblown = 0;
+ outputpins[index].pin = pin_output_configs[index].pin;
+ outputpins[index].flags = pin_output_configs[index].flags;
- if (pal->pinfuserows[index].fuserowoutputenable == CNoOutputEnableFuseRow)
- {
- fuseblown = 1;
- }
- else
- {
- for (column = 0; column < columncount; ++column)
- {
- if (jed_get_fuse(jed, pal->pinfuserows[index].fuserowoutputenable + column) == 1)
- {
- fuseblown = 1;
- }
- }
- }
+ ++outputpinscount;
+ }
+}
- if (fuseblown)
- {
- outputpins[outputpinscount] = pal->pinfuserows[index].pin;
- ++outputpinscount;
+
+/*-------------------------------------------------
+ is_output_pin - determines if the pin is an
+ output pin
+-------------------------------------------------*/
+
+static int is_output_pin(UINT16 pin)
+{
+ UINT16 index;
+
+ for (index = 0; index < outputpinscount; ++index)
+ {
+ if (outputpins[index].pin == pin)
+ {
+ return 1;
}
}
+
+ return 0;
}
-static int is_output_pin_used(const pal_data* pal, const jed_data* jed, const pin_fuse_rows* fuse_rows)
-{
- UINT16 row, column, columncount;
+/*-------------------------------------------------
+ get_pin_output_flags - gets the flags
+ of an output pin
+-------------------------------------------------*/
- columncount = calc_fuse_column_count(pal);
+static UINT16 get_pin_output_flags(UINT16 pin)
+{
+ UINT16 index;
- for (row = fuse_rows->fuserowtermstart;
- row <= fuse_rows->fuserowtermend;
- row += columncount)
+ for (index = 0; index < outputpinscount; ++index)
{
- for (column = 0; column < columncount; ++column)
+ if (outputpins[index].pin == pin)
{
- if (jed_get_fuse(jed, row + column))
- {
- return 1;
- }
+ return outputpins[index].flags;
}
}
@@ -1034,59 +1160,123 @@ static int is_output_pin_used(const pal_data* pal, const jed_data* jed, const pi
/*-------------------------------------------------
- generate_product_terms - prints the product terms
- for a fuse row
+ get_pin_fuse_state - gets the fuse state of
+ an input pin
+-------------------------------------------------*/
+
+static UINT16 get_pin_fuse_state(const pal_data* pal, const jed_data* jed, UINT16 pin, UINT16 fuserow)
+{
+ const pin_fuse_columns* fuse_columns = find_fuse_columns(pal, pin);
+ int lowfusestate, highfusestate;
+
+ if (!fuse_columns)
+ {
+ fprintf(stderr, "Fuse column data missing for pin %d!\n", pin);
+
+ return NO_FUSE_BLOWN;
+ }
+
+ lowfusestate = jed_get_fuse(jed, fuserow + fuse_columns->lowfusecolumn);
+ highfusestate = jed_get_fuse(jed, fuserow + fuse_columns->highfusecolumn);
+
+ if (!lowfusestate && highfusestate)
+ {
+ return LOW_FUSE_BLOWN;
+ }
+ else if (lowfusestate && !highfusestate)
+ {
+ return HIGH_FUSE_BLOWN;
+ }
+ else if (!lowfusestate && !highfusestate)
+ {
+ return NO_FUSE_BLOWN;
+ }
+
+ return LOWHIGH_FUSE_BLOWN;
+}
+
+
+
+/*-------------------------------------------------
+ generate_product_terms - prints the product
+ terms for a fuse row
-------------------------------------------------*/
static void generate_product_terms(const pal_data* pal, const jed_data* jed, UINT16 fuserow, char* buffer)
{
- UINT16 index;
- int lowfusestate, highfusestate, haveterm;
+ UINT16 index, pin, fuse_state, haveterm, flags;
char tmpbuffer[20];
*buffer = 0;
haveterm = 0;
- for (index = 0; index < pal->pinfusecolumnscount; ++index)
+ if (pal->is_product_term_enabled && !pal->is_product_term_enabled(pal, jed, fuserow))
{
- lowfusestate = jed_get_fuse(jed, fuserow + pal->pinfusecolumns[index].lowfusecolumn);
- highfusestate = jed_get_fuse(jed, fuserow + pal->pinfusecolumns[index].highfusecolumn);
+ return;
+ }
+
+ for (index = 0; index < inputpinscount; ++index)
+ {
+ pin = inputpins[index];
- if (!lowfusestate && highfusestate)
+ fuse_state = get_pin_fuse_state(pal, jed, pin, fuserow);
+
+ if (fuse_state == LOW_FUSE_BLOWN)
{
if (haveterm)
{
strcat(buffer, " & ");
}
- if (!is_output_pin(pal->pinfusecolumns[index].pin))
+ if (!is_output_pin(pin))
{
- sprintf(tmpbuffer, "/i%d", pal->pinfusecolumns[index].pin);
+ sprintf(tmpbuffer, "/i%d", pin);
strcat(buffer, tmpbuffer);
}
else
{
- sprintf(tmpbuffer, "/o%d", pal->pinfusecolumns[index].pin);
+ flags = get_pin_output_flags(pin);
+
+ if (flags & OUTPUT_COMBINATORIAL)
+ {
+ sprintf(tmpbuffer, "/o%d", pin);
+ }
+ else if (flags & OUTPUT_REGISTERED)
+ {
+ sprintf(tmpbuffer, "/rf%d", pin);
+ }
+
strcat(buffer, tmpbuffer);
}
haveterm = 1;
}
- else if (lowfusestate && !highfusestate)
+
+ if (fuse_state == HIGH_FUSE_BLOWN)
{
if (haveterm)
{
strcat(buffer, " & ");
}
- if (!is_output_pin(pal->pinfusecolumns[index].pin))
+ if (!is_output_pin(pin))
{
- sprintf(tmpbuffer, "i%d", pal->pinfusecolumns[index].pin);
+ sprintf(tmpbuffer, "i%d", pin);
strcat(buffer, tmpbuffer);
}
else
{
- sprintf(tmpbuffer, "o%d", pal->pinfusecolumns[index].pin);
+ flags = get_pin_output_flags(pin);
+
+ if (flags & OUTPUT_COMBINATORIAL)
+ {
+ sprintf(tmpbuffer, "o%d", pin);
+ }
+ else if (flags & OUTPUT_REGISTERED)
+ {
+ sprintf(tmpbuffer, "rf%d", pin);
+ }
+
strcat(buffer, tmpbuffer);
}
@@ -1102,84 +1292,109 @@ static void generate_product_terms(const pal_data* pal, const jed_data* jed, UIN
for a pal
-------------------------------------------------*/
-static void print_product_terms(const pal_data* pal, const jed_data* jed, int activestate)
+static void print_product_terms(const pal_data* pal, const jed_data* jed)
{
- UINT16 index, row, columncount;
+ UINT16 index, columncount, flags, row, haveterms;
char buffer[200];
- int haveterms, indent, indentindex;
+ int indent, indentindex;
+ const pin_fuse_rows* fuse_rows;
columncount = calc_fuse_column_count(pal);
- for (index = 0; index < pal->pinfuserowscount; ++index)
+ for (index = 0; index < outputpinscount; ++index)
{
- if (is_output_pin(pal->pinfuserows[index].pin) &&
- is_output_pin_used(pal, jed, &pal->pinfuserows[index]))
+ flags = outputpins[index].flags;
+
+ indent = 0;
+
+ if (flags & OUTPUT_ACTIVELOW)
{
- indent = 0;
+ printf("/");
- if (!activestate)
- {
- printf("/");
+ ++indent;
+ }
- ++indent;
- }
+ if (flags & OUTPUT_COMBINATORIAL)
+ {
+ sprintf(buffer, "o%d = ", outputpins[index].pin);
+ }
+ else if (flags & OUTPUT_REGISTERED)
+ {
+ sprintf(buffer, "rf%d := ", outputpins[index].pin);
+ }
+ else
+ {
+ fprintf(stderr, "Unknown output type for pin %d!\n", outputpins[index].pin);
- sprintf(buffer, "o%d = ", pal->pinfuserows[index].pin);
+ continue;
+ }
- printf("%s", buffer);
+ printf("%s", buffer);
- haveterms = 0;
- indent += strlen(buffer);
+ haveterms = 0;
+ indent += strlen(buffer);
- for (row = pal->pinfuserows[index].fuserowtermstart;
- row <= pal->pinfuserows[index].fuserowtermend;
- row += columncount)
- {
- generate_product_terms(pal, jed, row, buffer);
+ fuse_rows = find_fuse_rows(pal, outputpins[index].pin);
- if (strlen(buffer) > 0)
+ if (!fuse_rows)
+ {
+ fprintf(stderr, "Fuse row data missing!\n");
+
+ continue;
+ }
+
+ for (row = fuse_rows->fuserowtermstart; row <= fuse_rows->fuserowtermend;
+ row += columncount)
+ {
+ generate_product_terms(pal, jed, row, buffer);
+
+ if (strlen(buffer) > 0)
+ {
+ if (haveterms)
{
- if (haveterms)
- {
- printf(" +\n");
+ printf(" +\n");
- for (indentindex = 0; indentindex < indent; ++indentindex)
- {
- printf(" ");
- }
- }
- else
+ for (indentindex = 0; indentindex < indent; ++indentindex)
{
- haveterms = 1;
+ printf(" ");
}
-
- printf("%s", buffer);
}
+ else
+ {
+ haveterms = 1;
+ }
+
+ printf("%s", buffer);
}
+ }
- printf("\n");
+ printf("\n");
- /* output enable equations */
+ /* output enable equations */
- printf("o%d.oe = ", pal->pinfuserows[index].pin);
+ if (flags & OUTPUT_COMBINATORIAL)
+ {
+ printf("o%d.oe = ", outputpins[index].pin);
- if (pal->pinfuserows[index].fuserowoutputenable == CNoOutputEnableFuseRow ||
- is_fuse_row_blown(pal, jed, pal->pinfuserows[index].fuserowoutputenable))
+ if (fuse_rows->fuserowoutputenable == NO_OUTPUT_ENABLE_FUSE_ROW ||
+ all_fuses_in_row_blown(pal, jed, fuse_rows->fuserowoutputenable))
{
printf("vcc\n");
}
else
{
- generate_product_terms(pal, jed, pal->pinfuserows[index].fuserowoutputenable, buffer);
+ generate_product_terms(pal, jed, fuse_rows->fuserowoutputenable, buffer);
printf("%s\n", buffer);
}
-
- printf("\n");
}
- }
+ else if (flags & OUTPUT_REGISTERED)
+ {
+ printf("rf%d.oe = OE\n", outputpins[index].pin);
+ }
- printf("\n");
+ printf("\n");
+ }
}
@@ -1191,7 +1406,7 @@ static void print_product_terms(const pal_data* pal, const jed_data* jed, int ac
static void print_pal10l8_product_terms(const pal_data* pal, const jed_data* jed)
{
- print_product_terms(pal, jed, 0);
+ print_product_terms(pal, jed);
}
@@ -1203,7 +1418,7 @@ static void print_pal10l8_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal10h8_product_terms(const pal_data* pal, const jed_data* jed)
{
- print_product_terms(pal, jed, 1);
+ print_product_terms(pal, jed);
}
@@ -1215,7 +1430,7 @@ static void print_pal10h8_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal12l6_product_terms(const pal_data* pal, const jed_data* jed)
{
- print_product_terms(pal, jed, 0);
+ print_product_terms(pal, jed);
}
@@ -1227,7 +1442,7 @@ static void print_pal12l6_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal12h6_product_terms(const pal_data* pal, const jed_data* jed)
{
- print_product_terms(pal, jed, 1);
+ print_product_terms(pal, jed);
}
@@ -1239,7 +1454,7 @@ static void print_pal12h6_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal14l4_product_terms(const pal_data* pal, const jed_data* jed)
{
- print_product_terms(pal, jed, 0);
+ print_product_terms(pal, jed);
}
@@ -1251,7 +1466,7 @@ static void print_pal14l4_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal14h4_product_terms(const pal_data* pal, const jed_data* jed)
{
- print_product_terms(pal, jed, 1);
+ print_product_terms(pal, jed);
}
@@ -1263,7 +1478,7 @@ static void print_pal14h4_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal16l2_product_terms(const pal_data* pal, const jed_data* jed)
{
- print_product_terms(pal, jed, 0);
+ print_product_terms(pal, jed);
}
@@ -1275,7 +1490,7 @@ static void print_pal16l2_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal16h2_product_terms(const pal_data* pal, const jed_data* jed)
{
- print_product_terms(pal, jed, 1);
+ print_product_terms(pal, jed);
}
@@ -1287,7 +1502,7 @@ static void print_pal16h2_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal16c1_product_terms(const pal_data* pal, const jed_data* jed)
{
- printf("Viewing product terms are not supported.\n");
+ print_product_terms(pal, jed);
}
@@ -1299,7 +1514,7 @@ static void print_pal16c1_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal16l8_product_terms(const pal_data* pal, const jed_data* jed)
{
- print_product_terms(pal, jed, 0);
+ print_product_terms(pal, jed);
}
@@ -1311,7 +1526,7 @@ static void print_pal16l8_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal16r4_product_terms(const pal_data* pal, const jed_data* jed)
{
- printf("Viewing product terms are not supported.\n");
+ print_product_terms(pal, jed);
}
@@ -1323,7 +1538,7 @@ static void print_pal16r4_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal16r6_product_terms(const pal_data* pal, const jed_data* jed)
{
- printf("Viewing product terms are not supported.\n");
+ print_product_terms(pal, jed);
}
@@ -1335,7 +1550,19 @@ static void print_pal16r6_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal16r8_product_terms(const pal_data* pal, const jed_data* jed)
{
- printf("Viewing product terms are not supported.\n");
+ print_product_terms(pal, jed);
+}
+
+
+
+/*-------------------------------------------------
+ print_gal16v8_product_terms - prints the product
+ terms for a GAL16V8
+-------------------------------------------------*/
+
+static void print_gal16v8_product_terms(const pal_data* pal, const jed_data* jed)
+{
+ print_product_terms(pal, jed);
}
@@ -1345,10 +1572,10 @@ static void print_pal16r8_product_terms(const pal_data* pal, const jed_data* jed
terms for a GAL18V10
-------------------------------------------------*/
-static void print_gal18v10_product_terms(const pal_data* pal, const jed_data* jed)
+/*static void print_gal18v10_product_terms(const pal_data* pal, const jed_data* jed)
{
printf("Viewing product terms are not supported.\n");
-}
+}*/
@@ -1359,7 +1586,7 @@ static void print_gal18v10_product_terms(const pal_data* pal, const jed_data* je
static void print_pal20l8_product_terms(const pal_data* pal, const jed_data* jed)
{
- print_product_terms(pal, jed, 0);
+ print_product_terms(pal, jed);
}
@@ -1371,7 +1598,7 @@ static void print_pal20l8_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal20l10_product_terms(const pal_data* pal, const jed_data* jed)
{
- print_product_terms(pal, jed, 0);
+ print_product_terms(pal, jed);
}
@@ -1383,7 +1610,7 @@ static void print_pal20l10_product_terms(const pal_data* pal, const jed_data* je
static void print_pal20r4_product_terms(const pal_data* pal, const jed_data* jed)
{
- printf("Viewing product terms are not supported.\n");
+ print_product_terms(pal, jed);
}
@@ -1395,7 +1622,7 @@ static void print_pal20r4_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal20r6_product_terms(const pal_data* pal, const jed_data* jed)
{
- printf("Viewing product terms are not supported.\n");
+ print_product_terms(pal, jed);
}
@@ -1407,7 +1634,818 @@ static void print_pal20r6_product_terms(const pal_data* pal, const jed_data* jed
static void print_pal20r8_product_terms(const pal_data* pal, const jed_data* jed)
{
- printf("Viewing product terms are not supported.\n");
+ print_product_terms(pal, jed);
+}
+
+
+
+/*-------------------------------------------------
+ config_pal10l8_pins - configures the pins for
+ a PAL10L8
+-------------------------------------------------*/
+
+static void config_pal10l8_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11};
+ static pin_output_config output_pins[] = {
+ {12, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {13, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {14, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {15, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {16, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {17, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {18, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {19, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL}};
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, ARRAY_LEN(output_pins));
+}
+
+
+
+/*-------------------------------------------------
+ config_pal10h8_pins - configures the pins for
+ a PAL10H8
+-------------------------------------------------*/
+
+static void config_pal10h8_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11};
+ static pin_output_config output_pins[] = {
+ {12, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {13, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {14, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {15, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {16, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {17, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {18, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {19, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL}};
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, ARRAY_LEN(output_pins));
+}
+
+
+
+/*-------------------------------------------------
+ config_pal12l6_pins - configures the pins for
+ a PAL12L6
+-------------------------------------------------*/
+
+static void config_pal12l6_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 19};
+ static pin_output_config output_pins[] = {
+ {13, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {14, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {15, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {16, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {17, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {18, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL}};
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, ARRAY_LEN(output_pins));
+}
+
+
+
+/*-------------------------------------------------
+ config_pal12h6_pins - configures the pins for
+ a PAL12H6
+-------------------------------------------------*/
+
+static void config_pal12h6_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 19};
+ static pin_output_config output_pins[] = {
+ {13, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {14, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {15, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {16, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {17, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {18, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL}};
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, ARRAY_LEN(output_pins));
+}
+
+
+
+/*-------------------------------------------------
+ config_pal14l4_pins - configures the pins for
+ a PAL14L4
+-------------------------------------------------*/
+
+static void config_pal14l4_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 18, 19};
+ static pin_output_config output_pins[] = {
+ {14, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {15, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {16, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {17, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL}};
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, ARRAY_LEN(output_pins));
+}
+
+
+
+/*-------------------------------------------------
+ config_pal14h4_pins - configures the pins for
+ a PAL14H4
+-------------------------------------------------*/
+
+static void config_pal14h4_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 18, 19};
+ static pin_output_config output_pins[] = {
+ {14, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {15, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {16, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {17, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL}};
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, ARRAY_LEN(output_pins));
+}
+
+
+
+/*-------------------------------------------------
+ config_pal16l2_pins - configures the pins for
+ a PAL16L2
+-------------------------------------------------*/
+
+static void config_pal16l2_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 17, 18, 19};
+ static pin_output_config output_pins[] = {
+ {15, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {16, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL}};
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, ARRAY_LEN(output_pins));
+}
+
+
+
+/*-------------------------------------------------
+ config_pal16h2_pins - configures the pins for
+ a PAL16H2
+-------------------------------------------------*/
+
+static void config_pal16h2_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 17, 18, 19};
+ static pin_output_config output_pins[] = {
+ {15, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL},
+ {16, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL}};
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, ARRAY_LEN(output_pins));
+}
+
+
+
+/*-------------------------------------------------
+ config_pal16c1_pins - configures the pins for
+ a PAL16C1
+-------------------------------------------------*/
+
+static void config_pal16c1_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 17, 18, 19};
+ static pin_output_config output_pins[] = {
+ {15, OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL},
+ {16, OUTPUT_ACTIVEHIGH | OUTPUT_COMBINATORIAL}};
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, ARRAY_LEN(output_pins));
+}
+
+
+
+/*-------------------------------------------------
+ config_pal16l8_pins - configures the pins for
+ a PAL16L8
+-------------------------------------------------*/
+
+static void config_pal16l8_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 14, 15, 16, 17, 18};
+ pin_output_config output_pins[8];
+ UINT16 output_pin_count, index;
+
+ output_pin_count = 0;
+
+ for (index = 0; index < pal->pinfuserowscount; ++index)
+ {
+ if (any_fuses_in_row_blown(pal, jed, pal->pinfuserows[index].fuserowoutputenable))
+ {
+ output_pins[output_pin_count].pin = pal->pinfuserows[index].pin;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+ }
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, output_pin_count);
+}
+
+
+
+/*-------------------------------------------------
+ config_pal16r4_pins - configures the pins for
+ a PAL16R4
+-------------------------------------------------*/
+
+static void config_pal16r4_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19};
+ static UINT16 registered_pins[] = {14, 15, 16, 17};
+ pin_output_config output_pins[8];
+ UINT16 output_pin_count, index;
+
+ output_pin_count = 0;
+
+ if (any_fuses_in_row_blown(pal, jed, 1792))
+ {
+ output_pins[output_pin_count].pin = 12;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+
+ if (any_fuses_in_row_blown(pal, jed, 1536))
+ {
+ output_pins[output_pin_count].pin = 13;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+
+ for (index = 0; index < ARRAY_LEN(registered_pins); ++index)
+ {
+ output_pins[output_pin_count].pin = registered_pins[index];
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_REGISTERED;
+
+ ++output_pin_count;
+ }
+
+ if (any_fuses_in_row_blown(pal, jed, 256))
+ {
+ output_pins[output_pin_count].pin = 18;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+
+ if (any_fuses_in_row_blown(pal, jed, 0))
+ {
+ output_pins[output_pin_count].pin = 19;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, output_pin_count);
+}
+
+
+
+/*-------------------------------------------------
+ config_pal16r6_pins - configures the pins
+ for a PAL16R6
+-------------------------------------------------*/
+
+static void config_pal16r6_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19};
+ static UINT16 registered_pins[] = {13, 14, 15, 16, 17, 18};
+ pin_output_config output_pins[8];
+ UINT16 output_pin_count, index;
+
+ output_pin_count = 0;
+
+ if (any_fuses_in_row_blown(pal, jed, 1792))
+ {
+ output_pins[output_pin_count].pin = 12;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+
+ for (index = 0; index < ARRAY_LEN(registered_pins); ++index)
+ {
+ output_pins[output_pin_count].pin = registered_pins[index];
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_REGISTERED;
+
+ ++output_pin_count;
+ }
+
+ if (any_fuses_in_row_blown(pal, jed, 0))
+ {
+ output_pins[output_pin_count].pin = 19;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, output_pin_count);
+}
+
+
+
+/*-------------------------------------------------
+ config_pal16r8_pins - configures the pins for
+ a PAL16R8
+-------------------------------------------------*/
+
+static void config_pal16r8_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19};
+ static pin_output_config output_pins[] = {
+ {12, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED},
+ {13, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED},
+ {14, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED},
+ {15, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED},
+ {16, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED},
+ {17, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED},
+ {18, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED},
+ {19, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED}};
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, ARRAY_LEN(output_pins));
+}
+
+
+
+/*-------------------------------------------------
+ config_gal16v8_pins - configures the pins for
+ a GAL16V8
+-------------------------------------------------*/
+
+static void config_gal16v8_pins(const pal_data* pal, const jed_data* jed)
+{
+ typedef struct _output_logic_macrocell output_logic_macrocell;
+ struct _output_logic_macrocell
+ {
+ UINT16 pin;
+ UINT16 xor_fuse;
+ UINT16 ac1_fuse;
+ };
+
+ static output_logic_macrocell macrocells[] = {
+ {12, 2055, 2127},
+ {13, 2054, 2126},
+ {14, 2053, 2125},
+ {15, 2052, 2124},
+ {16, 2051, 2123},
+ {17, 2050, 2122},
+ {18, 2049, 2121},
+ {19, 2048, 2120}};
+ static pin_fuse_rows pinfuserows_registered[] = {
+ {12, NO_OUTPUT_ENABLE_FUSE_ROW, 1792, 2016},
+ {13, NO_OUTPUT_ENABLE_FUSE_ROW, 1536, 1760},
+ {14, NO_OUTPUT_ENABLE_FUSE_ROW, 1280, 1504},
+ {15, NO_OUTPUT_ENABLE_FUSE_ROW, 1024, 1248},
+ {16, NO_OUTPUT_ENABLE_FUSE_ROW, 768, 992},
+ {17, NO_OUTPUT_ENABLE_FUSE_ROW, 512, 736},
+ {18, NO_OUTPUT_ENABLE_FUSE_ROW, 256, 480},
+ {19, NO_OUTPUT_ENABLE_FUSE_ROW, 0, 224}};
+ static pin_fuse_rows pinfuserows_combinatorial[] = {
+ {12, 1792, 1824, 2016},
+ {13, 1536, 1568, 1760},
+ {14, 1280, 1312, 1504},
+ {15, 1024, 1056, 1248},
+ {16, 768, 800, 992},
+ {17, 512, 544, 736},
+ {18, 256, 288, 480},
+ {19, 0, 32, 224}};
+ static pin_fuse_columns pinfusecolumns_registered[] = {
+ {2, 1, 0},
+ {3, 5, 4},
+ {4, 9, 8},
+ {5, 13, 12},
+ {6, 17, 16},
+ {7, 21, 20},
+ {8, 25, 24},
+ {9, 29, 28},
+ {12, 31, 30},
+ {13, 27, 26},
+ {14, 23, 22},
+ {15, 19, 18},
+ {16, 15, 14},
+ {17, 11, 10},
+ {18, 7, 6},
+ {19, 3, 2}};
+ static pin_fuse_columns pinfusecolumns_combinatorialcomplex[] = {
+ {1, 3, 2},
+ {2, 1, 0},
+ {3, 5, 4},
+ {4, 9, 8},
+ {5, 13, 12},
+ {6, 17, 16},
+ {7, 21, 20},
+ {8, 25, 24},
+ {9, 29, 28},
+ {11, 31, 30},
+ {13, 27, 26},
+ {14, 23, 22},
+ {15, 19, 18},
+ {16, 15, 14},
+ {17, 11, 10},
+ {18, 7, 6}};
+ static pin_fuse_columns pinfusecolumns_combinatorialsimple[] = {
+ {1, 3, 2},
+ {2, 1, 0},
+ {3, 5, 4},
+ {4, 9, 8},
+ {5, 13, 12},
+ {6, 17, 16},
+ {7, 21, 20},
+ {8, 25, 24},
+ {9, 29, 28},
+ {11, 31, 30},
+ {12, 27, 26},
+ {13, 23, 22},
+ {14, 19, 18},
+ {17, 15, 14},
+ {18, 11, 10},
+ {19, 7, 6}};
+ static UINT16 input_pins_registered[] = {2, 3, 4, 5, 6, 7, 8, 9, 12, 13, 14, 15, 16, 17, 18, 19};
+ static UINT16 input_pins_combinatorialcomplex[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 13, 14, 15, 16, 17, 18};
+ static UINT16 input_pins_combinatorialsimple[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 11, 12, 13, 14, 17, 18, 19};
+ pin_output_config output_pins[ARRAY_LEN(macrocells)];
+ UINT16 index, output_pin_count;
+
+ output_pin_count = 0;
+
+ /* SYN Fuse: 0 - registered, 1 - combinatorial */
+
+ if (jed_get_fuse(jed, 2192))
+ {
+ /* Combinatorial */
+ /* AC0 Fuse: 0 - simple mode, 1 - complex mode */
+
+ if (jed_get_fuse(jed, 2193))
+ {
+ /* Complex Mode */
+
+ set_input_pins(input_pins_combinatorialcomplex, ARRAY_LEN(input_pins_combinatorialcomplex));
+
+ memcpy(gal16v8pinfuserows, pinfuserows_combinatorial, sizeof(pinfuserows_combinatorial));
+ memcpy(gal16v8pinfusecolumns, pinfusecolumns_combinatorialcomplex, sizeof(pinfusecolumns_combinatorialcomplex));
+
+ for (index = 0; index < ARRAY_LEN(macrocells); ++index)
+ {
+ if (is_gal16v8_product_term_enabled(pal, jed, pal->pinfuserows[index].fuserowoutputenable) &&
+ any_fuses_in_row_blown(pal, jed, pal->pinfuserows[index].fuserowoutputenable))
+ {
+ output_pins[output_pin_count].pin = macrocells[index].pin;
+ output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL;
+
+ if (jed_get_fuse(jed, macrocells[index].xor_fuse))
+ {
+ output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
+ }
+ else
+ {
+ output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
+ }
+
+ ++output_pin_count;
+ }
+ }
+ }
+ else
+ {
+ /* Simple Mode */
+
+ set_input_pins(input_pins_combinatorialsimple, ARRAY_LEN(input_pins_combinatorialsimple));
+
+ memcpy(gal16v8pinfuserows, pinfuserows_registered, sizeof(pinfuserows_registered));
+ memcpy(gal16v8pinfusecolumns, pinfusecolumns_combinatorialsimple, sizeof(pinfusecolumns_combinatorialsimple));
+
+ for (index = 0; index < ARRAY_LEN(macrocells); ++index)
+ {
+ if (jed_get_fuse(jed, macrocells[index].ac1_fuse))
+ {
+ /* Pin is for input only */
+
+ if (macrocells[index].pin == 15 || macrocells[index].pin == 16)
+ {
+ fprintf(stderr, "Pin %d cannot be configured as an input pin.\n",
+ macrocells[index].pin);
+ }
+ }
+ else
+ {
+ output_pins[output_pin_count].pin = macrocells[index].pin;
+ output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL;
+
+ if (jed_get_fuse(jed, macrocells[index].xor_fuse))
+ {
+ output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
+ }
+ else
+ {
+ output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
+ }
+
+ ++output_pin_count;
+ }
+ }
+ }
+ }
+ else
+ {
+ /* Registered */
+
+ set_input_pins(input_pins_registered, ARRAY_LEN(input_pins_registered));
+
+ memcpy(gal16v8pinfusecolumns, pinfusecolumns_registered, sizeof(pinfusecolumns_registered));
+
+ for (index = 0; index < ARRAY_LEN(macrocells); ++index)
+ {
+ if (jed_get_fuse(jed, macrocells[index].ac1_fuse))
+ {
+ /* combinatorial pin */
+
+ gal16v8pinfuserows[index].fuserowoutputenable = pinfuserows_combinatorial[index].fuserowoutputenable;
+ gal16v8pinfuserows[index].fuserowtermstart = pinfuserows_combinatorial[index].fuserowtermstart;
+ gal16v8pinfuserows[index].fuserowtermend = pinfuserows_combinatorial[index].fuserowtermend;
+
+ if (is_gal16v8_product_term_enabled(pal, jed, pal->pinfuserows[index].fuserowoutputenable) &&
+ any_fuses_in_row_blown(pal, jed, pal->pinfuserows[index].fuserowoutputenable))
+ {
+ output_pins[output_pin_count].pin = macrocells[index].pin;
+ output_pins[output_pin_count].flags = OUTPUT_COMBINATORIAL;
+
+ if (jed_get_fuse(jed, macrocells[index].xor_fuse))
+ {
+ output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
+ }
+ else
+ {
+ output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
+ }
+
+ ++output_pin_count;
+ }
+ }
+ else
+ {
+ /* registered pin */
+
+ gal16v8pinfuserows[index].fuserowoutputenable = pinfuserows_registered[index].fuserowoutputenable;
+ gal16v8pinfuserows[index].fuserowtermstart = pinfuserows_registered[index].fuserowtermstart;
+ gal16v8pinfuserows[index].fuserowtermend = pinfuserows_registered[index].fuserowtermend;
+
+ output_pins[output_pin_count].pin = macrocells[index].pin;
+ output_pins[output_pin_count].flags = OUTPUT_REGISTERED;
+
+ if (jed_get_fuse(jed, macrocells[index].xor_fuse))
+ {
+ output_pins[output_pin_count].flags |= OUTPUT_ACTIVEHIGH;
+ }
+ else
+ {
+ output_pins[output_pin_count].flags |= OUTPUT_ACTIVELOW;
+ }
+
+ ++output_pin_count;
+ }
+ }
+ }
+
+ set_output_pins(output_pins, output_pin_count);
+}
+
+
+
+/*-------------------------------------------------
+ config_gal18v10_pins - configures the pins
+ for a GAL18V10
+-------------------------------------------------*/
+
+/*static void config_gal18v10_pins(const pal_data* pal, const jed_data* jed)
+{
+}*/
+
+
+
+/*-------------------------------------------------
+ config_pal20l8_pins - configures the pins for
+ a PAL20L8
+-------------------------------------------------*/
+
+static void config_pal20l8_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 14, 16, 17, 18, 19, 20, 21, 23};
+ pin_output_config output_pins[8];
+ UINT16 output_pin_count, index;
+
+ output_pin_count = 0;
+
+ for (index = 0; index < pal->pinfuserowscount; ++index)
+ {
+ if (any_fuses_in_row_blown(pal, jed, pal->pinfuserows[index].fuserowoutputenable))
+ {
+ output_pins[output_pin_count].pin = pal->pinfuserows[index].pin;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+ }
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, output_pin_count);
+}
+
+
+
+/*-------------------------------------------------
+ config_pal20l10_pins - configures the pins for
+ a PAL20L10
+-------------------------------------------------*/
+
+static void config_pal20l10_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 16, 17, 18, 19, 20, 21, 22};
+ pin_output_config output_pins[10];
+ UINT16 output_pin_count, index;
+
+ output_pin_count = 0;
+
+ for (index = 0; index < pal->pinfuserowscount; ++index)
+ {
+ if (any_fuses_in_row_blown(pal, jed, pal->pinfuserows[index].fuserowoutputenable))
+ {
+ output_pins[output_pin_count].pin = pal->pinfuserows[index].pin;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+ }
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, output_pin_count);
+}
+
+
+
+/*-------------------------------------------------
+ config_pal20r4_pins - configures the pins for
+ a PAL20R4
+-------------------------------------------------*/
+
+static void config_pal20r4_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23};
+ static UINT16 registered_pins[] = {17, 18, 19, 20};
+ pin_output_config output_pins[8];
+ UINT16 output_pin_count, index;
+
+ output_pin_count = 0;
+
+ if (any_fuses_in_row_blown(pal, jed, 2240))
+ {
+ output_pins[output_pin_count].pin = 15;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+
+ if (any_fuses_in_row_blown(pal, jed, 1920))
+ {
+ output_pins[output_pin_count].pin = 16;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+
+ for (index = 0; index < ARRAY_LEN(registered_pins); ++index)
+ {
+ output_pins[output_pin_count].pin = registered_pins[index];
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_REGISTERED;
+
+ ++output_pin_count;
+ }
+
+ if (any_fuses_in_row_blown(pal, jed, 320))
+ {
+ output_pins[output_pin_count].pin = 21;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+
+ if (any_fuses_in_row_blown(pal, jed, 0))
+ {
+ output_pins[output_pin_count].pin = 22;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, output_pin_count);
+}
+
+
+
+/*-------------------------------------------------
+ config_pal20r6_pins - configures the pins for
+ a PAL20R6
+-------------------------------------------------*/
+
+static void config_pal20r6_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23};
+ static UINT16 registered_pins[] = {16, 17, 18, 19, 20, 21};
+ pin_output_config output_pins[8];
+ UINT16 output_pin_count, index;
+
+ output_pin_count = 0;
+
+ if (any_fuses_in_row_blown(pal, jed, 2240))
+ {
+ output_pins[output_pin_count].pin = 15;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+
+ for (index = 0; index < ARRAY_LEN(registered_pins); ++index)
+ {
+ output_pins[output_pin_count].pin = registered_pins[index];
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_REGISTERED;
+
+ ++output_pin_count;
+ }
+
+ if (any_fuses_in_row_blown(pal, jed, 0))
+ {
+ output_pins[output_pin_count].pin = 22;
+ output_pins[output_pin_count].flags = OUTPUT_ACTIVELOW | OUTPUT_COMBINATORIAL;
+
+ ++output_pin_count;
+ }
+
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, output_pin_count);
+}
+
+
+
+/*-------------------------------------------------
+ config_pal20r8_pins - configures the pins for
+ a PAL20R8
+-------------------------------------------------*/
+
+static void config_pal20r8_pins(const pal_data* pal, const jed_data* jed)
+{
+ static UINT16 input_pins[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23};
+ static pin_output_config output_pins[] = {
+ {15, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED},
+ {16, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED},
+ {17, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED},
+ {18, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED},
+ {19, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED},
+ {20, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED},
+ {21, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED},
+ {22, OUTPUT_ACTIVELOW | OUTPUT_REGISTERED}};
+
+ set_input_pins(input_pins, ARRAY_LEN(input_pins));
+ set_output_pins(output_pins, ARRAY_LEN(output_pins));
+}
+
+
+
+/*-------------------------------------------------
+ is_gal16v8_product_term_enabled - determins if
+ a fuse row in a GAL16V8 is enabled
+-------------------------------------------------*/
+
+static int is_gal16v8_product_term_enabled(const pal_data* pal, const jed_data* jed, UINT16 fuserow)
+{
+ UINT16 fuse_ptd;
+
+ fuse_ptd = (fuserow / calc_fuse_column_count(pal)) + 2128;
+
+ if (fuse_ptd > 2191)
+ {
+ fprintf(stderr, "Fuse row %d is illegal!\n", fuserow);
+
+ return 0;
+ }
+
+ return jed_get_fuse(jed, fuse_ptd);
}
@@ -1506,6 +2544,7 @@ static int print_usage()
" jedutil -convert <source.bin> <target.jed> -- convert binary to JED form\n"
" jedutil -view <source.jed> <pal name> -- dump JED logic equations\n"
" jedutil -view <source.bin> <pal name> -- dump binary logic equations\n"
+ " jedutil -viewlist -- view list of supported devices\n"
);
return 0;
@@ -1639,7 +2678,7 @@ static int command_view(int argc, char *argv[])
{
const char *srcfile, *palname;
int is_jed;
- pal_data* pal;
+ const pal_data* pal;
jed_data jed;
int err;
@@ -1692,8 +2731,7 @@ static int command_view(int argc, char *argv[])
/* generate equations from fuse map */
- find_output_pins(pal, &jed);
- find_input_pins(pal, &jed);
+ pal->config_pins(pal, &jed);
if (pal->print_product_terms)
{
@@ -1712,23 +2750,46 @@ static int command_view(int argc, char *argv[])
/*-------------------------------------------------
+ command_viewlist - views the list of supported
+ jeds
+-------------------------------------------------*/
+
+static int command_viewlist(int argc, char *argv[])
+{
+ int index;
+
+ if (argc > 0)
+ {
+ return print_usage();
+ }
+
+ for (index = 0; index < ARRAY_LEN(paldata); ++index)
+ {
+ printf("%s\n", paldata[index].name);
+ }
+
+ return 0;
+}
+
+
+/*-------------------------------------------------
main - primary entry point
-------------------------------------------------*/
int main(int argc, char *argv[])
{
command_entry command_entries[] = {
- {"-convert", &command_convert},
- {"-view", &command_view}};
+ {"-convert", &command_convert},
+ {"-view", &command_view},
+ {"-viewlist", &command_viewlist}};
int index;
- /* needs at least two arguments */
- if (argc < 4)
+ if (argc < 2)
{
return print_usage();
}
- for (index = 0; index < sizeof(command_entries) / sizeof(command_entries[0]); ++index)
+ for (index = 0; index < ARRAY_LEN(command_entries); ++index)
{
if (!strcmp(argv[1], command_entries[index].command))
return command_entries[index].command_func(argc - 2, &argv[2]);