|
@@ -5,7 +5,9 @@ import org.slf4j.LoggerFactory;
|
|
|
|
|
|
import info.hkzlab.dupal.analyzer.exceptions.*;
|
|
import info.hkzlab.dupal.analyzer.exceptions.*;
|
|
import info.hkzlab.dupal.analyzer.palanalisys.explorers.OSExplorer;
|
|
import info.hkzlab.dupal.analyzer.palanalisys.explorers.OSExplorer;
|
|
|
|
+import info.hkzlab.dupal.analyzer.palanalisys.explorers.SimpleExplorer;
|
|
import info.hkzlab.dupal.analyzer.palanalisys.graph.OutState;
|
|
import info.hkzlab.dupal.analyzer.palanalisys.graph.OutState;
|
|
|
|
+import info.hkzlab.dupal.analyzer.palanalisys.simple.SimpleState;
|
|
import info.hkzlab.dupal.analyzer.utilities.BitUtils;
|
|
import info.hkzlab.dupal.analyzer.utilities.BitUtils;
|
|
|
|
|
|
public class DuPALAnalyzer {
|
|
public class DuPALAnalyzer {
|
|
@@ -93,15 +95,20 @@ public class DuPALAnalyzer {
|
|
dpci.setLED(led, true);
|
|
dpci.setLED(led, true);
|
|
|
|
|
|
try {
|
|
try {
|
|
- if(ioAsOutMask < 0) {
|
|
|
|
- ioAsOutMask = detectIOTypeMask(dpci);
|
|
|
|
- logger.info("startAnalisys() -> Detected the following IO Type mask: " + String.format("%06X", ioAsOutMask));
|
|
|
|
|
|
+ if((dpci.palSpecs.getPinCount_IO() == 0) && (dpci.palSpecs.getPinCount_RO() == 0)) { // Purely combinatorial and no feedbacks, we can perform simple bruteforcing
|
|
|
|
+ SimpleState[] ssArray = SimpleExplorer.exploreStates(dpci);
|
|
|
|
+ for(SimpleState ss : ssArray) logger.info(ss.toString());
|
|
|
|
+ } else { // Either registered, or with feedbacks
|
|
|
|
+ if(ioAsOutMask < 0) {
|
|
|
|
+ ioAsOutMask = detectIOTypeMask(dpci);
|
|
|
|
+ logger.info("startAnalisys() -> Detected the following IO Type mask: " + String.format("%06X", ioAsOutMask));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ OutState[] osArray = OSExplorer.exploreOutStates(dpci, ioAsOutMask);
|
|
|
|
+
|
|
|
|
+ logger.info("Got " + osArray.length + " output states!");
|
|
|
|
+ for(OutState os : osArray) logger.info(os.toString());
|
|
}
|
|
}
|
|
-
|
|
|
|
- OutState[] osArray = OSExplorer.exploreOutStates(dpci, ioAsOutMask);
|
|
|
|
-
|
|
|
|
- logger.info("Got " + osArray.length + " output states!");
|
|
|
|
- for(OutState os : osArray) logger.info(os.toString());
|
|
|
|
} catch(Exception e) {
|
|
} catch(Exception e) {
|
|
throw e;
|
|
throw e;
|
|
} finally {
|
|
} finally {
|