Skip to content

ume: Add interpolation to rv64ume and custom template tags#834

Open
arcane-quill wants to merge 17 commits intomasterfrom
wip/ume-viam-def
Open

ume: Add interpolation to rv64ume and custom template tags#834
arcane-quill wants to merge 17 commits intomasterfrom
wip/ume-viam-def

Conversation

@arcane-quill
Copy link
Copy Markdown

@arcane-quill arcane-quill commented Mar 22, 2026

PR for issue #757 (and #761, #759)
interpolated hardcoded rv64ume files from linux-user
created UmeHardcodedRiscvDefinitionPass and UmeTemplateRenderingPass to add custom template tags (e.g. registers, exceptions..) with hardcoded values that later get filled in by the vadl file
added VIAM definition UserModeEmulation

@flofriday
Copy link
Copy Markdown
Contributor

flofriday commented Mar 22, 2026

I think the branch of this PR isn't cleanly based on a fresh master, because it contains some of my commits that are already on master.

So let's rebase on master with (on your branch):

git fetch
git rebase origin/master

There might be some conflicts but if you execute these commands in IntelliJ you'll get some help resolving the conflicts in a nice UI. 😉

@arcane-quill
Copy link
Copy Markdown
Author

I think the branch of this PR isn't cleanly based on a fresh master, because it contains some of my commits that are already on master.

So let's rebase on master with (on your branch):

git fetch
git rebase origin/master

There might be some conflicts but if you execute these commands in IntelliJ you'll get some help resolving the conflicts in a nice UI. 😉

I tried to rebase twice now but it doesnt seem to be fixed @flofriday

@flofriday
Copy link
Copy Markdown
Contributor

Yeah sometimes rebasing still contains some weired artifacts, but I just tried it on my machine and it (mostly) worked. I'll send you a DM (on matrix), let's figure it out there.

@arcane-quill arcane-quill force-pushed the wip/ume-viam-def branch 2 times, most recently from ce9eaf4 to 0d64625 Compare March 22, 2026 19:08
@arcane-quill arcane-quill changed the title Wip/ume viam def ume: Add interpolation to rv64ume and custom template tags Mar 23, 2026
@arcane-quill arcane-quill force-pushed the wip/ume-viam-def branch 2 times, most recently from 4d6afb8 to f54e597 Compare April 12, 2026 01:50
Comment thread vadl/main/vadl/ast/AstVisitor.java
Copy link
Copy Markdown
Contributor

@Jozott00 Jozott00 left a comment

Choose a reason for hiding this comment

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

Unfortunately the current state is too RISC-V specific and needs an overhaul. Please take a closer look at other VIAM definitions and how they are handled in the code emission.

Comment thread vadl/main/resources/templates/iss/linux-user/gen-arch/cpu_loop.c
Comment thread vadl/main/resources/templates/iss/linux-user/gen-arch/cpu_loop.c Outdated
Comment thread vadl/main/resources/templates/iss/linux-user/gen-arch/cpu_loop.c Outdated

env->pc = regs->sepc;
env->x[RV64UME_REG_SP] = regs->sp;
env->[(${pc_reg.name_lower})] = regs->[(${config.ptRegPc})];
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What does ptRegPc stand for?

Comment thread vadl/main/resources/templates/iss/linux-user/gen-arch/signal.c Outdated
Comment thread vadl/main/resources/templates/iss/linux-user/gen-arch/signal.c Outdated
Comment thread vadl/main/vadl/iss/passes/UmeTemplateRenderingPass.java Outdated
Comment thread vadl/main/vadl/pass/PassOrders.java Outdated
Comment thread vadl/main/vadl/viam/UserModeEmulation.java Outdated
Comment thread vadl/main/vadl/viam/UserModeEmulation.java Outdated
@arcane-quill
Copy link
Copy Markdown
Author

Unfortunately the current state is too RISC-V specific and needs an overhaul. Please take a closer look at other VIAM definitions and how they are handled in the code emission.

Thanks for the extensive review, I'm working on it now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

frontend This is frontend related iss This is ISS related lcb This is LCB related

Projects

None yet

3 participants