[Libre-soc-bugs] [Bug 980] Implement C-based Power ISA pseudocode compiler

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Sun Jan 14 11:56:06 GMT 2024


https://bugs.libre-soc.org/show_bug.cgi?id=980

--- Comment #101 from Jacob Lifshay <programmerjake at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #100)
> (In reply to Dmitry Selyutin from comment #95)
> 
> > ...where assignments to registers (and similar stuff) have the flags
> > updated. What's the point of having ok
> 
> i explained already, jacob can you explain it, it matches the hardware.
> but briefly so that time is not wasted.

ok is inspired by the pipeline/data classes for soc.git:

simplified:
class Foo:
    data: Signal  # n-bit value, or some other data type like Record
    ok: Signal  # 1-bit value, true when `data` is valid, false when no data is
supplied

since we didn't want to have to rewrite large portions of the simulator, we
decided to add an `ok` field directly to SelectableInt, which tells the
simulator which outputs were actually written (when ok=True) and which should
retain their old values (when ok=False, indicating that output wasn't written).
knowing when outputs aren't written is necessary for a lot of FP operations
that intentionally don't write to FRT if they'll trap, so the trap handler can
see the original input values if FRT is the same register as an input.

since the C code generator doesn't have to worry about problems caused by
rewriting a bunch of the output code, we can just use ok without having to mash
it into SelectableInt, like in comment #98

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the libre-soc-bugs mailing list