-
Notifications
You must be signed in to change notification settings - Fork 2
Update #33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update #33
Conversation
n0thingNoob
commented
Jan 20, 2026
- Update a script to generate the utilization graph
- Fix the store instruction (src1 is data, src2 is addr)
- Add histogram main.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This pull request introduces a utilization visualization tool, adds a histogram test benchmark, and attempts to fix the operand order for the StoreDirect instruction. However, there is a critical breaking change that will cause existing tests to fail.
Changes:
- Added Python script
tool/utilization_plot.pyto generate tile and port utilization heatmaps from JSON logs - Added new histogram testbench in
test/testbench/histogram/main.gowith input data preloading and validation - Modified
core/emu.goto swap StoreDirect operand order and removed extraneous whitespace
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| tool/utilization_plot.py | New visualization tool that parses JSON logs and generates utilization heatmaps for CGRA tiles and ports |
| test/testbench/histogram/main.go | New histogram test benchmark that preloads data, runs simulation, and validates output against expected results |
| core/emu.go | Swaps StoreDirect operand order (src1=data, src2=address) and removes blank lines for cleaner formatting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
test/testbench/histogram/main.go
Outdated
| scanLimit := 64 | ||
| outputData := make([]uint32, scanLimit) | ||
| for addr := 0; addr < 5; addr++ { |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The scanLimit variable is set to 64 but only 5 histogram bins are read from memory. This allocates more memory than needed. Consider setting scanLimit to 5 or using the bins parameter to match the actual number of histogram bins being read.
| scanLimit := 64 | |
| outputData := make([]uint32, scanLimit) | |
| for addr := 0; addr < 5; addr++ { | |
| scanLimit := 5 | |
| outputData := make([]uint32, scanLimit) | |
| for addr := 0; addr < scanLimit; addr++ { |
| src1 := inst.SrcOperands.Operands[0] | ||
| addrStruct := i.readOperand(src1, state) | ||
| addr := addrStruct.First() | ||
| src2 := inst.SrcOperands.Operands[1] | ||
| valueStruct := i.readOperand(src2, state) | ||
| valueStruct := i.readOperand(src1, state) | ||
| value := valueStruct.First() | ||
| src2 := inst.SrcOperands.Operands[1] | ||
| addrStruct := i.readOperand(src2, state) | ||
| addr := addrStruct.First() |
Copilot
AI
Jan 20, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The operand order change for StoreDirect breaks existing test files. The test YAML files (e.g., test/mem/test_loadstore.yaml) have STD instructions with src_operands[0] as the address and src_operands[1] as the data value. However, after this change, the code reads src_operands[0] as data and src_operands[1] as address, which is the opposite. Either the fix needs to be reverted, or all existing YAML test files need to be updated to match the new operand order. The PR description states "src1 is data, src2 is addr" but the existing convention in YAML files is the opposite.
Jackcuii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM