Skip to content

Commit

Permalink
Rename interrupt/exception to raise_interrupt/raise_exception
Browse files Browse the repository at this point in the history
Verilator takes issue with a parameter named "interrupt" in DPI calls
  • Loading branch information
jerryz123 committed Feb 3, 2023
1 parent 7a03c4c commit adf8f79
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions generators/chipyard/src/main/resources/csrc/cospike.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down Expand Up @@ -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) {
Expand All @@ -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);
Expand All @@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions generators/chipyard/src/main/resources/vsrc/cospike.v
Original file line number Diff line number Diff line change
Expand Up @@ -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
);
Expand Down

0 comments on commit adf8f79

Please sign in to comment.