public void go() throws Exception {
		BufferedReader br = new BufferedReader(new FileReader("verilog\\out.log"));
		String line;
		Pattern p = Pattern.compile(".+JAG RD REF=. OB=1 BLT=. GPU=. \\$(......).*");
		long lineNo = 0;
		int Xmin[] = new int[3];
		int Xmax[] = new int[3];
		int Ymin[] = new int[3];
		int Ymax[] = new int[3];
		long slino[] = new long[3];
		long elino[] = new long[3];
		for(int k = 0; k < 3; k++) {
			Xmin[k] = Ymin[k] = Integer.MAX_VALUE;
			Xmax[k] = Ymax[k] = Integer.MIN_VALUE;
		}
		while( (line = br.readLine()) != null) {
			lineNo++;
			if (lineNo >= 10L * 1000L * 1000L)
				break;
			Matcher m = p.matcher(line);
			if (m.matches()) {
				// System.out.println(line);
				int addr = Integer.parseInt(m.group(1), 16);
				int index = -1;
				boolean wtf = false;
				if (addr == 0xeb40) {
					// OLP
					// System.out.print(".");
					for(int k = 0; k < 3; k++) {
						if (slino[k] != 0) {
							//wtf = (Ymin[k] != Ymax[k]);
							System.out.format("%-9d %-9d S%d (%d,%d) -> (%d,%d) %s ", slino[k], elino[k], (k+1), Xmin[k], Ymin[k], Xmax[k], Ymax[k], 
									(wtf ? "WTF" : ""));
						}
						Xmin[k] = Ymin[k] = Integer.MAX_VALUE;
						Xmax[k] = Ymax[k] = Integer.MIN_VALUE;
						slino[k] = 0;
						elino[k] = 0;
					}
					System.out.println();
				}
				/*if (wtf)
					break;*/
				if (addr >= SCREEN1 && addr < SCREEN1 + SCREENSIZE) {
					index = 0;
					addr -= SCREEN1;
				}
				else if (addr >= SCREEN2 && addr < SCREEN2 + SCREENSIZE) {
					index = 1;
					addr -= SCREEN2;
				}
				else if (addr >= SCREEN3 && addr < SCREEN3 + SCREENSIZE) {
					index = 2;
					addr -= SCREEN3;
				}
				if (index < 0)
					continue;
				// System.out.format("%06x %04x\n", addr, val);
				int y = (addr >> 1) / WIDTH;
				int x = (addr >> 1) % WIDTH;
				// System.out.format("%d (%d,%d)\n", index, x, y);
				if (slino[index] == 0)
					slino[index] = lineNo;
				elino[index] = lineNo;
				if (Xmin[index] > x)
					Xmin[index] = x;
				if (Xmax[index] < x)
					Xmax[index] = x;
				if (Ymin[index] > y)
					Ymin[index] = y;
				if (Ymax[index] < y)
					Ymax[index] = y;
			}
		} 
		br.close();
	}
public void go() throws Exception {
		BufferedReader br = new BufferedReader(new FileReader("verilog\\out.log"));
		String line;
		Pattern p = Pattern.compile(".+JAG RD REF=. OB=1 BLT=. GPU=. \\$(......).*");
		long lineNo = 0;
		int Xmin[] = new int[3];
		int Xmax[] = new int[3];
		int Ymin[] = new int[3];
		int Ymax[] = new int[3];
		long slino[] = new long[3];
		long elino[] = new long[3];
		for(int k = 0; k < 3; k++) {
			Xmin[k] = Ymin[k] = Integer.MAX_VALUE;
			Xmax[k] = Ymax[k] = Integer.MIN_VALUE;
		}
		while( (line = br.readLine()) != null) {
			lineNo++;
			if (lineNo >= 10L * 1000L * 1000L)
				break;
			Matcher m = p.matcher(line);
			if (m.matches()) {
			
				int addr = Integer.parseInt(m.group(1), 16);
				int index = -1;
				boolean wtf = false;
				if (addr == 0xeb40) {
				
				
					for(int k = 0; k < 3; k++) {
						if (slino[k] != 0) {
						
							System.out.format("%-9d %-9d S%d (%d,%d) -> (%d,%d) %s ", slino[k], elino[k], (k+1), Xmin[k], Ymin[k], Xmax[k], Ymax[k], 
									(wtf ? "WTF" : ""));
						}
						Xmin[k] = Ymin[k] = Integer.MAX_VALUE;
						Xmax[k] = Ymax[k] = Integer.MIN_VALUE;
						slino[k] = 0;
						elino[k] = 0;
					}
					System.out.println();
				}
			
				if (addr >= SCREEN1 && addr < SCREEN1 + SCREENSIZE) {
					index = 0;
					addr -= SCREEN1;
				}
				else if (addr >= SCREEN2 && addr < SCREEN2 + SCREENSIZE) {
					index = 1;
					addr -= SCREEN2;
				}
				else if (addr >= SCREEN3 && addr < SCREEN3 + SCREENSIZE) {
					index = 2;
					addr -= SCREEN3;
				}
				if (index < 0)
					continue;
			
				int y = (addr >> 1) / WIDTH;
				int x = (addr >> 1) % WIDTH;
			
				if (slino[index] == 0)
					slino[index] = lineNo;
				elino[index] = lineNo;
				if (Xmin[index] > x)
					Xmin[index] = x;
				if (Xmax[index] < x)
					Xmax[index] = x;
				if (Ymin[index] > y)
					Ymin[index] = y;
				if (Ymax[index] < y)
					Ymax[index] = y;
			}
		} 
		br.close();
	}
public void go() throws exception { bufferedreader br = new bufferedreader(new filereader("verilog\\out.log")); string line; pattern p = pattern.compile(".+jag rd ref=. ob=1 blt=. gpu=. \\$(......).*"); long lineno = 0; int xmin[] = new int[3]; int xmax[] = new int[3]; int ymin[] = new int[3]; int ymax[] = new int[3]; long slino[] = new long[3]; long elino[] = new long[3]; for(int k = 0; k < 3; k++) { xmin[k] = ymin[k] = integer.max_value; xmax[k] = ymax[k] = integer.min_value; } while( (line = br.readline()) != null) { lineno++; if (lineno >= 10l * 1000l * 1000l) break; matcher m = p.matcher(line); if (m.matches()) { int addr = integer.parseint(m.group(1), 16); int index = -1; boolean wtf = false; if (addr == 0xeb40) { for(int k = 0; k < 3; k++) { if (slino[k] != 0) { system.out.format("%-9d %-9d s%d (%d,%d) -> (%d,%d) %s ", slino[k], elino[k], (k+1), xmin[k], ymin[k], xmax[k], ymax[k], (wtf ? "wtf" : "")); } xmin[k] = ymin[k] = integer.max_value; xmax[k] = ymax[k] = integer.min_value; slino[k] = 0; elino[k] = 0; } system.out.println(); } if (addr >= screen1 && addr < screen1 + screensize) { index = 0; addr -= screen1; } else if (addr >= screen2 && addr < screen2 + screensize) { index = 1; addr -= screen2; } else if (addr >= screen3 && addr < screen3 + screensize) { index = 2; addr -= screen3; } if (index < 0) continue; int y = (addr >> 1) / width; int x = (addr >> 1) % width; if (slino[index] == 0) slino[index] = lineno; elino[index] = lineno; if (xmin[index] > x) xmin[index] = x; if (xmax[index] < x) xmax[index] = x; if (ymin[index] > y) ymin[index] = y; if (ymax[index] < y) ymax[index] = y; } } br.close(); }