Skip to content

Commit

Permalink
RFC #65: fix accidental duplication in code.
Browse files Browse the repository at this point in the history
  • Loading branch information
whitequark authored May 5, 2024
1 parent 465657c commit ed2956f
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions text/0065-format-struct-enum.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,6 @@ class MyStruct(ShapeCastable):
def format(self, obj, spec):
assert spec == ""
return Format("{{a: {}, b: {}, c: {}}}", obj.a, obj.b, obj.c)
return Format.Struct(Value.cast(obj), {
# Assume obj.a, obj.b, obj.c are accessors that return the struct fields as ValueLike.
"a": Format("{}", obj.a),
"b": Format("{}", obj.b),
"c": Format("{}", obj.c),
})
```

with the added benefit that any `MyStruct`-shaped signal will automatically have per-field traces included in VCD output and per-field wires included in RTLIL output.
Expand Down Expand Up @@ -162,4 +156,4 @@ None.
## Future possibilities
[future-possibilities]: #future-possibilities

The current `decoder` interface on `Signal` could be deprecated and retired.
The current `decoder` interface on `Signal` could be deprecated and retired.

0 comments on commit ed2956f

Please sign in to comment.