public static void main(String[] args) throws IOException {
		int[][] a = new int[DIM][DIM];
		int[][] b = new int[DIM][DIM];
//		int[][] c = new int[DIM][DIM];
		for (int i = 0; i < DIM; i++) {
			for (int j = 0; j < DIM; j++) {
				a[i][j] = i * DIM + j;
			}
		}
		for (int i = 0; i < DIM; i++) {
			for (int j = 0; j < DIM; j++) {
				b[i][j] = 2048 + i * DIM + j;
			}
		}
//		printMat(a);
//		printMat(b);
		PrintWriter out = new PrintWriter(new FileWriter(new File("mat" + DIM
				+ ".prg")));
		for (int i = 0; i < DIM; i++) {
			for (int j = 0; j < DIM; j++) {
				for (int k = 0; k < DIM; k++) {
					int addr = 2048 * 2048 + i * DIM + j;
//					c[i][j] += a[i][k] * b[k][j];
					trace(out, RD, a[i][k]);
					trace(out, RD, b[k][j]);
					trace(out, RD, addr);
					trace(out, WR, addr);
				}
			}
		}
//		printMat(c);
	}