From: Sebastien Bourdeauducq Date: Mon, 5 Mar 2012 14:40:21 +0000 (+0100) Subject: sim: signal writes working X-Git-Tag: 24jan2021_ls180~2099^2~1000 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=c4c22c9ca071816f7754d7eb2da46de04e5e8f33;p=litex.git sim: signal writes working --- diff --git a/vpi/main.c b/vpi/main.c index 5774a7e6..44fc21ce 100644 --- a/vpi/main.c +++ b/vpi/main.c @@ -17,14 +17,36 @@ static int h_go(void *user) return 1; } +static s_vpi_time zero_delay = { + .type = vpiSimTime, + .high = 0, + .low = 0 +}; + static int h_write(char *name, int nchunks, const unsigned char *chunks, void *user) { + vpiHandle item; + s_vpi_vecval vector[64]; int i; + s_vpi_value value; - printf("WRITE: %s / nchunks: %d / ", name, nchunks); + item = vpi_handle_by_name(name, NULL); + if(item == NULL) { + fprintf(stderr, "Attempted to write non-existing signal %s\n", name); + return 0; + } + + assert(nchunks <= 255); + for(i=0;i<64;i++) { + vector[i].aval = 0; + vector[i].bval = 0; + } for(i=0;i