Better experimental ATF1508 support.

This commit is contained in:
hneemann 2017-12-07 16:53:56 +01:00
parent b6034a9fc6
commit f4494a4414
5 changed files with 32 additions and 14 deletions

View File

@ -1,11 +1,13 @@
package de.neemann.digital.builder.ATF1502;
import de.neemann.digital.builder.tt2.TT2Exporter;
/**
* Creates a TT2 file suitable for the ATF1508
*
* @author hneemann
*/
public class ATF1508TT2Exporter extends ATF1502TT2Exporter {
public class ATF1508TT2Exporter extends TT2Exporter {
/**
* Creates a new project name
@ -15,7 +17,17 @@ public class ATF1508TT2Exporter extends ATF1502TT2Exporter {
public ATF1508TT2Exporter(String projectName) {
super(projectName);
setDevice("f1508ispplcc84");
setClockPin(81);
getPinMapping().setAvailBidirectional(
4, 5, 6, 8, 9, 10, 11, 12, // A
15, 16, 17, 18, 20, 21, 22, 24, // B
25, 27, 28, 29, 30, 31, 33, 34, // C
35, 36, 37, 39, 40, 41, 44, 45, // D
46, 48, 49, 50, 51, 52, 54, 55, // E
56, 57, 58, 60, 61, 63, 64, 65, // F
67, 68, 69, 70, 73, 74, 75, 76, // G
77, 79, 80 // H
);
}
}

View File

@ -154,7 +154,7 @@ public class CuplExporter implements ExpressionExporter<CuplExporter> {
for (String var : builder.getOutputs()) {
if (createNodes) {
int p = pinMap.isAssigned(var);
int p = pinMap.isOutputAssigned(var);
if (p >= 0)
out.append("PIN ").append(Integer.toString(p)).append(" = ").append(var).append(";\r\n");
else

View File

@ -200,11 +200,16 @@ public class PinMap {
*
* @param in the pins name
* @return the pin number or -1 if not assigned
* @throws PinMapException PinMap
*/
public int isAssigned(String in) {
public int isOutputAssigned(String in) throws PinMapException {
Integer p = searchPinWithAlias(in);
if (p == null) return -1;
else return p;
else {
if (!isAvailable(PinDescription.Direction.output, p))
throw new PinMapException(Lang.get("err_pinMap_pin_N0_isNotAnOutput", p));
return p;
}
}
private int getPinFor(String in, PinDescription.Direction direction) throws PinMapException {

View File

@ -257,7 +257,7 @@ public class TT2Exporter implements ExpressionExporter<TT2Exporter> {
}
for (String o : builder.getOutputs()) {
int p = pinMap.isAssigned(o);
int p = pinMap.isOutputAssigned(o);
if (p >= 0) {
pin.append(" ").append(o).append("+:").append(p);
pinNum++;

View File

@ -476,7 +476,7 @@ public class TableDialog extends JDialog {
if (Main.enableExperimental()) {
hardware.add(createATF150XExporterMenu("ATF1508",
new ATF1508CuplExporter(),
null,
new ExpressionToFileExporter(new ATF1508TT2Exporter(getProjectName()))
.addProcessingStep(new StartATF1508Fitter(TableDialog.this))
.addProcessingStep(new CreateCHN("ATF1508AS"))
@ -490,12 +490,13 @@ public class TableDialog extends JDialog {
private JMenuItem createATF150XExporterMenu(String menuName, CuplExporter cuplExporter, ExpressionToFileExporter expressionToFileExporter) {
JMenu menu = new JMenu(menuName);
menu.add(new ToolTipAction(Lang.get("menu_table_createCUPL")) {
@Override
public void actionPerformed(ActionEvent actionEvent) {
createCUPL(cuplExporter);
}
}.setToolTip(Lang.get("menu_table_createCUPL_tt")).createJMenuItem());
if (cuplExporter != null)
menu.add(new ToolTipAction(Lang.get("menu_table_createCUPL")) {
@Override
public void actionPerformed(ActionEvent actionEvent) {
createCUPL(cuplExporter);
}
}.setToolTip(Lang.get("menu_table_createCUPL_tt")).createJMenuItem());
menu.add(new ToolTipAction(Lang.get("menu_table_createTT2")) {
@Override
public void actionPerformed(ActionEvent actionEvent) {
@ -608,7 +609,7 @@ public class TableDialog extends JDialog {
}
private String getProjectName() {
if (filename==null)
if (filename == null)
return "unknown";
else return filename.getName();
}