Search in sources :

Example 21 with CodePrinterStr

use of de.neemann.digital.hdl.printer.CodePrinterStr in project Digital by hneemann.

the class VHDLGeneratorTest method testSplitter3.

public void testSplitter3() throws PinException, NodeException, ElementNotFoundException, IOException {
    ToBreakRunner br = new ToBreakRunner("dig/hdl/model2/splitter3.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(3 downto 0);\n" + "    B: in std_logic_vector(3 downto 0);\n" + "    S: out std_logic_vector(3 downto 0));\n" + "end main;\n" + "\n" + "architecture Behavioral of main is\n" + "begin\n" + "  S(1 downto 0) <= (A(1 downto 0) AND B(1 downto 0));\n" + "  S(3 downto 2) <= (A(3 downto 2) OR B(3 downto 2));\n" + "end Behavioral;\n", out.toString());
}
Also used : CodePrinterStr(de.neemann.digital.hdl.printer.CodePrinterStr) ToBreakRunner(de.neemann.digital.integration.ToBreakRunner)

Aggregations

CodePrinterStr (de.neemann.digital.hdl.printer.CodePrinterStr)21 ToBreakRunner (de.neemann.digital.integration.ToBreakRunner)6 HDLCircuit (de.neemann.digital.hdl.model2.HDLCircuit)2 HDLModel (de.neemann.digital.hdl.model2.HDLModel)2 ClockIntegratorGeneric (de.neemann.digital.hdl.model2.clock.ClockIntegratorGeneric)1 CodePrinter (de.neemann.digital.hdl.printer.CodePrinter)1