Commit 34c22903 authored by Anirudh's avatar Anirudh
Browse files

Base test

parent e1b67b24
#include "systemc.h"
#include "gpumacro.h"
sc_event e1;
SC_MODULE(producer){
......@@ -21,7 +22,12 @@ SC_MODULE(producer){
}
}
void f3() {
while(true) {
while(true) {
for (int i = 0; i<20; i++ ) {
PROFILE_TIME(p1, 0, 12, 30);
PROFILE_TIME(p2, 1, 42, 90);
global = global + i;
}
global = 4;
wait(15, SC_NS);
e1.notify();
......@@ -38,9 +44,13 @@ SC_MODULE(consumer) {
void f2() {
int x;
while(true) {
for (int i = 0; i<4; i++ ) {
PROFILE_TIME(c1, 0, 100, 50);
PROFILE_TIME(c2, 1, 200, 10);
x = i*7;
}
wait(5, SC_NS);
if(x>5) {
wait(10, SC_NS);
......@@ -57,12 +67,20 @@ SC_MODULE(consumer) {
int sc_main(int argc, char *argv[]) {
sc_signal<int> s1;
producer p1("producer");
consumer c1("consumer");
sc_signal<int> s2;
producer p1("producer1");
consumer c1("consumer1");
producer p2("producer2");
consumer c2("consumer2");
p1.out(s1);
c1.in(s1);
p2.out(s2);
c2.in(s2);
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