// Place global declarations here.
//Global Clock
clock global;
clock x_MP3, x_SRC, x_DAC;
const int N = 3; //# of Processors
const int M = 3 ; //# of Actors
typedef int[0,N-1] id_r;
//Channels
chan fire[N][M], req[N][M];
//chan priority req[N-1][M-1] < fire[N-1][M-1];
//Buffer and Edge Sizes
int buff_MP32SRC=0;
int buff_SRC2DAC=0;
int buff_SRC2MP3=1536;
int buff_DAC2SRC=517;
int buff_DAC2DAC=1;
int buff_MP32MP3=1;
int buff_SRC2SRC=1;
//Counter for each actor
int counter_MP3, counter_SRC, counter_DAC=0;
bool flag_act=true;
int min(int a, int b) {
if (a<b) {return a;}
else {return b;}
}
void produce(int &channel_tokens, int tokens)
{
channel_tokens+=tokens;
}
void consume(int &channel_tokens, int tokens)
{
channel_tokens-=tokens;
}SDFGconst int MP3,const int SRC,const int DAC// Place local declarations here.
InitialProcessorconst int pid, const int MP3,const int SRC,const int DAC//clock x;InUse_DACInUse_MP3InUse_SRCIdle// Place template instantiations here.
const int MP3=0;
const int SRC=1;
const int DAC=2;
//const int RC=3;
//const int MC=4;
const int p0=0;
const int p1=1;
//const int p2=2;
//const int p3=3;
//const int p4=4;
//const int p5=4;
//const int p6=4;
//const int p7=4;
Processor0 = Processor(p0,MP3,SRC,DAC);
Processor1 = Processor(p1,MP3,SRC,DAC);
//Processor2 = Processor(p2,MP3,SRC,DAC);
//Processor3 = Processor(p3,FD,VLD,IDCT,RC,MC);
//Processor4 = Processor(p4,FD,VLD,IDCT,RC,MC);
//Processor5 = Processor(p5,FD,VLD,IDCT,RC,MC);
//Processor6 = Processor(p6,FD,VLD,IDCT,RC,MC);
//Processor7 = Processor(p7,FD,VLD,IDCT,RC,MC);
SDF_Graph = SDFG(MP3,SRC,DAC);
// List one or more processes to be composed into a system.
system SDF_Graph, Processor0,Processor1;