You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
When given a memory with a write port that writes to only a subslice of a data word at a time, ghdl does not infer appropriate byte-enables unless the sub-slices are iterated over explicitly, and falls back to register-based storage instead.
Expected behaviour
Memory inference recognizes this pattern as a byte-enable and successfully infers the memory.
How to reproduce?
library ieee;
use ieee.std_logic_1164.all;
entityentisgeneric (
DEPTH : positive:=256
);
port (
clk: instd_logic;
write_enable: instd_logic;
write_address: innaturalrange0to DEPTH-1;
write_byte: innaturalrange0to3;
input: instd_logic_vector(7downto0);
read_address: innaturalrange0to DEPTH-1;
output: outstd_logic_vector(31downto0)
);
endentity;
architectureaofentisbeginprocess(clk)
type memory_t isarray(0to DEPTH-1) ofstd_logic_vector(31downto0);
variable memory : memory_t;
beginifrising_edge(clk) thenoutput<= memory(read_address);
if write_enable then
memory(write_address)((write_byte+1) *8-1downto write_byte *8) :=input;
-- the following works:/*for i in0to3loopif i = write_byte then
memory(write_address)((i+1) *8-1downto i *8) :=input;
endif;
endloop;
*/endif;
endif;
endprocess;
endarchitecture;
ghdl synth --std=08 ent.vhdl -e ent |& grep 'found RAM'
Context
Please, provide the following information:
Description
When given a memory with a write port that writes to only a subslice of a data word at a time, ghdl does not infer appropriate byte-enables unless the sub-slices are iterated over explicitly, and falls back to register-based storage instead.
Expected behaviour
Memory inference recognizes this pattern as a byte-enable and successfully infers the memory.
How to reproduce?
Context
Please, provide the following information:
The text was updated successfully, but these errors were encountered: