Skip to content

Commit

Permalink
[cosim] feat: write mcycle on spike_step
Browse files Browse the repository at this point in the history
  • Loading branch information
SharzyL authored and sequencer committed Apr 14, 2024
1 parent 7423309 commit c2abd82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions ipemu/csrc/vbridge_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -361,6 +361,7 @@ void VBridgeImpl::getCoverage() { return ctx->coveragep()->write(); }

std::optional<SpikeEvent> VBridgeImpl::spike_step() {
auto state = proc.get_state();
state->csrmap.at(CSR_MCYCLE)->write(get_t());
auto fetch = proc.get_mmu()->load_insn(state->pc);
auto event = create_spike_event(fetch);

Expand Down
3 changes: 3 additions & 0 deletions tests/asm/smoke/smoke.asm
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ loop:
addi a2, a2, -1
bnez a2, add_test

# read cycles
csrr t0, mcycle

ret

will_not_be_executed:
Expand Down

0 comments on commit c2abd82

Please sign in to comment.