Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
From: Luke Kenneth Casson Leighton <lkcl@lkcl.net>
To: openpower-hdl-cores@mailinglist.openpowerfoundation.org,
	 Libre-RISCV General Development
	<libre-riscv-dev@lists.libre-riscv.org>
Subject: [libre-riscv-dev] 3.0B PDF spec parser and first auto-generator working well
Date: Sat, 4 Apr 2020 14:33:58 +0100
Message-ID: <CAPweEDzbq3xJRu0MoV1L3YVjcsXpdCqwSWEjZ1okD3qdCcpNcg@mail.gmail.com> (raw)

making good progress.  this (which can be seen here
https://libre-riscv.org/openpower/isa/fixedarith/)

vvvvvv
# Add Immediate Shifted

D-Form

* addis RT,RA,SI

    if RA = 0 then RT <- EXTS(SI || [0]*16)
    else           RT <- (RA) + EXTS(SI || [0]*16)

Special Registers Altered:

    None
^^^^^

gets turned into this:

vvvv
# auto-generated, do not edit
from soc.decoder.helpers import (EXTS,)
class fixedarith(ISACaller):
    def op_addis(self, RA):
        if RA == 0:
            RT = EXTS(concat(SI, concat(0, repeat=16)))
        else:
            RT = RA + EXTS(concat(SI, concat(0, repeat=16)))
        return (RT,)
    instrs = {}
    instrs['addis'] = (op_addis, ['RA'], [], ['RT']) # records input
and output regs
^^^^

no "laborious manually-written simulator code" was written.  the next
phase is, obviously, to try actually executing these code-fragments.
that's what the base-class "ISACaller" is for.

l.

_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

                 reply index

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAPweEDzbq3xJRu0MoV1L3YVjcsXpdCqwSWEjZ1okD3qdCcpNcg@mail.gmail.com \
    --to=lkcl@lkcl.net \
    --cc=libre-riscv-dev@lists.libre-riscv.org \
    --cc=openpower-hdl-cores@mailinglist.openpowerfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

Libre RISC-V Mailing list Archives (accessible via public-inbox)

Archives are clonable: git clone --mirror https://inbox.libre-soc.org/libre-riscv-dev

Example config snippet for mirrors


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git