-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Profiling] Differentiating FSM tracking of groups vs ground truths (…
…go, done) (#2277) This PR contains bug fixes and adjustments for: 1. Register-based control flow coordination taking extra cycles 2. Stream-processing VCD files are prone to bugs To elaborate for my own sake: 1. Any register that TDCC generates to track control flow use an extra cycle to process. For example, a group `g`'s `go` and `done` signals may denote that `g` takes only 2 cycles. However, if an FSM register `fsm` uses 0 to encode **when `g` is allowed to be active**, then `fsm` would have value 0 for **3 cycles** (2 cycles for `g` + 1 cycle for reading in that `g` is done). To deal with this situation, the profiler maintains two versions of information for all FSM-managed groups: (a) the ground truth information provided by `go` and `done` signals for the group (ex. `TOP.toplevel.main.write` in the below screenshot), and (b) the FSM register-based information (ex. `TOP.toplevel.main.write[FSM]` in the below screenshot). The screenshot is the summary provided for `tests/profiler/simple-seq.futil`) ![image](https://github.com/user-attachments/assets/2ee80aea-1ec9-4e93-b67c-d80b6ab6aa72) Having both versions will help us understand the impacts of these extra (phantom) cycles. 2. While working on (1), I found that my VCD parsing script didn't capture some value changes that happened simultaneously with the clock cycle updates. The below is a small illustrative example (denoted `timestamp signal value`): ``` 70 a 1 70 clk 1 70 b 1 ``` We see that on the cycle starting at timestamp 70, both `a` and `b` updated values. However, since my script read the VCD file through a stream, it only noticed that `a` updated values (because it was listed before the `clk` update). To fix this bug, I read the value changes into a dictionary from timestamps to value change events, so that I can process all events that happened at the same time as a cycle update.
- Loading branch information
1 parent
9605a8d
commit e7d2d64
Showing
12 changed files
with
271 additions
and
271 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
[get-profile-counts-info.sh] Obtaining FSM info from TDCC | ||
[get-profile-counts-info.sh] Obtaining cell information from component-cells backend | ||
[get-profile-counts-info.sh] Obtaining VCD file via simulation | ||
[get-profile-counts-info.sh] Using FSM info and VCD file to obtain cycle level counts | ||
Total clock cycles: 2 | ||
=====SUMMARY===== | ||
|
||
[FSM] Group TOP.toplevel.main.cond Summary: | ||
Total cycles: 2 | ||
# of times active: 1 | ||
Avg runtime: 2.0 | ||
|
||
[GT] Group TOP.toplevel.main.cond Summary: | ||
Total cycles: 1 | ||
# of times active: 1 | ||
Avg runtime: 1.0 | ||
|
||
[FSM] Group TOP.toplevel.main.incr Summary: | ||
Total cycles: 0 | ||
# of times active: 0 | ||
Avg runtime: 0 | ||
|
||
[GT] Group TOP.toplevel.main.incr Summary: | ||
Total cycles: 0 | ||
# of times active: 0 | ||
Avg runtime: 0 | ||
|
||
=====DUMP===== | ||
|
||
[FSM] Group TOP.toplevel.main.cond: | ||
FSM name: TOP.toplevel.main.fsm | ||
FSM state ids: [0, 3] | ||
Total cycles: 2 | ||
# of times active: 1 | ||
Segments: [0, 2) | ||
|
||
[GT] Group TOP.toplevel.main.cond: | ||
Total cycles: 1 | ||
# of times active: 1 | ||
Segments: [0, 1) | ||
|
||
[FSM] Group TOP.toplevel.main.incr: | ||
FSM name: TOP.toplevel.main.fsm | ||
FSM state ids: [2, 1] | ||
Total cycles: 0 | ||
# of times active: 0 | ||
Segments: | ||
|
||
[GT] Group TOP.toplevel.main.incr: | ||
Total cycles: 0 | ||
# of times active: 0 | ||
Segments: | ||
|
||
name,total-cycles,times-active,avg | ||
TOP.toplevel.main.cond[FSM],2,1,2.0 | ||
TOP.toplevel.main.cond,1,1,1.0 | ||
TOP.toplevel.main.incr[FSM],0,0,0 | ||
TOP.toplevel.main.incr,0,0,0 | ||
TOTAL,2,-,- | ||
[get-profile-counts-info.sh] Writing visualization |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.