Commit aa02c969 authored by Anirudh Kaushik's avatar Anirudh Kaushik
Browse files

removed unwanted files

parent 5e926009
#include <iostream>
#include <stdio.h>
using namespace std;
class sc_gpu_thread_hierarchy {
public:
sc_gpu_thread_hierarchy(int xd, int yd, int zd)
:_xd(xd), _yd(yd), _zd(zd) {
} void dump() {
printf("thread: xd %d, yd %d, zd %d\n", _xd, _yd, _zd);
}
int _xd;
int _yd;
int _zd;
};
class sc_gpu_block_hierarchy {
public:
sc_gpu_block_hierarchy(int xd, int yd, int zd)
:_xd(xd), _yd(yd), _zd(zd) {
} void dump() {
printf("block: xd %d, yd %d, zd %d\n", _xd, _yd, _zd);
}
int _xd;
int _yd;
int _zd;
};
#define SC_GPU_THREADS(xd, yd, zd) \
sc_gpu_thread_hierarchy tht(xd,yd,zd); \
tht.dump();
#define SC_GPU_BLOCKS(xd, yd, zd) \
sc_gpu_block_hierarchy thb(xd,yd,zd); \
thb.dump();
This diff is collapsed.
#include "systemc.h"
#include "GPUMacro.h"
SC_MODULE(producer){
int global;
sc_out <int> out;
void f1() {
int i, j;
while(true) {
wait(2, SC_NS);
for (int x = 0; x<5; x++) {
i = i + x*8;
wait(3, SC_NS);
}
out.write(i);
i++;
wait(10, SC_NS);
global = 0;
}
}
void f3() {
while(true) {
global = 4;
wait(15, SC_NS);
}
}
SC_CTOR(producer) {
SC_THREAD(f1);
SC_THREAD(f3);
}
};
SC_MODULE(consumer) {
sc_in<int> in;
void f2() {
int x;
while(true) {
for (int i = 0; i<4; i++ ) {
SC_GPU_THREADS(1, 2, 3);
SC_GPU_BLOCKS(1, 2, 3);
x = i*7;
}
wait(5, SC_NS);
if(x>5) {
wait(10, SC_NS);
}
x = in.read();
wait(2, SC_NS);
}
}
SC_CTOR(consumer) {
SC_THREAD(f2);
}
};
int sc_main(int argc, char *argv[]) {
sc_signal<int> s1;
producer p1("producer");
consumer c1("consumer");
p1.out(s1);
c1.in(s1);
sc_start();
return 0;
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment