use of de.neemann.digital.integration.ToBreakRunner in project Digital by hneemann.
the class DependencyAnalyserTest method testInputInvert.
/*
ExpressionCreator - p0n+1 reduced from 17 to 1 variables ([Count])
ExpressionCreator - p1n+1 reduced from 17 to 1 variables ([p0n])
ExpressionCreator - Q_1n+1 reduced from 17 to 1 variables ([Q_0n])
ExpressionCreator - Q_0n+1 reduced from 17 to 2 variables ([Q_1n, Q_0n])
ExpressionCreator - C0Q_3n+1 reduced from 17 to 6 variables ([p0n, p1n, C0Q_3n, C0Q_2n, C0Q_1n, C0Q_0n])
ExpressionCreator - C0Q_2n+1 reduced from 17 to 5 variables ([p0n, p1n, C0Q_2n, C0Q_1n, C0Q_0n])
ExpressionCreator - C0Q_1n+1 reduced from 17 to 5 variables ([p0n, p1n, C0Q_3n, C0Q_1n, C0Q_0n])
ExpressionCreator - C0Q_0n+1 reduced from 17 to 3 variables ([p0n, p1n, C0Q_0n])
ExpressionCreator - C1Q_3n+1 reduced from 17 to 8 variables ([p0n, p1n, C0Q_3n, C0Q_0n, C1Q_3n, C1Q_2n, C1Q_1n, C1Q_0n])
ExpressionCreator - C1Q_2n+1 reduced from 17 to 7 variables ([p0n, p1n, C0Q_3n, C0Q_0n, C1Q_2n, C1Q_1n, C1Q_0n])
ExpressionCreator - C1Q_1n+1 reduced from 17 to 7 variables ([p0n, p1n, C0Q_3n, C0Q_0n, C1Q_3n, C1Q_1n, C1Q_0n])
ExpressionCreator - C1Q_0n+1 reduced from 17 to 5 variables ([p0n, p1n, C0Q_3n, C0Q_0n, C1Q_0n])
ExpressionCreator - C2Q_3n+1 reduced from 17 to 10 variables ([p0n, p1n, C0Q_3n, C0Q_0n, C1Q_3n, C1Q_0n, C2Q_3n, C2Q_2n, C2Q_1n, C2Q_0n])
ExpressionCreator - C2Q_2n+1 reduced from 17 to 9 variables ([p0n, p1n, C0Q_3n, C0Q_0n, C1Q_3n, C1Q_0n, C2Q_2n, C2Q_1n, C2Q_0n])
ExpressionCreator - C2Q_1n+1 reduced from 17 to 9 variables ([p0n, p1n, C0Q_3n, C0Q_0n, C1Q_3n, C1Q_0n, C2Q_3n, C2Q_1n, C2Q_0n])
ExpressionCreator - C2Q_0n+1 reduced from 17 to 7 variables ([p0n, p1n, C0Q_3n, C0Q_0n, C1Q_3n, C1Q_0n, C2Q_0n])
ExpressionCreator - s2 reduced from 17 to 2 variables ([Q_1n, Q_0n])
ExpressionCreator - d0 reduced from 17 to 14 variables ([Q_1n, Q_0n, C0Q_3n, C0Q_2n, C0Q_1n, C0Q_0n, C1Q_3n, C1Q_2n, C1Q_1n, C1Q_0n, C2Q_3n, C2Q_2n, C2Q_1n, C2Q_0n])
ExpressionCreator - c0 reduced from 17 to 14 variables ([Q_1n, Q_0n, C0Q_3n, C0Q_2n, C0Q_1n, C0Q_0n, C1Q_3n, C1Q_2n, C1Q_1n, C1Q_0n, C2Q_3n, C2Q_2n, C2Q_1n, C2Q_0n])
ExpressionCreator - b0 reduced from 17 to 14 variables ([Q_1n, Q_0n, C0Q_3n, C0Q_2n, C0Q_1n, C0Q_0n, C1Q_3n, C1Q_2n, C1Q_1n, C1Q_0n, C2Q_3n, C2Q_2n, C2Q_1n, C2Q_0n])
ExpressionCreator - a0 reduced from 17 to 14 variables ([Q_1n, Q_0n, C0Q_3n, C0Q_2n, C0Q_1n, C0Q_0n, C1Q_3n, C1Q_2n, C1Q_1n, C1Q_0n, C2Q_3n, C2Q_2n, C2Q_1n, C2Q_0n])
ExpressionCreator - e0 reduced from 17 to 14 variables ([Q_1n, Q_0n, C0Q_3n, C0Q_2n, C0Q_1n, C0Q_0n, C1Q_3n, C1Q_2n, C1Q_1n, C1Q_0n, C2Q_3n, C2Q_2n, C2Q_1n, C2Q_0n])
ExpressionCreator - f0 reduced from 17 to 14 variables ([Q_1n, Q_0n, C0Q_3n, C0Q_2n, C0Q_1n, C0Q_0n, C1Q_3n, C1Q_2n, C1Q_1n, C1Q_0n, C2Q_3n, C2Q_2n, C2Q_1n, C2Q_0n])
ExpressionCreator - g0 reduced from 17 to 14 variables ([Q_1n, Q_0n, C0Q_3n, C0Q_2n, C0Q_1n, C0Q_0n, C1Q_3n, C1Q_2n, C1Q_1n, C1Q_0n, C2Q_3n, C2Q_2n, C2Q_1n, C2Q_0n])
ExpressionCreator - s1 reduced from 17 to 2 variables ([Q_1n, Q_0n])
ExpressionCreator - s0 reduced from 17 to 2 variables ([Q_1n, Q_0n])
*/
public void testInputInvert() throws Exception {
Model model = new ToBreakRunner("dig/backtrack/InputInvert.dig").getModel();
ModelAnalyser m = new ModelAnalyser(model);
DependencyAnalyser da = new DependencyAnalyser(m);
assertEquals(1, m.getOutputs().size());
Signal out = m.getOutputs().get(0);
ArrayList<Signal> inputs = da.getInputs(out);
assertEquals(2, inputs.size());
}
use of de.neemann.digital.integration.ToBreakRunner in project Digital by hneemann.
the class ModelAnalyserTest method testAnalyzer.
public void testAnalyzer() throws Exception {
Model model = new ToBreakRunner("dig/analyze/analyzeTest.dig").getModel();
TruthTable tt = new ModelAnalyser(model).analyse();
assertEquals(4, tt.getRows());
assertEquals(3, tt.getCols());
// circuit is XOr:
assertEquals(0, tt.getValue(0, 2));
assertEquals(1, tt.getValue(1, 2));
assertEquals(1, tt.getValue(2, 2));
assertEquals(0, tt.getValue(3, 2));
assertEquals("A\tB\tY\t\n" + "0\t0\t0\t\n" + "0\t1\t1\t\n" + "1\t0\t1\t\n" + "1\t1\t0\t\n", tt.toString());
}
use of de.neemann.digital.integration.ToBreakRunner in project Digital by hneemann.
the class ModelAnalyserTest method testAnalyzerMultiBit.
public void testAnalyzerMultiBit() throws Exception {
Model model = new ToBreakRunner("dig/analyze/multiBitCounter.dig", false).getModel();
TruthTable tt = new ModelAnalyser(model).analyse();
checkTable(tt.getResult("Q0n+1"), one, zero, one, zero);
checkTable(tt.getResult("Q1n+1"), zero, one, one, zero);
assertEquals("Y1", tt.getResultName(2));
assertEquals("Y0", tt.getResultName(3));
final BoolTable y1 = tt.getResult(2);
final BoolTable y0 = tt.getResult(3);
for (int i = 0; i < 4; i++) {
assertEquals((i & 1) > 0, y0.get(i).invert().bool());
assertEquals((i & 2) > 0, y1.get(i).invert().bool());
}
}
use of de.neemann.digital.integration.ToBreakRunner in project Digital by hneemann.
the class ModelAnalyserTest method testAnalyzerMultiBit3.
// test with non zero default values set
public void testAnalyzerMultiBit3() throws Exception {
Model model = new ToBreakRunner("dig/analyze/multiBitInOutDef.dig", false).getModel();
TruthTable tt = new ModelAnalyser(model).analyse();
checkIdent(tt);
}
use of de.neemann.digital.integration.ToBreakRunner in project Digital by hneemann.
the class ModelAnalyserTest method testAnalyzerDFF.
public void testAnalyzerDFF() throws Exception {
Model model = new ToBreakRunner("dig/analyze/analyzeTestDFF.dig").getModel();
TruthTable tt = new ModelAnalyser(model).analyse();
check2BitCounter(tt);
}
Aggregations