const int FPGAlength = 10;
bool fpga[FPGAlength] = {0,0,0,0,0,0,0,0,0,0};
typedef int[0,FPGAlength-1] fpga_t;
const int TASKS = 4;
bool done[TASKS] = {0,0,0,0};
typedef int[0,TASKS-1] id_t;
clock c[FPGAlength];
int[0,FPGAlength-1] next_c = 0;
const int psize[TASKS] = {2,2,4,3};
const int ptime[TASKS] = {5,2,4,2};
const bool deps[TASKS][TASKS] =
{
{0,0,0,0},
{0,0,0,0},
{0,0,0,0},
{0,1,0,0}
};
bool check_deps(id_t id)
{
return forall(i : id_t) deps[id][i] ? done[i] : true;
}
bool check_availability(fpga_t place, int nb)
{
int i;
for (i = place; i < place+nb; i++)
{
if (fpga[i])
return false;
}
return true;
}
void occupy_fpga(fpga_t place, int nb)
{
int i;
for (i = 0; i < nb; i++)
{
fpga[place+i] = 1;
}
}
void release_fpga(fpga_t place, int nb)
{
int i;
for (i = 0; i < nb; i++)
{
fpga[place+i] = 0;
}
}
Taskconst id_t id// Place local declarations here.
int[0,FPGAlength-1] my_c;
fpga_t start;
deps_metcompleteprocessingwaiting// Place template instantiations here.
// List one or more processes to be composed into a system.
system Task;