Commit graph

14 commits

Author SHA1 Message Date
Wanda 77dab7884c hdl._dsl: raise an error when modifying an already-elaborated Module.
This renames the `FrozenMemory` exception to `AlreadyElaborated`
and reuses it for modules.

Fixes #1350.
2024-05-18 00:59:00 +00:00
Catherine 7dd93bea57 Document RFC 62.
This includes a few minor code changes:
- Removing redundant `lib.memory.Memory.Init = hdl.MemoryData.Init`
  re-export;
- Renaming `FrozenError` to `FrozenMemory` and moving it to `.hdl`;
- Marking `ReadPort` and `WritePort` as `@final`.
2024-04-09 15:52:34 +00:00
Wanda 09d5540430 hdl._mem: add MemoryData class.
This implements half of RFC 62. The `MemoryData._Row` class will be
implemented later, as a follow-up.
2024-04-02 14:58:23 +00:00
Wanda 6ffafef794 lib.memory: raise an error on mutating already-elaborated memory. 2024-03-25 18:40:20 +00:00
Catherine 6ce82848d9 lib.memory: Memory.{r,w}_ports.{read,write}_ports.
The abbreviated form was initially added to match `lib.fifo`, but it
looks very out of place on `lib.memory`, and we may be moving away from
such heavy use of abbreviations anyway.

While technically a breaking change, these attributes have very narrow
usefulness and so this change qualifies as "minor".
2024-03-22 23:05:42 +00:00
Catherine 2333c5f0af lib.memory: expand Memory.Init.__repr__().
Display `shape` and `depth` also. `depth` is redundant although useful
for ease of reading (there are always `depth` elements shown), but
`shape` was just lost.
2024-03-22 23:05:42 +00:00
Catherine fc84b8decf lib.memory: remove Memory.Init.depth.
This attribute is fully redundant with `.__len__()`, and is out of place
on a `list`-like container like `Memory.Init`.

The `.shape` attribute, however, provides a unique function.
2024-03-22 23:05:42 +00:00
Catherine b8b1e7081b lib.memory: improve and regularize diagnostics. 2024-03-22 23:05:42 +00:00
Catherine 8d44ec513d lib.memory: improve and finish documentation. 2024-03-22 23:05:42 +00:00
Wanda 23f1b63425 lib.memory: Add Signature.create implementations. 2024-03-16 08:48:32 +00:00
Wanda 49dee891e8 tests: Exorcise some star-imports. 2024-03-13 18:03:22 +00:00
Wanda 455a7bc6c8 lib.memory: Allow setting Memory.init.
The `init` property is already mutable, so this adds no actual new
functionality, just convenience.
2024-03-13 13:12:15 +00:00
Wanda 8af9fe2606 lib.memory: Add missing __eq__ to signature types. 2024-02-28 09:06:49 +00:00
Wanda 890e099ec3 Implement RFC 45: Move hdl.Memory to lib.Memory. 2024-02-19 22:24:58 +00:00