Skip to content

Commit

Permalink
Fixed NoneType name in Mux (#5785)
Browse files Browse the repository at this point in the history
Co-authored-by: Dragon-Git <[email protected]>


Fixed #5784
  • Loading branch information
Dragon-Git authored Aug 5, 2023
1 parent 51bf274 commit 5754dfe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontends/PyCDE/src/constructs.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,17 +188,17 @@ def Mux(sel: BitVectorSignal, *data_inputs: typing.List[Signal]):
if sel.type.width != (num_inputs - 1).bit_length():
raise TypeError("'Sel' bit width must be clog2 of number of inputs")

input_names = [
i.name if i.name is not None else f"in{idx}"
for idx, i in enumerate(data_inputs)
]
if num_inputs == 2:
m = comb.MuxOp(sel, data_inputs[1], data_inputs[0])
else:
a = ArraySignal.create(data_inputs)
a.name = "arr_" + "_".join([i.name for i in data_inputs])
a.name = "arr_" + "_".join(input_names)
m = a[sel]

input_names = [
i.name if i.name is not None else f"in{idx}"
for idx, i in enumerate(data_inputs)
]
m.name = f"mux_{sel.name}_" + "_".join(input_names)
return m

Expand Down

0 comments on commit 5754dfe

Please sign in to comment.