From: Michael Nolan <mtnolan2640@gmail.com>
To: Luke Kenneth Casson Leighton <lkcl@lkcl.net>,
Libre-RISCV General Development
<libre-riscv-dev@lists.libre-riscv.org>
Subject: Re: [libre-riscv-dev] extremely busy crowdsupply update started
Date: Sat, 28 Mar 2020 14:07:19 -0400
Message-ID: <9e50160c-5105-7a0c-0add-851dd14abb41@gmail.com> (raw)
In-Reply-To: <CAPweEDw_h8VQ3JJFF3FXph7Eg0ucVknuvMk=Xc0jSp0WP13=UQ@mail.gmail.com>
On 3/26/20 5:03 PM, Luke Kenneth Casson Leighton wrote:
>
> if you prefer just reply to this message with a paragraph or two and i
> will cut/paste it?
>
> l.
The decoder we have is based on that of IBM's [microwatt reference
design](https://github.com/antonblanchard/microwatt). Because
microwatt's decoder is quite regular, consisting of a bunch of large
switch statements returning fields of a struct, we elected not to
pursue a direct conversion of the VHDL to nmigen. Instead, we
extracted the information in the switch statements into several CSV
tables, and leveraged nmigen to construct the decoder from these
tables. We applied the same technique to extract the subfields
(register numbers, branch offset, immediates, etc.) from the
instruction, where Luke converted the information in the POWER ISA
specification to text, and wrote a module in python to extract those
fields from an instruction.
To test the decoder, we initially verified it against the tables we
extracted, and manually against the power ISA specification. Later
however, we came up with the idea of verifying the decoder against the
output of the GNU assembler. This is done by selecting an instruction
type (integer reg/reg, integer immediate, load store, etc), and
randomly selecting the opcode, registers, immediates, and other
operands. We then feed this instruction to GNU AS to assemble, and
then the assembled instruction is sent to our decoder. From this, we
can then verify that the output of the decoder matches what was generated
earlier.
We also explored using a similar idea to test the functionality of the
entire SOC. By using the [QEMU](https://www.qemu.org/) powerpc
emulator, we can compare the execution of our SOC against that of the
emulator to verify that our decoder and backend are working correctly.
We would write snippets of test code (or potentially randomly generate
instructions) and send the resulting binary to both the SOC and
QEMU. We would then simulate our SOC until it was finished executing
instructions, and use Qemu's gdb interface to do the same. We would
then use Qemu's gdb interface to compare the register file and memory
with that of our SOC to verify that it is working correctly. I did
some experimentation using this technique to verify a rudimentary
simulator of the SOC backend, and it seemed to work quite well.
_______________________________________________
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: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-26 21:03 Luke Kenneth Casson Leighton
2020-03-27 5:49 ` Jacob Lifshay
2020-03-27 8:47 ` Luke Kenneth Casson Leighton
2020-03-27 21:31 ` Jacob Lifshay
2020-03-27 21:36 ` Luke Kenneth Casson Leighton
2020-03-31 4:18 ` Jacob Lifshay
2020-03-27 14:39 ` Immanuel, Yehowshua U
2020-03-27 15:49 ` Luke Kenneth Casson Leighton
2020-03-27 16:35 ` Tobias Platen
2020-03-27 19:20 ` Luke Kenneth Casson Leighton
2020-03-27 21:29 ` Jacob Lifshay
2020-03-27 21:32 ` Luke Kenneth Casson Leighton
2020-03-28 11:52 ` Luke Kenneth Casson Leighton
2020-03-27 16:56 ` Michael Nolan
2020-03-27 19:21 ` Luke Kenneth Casson Leighton
2020-03-28 8:09 ` Jock Tanner
2020-03-28 10:02 ` Luke Kenneth Casson Leighton
2020-03-28 16:44 ` Jean-Paul Chaput
2020-03-28 17:13 ` Luke Kenneth Casson Leighton
2020-03-31 8:17 ` Jean-Paul Chaput
2020-03-31 9:31 ` Luke Kenneth Casson Leighton
2020-03-31 9:32 ` Luke Kenneth Casson Leighton
2020-03-31 9:38 ` [libre-riscv-dev] pyobjc, gnu objective-c and gnustep Luke Kenneth Casson Leighton
2020-03-31 11:42 ` lkcl .
2020-03-31 14:11 ` Jean-Paul Chaput
2020-03-31 14:30 ` lkcl .
2020-03-31 16:16 ` Jacob Lifshay
2020-03-28 17:14 ` [libre-riscv-dev] extremely busy crowdsupply update started Luke Kenneth Casson Leighton
2020-03-28 23:16 ` Luke Kenneth Casson Leighton
2020-03-29 13:23 ` Jock Tanner
2020-03-29 13:46 ` Luke Kenneth Casson Leighton
2020-03-29 10:46 ` Jock Tanner
2020-03-29 11:22 ` Luke Kenneth Casson Leighton
2020-03-29 16:05 ` Immanuel, Yehowshua U
2020-03-29 16:26 ` Luke Kenneth Casson Leighton
2020-03-28 18:07 ` Michael Nolan [this message]
2020-03-28 18:33 ` Luke Kenneth Casson Leighton
2020-03-31 11:17 ` Luke Kenneth Casson Leighton
2020-03-29 3:14 ` Immanuel, Yehowshua U
2020-03-29 3:15 ` Immanuel, Yehowshua U
2020-03-31 11:26 ` Luke Kenneth Casson Leighton
2020-03-31 18:09 ` Luke Kenneth Casson Leighton
2020-03-31 18:14 ` Luke Kenneth Casson Leighton
2020-04-01 1:51 ` [libre-riscv-dev] name change announcement on crowdsupply Jacob Lifshay
2020-04-01 1:52 ` Jacob Lifshay
2020-04-01 10:57 ` Luke Kenneth Casson Leighton
2020-04-01 17:31 ` Jacob Lifshay
2020-04-01 17:44 ` Luke Kenneth Casson Leighton
2020-03-31 18:35 ` [libre-riscv-dev] extremely busy crowdsupply update started Cole Poirier
2020-03-31 23:11 ` Cole Poirier
2020-04-01 10:08 ` Luke Kenneth Casson Leighton
2020-04-01 10:54 ` Luke Kenneth Casson Leighton
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=9e50160c-5105-7a0c-0add-851dd14abb41@gmail.com \
--to=mtnolan2640@gmail.com \
--cc=libre-riscv-dev@lists.libre-riscv.org \
--cc=lkcl@lkcl.net \
/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