Skip to content

Commit 0743208

Browse files
authored
Single-bit std_logic to a slice (ghdl) (#28)
* peakrdl-regblock-vhdl used (0 => value) when assigning single-bit std_logic to a slice, instead of (low => value), causing “choice is out of index range” when low != 0 * Fix to use to_std_logic_vector instead of =>
1 parent 91895d5 commit 0743208

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/peakrdl_regblock_vhdl/readback/generators.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def process_buffered_reg_with_bypass(self, node: RegNode, regwidth: int, accessw
248248

249249
if field.width == 1:
250250
# convert from std_logic to std_logic_vector
251-
value = f"(0 => {value})"
251+
value = f"to_std_logic_vector({value})"
252252
self.add_content(f"readback_array({self.current_offset_str})({field.high} downto {field.low}) <= {value} when {rd_strb} else (others => '0');")
253253
bidx = field.high + 1
254254

@@ -317,7 +317,7 @@ def process_wide_reg(self, node: RegNode, accesswidth: int) -> None:
317317

318318
if field.width == 1:
319319
# convert from std_logic to std_logic_vector
320-
value = f"(0 => {value})"
320+
value = f"to_std_logic_vector({value})"
321321
self.add_content(f"readback_array({self.current_offset_str})({high} downto {low}) <= {value} when {rd_strb} else (others => '0');")
322322

323323
current_bit = field.high + 1

0 commit comments

Comments
 (0)