meliT
Newbie level 4
- Joined
- Jul 16, 2013
- Messages
- 5
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1
- Activity points
- 40
Dear all,
Hi.
I've got a problem synthesizing the generic mux code with
Design Compiler. As I know, it is not possible to vhdl synthesize a
2-dimentinal array with generic parameters in DC. So, I thought of
defining a new type like "wire" which is an array of std_logic_vector.
Some colleagues told me this type might be synthesizable. But I have
problem defining the new type with constant variables.
The code follows is my vhdl code for it. Is it not really possible to define an array
type with parameters?
Hi.
I've got a problem synthesizing the generic mux code with
Design Compiler. As I know, it is not possible to vhdl synthesize a
2-dimentinal array with generic parameters in DC. So, I thought of
defining a new type like "wire" which is an array of std_logic_vector.
Some colleagues told me this type might be synthesizable. But I have
problem defining the new type with constant variables.
The code follows is my vhdl code for it. Is it not really possible to define an array
type with parameters?
Code:
library IEEE;
use IEEE.std_logic_1164.all;
use IEEE.std_logic_arith.all;
use IEEE.std_logic_unsigned.all;
--------------------------
--------------------------
package type_def_pack is
constant s is integer range 1 to 5 := 1;
constant line_width is integer range 0 to 31 := 8;
type wire is array (0 to 2**s -1) of std_logic_vector(line_width-1 downto 0);
end package;
--------------------------
--------------------------
entity Generic_Mux is
generic ( line_width : integer := 8);
port ( Dinput : in wire;
sel : in std_logic_vector (s-1 downto 0);
output : out std_logic_vector(line_width-1 downto 0));
end Generic_Mux;
-------------------------
-------------------------
architecture behavioral of Generic_Mux is
BEGIN
output <= Dinput(conv_integer(sel))(line_width-1 downto 0);
END architecture behavioral;