minor cleanup

This commit is contained in:
hneemann 2018-03-26 17:05:31 +02:00
parent ecf0a1c561
commit d1e5712b74
5 changed files with 7 additions and 32 deletions

View File

@ -22,7 +22,7 @@ public class MergeConstants {
* @param nodes the node to simplify
* @param circuit the circuit
*/
public MergeConstants(ArrayList<HDLNode> nodes, HDLCircuit circuit) {
MergeConstants(ArrayList<HDLNode> nodes, HDLCircuit circuit) {
this.nodes = nodes;
this.circuit = circuit;
}

View File

@ -20,6 +20,7 @@ import java.util.HashSet;
* Create the vhdl output
*/
public class VHDLCreator {
private static final String ZEROS = "0000000000000000000000000000000000000000000000000000000000000000";
private final CodePrinter out;
private final VHDLLibrary library;
private HashSet<String> customPrinted;
@ -57,8 +58,9 @@ public class VHDLCreator {
*/
public static String value(long val, int bits) {
String s = Long.toBinaryString(val & Bits.mask(bits));
while (s.length() < bits)
s = "0" + s;
int missing = bits - s.length();
if (missing > 0)
s = ZEROS.substring(0, missing) + s;
if (bits > 1)
s = "\"" + s + "\"";

View File

@ -16,7 +16,6 @@ import de.neemann.digital.hdl.model2.HDLException;
import de.neemann.digital.hdl.model2.HDLModel;
import de.neemann.digital.hdl.model2.clock.HDLClockIntegrator;
import de.neemann.digital.hdl.printer.CodePrinter;
import de.neemann.digital.hdl.printer.CodePrinterStr;
import de.neemann.digital.hdl.vhdl2.boards.BoardInterface;
import de.neemann.digital.hdl.vhdl2.boards.BoardProvider;
import de.neemann.digital.lang.Lang;
@ -36,16 +35,6 @@ public class VHDLGenerator implements Closeable {
private ArrayList<File> testBenches;
private boolean useClockIntegration = true;
/**
* Creates a new exporter
*
* @param library the library
* @throws IOException IOException
*/
public VHDLGenerator(ElementLibrary library) throws IOException {
this(library, new CodePrinterStr());
}
/**
* Creates a new exporter
*

View File

@ -174,25 +174,10 @@ public class ClockIntegratorARTIX7 implements HDLClockIntegrator {
+ '}';
}
public int getD() {
return d;
}
public int getM() {
return m;
}
public int getDivider() {
return divider;
}
public boolean isCascading() {
private boolean isCascading() {
return divider4 != 0;
}
public int getDivider4() {
return divider4;
}
}
}

View File

@ -12,7 +12,6 @@ import de.neemann.digital.core.extern.ProcessStarter;
import de.neemann.digital.draw.elements.PinException;
import de.neemann.digital.draw.library.ElementNotFoundException;
import de.neemann.digital.gui.Settings;
import de.neemann.digital.hdl.hgs.HGSEvalException;
import de.neemann.digital.hdl.model2.HDLException;
import de.neemann.digital.hdl.printer.CodePrinter;
import de.neemann.digital.integration.FileScanner;
@ -109,7 +108,7 @@ public class VHDLGeneratorTest extends TestCase {
}
private void checkVHDLExport(File file) throws PinException, NodeException, ElementNotFoundException, IOException, FileScanner.SkipAllException, HDLException, de.neemann.digital.hdl.model2.HDLException, HGSEvalException {
private void checkVHDLExport(File file) throws PinException, NodeException, ElementNotFoundException, IOException, FileScanner.SkipAllException, HDLException {
ToBreakRunner br = new ToBreakRunner(file);
File dir = Files.createTempDirectory("digital_vhdl_" + getTime() + "_").toFile();
try {