Libre RISC-V Mailing list Archives (accessible via public-inbox)
 help / color / Atom feed
From: bugzilla-daemon@libre-riscv.org
To: libre-riscv-dev@lists.libre-riscv.org
Subject: [libre-riscv-dev] [Bug 269] auto-conversion / parser of POWER ISA Spec v3.0B
Date: Mon, 06 Apr 2020 02:28:21 +0000
Message-ID: <bug-269-13-CD8HVFkh4N@http.bugs.libre-riscv.org/> (raw)
In-Reply-To: <bug-269-13@http.bugs.libre-riscv.org/>

http://bugs.libre-riscv.org/show_bug.cgi?id=269

--- Comment #33 from Luke Kenneth Casson Leighton <lkcl@lkcl.net> ---
(In reply to Michael Nolan from comment #32)
> I'm trying to get addpcis working (so I can test NIA and CIA without messing
> with branches), and the instruction builds the displacement from "concat(d0,
> d1, d2)". We don't have separate d0, d1, and d2 fields, but we do have a D
> field and a d0_d1_d2 field. Should this sort of thing (I expect we'll run
> into this again with shifts) be corrected in the ISA spec, or by adding the
> relevant fields in in fields.text?

they're already there, what i did however was to take d0,d1,d2 and cat them
with underscores into a compound named field.

   d0,d1,d2 (16:25,11:15,31)
        Immediate fields that are concatenated to specify a
        16-bit signed two's complement integer which is
        sign-extended to 64 bits.
        Formats: DX

what should actually happen is that 3 fields should be created.

might need to keep the compound name as well.

hmmm line 225

https://git.libre-riscv.org/?p=soc.git;a=blob;f=src/soc/decoder/power_fields.py;h=26b59d46863fcd313e6d952b8f5fab22129afef0;hb=1117d7c3cd52cc73a757f3c6f62c6602551d7ad3#l225

i apologise, i write these types of line-based parsers on a one-off basis quite
regularly, without expectation of modifying them, afterwards.

i think that one would be easier to process back in decode_instructions.

line 24

https://git.libre-riscv.org/?p=soc.git;a=blob;f=src/soc/decoder/power_fields.py;h=26b59d46863fcd313e6d952b8f5fab22129afef0;hb=1117d7c3cd52cc73a757f3c6f62c6602551d7ad3#l24

here it is just collecting d0,d1,d2 *without* splitting by commas

but in between the brackets *is* split

err nowait, line 213 is where the brackets are silently discarded (spec[1:-1])

then split by comma to recognise 16, 23:24, 31

then split by colon to recognise slices from indices

so hmmm..

suggest taking f from line 210 and splitting it by comma.  if no commas skip
this next bit.

then take s from line 213

use zip on those two lists.

then *recreate* the lines as if they were actually in fields.text with "%s:
[%s]"


 d0 : [16]
 d1 ....
 d2 ....

append those together and *re-call* decodeinstrfields, and do res.update() on
the return dict.

only do that if f from line 210 has a comma in it.

sorry it is 3:30 am if that is totally confusing i can tackle it tomorrow
morning

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
libre-riscv-dev mailing list
libre-riscv-dev@lists.libre-riscv.org
http://lists.libre-riscv.org/mailman/listinfo/libre-riscv-dev

  parent reply index

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-28 11:12 [libre-riscv-dev] [Bug 269] New: " bugzilla-daemon
2020-03-28 17:35 ` [libre-riscv-dev] [Bug 269] " bugzilla-daemon
2020-03-30 15:16 ` bugzilla-daemon
2020-03-31 13:21 ` bugzilla-daemon
2020-04-01 13:42 ` bugzilla-daemon
2020-04-01 13:48 ` bugzilla-daemon
2020-04-02 15:06 ` bugzilla-daemon
2020-04-03 18:37 ` bugzilla-daemon
2020-04-03 18:45 ` bugzilla-daemon
2020-04-03 19:11 ` bugzilla-daemon
2020-04-03 19:45 ` bugzilla-daemon
2020-04-03 20:34 ` bugzilla-daemon
2020-04-03 20:55 ` bugzilla-daemon
2020-04-03 21:41 ` bugzilla-daemon
2020-04-03 22:55 ` bugzilla-daemon
2020-04-04  3:04 ` bugzilla-daemon
2020-04-04 16:45 ` bugzilla-daemon
2020-04-04 19:27 ` bugzilla-daemon
2020-04-04 19:38 ` bugzilla-daemon
2020-04-04 19:39 ` bugzilla-daemon
2020-04-04 20:28 ` bugzilla-daemon
2020-04-04 20:37 ` bugzilla-daemon
2020-04-04 20:39 ` bugzilla-daemon
2020-04-04 20:46 ` bugzilla-daemon
2020-04-04 21:36 ` bugzilla-daemon
2020-04-04 22:25 ` bugzilla-daemon
2020-04-05  4:28 ` bugzilla-daemon
2020-04-05 18:23 ` bugzilla-daemon
2020-04-05 18:55 ` bugzilla-daemon
2020-04-05 19:05 ` bugzilla-daemon
2020-04-05 19:52 ` bugzilla-daemon
2020-04-05 20:03 ` bugzilla-daemon
2020-04-05 23:27 ` bugzilla-daemon
2020-04-06  2:28 ` bugzilla-daemon [this message]
2020-04-06  2:35 ` bugzilla-daemon
2020-04-06  2:39 ` bugzilla-daemon
2020-04-06  3:07 ` bugzilla-daemon
2020-04-06 10:29 ` bugzilla-daemon
2020-04-06 11:18 ` bugzilla-daemon
2020-04-07  0:16 ` bugzilla-daemon
     [not found] <bug-269-13@https.bugs.libre-soc.org/>
2020-04-07 15:55 ` bugzilla-daemon
2020-04-07 16:57 ` bugzilla-daemon
2020-04-27 20:26 ` bugzilla-daemon
2020-04-27 20:28 ` bugzilla-daemon
2020-04-27 20:29 ` bugzilla-daemon

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=bug-269-13-CD8HVFkh4N@http.bugs.libre-riscv.org/ \
    --to=bugzilla-daemon@libre-riscv.org \
    --cc=libre-riscv-dev@lists.libre-riscv.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