comparison modules/bluespec/Pygar/core/AudioCoreSystem.cpp @ 23:90197e3375e2 pygar svn.24

[svn r24] added testing, but something is wrong with our c++ file.
author rlm
date Wed, 28 Apr 2010 08:19:09 -0400
parents 6d461680c6d9
children 220c14f5963c
comparison
equal deleted inserted replaced
22:0cfbb1e2de22 23:90197e3375e2
14 pthread_cond_t CONNECTED_APPLICATION_CLASS::cond; 14 pthread_cond_t CONNECTED_APPLICATION_CLASS::cond;
15 sem_t CONNECTED_APPLICATION_CLASS::throttle; 15 sem_t CONNECTED_APPLICATION_CLASS::throttle;
16 16
17 // constructor 17 // constructor
18 CONNECTED_APPLICATION_CLASS::CONNECTED_APPLICATION_CLASS(VIRTUAL_PLATFORM vp) : 18 CONNECTED_APPLICATION_CLASS::CONNECTED_APPLICATION_CLASS(VIRTUAL_PLATFORM vp) :
19 clientStub(new AUDIOCORERRR_CLIENT_STUB_CLASS(this)) 19
20 clientStub(new AUDIOCORERRR_CLIENT_STUB_CLASS(this))
20 { 21 {
21 } 22 }
22 23
23 // destructor 24 // destructor
24 CONNECTED_APPLICATION_CLASS::~CONNECTED_APPLICATION_CLASS() 25 CONNECTED_APPLICATION_CLASS::~CONNECTED_APPLICATION_CLASS()
72 assert(inputFile); 73 assert(inputFile);
73 74
74 75
75 int count = 0; 76 int count = 0;
76 77
77 printf("main: about to enter loop %d\n", count); 78 printf("main:PROCESSOR about to enter loop %d\n", count);
78 79
79 while(fread(&sample, 2, 1, inputFile)) { 80 while(fread(&sample, 2, 1, inputFile)) {
80 if(count%1000 == 0) 81 if(count%1000 == 0)
81 printf("main: %d\n", count); 82 printf("main: %d\n", count);
82 count++; 83 count++;
83 sem_wait(&throttle); 84 sem_wait(&throttle);
85 printf("rlm:sending data to processor (%d)\n", count);
84 clientStub->SendUnprocessedStream(Data,(UINT32)sample); 86 clientStub->SendUnprocessedStream(Data,(UINT32)sample);
85 } 87 }
86 88
87 printf("main: out of loop\n"); 89 printf("main: out of loop\n");
88 90
93 printf("main: wait for end of file\n"); 95 printf("main: wait for end of file\n");
94 96
95 pthread_cond_wait(&cond, &lock); 97 pthread_cond_wait(&cond, &lock);
96 pthread_mutex_unlock(&lock); 98 pthread_mutex_unlock(&lock);
97 99
98 printf("main: lastt data out\n"); 100 printf("main: last data out\n");
99 101
100 // Convert input wav to pcm 102 // Convert input wav to pcm
101 generate_wav("out_hw.pcm","input.wav","out_hw.wav"); 103 generate_wav("out_hw.pcm","input.wav","out_hw.wav");
102 104
103 printf("generate wav done\n"); 105 printf("generate wav done\n");