litex/build/sim: small cleanup

This commit is contained in:
Florent Kermarrec 2017-06-28 16:25:56 +02:00
parent 1d8298af94
commit ab6f4de521
9 changed files with 10 additions and 44 deletions

View File

@ -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;

View File

@ -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);

View File

@ -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)

View File

@ -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;

View File

@ -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)
{

View File

@ -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)
@ -184,7 +174,6 @@ static int serial2tcp_new(void **sess, char *args)
goto out;
}
s=(struct session_s*)malloc(sizeof(struct session_s));
if(!s)
{
@ -206,9 +195,6 @@ static int serial2tcp_new(void **sess, char *args)
}
evconnlistener_set_error_cb(listener, accept_error_cb);
out:
*sess=(void*)s;
return ret;
@ -257,7 +243,6 @@ static int serial2tcp_tick(void *sess)
return RC_OK;
}
*s->tx_ready = 1;
if(s->fd && *s->tx_valid)
{

View File

@ -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;

View File

@ -23,7 +23,6 @@
void lambdasim_init(void **out);
struct session_list_s {
void *session;
char tickfirst;
@ -61,7 +60,6 @@ static int lambdasim_initialize_all(void **dut, void *base)
}
}
/* Load configuration */
ret = lambdasim_file_to_module_list("sim_config.js", &ml);
if(RC_OK != ret)
@ -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;
@ -162,9 +161,10 @@ int lambdasim_sort_session()
}
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;

View File

@ -9,7 +9,6 @@
#include "verilated_vcd_c.h"
#include <verilated.h>
VerilatedVcdC* tfp;
extern "C" void lambdasim_eval(void *vdut)