[Libre-soc-bugs] [Bug 758] pypowersim and how to run bare metal programs/functions is needed

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Tue Jun 28 19:59:22 BST 2022


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

--- Comment #7 from Luke Kenneth Casson Leighton <lkcl at lkcl.net> ---
(In reply to Andrey Miroshnikov from comment #6)
> Updated the wiki page, have a look if this is sufficient:
> https://libre-soc.org/docs/pypowersim/

notes look good for an overview, note that it doesn't "run SV", it is
an *actual* Power ISA simulator, which happens to have had support for
SV added to it.  this becomes relevant, below.

now let's go onto an actual program.

https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/test/basic_pypowersim/Makefile;hb=HEAD

https://git.libre-soc.org/?p=openpower-isa.git;a=blob;f=src/test/basic_pypowersim/test.s;hb=HEAD

note that test.s has absolutely no SVP64 instructions in it whatsoever?


   3         lis 2, 0x2000
   4         ori 2, 2, 0x0100

this is loading the constant 0x2000_0100 into r2.

which is then used in the next two instructions:

   5         std 1, 0(2)
   6         lhz 1, 4(2)

and, surpriiise! back in Makefile:

  14                   --dump testout2.bin:0x20000100:8 \

8 bytes at memory location 0x2000_0100 are "dumped" into testout2.bin
and are found to contain 0xdeadbeef

   1         lis 1, 0xdead     # test comment
   2         ori 1, 1, 0xbeef

which was exactly what was put into r1.

so again there's a trail there.  it's an *actual* Power ISA simulator.
it's not "an executor of SV assembler".

      Assembler code written in SV is 

this is wrong.  it's a *binary* Power ISA simulator.  pysvp64asm happens
to be a temporary solution to insert SVP64 assembler (Dmitry's working
on binutils gas to actually add SVP64 support)

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


More information about the libre-soc-bugs mailing list