| Summary: | introduce XLEN-friendly helper class which aggregates all helpers | ||
|---|---|---|---|
| Product: | Libre-SOC's first SoC | Reporter: | Dmitry Selyutin <ghostmansd> |
| Component: | Source Code | Assignee: | Luke Kenneth Casson Leighton <lkcl> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | libre-soc-bugs, maciej.pijanowski |
| Priority: | --- | ||
| Version: | unspecified | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| See Also: |
https://bugs.libre-soc.org/show_bug.cgi?id=684 https://bugs.libre-soc.org/show_bug.cgi?id=671 |
||
| NLnet milestone: | NLNet.2019.10.046.Standards | total budget (EUR) for completion of task and all subtasks: | 500 |
| budget (EUR) for this task, excluding subtasks' budget: | 500 | parent task for budget allocation: | 241 |
| child tasks for budget allocation: | The table of payments (in EUR) for this task; TOML format: |
ghostmansd = { amount = 325, paid = 2021-11-01 }
maciej = 75
[lkcl]
amount = 100
submitted = 2021-12-09
paid = 2021-12-09
|
|
|
Description
Dmitry Selyutin
2021-09-25 17:11:12 BST
the basis of this one is as dmitry says, XLEN needs to be available to all helpers, and we are not going to modify the functions to add it as an argument. so the only other way is to drop all helper routines (including those compiled by pyfnwriter) into a class, which ISACaller happens to inherit from. that in turn means that a list of all helper routines needs to be created.... OR the helper.py class actually imported and introspection used. for pyfnwriter functions that technique will not work because the routines themselves are in fact autogenerated *by* the parser, so will have to be handled differently. this all unfortunately needs to be done in "one hit" so sigh a branch is, reluctantly, probably the most sensible option. The class with the redirection logic is submitted. Functions will migrate from the global scope on demand to minimize changes at this stage. looks great dmitry, pyfnwriter should be checked, then i think we're good. I thought about these for a while, they have one problem. We run pywriter and pyfnwriter as separate stages; one doesn't know of another. We can for sure collect names which we met so far in pyfnwriter stage; but these are unavailable outside of pyfnwriter, so pywriter have no idea which names should be checked w.r.t. "self." prefix addition before the call. Any ideas? The simpler option would be to add "self." prefix unconditionally and distribute everything as part of our class; I feel, however, that this might bring other problems in the future. What's your take on this? If the first option is good, I have a patch which already takes care of all `def` sections for pywriter. Perhaps `pyfnwriter` could expose these as part of build or maybe via special option, and `pywriter` could re-use the list. pyfnwriter should be generating "self." in front of everything, yes. however, annoyingly, this looks like either a 2 pass situation or just having an explicit list. BCD_TO_DPD etc temporarily need to be added to the list |