diff --git a/litex/build/sim/core/modules.c b/litex/build/sim/core/modules.c index 8d7d30a6b..a5c57d9cc 100644 --- a/litex/build/sim/core/modules.c +++ b/litex/build/sim/core/modules.c @@ -16,9 +16,6 @@ static struct ext_module_list_s *modlist=NULL; - - - int lambdasim_register_ext_module(struct ext_module_s *mod) { int ret=RC_OK; @@ -43,7 +40,6 @@ int lambdasim_register_ext_module(struct ext_module_s *mod) modlist = ml; out: - return ret; } @@ -140,7 +136,6 @@ out: return ret; } - int lambdasim_find_module(struct module_s *first, char *name , struct module_s **found) { struct module_s *list = NULL; diff --git a/litex/build/sim/core/modules.h b/litex/build/sim/core/modules.h index 1bfabdf6d..d6ab8a02c 100644 --- a/litex/build/sim/core/modules.h +++ b/litex/build/sim/core/modules.h @@ -19,8 +19,6 @@ struct module_s { struct module_s *next; }; - - struct ext_module_s { char *name; int (*start)(void *); @@ -35,7 +33,6 @@ struct ext_module_list_s { 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); diff --git a/litex/build/sim/core/modules/clocker/clocker.c b/litex/build/sim/core/modules/clocker/clocker.c index 080ebf314..3681e1606 100644 --- a/litex/build/sim/core/modules/clocker/clocker.c +++ b/litex/build/sim/core/modules/clocker/clocker.c @@ -86,7 +86,6 @@ static int clocker_add_pads(void *sess, struct pad_list_s *plist) *s->sys_clk=0; out: return ret; - } static int clocker_tick(void *sess) diff --git a/litex/build/sim/core/modules/ethernet/ethernet.c b/litex/build/sim/core/modules/ethernet/ethernet.c index 90d3f513c..90601668a 100644 --- a/litex/build/sim/core/modules/ethernet/ethernet.c +++ b/litex/build/sim/core/modules/ethernet/ethernet.c @@ -35,7 +35,6 @@ struct session_s { struct event *ev; }; - static struct event_base *base=NULL; int lambdasim_module_get_args( char *args, char *arg, char **val) @@ -74,7 +73,6 @@ out: return ret; } - static int lambdasim_module_pads_get( struct pad_s *pads, char *name, void **signal) { int ret; @@ -109,8 +107,6 @@ static int ethernet_start(void *b) return RC_OK; } - - void event_handler(int fd, short event, void *arg) { struct session_s *s=(struct session_s*)arg; @@ -139,6 +135,7 @@ void event_handler(int fd, short event, void *arg) } } } + static const char macadr[6] = {0xaa, 0xb6, 0x24, 0x69, 0x77, 0x21}; static int ethernet_new(void **sess, char *args) @@ -194,7 +191,6 @@ 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) @@ -225,8 +221,8 @@ static int ethernet_add_pads(void *sess, struct pad_list_s *plist) out: return ret; - } + static int ethernet_tick(void *sess) { char c; diff --git a/litex/build/sim/core/modules/serial2console/serial2console.c b/litex/build/sim/core/modules/serial2console/serial2console.c index 850a56a8a..26813f8d1 100644 --- a/litex/build/sim/core/modules/serial2console/serial2console.c +++ b/litex/build/sim/core/modules/serial2console/serial2console.c @@ -52,8 +52,6 @@ out: return ret; } - - void set_conio_terminal_mode(void) { struct termios new_termios; @@ -63,8 +61,6 @@ void set_conio_terminal_mode(void) tcsetattr(0, TCSANOW, &new_termios); } - - static int serial2console_start(void *b) { base =(struct event_base *)b; @@ -97,7 +93,6 @@ static void event_handler(int fd, short event, void *arg) } } - static int serial2console_new(void **sess, char *args) { int ret=RC_OK; @@ -155,8 +150,8 @@ static int serial2console_add_pads(void *sess, struct pad_list_s *plist) out: return ret; - } + static int serial2console_tick(void *sess) { diff --git a/litex/build/sim/core/modules/serial2tcp/serial2tcp.c b/litex/build/sim/core/modules/serial2tcp/serial2tcp.c index fbe539de6..181f35005 100644 --- a/litex/build/sim/core/modules/serial2tcp/serial2tcp.c +++ b/litex/build/sim/core/modules/serial2tcp/serial2tcp.c @@ -27,7 +27,6 @@ struct session_s { struct event_base *base; - int lambdasim_module_get_args( char *args, char *arg, char **val) { int ret=RC_OK; @@ -64,8 +63,6 @@ out: return ret; } - - static int lambdasim_module_pads_get( struct pad_s *pads, char *name, void **signal) { int ret; @@ -93,8 +90,6 @@ out: return ret; } - - static int serial2tcp_start(void *b) { base =(struct event_base *)b; @@ -127,9 +122,6 @@ static void event_handler(int fd, short event, void *arg) } } - - - 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; @@ -158,14 +150,12 @@ static int serial2tcp_new(void **sess, char *args) 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) @@ -183,8 +173,7 @@ static int serial2tcp_new(void **sess, char *args) fprintf(stderr, "Invalid port selected!\n"); goto out; } - - + s=(struct session_s*)malloc(sizeof(struct session_s)); if(!s) { @@ -204,10 +193,7 @@ static int serial2tcp_new(void **sess, char *args) 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; @@ -257,7 +243,6 @@ static int serial2tcp_tick(void *sess) return RC_OK; } - *s->tx_ready = 1; if(s->fd && *s->tx_valid) { diff --git a/litex/build/sim/core/pads.c b/litex/build/sim/core/pads.c index 232bfeeb4..336dbce76 100644 --- a/litex/build/sim/core/pads.c +++ b/litex/build/sim/core/pads.c @@ -7,6 +7,7 @@ #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; diff --git a/litex/build/sim/core/sim.c b/litex/build/sim/core/sim.c index 9c87380c1..bee87f58d 100644 --- a/litex/build/sim/core/sim.c +++ b/litex/build/sim/core/sim.c @@ -23,7 +23,6 @@ void lambdasim_init(void **out); - struct session_list_s { void *session; char tickfirst; @@ -60,7 +59,6 @@ static int lambdasim_initialize_all(void **dut, void *base) pmlist->module->start(base); } } - /* Load configuration */ ret = lambdasim_file_to_module_list("sim_config.js", &ml); @@ -138,6 +136,7 @@ static int lambdasim_initialize_all(void **dut, void *base) out: return ret; } + int lambdasim_sort_session() { struct session_list_s *s; @@ -161,10 +160,11 @@ int lambdasim_sort_session() 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; @@ -201,7 +201,6 @@ static void cb(int sock, short which, void *arg) int main() { - void *vdut=NULL; struct event_base *base=NULL; struct timeval tv; diff --git a/litex/build/sim/core/veril.cpp b/litex/build/sim/core/veril.cpp index cd5b2db09..677d6ff89 100644 --- a/litex/build/sim/core/veril.cpp +++ b/litex/build/sim/core/veril.cpp @@ -9,7 +9,6 @@ #include "verilated_vcd_c.h" #include - VerilatedVcdC* tfp; extern "C" void lambdasim_eval(void *vdut)