comparison modules/bluespec/Pygar/core/AudioCoreSystem.cpp @ 37:0475235d1513 pygar svn.38

[svn r38] fixed audiocorepipe
author punk
date Tue, 04 May 2010 19:25:30 -0400
parents 99519a031813
children 5a30f173bbac
comparison
equal deleted inserted replaced
36:99519a031813 37:0475235d1513
62 void 62 void
63 CONNECTED_APPLICATION_CLASS::Main() 63 CONNECTED_APPLICATION_CLASS::Main()
64 { 64 {
65 //rlm: two files 65 //rlm: two files
66 FILE *inputFile; 66 FILE *inputFile;
67 // FILE *inputFile1; 67 // FILE *inputFile1;
68 UINT16 sample; 68 UINT16 sample;
69 //UINT16 sample1; 69 //UINT16 sample1;
70 70
71 //rlm: not sure if normal ints are ok here; using UINT16 because I know it works 71 //rlm: not sure if normal ints are ok here; using UINT16 because I know it works
72 UINT16 channel0 = 0; 72 UINT16 channel0 = 0;
73 //UINT16 channel1 = 1; 73 //UINT16 channel1 = 1;
74 74
101 101
102 printf("main:PROCESSOR about to enter loop %d\n", count); 102 printf("main:PROCESSOR about to enter loop %d\n", count);
103 103
104 //rlm: here we read both files. later refactor into a function. 104 //rlm: here we read both files. later refactor into a function.
105 // also, this will terminate when the FIRST file reaches its end. 105 // also, this will terminate when the FIRST file reaches its end.
106 while( (fread(&sample, 2, 1, inputFile)) )//&& (fread(&sample1, 2 , 1, inputFile1))) 106 while( fread(&sample, 2, 1, inputFile)) //&& (fread(&sample1, 2 , 1, inputFile1)))
107 { 107 {
108 if (!coreFin && (result = clientStub->ReadCPUToHost(0)) != 1) 108 printf("hi\n");
109 { 109 if (!coreFin && (result = clientStub->ReadCPUToHost(0)) != 1)
110 sleepCount++; 110 {
111 if(sleepCount == 200) { 111 sleepCount++;
112 printf("Failed to get response from hardware, bailing\n\n"); 112 if(sleepCount == 200) {
113 printf("This means that either your hardware is hanging\n"); 113 printf("Failed to get response from hardware, bailing\n\n");
114 printf("or that the software hasn't given it enough time\n"); 114 printf("This means that either your hardware is hanging\n");
115 printf("to complete. If you think it needs more time, then\n"); 115 printf("or that the software hasn't given it enough time\n");
116 printf("edit CONNECTED_APPLICATION_CLASS::Main() in ProcessorSystem.cpp\n"); 116 printf("to complete. If you think it needs more time, then\n");
117 printf("(connected_application)\n"); 117 printf("edit CONNECTED_APPLICATION_CLASS::Main() in ProcessorSystem.cpp\n");
118 printf("(connected_application)\n");
118 } 119 }
119 } 120 }
120 else if (!coreFin && result == 1) 121 else if (!coreFin && result == 1)
121 { 122 {
122 printf("\n***SOFT_CORE PASSED***\n"); 123 printf("\n***SOFT_CORE PASSED***\n");
123 coreFin = true; 124 coreFin = true;
124 } 125 }
125 126
126 if(count%1000 == 0) 127 if(count%1000 == 0)
127 printf("main: %d\n", count); 128 printf("main: %d\n", count);
128 count++; 129 count++;
129 sem_wait(&throttle); 130 sem_wait(&throttle);
130 131
132 printf("sending file\n");
131 //rlm: two files. 133 //rlm: two files.
132 clientStub->SendUnprocessedStream( Data,(UINT32)sample); 134 clientStub->SendUnprocessedStream( Data,(UINT32)sample);
133 //clientStub->SendUnprocessedStream(channel0 , Data,(UINT32)sample); 135 //clientStub->SendUnprocessedStream(channel0 , Data,(UINT32)sample);
134 //clientStub->SendUnprocessedStream(channel1 , Data,(UINT32)sample1); 136 //clientStub->SendUnprocessedStream(channel1 , Data,(UINT32)sample1);
135 137
136 } 138 }
137 139
138 printf("main: out of loop\n"); 140 printf("main: out of loop\n");
139 141