mirror of
https://github.com/hneemann/Digital.git
synced 2025-09-17 00:44:40 -04:00
refactoring of Gal16v8JEDECExporter
This commit is contained in:
parent
112e2b945b
commit
f4a23ced0e
@ -58,14 +58,12 @@ public class Gal16v8JEDECExporter implements ExpressionExporter<Gal16v8JEDECExpo
|
||||
if (registered) {
|
||||
map.setFuse(SYN, false);
|
||||
map.setFuse(AC0, true);
|
||||
for (int i = 0; i < 8; i++)
|
||||
map.setFuse(AC1 + i, true);
|
||||
} else {
|
||||
map.setFuse(SYN, true);
|
||||
map.setFuse(AC0, false);
|
||||
for (int i = 0; i < 8; i++)
|
||||
map.setFuse(AC1 + i, false);
|
||||
}
|
||||
for (int i = 0; i < 8; i++)
|
||||
map.setFuse(AC1 + i, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -73,17 +71,6 @@ public class Gal16v8JEDECExporter implements ExpressionExporter<Gal16v8JEDECExpo
|
||||
return builder;
|
||||
}
|
||||
|
||||
/**
|
||||
* enables register in registered mode
|
||||
*
|
||||
* @param i the OLMC to enable the register for
|
||||
* @return this for chained calls
|
||||
*/
|
||||
private Gal16v8JEDECExporter enableRegisterFor(int i) {
|
||||
map.setFuse(AC1 + i, false);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PinMap getPinMapping() {
|
||||
return pinMap;
|
||||
@ -106,29 +93,22 @@ public class Gal16v8JEDECExporter implements ExpressionExporter<Gal16v8JEDECExpo
|
||||
for (String o : builder.getOutputs()) {
|
||||
int olmc = 19 - pinMap.getOutputFor(o);
|
||||
int offs = olmc * 256;
|
||||
if (builder.getCombinatorial().containsKey(o)) {
|
||||
map.setFuse(XOR + olmc); // set XOR to compensate inverted driver
|
||||
if (builder.getCombinatorial().containsKey(o)) {
|
||||
if (registered) {
|
||||
for (int j = 0; j < 32; j++) map.setFuse(offs + j);
|
||||
for (int j = 0; j < 32; j++) map.setFuse(offs + j); // turn on OE
|
||||
filler.fillExpression(offs + 32, builder.getCombinatorial().get(o), 7);
|
||||
} else {
|
||||
map.setFuse(AC1 + olmc, false);
|
||||
filler.fillExpression(offs, builder.getCombinatorial().get(o), 8);
|
||||
}
|
||||
} else if (builder.getRegistered().containsKey(o)) {
|
||||
enableRegisterFor(olmc);
|
||||
map.setFuse(XOR + olmc); // set XOR to compensate inverted driver
|
||||
map.setFuse(AC1 + olmc, false); // turn on register
|
||||
filler.fillExpression(offs, builder.getRegistered().get(o), 8);
|
||||
} else
|
||||
throw new FuseMapFillerException("variable " + o + " not found!");
|
||||
}
|
||||
|
||||
if (!registered) {
|
||||
// turn on unused AC1(n) bits
|
||||
for (int i : pinMap.getUnusedOutputs())
|
||||
map.setFuse(AC1 + (19 - i));
|
||||
}
|
||||
|
||||
|
||||
new JedecWriter(out).println("Digital GAL16v8 assembler*").write(map).close();
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user