From adf8f7962dac5fc57e538876782f7cba0e00eba0 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Thu, 2 Feb 2023 19:07:56 -0800 Subject: [PATCH] Rename interrupt/exception to raise_interrupt/raise_exception Verilator takes issue with a parameter named "interrupt" in DPI calls --- generators/chipyard/src/main/resources/csrc/cospike.cc | 10 +++++----- generators/chipyard/src/main/resources/vsrc/cospike.v | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/generators/chipyard/src/main/resources/csrc/cospike.cc b/generators/chipyard/src/main/resources/csrc/cospike.cc index 2f6e74901d..7c8f249e20 100644 --- a/generators/chipyard/src/main/resources/csrc/cospike.cc +++ b/generators/chipyard/src/main/resources/csrc/cospike.cc @@ -58,8 +58,8 @@ extern "C" void cospike_cosim(long long int cycle, int valid, long long int iaddr, unsigned long int insn, - int exception, - int interrupt, + int raise_exception, + int raise_interrupt, unsigned long long int cause, unsigned long long int wdata) { @@ -161,7 +161,7 @@ extern "C" void cospike_cosim(long long int cycle, processor_t* p = sim->get_core(hartid); state_t* s = p->get_state(); uint64_t s_pc = s->pc; - if (interrupt) { + if (raise_interrupt) { printf("%d interrupt %lx\n", cycle, cause); uint64_t interrupt_cause = cause & 0x7FFFFFFFFFFFFFFF; if (interrupt_cause == 3) { @@ -170,7 +170,7 @@ extern "C" void cospike_cosim(long long int cycle, printf("Unknown interrupt %lx\n", interrupt_cause); } } - if (exception) + if (raise_exception) printf("%d exception %lx\n", cycle, cause); if (valid) { printf("%d Cosim: %lx", cycle, iaddr); @@ -179,7 +179,7 @@ extern "C" void cospike_cosim(long long int cycle, } printf("\n"); } - if (valid || interrupt || exception) + if (valid || raise_interrupt || raise_exception) p->step(1); if (valid) { diff --git a/generators/chipyard/src/main/resources/vsrc/cospike.v b/generators/chipyard/src/main/resources/vsrc/cospike.v index 260506758d..0b70d365f5 100644 --- a/generators/chipyard/src/main/resources/vsrc/cospike.v +++ b/generators/chipyard/src/main/resources/vsrc/cospike.v @@ -13,8 +13,8 @@ import "DPI-C" function void cospike_cosim(input longint cycle, input bit valid, input longint iaddr, input int insn, - input bit exception, - input bit interrupt, + input bit raise_exception, + input bit raise_interrupt, input longint cause, input longint wdata );