Merge pull request #163 from gsomlo/gls-verilated-cmdargs

build/sim/core: Initialize Verilator commandArgs
This commit is contained in:
enjoy-digital 2019-04-17 18:59:28 +02:00 committed by GitHub
commit ce81a39ce9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -203,7 +203,7 @@ static void cb(int sock, short which, void *arg)
} }
} }
int main() int main(int argc, char *argv[])
{ {
void *vdut=NULL; void *vdut=NULL;
struct timeval tv; struct timeval tv;
@ -224,6 +224,7 @@ int main()
goto out; goto out;
} }
litex_sim_init_cmdargs(argc, argv);
if(RC_OK != (ret = litex_sim_initialize_all(&vdut, base))) if(RC_OK != (ret = litex_sim_initialize_all(&vdut, base)))
{ {
goto out; goto out;

View File

@ -17,6 +17,11 @@ extern "C" void litex_sim_eval(void *vdut)
dut->eval(); dut->eval();
} }
extern "C" void litex_sim_init_cmdargs(int argc, char *argv[])
{
Verilated::commandArgs(argc, argv);
}
extern "C" void litex_sim_init_tracer(void *vdut) extern "C" void litex_sim_init_tracer(void *vdut)
{ {
Vdut *dut = (Vdut*)vdut; Vdut *dut = (Vdut*)vdut;

View File

@ -4,6 +4,7 @@
#define __VERIL_H_ #define __VERIL_H_
#ifdef __cplusplus #ifdef __cplusplus
extern "C" void litex_sim_init_cmdargs(int argc, char *argv[]);
extern "C" void litex_sim_eval(void *vdut); extern "C" void litex_sim_eval(void *vdut);
extern "C" void litex_sim_init_tracer(void *vdut); extern "C" void litex_sim_init_tracer(void *vdut);
extern "C" void litex_sim_tracer_dump(); extern "C" void litex_sim_tracer_dump();