Skip to content

Comments

upload mac and asm to yaml parser#42

Merged
n0thingNoob merged 2 commits intomainfrom
new_verify_update
Feb 24, 2026
Merged

upload mac and asm to yaml parser#42
n0thingNoob merged 2 commits intomainfrom
new_verify_update

Conversation

@n0thingNoob
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a 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 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.py tool 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)
Copy link

Copilot AI Feb 23, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

@Jackcuii Jackcuii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@n0thingNoob n0thingNoob merged commit 9e7e293 into main Feb 24, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants