readerPort = 0; writerPort = (rawChip.getNumPorts() / 2) + (rawChip.getXSize());
if (rawChip.getTotalTiles() == 1) { readerPort = 0; writerPort = 0; } else { readerPort = 0; writerPort = (rawChip.getNumPorts() / 2) + (rawChip.getXSize()); }
    public FileState(SpdStreamGraph streamGraph) {        this.streamGraph = streamGraph;        this.rawChip = streamGraph.getRawChip();        foundReader = false;        foundWriter = false;        fileReaders = new HashMap();        fileWriters = new HashMap();        fileNodes = new HashSet();                readerPort = 0;        writerPort = (rawChip.getNumPorts() / 2) + (rawChip.getXSize());        if (KjcOptions.devassignfile != null) {            try { // read from the file specified...                inputBuffer = new BufferedReader(new FileReader(                                                                KjcOptions.devassignfile));            } catch (Exception e) {                System.err                    .println("Error opening device-to-port assignment file "                             + KjcOptions.devassignfile);                System.exit(1);            }        } else            // otherwise read for standard input            inputBuffer = new BufferedReader(new InputStreamReader(System.in));        ((SpdStaticStreamGraph)streamGraph.getTopLevel()).accept(this, null, true);        try { // close the file            if (KjcOptions.devassignfile != null)                inputBuffer.close();        } catch (Exception e) {            System.err                .println("Error closing device-to-port assignment stream");            System.exit(1);        }        // add everything to the fileNodes hashset        SpaceDynamicBackend.addAll(fileNodes, fileReaders.keySet());        SpaceDynamicBackend.addAll(fileNodes, fileWriters.keySet());    }