Commits (1)
......@@ -2,7 +2,7 @@ obj-m := async_dispatch.o
INC_BASE_PATH=/local/sda4/xcap-async-module
ASYNC_SRC=../../../../libasync/src/common
ccflags-y += -O0 -I$(INC_BASE_PATH)/fast-ipc-module/current/IPC -I$(INC_BASE_PATH)/libasync/src/include -fno-ipa-cp -fno-ipa-sra -DUSE_ASYNC
ccflags-y += -O0 -I$(INC_BASE_PATH)/fast-ipc-module/current/IPC -I$(INC_BASE_PATH)/libasync/src/include -fno-ipa-cp -fno-ipa-sra -DUSE_ASYNC -DCONFIG_LAZY_THC
EXTRA_CFLAGS=-DDEBUG_OUTPUT
INC_DIR = ../../IPC
CFLAGS_ipc.o = -O2 -DPOLL
......
......@@ -21,9 +21,9 @@
#include "thread_fn_util.h"
#include "../../IPC/ipc.h"
#define CHAN_NUM_PAGES 4
#define THREAD1_CPU 1
#define THREAD2_CPU 3
#define THREAD3_CPU 4
#define THREAD1_CPU 3
#define THREAD2_CPU 2
#define THREAD3_CPU 1
MODULE_LICENSE("GPL");
......
......@@ -13,9 +13,10 @@ int ipc_dispatch_loop(struct ttd_ring_channel_group* rx_group, int max_recv_ct)
volatile void ** frame = (volatile void**)__builtin_frame_address(0);
volatile void *ret_addr = *(frame + 1);
int recv_ct = 0;
unsigned long top_of_stack;
*(frame + 1) = NULL;
//NOTE:recv_ct is just for testing
//NOTE:max_recv_ct is just for testing
DO_FINISH_(ipc_dispatch,{
int curr_ind = 0;
int* curr_ind_pt = &curr_ind;
......@@ -24,16 +25,15 @@ int ipc_dispatch_loop(struct ttd_ring_channel_group* rx_group, int max_recv_ct)
uint32_t do_finish_awe_id = awe_mapper_create_id();
while( recv_ct < max_recv_ct )
{
curr_ind = 0;
if( poll_recv(rx_group, curr_ind_pt, &curr_msg) )
curr_ind = 0;
if( poll_recv(rx_group, curr_ind_pt, &curr_msg) )
{
recv_ct++;
//printk(KERN_ERR "poll_recv returned\n");
//check if curr_msg corresponds to existing awe in this thread
if( curr_msg->msg_type == msg_type_response )
{
printk(KERN_ERR "yielding to\n");
THCYieldToId(curr_msg->msg_id, do_finish_awe_id);
}
//else find corresponding function and execute.
......
......@@ -2,4 +2,11 @@
#define IPC_DISPATCH_H
int ipc_dispatch_loop(struct ttd_ring_channel_group* rx_group, int max_recv_ct);
static inline void ipc_dispatch_print_sp(char* time)
{
unsigned long sp;
asm volatile("mov %%rsp, %0" : "=g"(sp) : :);
printk(KERN_ERR "%s sp: %lx\n", time, sp);
}
#endif
......@@ -6,6 +6,8 @@
#include <awe-mapper.h>
#include <linux/delay.h>
#define BATCH_INTERVAL 100
static struct ttd_ring_channel* channel;
static unsigned long add_nums_async(unsigned long lhs, unsigned long rhs, unsigned long msg_id, int fn_type)
......@@ -68,7 +70,7 @@ int thread1_fn1(void* group)
num_transactions++;
add_nums_async(num_transactions, 3,(unsigned long) id_num, ADD_2_FN);
);
msleep(5);
//msleep(20);
}
printk(KERN_ERR "done with transactions\n");
});
......
......@@ -75,7 +75,7 @@ int thread2_fn1(void* group)
thc_init();
rx_group = (struct ttd_ring_channel_group*)group;
rx_group->chans[0]->dispatch_fn = thread1_dispatch_fn;
ipc_dispatch_loop(rx_group, TRANSACTIONS + 50);
ipc_dispatch_loop(rx_group, TRANSACTIONS);
thc_done();
return 1;
......
......@@ -17,7 +17,7 @@ static int add_10_fn(struct ttd_ring_channel* chan, struct ipc_message* msg)
unsigned long reg1 = msg->reg1;
unsigned long reg2 = msg->reg2;
transaction_complete(msg);
msleep(5);
msleep(10);
unsigned long result = reg1 + reg2 + 10;
struct ipc_message* out_msg = get_send_slot(chan);
printk(KERN_ERR "got to thread3\n");
......
......@@ -3,8 +3,8 @@
#define ADD_2_FN 1
#define ADD_10_FN 2
#define TRANSACTIONS 300
#define THD3_INTERVAL 31
#define TRANSACTIONS 3000
#define THD3_INTERVAL 100
int thread1_fn1(void* data);
int thread2_fn1(void* data);
......
......@@ -178,7 +178,7 @@ static unsigned long add_6_nums(unsigned long trans, unsigned long res1,
msg->reg3 = res2;
msg->reg4 = res3;
msg->reg5 = res4;
msg->pts = res5;
//msg->reg6 = res5;
send(channel,msg);
msg = recv(channel);
if (msg->fn_type != ADD_6_NUMS)
......
......@@ -112,7 +112,7 @@ int caller(void *channel)
break;
case ADD_6_NUMS:
temp_res = add_6_nums(msg->reg1, msg->reg2, msg->reg3,
msg->reg4, msg->reg5, msg->pts);
msg->reg4, msg->reg5, NULL);
transaction_complete(msg);
msg = get_send_slot(chan);
msg->fn_type = ADD_6_NUMS;
......