O
Olaf
Guest
Hello,
I have the following code:
entity ...
generic (
SMPL_WIDTH : integer range 2 to 32 := 32;
TS_WIDTH : integer range 2 to 32 := 32;
SMPL_DEPTH : integer range 2 to 1048576 := 16384;
...
port (
smpl_clk : in std_ulogic;
reset : in std_ulogic;
sample : in std_ulogic_vector(SMPL_WIDTH-1 downto 0);
...
end entity;
architecture behavioral ...
type smpl_memory_t is array (SMPL_DEPTH-1 downto 0) of
std_ulogic_vector (sample'range);
type ts_memory_t is array (SMPL_DEPTH-1 downto 0) of
std_ulogic_vector (TS_WIDTH-1 downto 0);
signal smpl_memory : smpl_memory_t;
signal ts_memory : ts_memory_t;
signal we : std_ulogic;
signal en : std_ulogic;
signal addr : std_ulogic_vector(log2(SMPL_DEPTH)-1 downto 0);
signal smpl_di : std_ulogic_vector(smpl_memory'range);
signal smpl_do : std_ulogic_vector(smpl_memory'range);
signal ts_di : std_ulogic_vector(ts_memory'range);
signal ts_do : std_ulogic_vector(ts_memory'range);
signal ts_smpl_data : std_ulogic_vector(63 downto 0);
begin
smpl_di <= sample;
ts_di <= ts_count;
ts_smpl_data(63 downto 32) <=
(ts_smpl_data(ts_do'range) => ts_do, others => '0');
ts_smpl_data(31 downto 0) <=
(ts_smpl_data(smpl_do'range) => smpl_do, others => '0');
ts_ram: process ...
smpl_ram: process ...
The goal is to align the vectors ts_do and smpl_do to a 32bit boundary;
the upper 32-bit word should hold the ts_do and the lower the smpl_do
regardless of the length of each vector. Unused bits should be tied to
'0'. Therefore the 64-bit data word is independ of the length of ts_do
and smpl_do.
Anyway, this won't compile in that manner. What is the correct syntax
for this?
Thanks
Olaf
I have the following code:
entity ...
generic (
SMPL_WIDTH : integer range 2 to 32 := 32;
TS_WIDTH : integer range 2 to 32 := 32;
SMPL_DEPTH : integer range 2 to 1048576 := 16384;
...
port (
smpl_clk : in std_ulogic;
reset : in std_ulogic;
sample : in std_ulogic_vector(SMPL_WIDTH-1 downto 0);
...
end entity;
architecture behavioral ...
type smpl_memory_t is array (SMPL_DEPTH-1 downto 0) of
std_ulogic_vector (sample'range);
type ts_memory_t is array (SMPL_DEPTH-1 downto 0) of
std_ulogic_vector (TS_WIDTH-1 downto 0);
signal smpl_memory : smpl_memory_t;
signal ts_memory : ts_memory_t;
signal we : std_ulogic;
signal en : std_ulogic;
signal addr : std_ulogic_vector(log2(SMPL_DEPTH)-1 downto 0);
signal smpl_di : std_ulogic_vector(smpl_memory'range);
signal smpl_do : std_ulogic_vector(smpl_memory'range);
signal ts_di : std_ulogic_vector(ts_memory'range);
signal ts_do : std_ulogic_vector(ts_memory'range);
signal ts_smpl_data : std_ulogic_vector(63 downto 0);
begin
smpl_di <= sample;
ts_di <= ts_count;
ts_smpl_data(63 downto 32) <=
(ts_smpl_data(ts_do'range) => ts_do, others => '0');
ts_smpl_data(31 downto 0) <=
(ts_smpl_data(smpl_do'range) => smpl_do, others => '0');
ts_ram: process ...
smpl_ram: process ...
The goal is to align the vectors ts_do and smpl_do to a 32bit boundary;
the upper 32-bit word should hold the ts_do and the lower the smpl_do
regardless of the length of each vector. Unused bits should be tied to
'0'. Therefore the 64-bit data word is independ of the length of ts_do
and smpl_do.
Anyway, this won't compile in that manner. What is the correct syntax
for this?
Thanks
Olaf