Search in sources :

Example 11 with ToBreakRunner

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);
}
Also used : Model(de.neemann.digital.core.Model) ToBreakRunner(de.neemann.digital.integration.ToBreakRunner)

Example 12 with ToBreakRunner

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) {
    }
}
Also used : Model(de.neemann.digital.core.Model) ToBreakRunner(de.neemann.digital.integration.ToBreakRunner)

Example 13 with ToBreakRunner

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");
}
Also used : Model(de.neemann.digital.core.Model) ToBreakRunner(de.neemann.digital.integration.ToBreakRunner)

Example 14 with ToBreakRunner

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();
}
Also used : CodePrinterStr(de.neemann.digital.hdl.printer.CodePrinterStr) HDLModel(de.neemann.digital.hdl.model2.HDLModel) CodePrinter(de.neemann.digital.hdl.printer.CodePrinter) ToBreakRunner(de.neemann.digital.integration.ToBreakRunner) HDLCircuit(de.neemann.digital.hdl.model2.HDLCircuit)

Example 15 with ToBreakRunner

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());
}
Also used : CodePrinterStr(de.neemann.digital.hdl.printer.CodePrinterStr) ToBreakRunner(de.neemann.digital.integration.ToBreakRunner)

Aggregations

ToBreakRunner (de.neemann.digital.integration.ToBreakRunner)29 Model (de.neemann.digital.core.Model)16 CodePrinterStr (de.neemann.digital.hdl.printer.CodePrinterStr)6 VisualElement (de.neemann.digital.draw.elements.VisualElement)3 BoolTable (de.neemann.digital.analyse.quinemc.BoolTable)2 Signal (de.neemann.digital.core.Signal)2 Circuit (de.neemann.digital.draw.elements.Circuit)2 HDLCircuit (de.neemann.digital.hdl.model2.HDLCircuit)2 HDLModel (de.neemann.digital.hdl.model2.HDLModel)2 CodePrinter (de.neemann.digital.hdl.printer.CodePrinter)2 File (java.io.File)2 ModelAnalyser (de.neemann.digital.analyse.ModelAnalyser)1 TruthTable (de.neemann.digital.analyse.TruthTable)1 Element (de.neemann.digital.core.element.Element)1 ElementAttributes (de.neemann.digital.core.element.ElementAttributes)1 ElementLibrary (de.neemann.digital.draw.library.ElementLibrary)1 BuilderExpressionCreator (de.neemann.digital.gui.components.table.BuilderExpressionCreator)1 ExpressionCreator (de.neemann.digital.gui.components.table.ExpressionCreator)1 ExpressionListenerStore (de.neemann.digital.gui.components.table.ExpressionListenerStore)1 TestCaseDescription (de.neemann.digital.testing.TestCaseDescription)1