google / google/CFU-Playground

Renode: cycles for a long-running CFU instruction are not tallied in $mcycle

Open
#566 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Verilog
Stars
565
Forks
160
PR merge metrics
No merged PRs in 30d

Description

I made an iterative 'Fibonacci' CFU. It only uses the first operand. It performs an iterative Fibonacci operation for that many cycles then returns the result, so it will stall the CPU for that many cycles.

On the Arty board, the measured cycle count is N + 4 when given N as an operand. But in Renode, the measured cycle count is always 2 regardless of the operand value. The cycles of CFU simulation spent waiting for `rsp_valid` should be added into `$mcycle`, but it seems they are not.

To reproduce:
* In this repo, check out branch `fib`.
* `cd proj/fib`
* `make renode`
* `2` (functional CFU tests)
* `t` (timed interactive test)
* type a value (e.g. 2, 10, 1000); the result and the `$mcycle` delta will be printed out.

@PiotrZierhoffer , is there someone familiar with the code here who can take a look?

Originally reported by @bala122 in #506.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.