olofk / ipyxact

Python-based IP-XACT parser
MIT License
121 stars 47 forks source link

cannot load leon2 registers file #29

Open bat52 opened 2 years ago

bat52 commented 2 years ago

loading leon2 register description file https://github.com/bat52/cheap_pie/blob/master/devices/leon2_creg.xml fails with this error

ValueError: invalid literal for int() with base 10: '4 * (2 ** 10)'

olofk commented 8 months ago

In order to evaluate these expressions, we need to have a full systemverilog expression parser within ipyxact, which we don't. There are basically three ways to handle this.

  1. Write a full systemverilog expression parser in Python. This is probably a terrible idea that would require an insane amount of work
  2. Integrate an existing systemverilog expression parser. Perhaps we can use e.g. verible, surelog or verilator for this, but I haven't looked into how hard it would be to extract the expression parser from any of those.
  3. Handle this on a case-by-case basis and just keep adding support when we encounter issues. Long-term, this would be terrible, but might be a reasonable path forward short-term