1
0
Эх сурвалжийг харах

Add note about implementing creation of long links

Baglio Tabifata 4 жил өмнө
parent
commit
40c2258b90

+ 3 - 1
src/main/java/info/hkzlab/dupal/analyzer/palanalisys/explorers/OSExplorer.java

@@ -34,7 +34,8 @@ public class OSExplorer {
                 if(linkPath != null && linkPath.length > 0) {
                     for(GraphLink l : linkPath) {
                         logger.info("exploreOutStates() -> Walking link " + l);
-                        dpci.write(l.getLinkInputs()); // Walk the path to the new state
+                        if(l.isLongLink()) dpci.writeAndPulseClock(l.getLinkInputs());
+                        else dpci.write(l.getLinkInputs()); // Walk the path to the new state
                     }
                     curState = (OutState) (linkPath[linkPath.length-1].getDestinationState());
                     logger.info("exploreOutStates() -> walked path to state " + curState);
@@ -51,6 +52,7 @@ public class OSExplorer {
                 } else break; // We're done: can't move to anywhere else
             }
 
+            // TODO: Handle creating long links
             int nextIdx = curState.getNextLinkIdx();
             OutState nOutState = getOutStateForIdx(dpci, nextIdx, ioAsOutMask, maxLinks, statesMap);
 

+ 1 - 1
src/main/java/info/hkzlab/dupal/analyzer/palanalisys/graph/PathFinder.java

@@ -27,7 +27,7 @@ public class PathFinder {
 
             for(GraphLink l : stateLinks) { // For every link...
                 if(!pathMap.containsKey(l.getDestinationState().hashCode())) { // If it's not leading somewhere we've already visited or we've already put in our path map
-                    ArrayList<GraphLink> statePath = (ArrayList<GraphLink>)linkStack.clone(); // Copy the map to the current state
+                    ArrayList<GraphLink> statePath = (ArrayList<GraphLink>)linkStack.clone(); // Copy the path to the current state
                     statePath.add(l); // And append this link to it
 
                     pathMap.put(l.getDestinationState().hashCode(), statePath); // Then put this new path into the map