use of de.neemann.digital.integration.ToBreakRunner in project Digital by hneemann.
the class ModelAnalyserTest method testAnalyzerTFF.
public void testAnalyzerTFF() throws Exception {
Model model = new ToBreakRunner("dig/analyze/analyzeTestTFF.dig", false).getModel();
TruthTable tt = new ModelAnalyser(model).analyse();
check2BitCounter(tt);
}
use of de.neemann.digital.integration.ToBreakRunner in project Digital by hneemann.
the class ModelAnalyserTest method testAnalyzerUniqueNames2.
public void testAnalyzerUniqueNames2() throws Exception {
Model model = new ToBreakRunner("dig/analyze/uniqueNames2.dig", false).getModel();
try {
new ModelAnalyser(model);
fail();
} catch (AnalyseException e) {
}
}
use of de.neemann.digital.integration.ToBreakRunner in project Digital by hneemann.
the class ModelAnalyserTest method testAnalyzerMultiBitPins.
public void testAnalyzerMultiBitPins() throws Exception {
Model model = new ToBreakRunner("dig/analyze/multiBitInOutXOr.dig", false).getModel();
ModelAnalyserInfo mai = new ModelAnalyser(model).analyse().getModelAnalyzerInfo();
assertEquals(2, mai.getInputBusMap().size());
checkBus(mai.getInputBusMap(), "A", "A0", "A1", "A2", "A3");
checkBus(mai.getInputBusMap(), "B", "B0", "B1", "B2", "B3");
assertEquals(1, mai.getOutputBusMap().size());
checkBus(mai.getOutputBusMap(), "S", "S0", "S1", "S2", "S3");
}
use of de.neemann.digital.integration.ToBreakRunner in project Digital by hneemann.
the class ClockTest method create.
String create(HDLClockIntegrator ci) throws IOException, PinException, NodeException, ElementNotFoundException, HDLException, HGSEvalException {
ToBreakRunner br = new ToBreakRunner("dig/hdl/model2/clock.dig");
HDLCircuit c = new HDLCircuit(br.getCircuit(), "main", new HDLModel(br.getLibrary()), ci);
c.applyDefaultOptimizations();
CodePrinter out = new CodePrinterStr();
new VHDLCreator(out).printHDLCircuit(c);
return out.toString();
}
use of de.neemann.digital.integration.ToBreakRunner in project Digital by hneemann.
the class VHDLGeneratorTest method testSplitter2.
public void testSplitter2() throws PinException, NodeException, ElementNotFoundException, IOException {
ToBreakRunner br = new ToBreakRunner("dig/hdl/model2/splitter2.dig");
CodePrinterStr out = new CodePrinterStr();
VHDLGenerator gen = new VHDLGenerator(br.getLibrary(), out).export(br.getCircuit());
assertEquals("-- generated by Digital. Don't modify this file!\n" + "-- Any changes will be lost if this file is regenerated.\n" + "\n" + "LIBRARY ieee;\n" + "USE ieee.std_logic_1164.all;\n" + "USE ieee.numeric_std.all;\n" + "\n" + "entity main is\n" + " port (\n" + " A: in std_logic_vector(1 downto 0);\n" + " B: in std_logic_vector(1 downto 0);\n" + " X: out std_logic;\n" + " Y: out std_logic_vector(2 downto 0));\n" + "end main;\n" + "\n" + "architecture Behavioral of main is\n" + " signal s0: std_logic_vector(3 downto 0);\n" + "begin\n" + " s0(1 downto 0) <= A;\n" + " s0(3 downto 2) <= B;\n" + " X <= s0(0);\n" + " Y <= s0(3 downto 1);\n" + "end Behavioral;\n", out.toString());
}
Aggregations