added support for ATF1504 in PLCC44

This commit is contained in:
hneemann 2017-03-12 20:55:15 +01:00
parent f304de898c
commit ffc5807e54
8 changed files with 118 additions and 14 deletions

View File

@ -18,7 +18,7 @@ public class ATF1502CuplExporter extends Gal16v8CuplExporter {
* Creates a new project name * Creates a new project name
*/ */
public ATF1502CuplExporter() { public ATF1502CuplExporter() {
this(System.getProperty("user.name"), new Date()); this(System.getProperty("user.name"), new Date(), "f1502ispplcc44");
} }
/** /**
@ -27,8 +27,8 @@ public class ATF1502CuplExporter extends Gal16v8CuplExporter {
* @param username user name * @param username user name
* @param date date * @param date date
*/ */
public ATF1502CuplExporter(String username, Date date) { public ATF1502CuplExporter(String username, Date date, String type) {
super(username, date, "f1502ispplcc44", new PinMap() super(username, date, type, new PinMap()
.setAvailBidirectional(4, 5, 6, 8, 9, 11, 12, 14, 16, 17, .setAvailBidirectional(4, 5, 6, 8, 9, 11, 12, 14, 16, 17,
18, 19, 20, 21, 24, 25, 26, 27, 28, 18, 19, 20, 21, 24, 25, 26, 27, 28,
29, 31, 33, 34, 36, 37, 38, 39, 40)); 29, 31, 33, 34, 36, 37, 38, 39, 40));

View File

@ -0,0 +1,19 @@
package de.neemann.digital.builder.ATF1502;
import java.util.Date;
/**
* Creates a CUPL file
*
* @author hneemann
*/
public class ATF1504CuplExporter extends ATF1502CuplExporter {
/**
* Creates a new project name
*/
public ATF1504CuplExporter() {
super(System.getProperty("user.name"), new Date(), "f1504ispplcc44");
}
}

View File

@ -0,0 +1,19 @@
package de.neemann.digital.builder.ATF1502;
/**
* Creates a TT2 file suitable for the ATF1502
*
* @author hneemann
*/
public class ATF1504TT2Exporter extends ATF1502TT2Exporter {
/**
* Creates a new project name
*/
public ATF1504TT2Exporter() {
super();
setDevice("f1502ispplcc44");
}
}

View File

@ -11,6 +11,18 @@ import java.io.*;
* Created by hneemann on 10.03.17. * Created by hneemann on 10.03.17.
*/ */
public class CreateCHN implements ExpressionToFileExporter.PostProcess { public class CreateCHN implements ExpressionToFileExporter.PostProcess {
private final String device;
/**
* create a new instance
*
* @param device the device name used in the chn file
*/
public CreateCHN(String device) {
this.device = device;
}
@Override @Override
public File execute(File file) throws IOException { public File execute(File file) throws IOException {
File chnFile = Main.checkSuffix(file, "chn"); File chnFile = Main.checkSuffix(file, "chn");
@ -18,7 +30,7 @@ public class CreateCHN implements ExpressionToFileExporter.PostProcess {
try (Writer chn = new OutputStreamWriter(new FileOutputStream(chnFile), "UTF-8")) { try (Writer chn = new OutputStreamWriter(new FileOutputStream(chnFile), "UTF-8")) {
chn.write("1 4 1 0 \r\n" chn.write("1 4 1 0 \r\n"
+ "\r\n" + "\r\n"
+ "ATF1502AS\r\n" + device + "\r\n"
+ "10\r\n" + "10\r\n"
+ "1\r\n"); + "1\r\n");
chn.write(file.getPath()); chn.write(file.getPath());

View File

@ -15,7 +15,7 @@ import java.util.ArrayList;
* Starts a fitter to create a JEDEC file. * Starts a fitter to create a JEDEC file.
* Created by hneemann on 10.03.17. * Created by hneemann on 10.03.17.
*/ */
public class StartFitter implements ExpressionToFileExporter.PostProcess { public class StartATF1502Fitter implements ExpressionToFileExporter.PostProcess {
private final JDialog parent; private final JDialog parent;
private final File fitterExe; private final File fitterExe;
@ -24,9 +24,19 @@ public class StartFitter implements ExpressionToFileExporter.PostProcess {
* *
* @param parent the parent dialog * @param parent the parent dialog
*/ */
public StartFitter(JDialog parent) { public StartATF1502Fitter(JDialog parent) {
this(parent, Settings.getInstance().get(Keys.SETTINGS_ATF1502_FITTER));
}
/**
* Creates a new instance
*
* @param parent the parent dialog
* @param fitterExe fitter executable
*/
public StartATF1502Fitter(JDialog parent, File fitterExe) {
this.parent = parent; this.parent = parent;
this.fitterExe = Settings.getInstance().get(Keys.SETTINGS_ATF1502_FITTER); this.fitterExe = fitterExe;
} }
@Override @Override

View File

@ -0,0 +1,26 @@
package de.neemann.digital.builder.tt2;
import de.neemann.digital.core.element.Keys;
import de.neemann.digital.gui.Settings;
import javax.swing.*;
import java.io.File;
/**
* StartATF1504Fitter start the fitter for ATF1504
* Created by hneemann on 12.03.17.
*/
public class StartATF1504Fitter extends StartATF1502Fitter {
/**
* Creates a new intance
*
* @param parent the parent dialog
*/
public StartATF1504Fitter(JDialog parent) {
super(parent, getATF1504(Settings.getInstance().get(Keys.SETTINGS_ATF1502_FITTER)));
}
private static File getATF1504(File file) {
return new File(file.getParentFile(), "fit1504.exe");
}
}

View File

@ -15,9 +15,7 @@ import de.neemann.digital.analyse.expression.modify.NOr;
import de.neemann.digital.analyse.expression.modify.TwoInputs; import de.neemann.digital.analyse.expression.modify.TwoInputs;
import de.neemann.digital.analyse.format.TruthTableFormatterLaTeX; import de.neemann.digital.analyse.format.TruthTableFormatterLaTeX;
import de.neemann.digital.analyse.quinemc.BoolTableByteArray; import de.neemann.digital.analyse.quinemc.BoolTableByteArray;
import de.neemann.digital.builder.ATF1502.ATF1502CuplExporter; import de.neemann.digital.builder.ATF1502.*;
import de.neemann.digital.builder.ATF1502.ATF1502TT2Exporter;
import de.neemann.digital.builder.ATF1502.CreateCHN;
import de.neemann.digital.builder.*; import de.neemann.digital.builder.*;
import de.neemann.digital.builder.Gal16v8.Gal16v8CuplExporter; import de.neemann.digital.builder.Gal16v8.Gal16v8CuplExporter;
import de.neemann.digital.builder.Gal16v8.Gal16v8JEDECExporter; import de.neemann.digital.builder.Gal16v8.Gal16v8JEDECExporter;
@ -25,7 +23,8 @@ import de.neemann.digital.builder.Gal22v10.Gal22v10CuplExporter;
import de.neemann.digital.builder.Gal22v10.Gal22v10JEDECExporter; import de.neemann.digital.builder.Gal22v10.Gal22v10JEDECExporter;
import de.neemann.digital.builder.circuit.CircuitBuilder; import de.neemann.digital.builder.circuit.CircuitBuilder;
import de.neemann.digital.builder.jedec.FuseMapFillerException; import de.neemann.digital.builder.jedec.FuseMapFillerException;
import de.neemann.digital.builder.tt2.StartFitter; import de.neemann.digital.builder.tt2.StartATF1502Fitter;
import de.neemann.digital.builder.tt2.StartATF1504Fitter;
import de.neemann.digital.draw.elements.Circuit; import de.neemann.digital.draw.elements.Circuit;
import de.neemann.digital.draw.shapes.ShapeFactory; import de.neemann.digital.draw.shapes.ShapeFactory;
import de.neemann.digital.gui.Main; import de.neemann.digital.gui.Main;
@ -441,12 +440,31 @@ public class TableDialog extends JDialog {
public void actionPerformed(ActionEvent actionEvent) { public void actionPerformed(ActionEvent actionEvent) {
createHardware( createHardware(
new ExpressionToFileExporter(new ATF1502TT2Exporter()) new ExpressionToFileExporter(new ATF1502TT2Exporter())
.addProcessingStep(new StartFitter(TableDialog.this)) .addProcessingStep(new StartATF1502Fitter(TableDialog.this))
.addProcessingStep(new CreateCHN()), filename, "tt2"); .addProcessingStep(new CreateCHN("ATF1502AS")), filename, "tt2");
} }
}.setToolTip(Lang.get("menu_table_createTT2_tt")).createJMenuItem()); }.setToolTip(Lang.get("menu_table_createTT2_tt")).createJMenuItem());
hardware.add(atf1502); hardware.add(atf1502);
JMenu atf1504 = new JMenu("ATF1504");
atf1504.add(new ToolTipAction(Lang.get("menu_table_createCUPL")) {
@Override
public void actionPerformed(ActionEvent actionEvent) {
createCUPL(new ATF1504CuplExporter());
}
}.setToolTip(Lang.get("menu_table_createCUPL_tt")).createJMenuItem());
atf1504.add(new ToolTipAction(Lang.get("menu_table_createTT2")) {
@Override
public void actionPerformed(ActionEvent actionEvent) {
createHardware(
new ExpressionToFileExporter(new ATF1504TT2Exporter())
.addProcessingStep(new StartATF1504Fitter(TableDialog.this))
.addProcessingStep(new CreateCHN("ATF1504AS")), filename, "tt2");
}
}.setToolTip(Lang.get("menu_table_createTT2_tt")).createJMenuItem());
hardware.add(atf1504);
createMenu.add(hardware); createMenu.add(hardware);

View File

@ -24,7 +24,7 @@ public class ATF1502CuplExporterTest extends TestCase {
Expression y0s = not(y0); Expression y0s = not(y0);
Expression y1s = or(and(not(y0), y1), and(y0, not(y1))); Expression y1s = or(and(not(y0), y1), and(y0, not(y1)));
ATF1502CuplExporter ce = new ATF1502CuplExporter("user", new Date(0)); ATF1502CuplExporter ce = new ATF1502CuplExporter("user", new Date(0), "f1502ispplcc44");
ce.setProjectName("test"); ce.setProjectName("test");
ce.getBuilder() ce.getBuilder()
.addSequential("Y_0", y0s) .addSequential("Y_0", y0s)