[libre-riscv-dev] [Bug 325] create POWER9 TRAP pipeline

bugzilla-daemon at libre-soc.org bugzilla-daemon at libre-soc.org
Fri Jun 5 20:49:44 BST 2020


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

--- Comment #56 from Cole Poirier <colepoirier at gmail.com> ---
(In reply to Luke Kenneth Casson Leighton from comment #55)
> whatever is in the PDF from the spec.  the format however has to be
> *exactly* like the others, down to the linebreaks, because it is machine
> readable.
> 
> see pywriter.py,in the top level Makefile.
> 
> so you can test it before committing

Apologies Luke, after 20 minutes of checking and rechecking the psuedo code
against the PDF and making lots of small modifications I am unable to get
pywriter to complete. It errors with the following stack trace, I think I
require your assistance.

```
UnusedElaboratable: Enable tracemalloc to get the object allocation traceback
[None, <_ast.Name object at 0x7f19c3d02320>, '=', <_ast.Constant object at
0x7f19c3d02358>]
Traceback (most recent call last):
  File "src/soc/decoder/pseudo/pywriter.py", line 135, in <module>
    isa.write_pysource(source)
  File "src/soc/decoder/pseudo/pywriter.py", line 58, in write_pysource
    pycode, rused = convert_to_python(pcode, d.form)
  File "/home/colepoirier/src/soc/src/soc/decoder/power_pseudo.py", line 219,
in convert_to_python
    tree = gsc.compile(pcode, mode="exec", filename="string")
  File "/home/colepoirier/src/soc/src/soc/decoder/pseudo/parser.py", line 797,
in compile
    tree = self.parser.parse(code)
  File "/home/colepoirier/src/soc/src/soc/decoder/pseudo/parser.py", line 784,
in parse
    result = self.parser.parse(code, lexer=self.lexer, debug=self.debug)
  File "/usr/local/lib/python3.7/dist-packages/ply-3.11-py3.7.egg/ply/yacc.py",
line 333, in parse
    return self.parseopt_notrack(input, lexer, debug, tracking, tokenfunc)
  File "/usr/local/lib/python3.7/dist-packages/ply-3.11-py3.7.egg/ply/yacc.py",
line 1201, in parseopt_notrack
    tok = call_errorfunc(self.errorfunc, errtoken, self)
  File "/usr/local/lib/python3.7/dist-packages/ply-3.11-py3.7.egg/ply/yacc.py",
line 192, in call_errorfunc
    r = errorfunc(token)
  File "/home/colepoirier/src/soc/src/soc/decoder/pseudo/parser.py", line 767,
in p_error
    raise SyntaxError(p)
SyntaxError: LexToken(NUMBER,48,2,29)
```

I cannot identify what in my current pseudo-code is causing this problem:

```
 # Move To Machine State Register

 X-Form

 * mtmsr RS,L

     if L = 0 then
       MSR48 <- (RS)48 | (RS)49
       MSR58 <- ((RS)58 | (RS)49)
         & ¬(MSR41 & MSR3 & (¬(RS)49))
       MSR59 <- ((RS)59 | (RS)49)
         & ¬(MSR41 & MSR3 & (¬(RS)49))
       MSR32:40 42:47 49:50 52:57 60:62
         <- (RS)32:40 42:47 49:50 52:57 60:62
     else
       MSR48 62 <- (RS)48 62

 Special Registers Altered:

     MSR

 # Move From Machine State Register

 X-Form

 * mfmsr RT

     RT <- MSR

 Special Registers Altered:

     None

```

> 
> > 
> > Additionally should the pseudo code for OP_SC from comment 38 be added to
> > sprset.mdwn as well?
> 
> grep sc or scv *.mdwn and you'll find those are in system.mdwn already.

Ah yes thank you, I mistakenly thougt OP_SC because I worked on it at the same
time as MTMSR and MFMSR belonged to sprset not system.

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


More information about the libre-riscv-dev mailing list