From: bugzilla-daemon@libre-soc.org
To: libre-riscv-dev@lists.libre-riscv.org
Subject: [libre-riscv-dev] [Bug 325] create POWER9 TRAP pipeline
Date: Sun, 07 Jun 2020 02:09:30 +0000
Message-ID: <bug-325-13-0sfzZx5MZB@https.bugs.libre-soc.org/> (raw)
In-Reply-To: <bug-325-13@https.bugs.libre-soc.org/>
https://bugs.libre-soc.org/show_bug.cgi?id=325
--- Comment #71 from Cole Poirier <colepoirier@gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #68)
> actually... cole, can you do the same thing as i just did with
> msr_check_pr() create a function called trap(m, addr, nia)?
>
> except this time it is a member function of the class, so trap(self, m,
> addr, nia)
>
> and just as you see i redid comb=m.d.comb in msr_check_pr, repeat/copy the
> convenience variables that allow you to set self.o.nia etc etc
>
> the reason for making this function is because you can see it is used twice
> already.
>
> also i am thinking it may be a good idea to add the address (0x700, etc)
> actually to the trap_input_record and pass it in from the *decode* phase.
Sorry, I'm very shaky on the dynamic input records and how they work with the
decoder.
One difference between OP_TRAP and OP_SC is that the end of the OP_TRAP
function is:
```
# take a copy of the current PC in SRR0
comb += srr0_o.data.eq(cia_i) # old PC
comb += srr0_o.ok.eq(1)
```
While the end of the OP_SC function is:
```
# and store the (next-after-return) PC in SRR0
comb += srr0_o.data.eq(cia_i+4) # addr to begin from on return
comb += srr0_o.ok.eq(1)
```
So should the function be:
```
def trap(self, m, addr, nia_o, srr0_o, trap_addr):
comb = m.d.comb
comb += nia_o.data.eq(trap_addr)
comb += nia_o.ok.eq(1)
comb += srr0_o.data.eq(addr) # addr to begin from on return
comb += srr0_o.ok.eq(1)
```
The below is where my shakiness on the CompXOpSubset and the decoder starts to
confuse me. If you can briefly explain that to me here, I can use this when
doing the documentation after the tape-out deadline.
> that would allow us to do exceptions in a micro-code fashion, and also when
> it comes to illegal instructions or privileged ones, in the *decode* phase
> (PowerDecoder2) we *CHANGE* the opcode from whatever it is from the incoming
> instruction, into an OP_TRAP, set the trap address to 0x700 (or whatever)
> manually, and let the trap pipeline execute it.
(In reply to Luke Kenneth Casson Leighton from comment #69)
> see https://bugs.libre-soc.org/show_bug.cgi?id=325#c8
>
> there, the only difference between OP_TRAP and that code is: one of the bits
> of SRR is changed (to indicate "priv execution")
>
> we can pass that in as a flag to CompTrapOpSubset, and change the
> instruction to OP_TRAP.
>
> illegal instruction trap happens. ta-daaa
--
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
next prev parent reply index
Thread overview: 96+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-19 12:28 [libre-riscv-dev] [Bug 325] New: " bugzilla-daemon
2020-05-19 12:29 ` [libre-riscv-dev] [Bug 325] " bugzilla-daemon
2020-05-19 12:30 ` bugzilla-daemon
2020-05-19 14:11 ` bugzilla-daemon
2020-05-19 14:57 ` bugzilla-daemon
2020-05-19 15:49 ` bugzilla-daemon
2020-05-19 16:54 ` bugzilla-daemon
2020-05-19 18:09 ` bugzilla-daemon
2020-05-19 18:13 ` bugzilla-daemon
2020-05-19 20:43 ` bugzilla-daemon
2020-05-19 23:19 ` bugzilla-daemon
2020-05-19 23:31 ` bugzilla-daemon
2020-05-24 3:41 ` bugzilla-daemon
2020-05-24 3:43 ` bugzilla-daemon
2020-05-25 2:41 ` bugzilla-daemon
2020-05-27 14:43 ` bugzilla-daemon
2020-05-27 14:48 ` bugzilla-daemon
2020-05-27 14:49 ` bugzilla-daemon
2020-06-01 19:05 ` bugzilla-daemon
2020-06-02 11:21 ` bugzilla-daemon
2020-06-02 14:06 ` bugzilla-daemon
2020-06-02 17:54 ` bugzilla-daemon
2020-06-02 23:07 ` bugzilla-daemon
2020-06-02 23:07 ` bugzilla-daemon
2020-06-02 23:46 ` bugzilla-daemon
2020-06-02 23:54 ` bugzilla-daemon
2020-06-02 23:59 ` bugzilla-daemon
2020-06-03 0:11 ` bugzilla-daemon
2020-06-03 0:38 ` bugzilla-daemon
2020-06-03 0:47 ` bugzilla-daemon
2020-06-03 1:13 ` bugzilla-daemon
2020-06-03 1:28 ` bugzilla-daemon
2020-06-03 1:35 ` bugzilla-daemon
2020-06-03 1:41 ` bugzilla-daemon
2020-06-03 1:50 ` bugzilla-daemon
2020-06-03 2:31 ` bugzilla-daemon
2020-06-03 3:27 ` bugzilla-daemon
2020-06-04 0:29 ` bugzilla-daemon
2020-06-04 0:34 ` bugzilla-daemon
2020-06-04 22:41 ` bugzilla-daemon
2020-06-05 0:32 ` bugzilla-daemon
2020-06-05 0:35 ` bugzilla-daemon
2020-06-05 1:06 ` bugzilla-daemon
2020-06-05 1:09 ` bugzilla-daemon
2020-06-05 1:25 ` bugzilla-daemon
2020-06-05 2:13 ` bugzilla-daemon
2020-06-05 2:34 ` bugzilla-daemon
2020-06-05 3:37 ` bugzilla-daemon
2020-06-05 3:52 ` bugzilla-daemon
2020-06-05 4:19 ` bugzilla-daemon
2020-06-05 14:16 ` bugzilla-daemon
2020-06-05 15:12 ` bugzilla-daemon
2020-06-05 15:21 ` bugzilla-daemon
2020-06-05 15:33 ` bugzilla-daemon
2020-06-05 15:43 ` bugzilla-daemon
2020-06-05 15:46 ` bugzilla-daemon
2020-06-05 16:14 ` bugzilla-daemon
2020-06-05 18:14 ` bugzilla-daemon
2020-06-05 19:08 ` bugzilla-daemon
2020-06-05 19:15 ` bugzilla-daemon
2020-06-05 19:49 ` bugzilla-daemon
2020-06-05 20:12 ` bugzilla-daemon
2020-06-05 21:59 ` bugzilla-daemon
2020-06-05 22:02 ` bugzilla-daemon
2020-06-05 23:25 ` bugzilla-daemon
2020-06-05 23:46 ` bugzilla-daemon
2020-06-06 2:23 ` bugzilla-daemon
2020-06-07 0:31 ` bugzilla-daemon
2020-06-07 0:38 ` bugzilla-daemon
2020-06-07 0:39 ` bugzilla-daemon
2020-06-07 0:44 ` bugzilla-daemon
2020-06-07 0:51 ` bugzilla-daemon
2020-06-07 1:32 ` bugzilla-daemon
2020-06-07 1:42 ` bugzilla-daemon
2020-06-07 1:52 ` bugzilla-daemon
2020-06-07 2:09 ` bugzilla-daemon [this message]
2020-06-07 2:36 ` bugzilla-daemon
2020-06-07 3:09 ` bugzilla-daemon
2020-06-07 3:23 ` bugzilla-daemon
2020-06-07 6:11 ` bugzilla-daemon
2020-06-07 6:26 ` bugzilla-daemon
2020-06-07 20:42 ` bugzilla-daemon
2020-06-07 20:45 ` bugzilla-daemon
2020-06-07 20:51 ` bugzilla-daemon
2020-06-07 21:11 ` bugzilla-daemon
2020-06-07 21:18 ` bugzilla-daemon
2020-06-07 21:23 ` bugzilla-daemon
2020-06-07 21:31 ` bugzilla-daemon
2020-06-07 22:32 ` bugzilla-daemon
2020-06-07 22:34 ` bugzilla-daemon
2020-06-08 12:59 ` bugzilla-daemon
2020-06-08 13:42 ` bugzilla-daemon
2020-06-08 21:03 ` bugzilla-daemon
2020-06-08 22:51 ` bugzilla-daemon
2020-06-09 19:32 ` bugzilla-daemon
2020-06-09 20:59 ` 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-325-13-0sfzZx5MZB@https.bugs.libre-soc.org/ \
--to=bugzilla-daemon@libre-soc.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