Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Properties ignored in the translation XML to RDL #25

Closed
MarinaQT opened this issue May 31, 2023 · 9 comments
Closed

Properties ignored in the translation XML to RDL #25

MarinaQT opened this issue May 31, 2023 · 9 comments
Labels
question Further information is requested

Comments

@MarinaQT
Copy link

Hello dear PeakRDL developers

First of all, thanks a lot for the cool project and package. Started using it last week, and having helpful results!
Nevertheless having some difficulties, for example:

  1. XML => RDL
    while translating XML (ipxact 2009) to RDL, certain properties are ignored, like:
    for registers: hdl_path
    for register-files: range and width
    The register-file properties are ignored, but then if convert back RDL=>XML some kind of default value is taken...

  2. RDL => XML
    Here also the hdl_path property is ignored, when translating back into XML.
    So overall if hdl_path property supported?

  3. XML version
    then tried newer version of XML (ipxact 2014, converted with xsltproc and official stylesheet from accelera), but here the parsing in peakrdl crashes (error below)
    d['reset.value'] = self.parse_integer(get_text(value_el))
    File "/home/mdqe/PycharmProjects/pythonProject/venv/lib/python3.6/site-packages/peakrdl_ipxact/importer.py", line 691, in parse_integer
    raise ValueError

Are any of these limitations/issues already known? Any workaround available?

@MarinaQT
Copy link
Author

Did a further trial about the hdl_path property:
When declared in XML or RDL, peakrdl takes it into account for generation of the UVM pkg.
But it is not translating it when transforming input formats (from XML to RDL, and vice versa).

@amykyta3
Copy link
Member

amykyta3 commented Jun 1, 2023

IP-XACT conversion is not going to be 100% symmetrical. A good amount of features between IP-XACT and SystemRDL do indeed overlap, but not all, so some information loss will happen in the conversion. The PeakRDL projects are optimized to use SystemRDL concepts, so I'll always recommend using RDL as the primary input language.

Regarding HDL paths, see this issue ticket: SystemRDL/PeakRDL-ipxact#14
The feature overlap is a little clunky, and SystemRDL's definition of HDL paths is a little sloppy.

Regarding range/width, this is due to a difference in philosophy between IP-XACT and SystemRDL standards. IP-XACT lets you define an explicit block size, where SystemRDL does not have a mechanism to explicitly add address padding (it can only be implied by instance placement). For this reason, you might get subtle differences (see my first comment on symmetry above)

For the ValueError exception, can you attach a small example XML file so I can reproduce the issue? The importer should be able to handle all variants of IP-XACT, including all variations of integer representations.

@MarinaQT
Copy link
Author

MarinaQT commented Jun 1, 2023

Thanks a lot for quick answer.
Please find below an example of a GenericBlock XML files in three ipxact versions: 1.5, 2009 and 2014
As commented above 1.5 and 2009 can be read into peakrdl (for example for dump) and 2014 fails.
GenericBlock.zip

@MarinaQT
Copy link
Author

MarinaQT commented Jun 1, 2023

Another question please:
currently installed peakrdl inside a PyCharm project, which is running very smoothly.
For future usage, would like to install outside PyCharm, with pip install directly in the Linux command shell.
According to the documentation, it seems this is possible if Linux environment has python3 w/ version 3.6 or above (we have version 3.6.8). So have tried with following steps:

  1. Created a venv and activated it
  2. Then called setup.py provided in the peakrdl package download
    But the installation failed with message below. Can you provide any debug hints? Thanks for your attention!!
    PS.: perhaps you prefer to take this question on a separated issue... sorry
    ===================== ERROR MSG ==========================
    Traceback (most recent call last): ....
    File "/tmp/mdqe/projects/Sandbox/work-Top/data/ralgen_trial2/peakrdl-0.8.0/tutorial_env/bin/peakrdl", line 11, in
    load_entry_point('peakrdl==0.8.0', 'console_scripts', 'peakrdl')()
    ...
    File "/tmp/mdqe/projects/Sandbox/work-Top/data/ralgen_trial2/peakrdl-0.8.0/tutorial_env/lib64/python3.6/site-packages/tomli-2.0.1-py3.6.egg/tomli/_parser.py", line 5
    from future import annotations

@amykyta3
Copy link
Member

amykyta3 commented Jun 1, 2023

Ah i see the issue with the 2014 xml. It looks like the tool you are using is generating values that have expressions in them:

              <ipxact:reset>
                <ipxact:value>('hABCD) / $pow(2,0) % $pow(2,8)</ipxact:value>
                <ipxact:mask>('hffff) / $pow(2,0) % $pow(2,8)</ipxact:mask>
              </ipxact:reset>

Currently the importer assumes simple integer literals.
Should be possible to extend support for some simple constant expressions like this.

Regarding the install issue - i have not seen that before. Will have to look into it in more detail.

@MarinaQT
Copy link
Author

MarinaQT commented Jun 5, 2023

Thanks amykyta3, for the checks & hints !
Will wait your input about the installation.

In the meantime another question please concerning user-defined properties.
Was able to create user-defined properties, but these are not being reported in the html documentation.
Could it be that one has to declared these new properties via configuration options? (like shown here:
https://peakrdl.readthedocs.io/en/latest/configuring.html#plugin-specific-configuration-options
last example with
[html]
user_template_dir = "../path/to/html_templates"
extra_doc_properties = ["hw", "my_udp"]

In case yes, could you please provide an example of a TOML configuration file?
Because unfortunately there is no example of a TOML configuration file in the "Gallery of Examples".

thanks for the help & attention!

@amykyta3
Copy link
Member

amykyta3 commented Jun 6, 2023

Here is an example in the HTML generator's readme file: https://github.com/SystemRDL/PeakRDL-html#peakrdl-toml-config-options

I admit I need to improve how the PeakRDL documentation links to all the sub-component documentation. It isn't the most obvious.

@amykyta3
Copy link
Member

amykyta3 commented Jun 8, 2023

Created this issue to track the expression parsing feature: SystemRDL/PeakRDL-ipxact#18

Since it sounds like everything else we discussed has been answered, I'm closing this.
Feel free to report other issues as you find them. Thanks for all your feedback!

@amykyta3 amykyta3 closed this as completed Jun 8, 2023
@amykyta3 amykyta3 added the question Further information is requested label Jun 8, 2023
@MarinaQT
Copy link
Author

MarinaQT commented Jun 8, 2023

Hello Alex

thanks for the support, and will follow the expression-parsing issue.

Need to ask you about the installation issue mentioned above.
Could you have a look on it? Should we track it with a separated issue thread?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants