Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request adds support for the MUL_ADD operation (multiply-accumulate) and introduces a Python tool to convert assembly files to YAML format. The MUL_ADD operation implements the formula dst = src0 * src1 + src2, which is commonly used in systolic array operations for matrix multiplication.
Changes:
- Added
asm_to_yaml.pytool that parses Zeonica assembly files and generates YAML compatible with the Go YAML parser - Implemented the MUL_ADD operation in the instruction emulator for systolic MAC (multiply-accumulate) operations
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tool/asm_to_yaml.py | New Python script that converts ASM files with PE blocks and instruction groups to YAML format, including regex-based parsing for operations, operands, and metadata |
| core/emu.go | Added MUL_ADD operation to the instruction dispatch map and implemented runMulAdd function that performs three-operand multiply-accumulate: dst = src0 * src1 + src2 |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for _, dst := range inst.DstOperands.Operands { | ||
| i.writeOperand(dst, cgra.NewScalarWithPred(dstVal, finalPred), state) | ||
| } | ||
| Trace("Inst", "Time", state.CurrentTime, "OpCode", inst.OpCode, "ID", inst.ID, "X", state.TileX, "Y", state.TileY, "Pred", finalPred) |
There was a problem hiding this comment.
Consider adding the "// elect no next PC" comment at the end for consistency with other operation implementations like runMul, runAdd, runSub, etc.
Suggested change
| Trace("Inst", "Time", state.CurrentTime, "OpCode", inst.OpCode, "ID", inst.ID, "X", state.TileX, "Y", state.TileY, "Pred", finalPred) | |
| Trace("Inst", "Time", state.CurrentTime, "OpCode", inst.OpCode, "ID", inst.ID, "X", state.TileX, "Y", state.TileY, "Pred", finalPred) | |
| // elect no next PC |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.