static struct ext_module_list_s *modlist=NULL;
-
-
-
int lambdasim_register_ext_module(struct ext_module_s *mod)
{
int ret=RC_OK;
modlist = ml;
out:
-
return ret;
}
return ret;
}
-
int lambdasim_find_module(struct module_s *first, char *name , struct module_s **found)
{
struct module_s *list = NULL;
struct module_s *next;
};
-
-
struct ext_module_s {
char *name;
int (*start)(void *);
struct ext_module_list_s *next;
};
-
int lambdasim_file_to_module_list(char *filename, struct module_s **mod);
int lambdasim_load_ext_modules(struct ext_module_list_s **mlist);
int lambdasim_find_ext_module(struct ext_module_list_s *first, char *name , struct ext_module_list_s **found);
*s->sys_clk=0;
out:
return ret;
-
}
static int clocker_tick(void *sess)
struct event *ev;
};
-
static struct event_base *base=NULL;
int lambdasim_module_get_args( char *args, char *arg, char **val)
return ret;
}
-
static int lambdasim_module_pads_get( struct pad_s *pads, char *name, void **signal)
{
int ret;
return RC_OK;
}
-
-
void event_handler(int fd, short event, void *arg)
{
struct session_s *s=(struct session_s*)arg;
}
}
}
+
static const char macadr[6] = {0xaa, 0xb6, 0x24, 0x69, 0x77, 0x21};
static int ethernet_new(void **sess, char *args)
out:
*sess=(void*)s;
return ret;
-
}
static int ethernet_add_pads(void *sess, struct pad_list_s *plist)
out:
return ret;
-
}
+
static int ethernet_tick(void *sess)
{
char c;
return ret;
}
-
-
void set_conio_terminal_mode(void)
{
struct termios new_termios;
tcsetattr(0, TCSANOW, &new_termios);
}
-
-
static int serial2console_start(void *b)
{
base =(struct event_base *)b;
}
}
-
static int serial2console_new(void **sess, char *args)
{
int ret=RC_OK;
out:
return ret;
-
}
+
static int serial2console_tick(void *sess)
{
struct event_base *base;
-
int lambdasim_module_get_args( char *args, char *arg, char **val)
{
int ret=RC_OK;
return ret;
}
-
-
static int lambdasim_module_pads_get( struct pad_s *pads, char *name, void **signal)
{
int ret;
return ret;
}
-
-
static int serial2tcp_start(void *b)
{
base =(struct event_base *)b;
}
}
-
-
-
static void accept_conn_cb(struct evconnlistener *listener, evutil_socket_t fd, struct sockaddr *address, int socklen, void *ctx)
{
struct session_s *s= (struct session_s*)ctx;
struct evconnlistener *listener;
struct sockaddr_in sin;
-
if(!sess)
{
ret = RC_INVARG;
goto out;
}
-
ret = lambdasim_module_get_args(args, "port", &cport);
{
if(RC_OK != ret)
fprintf(stderr, "Invalid port selected!\n");
goto out;
}
-
-
+
s=(struct session_s*)malloc(sizeof(struct session_s));
if(!s)
{
eprintf("Can't bind port %d\n!\n", port);
goto out;
}
- evconnlistener_set_error_cb(listener, accept_error_cb);
-
-
-
+ evconnlistener_set_error_cb(listener, accept_error_cb);
out:
*sess=(void*)s;
return RC_OK;
}
-
*s->tx_ready = 1;
if(s->fd && *s->tx_valid)
{
#include "pads.h"
static struct pad_list_s *padlist=NULL;
+
int lambdasim_register_pads(struct pad_s *pads, char *interface_name, int index)
{
int ret = RC_OK;
void lambdasim_init(void **out);
-
struct session_list_s {
void *session;
char tickfirst;
pmlist->module->start(base);
}
}
-
/* Load configuration */
ret = lambdasim_file_to_module_list("sim_config.js", &ml);
out:
return ret;
}
+
int lambdasim_sort_session()
{
struct session_list_s *s;
sprev = s;
}
- return RC_OK;
-
+ return RC_OK;
}
+
struct event *ev;
+
static void cb(int sock, short which, void *arg)
{
struct session_list_s *s;
int main()
{
-
void *vdut=NULL;
struct event_base *base=NULL;
struct timeval tv;
#include "verilated_vcd_c.h"
#include <verilated.h>
-
VerilatedVcdC* tfp;
extern "C" void lambdasim_eval(void *vdut)