| Summary: | nmigen general utils needed | ||
|---|---|---|---|
| Product: | Libre-SOC's first SoC | Reporter: | Luke Kenneth Casson Leighton <lkcl> |
| Component: | Source Code | Assignee: | Luke Kenneth Casson Leighton <lkcl> |
| Status: | PAYMENTPENDING FIXED | ||
| Severity: | enhancement | CC: | libre-soc-bugs |
| Priority: | --- | ||
| Version: | unspecified | ||
| Hardware: | PC | ||
| OS: | Linux | ||
| NLnet milestone: | NLnet.2019.02.012 | 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: | 62 |
| child tasks for budget allocation: | The table of payments (in EUR) for this task; TOML format: |
lkcl={amount=500, paid=2019-11-19}
|
|
| Bug Depends on: | |||
| Bug Blocks: | 62 | ||
| Attachments: | provides Record.__iter__ | ||
|
Description
Luke Kenneth Casson Leighton
2019-04-19 10:25:16 BST
occurred to me that eq is equivalent to the pattern of the python operator module. as such this would tend to suggest a name for a module where it could live: nmutil.operator. from nmutil.operator import eq this would form the pattern for additional "global" functions present in Value (such as shape, implies and part). flatten is... different, in that it is already in nmigen.tools, which in turn assumes that the nmigen object is iterable (isinstance(x, Iterable) and that in turn implies it should have an __iter__ (etc. etc.). except, the version in nmigen.tools fails because Record doesn't have an __iter__. patch for Record created (attached) Created attachment 8 [details]
provides Record.__iter__
(In reply to Luke Kenneth Casson Leighton from comment #1) > as such this would tend to suggest a name for a module where it could > live: nmutil.operator. > > from nmutil.operator import eq moved eq, shape and cat to nmoperator.py temporarily. also the two visitor classes. |