Guest
I've got a problem regarding the assignment of a GENERIC-number of
INOUT ports, specifically how something to do a "matrix transpose" on
the entity ports for the component port assignment, though I only want
a subentry. The trickiness comes from the fact that my INOUTs lack
output enables (I2C-interface).
Here are my entity and component declarations:
<code>
entity e1 is
generic
(
DATAWIDTH : positive := 8;
TRANSPOSEDWIDTH := positive := 2
)
port (
data0 : inout std_logic_vector(DATAWIDTH-1 downto 0);
data1 : inout std_logic_vector(DATAWIDTH-1 downto 0);
data2 : inout std_logic_vector(DATAWIDTH-1 downto 0);
data3 : inout std_logic_vector(DATAWIDTH-1 downto 0)
);
architecture arch of e1 is
component c1
generic
(
TRANSPOSEDWIDTH : positive := 2
);
port
(
data : inout std_logic_vector(TRANSPOSEDWIDTH-1 downto 0)
);
begin
end arch;
</code>
I want to do a transpose of the input data, giving me DATAWIDTH vectors
of 4-bits wide.
<code>
genTranspose : for i in DATAWIDTH-1 downto 0 generate
signal dataT : std_logic_vector(3 downto 0);
begin
-- ???? Can't do this without output enables ????
dataT <= data4(i) & data3(i) & data2(i) & data1(i);
c1_inst : c1
generic map
(
TRANSPOSEDWIDTH => TRANSPOSEDWIDTH
)
port map
(
-- ??????????
);
end generate genTranspose;
</code>
There are two trip-ups here:
1) can't assign the dataT signal in such a way due to the fact that
data4,3,2, and 1 are all INOUTs, and again, there are no output
enables.
2) how do I assign a subvector of dataT to the data input of component
c1 given that TRANSPOSEDWIDTH is a passed parameter? I can't
individually write out each port of c1, because I don't know how many
actually get assigned.
I've tried doing something like this:
<code>
...
port map
(
data => (0 => data0(i),
1 => data1(i),
2 => data2(i),
3 => data3(i))(TRANSPOSEWIDTH-1 downto 0),
);
...
</code>
where I try and aggregate all the signal assignments into the port
assignment (thereby eliminating the need for dataT) and then trying to
reference only a subvector of TRANSPOSEWIDTH width. However, Modelsim
didn't quite like my on-the-fly vector creation. Any ideas?
INOUT ports, specifically how something to do a "matrix transpose" on
the entity ports for the component port assignment, though I only want
a subentry. The trickiness comes from the fact that my INOUTs lack
output enables (I2C-interface).
Here are my entity and component declarations:
<code>
entity e1 is
generic
(
DATAWIDTH : positive := 8;
TRANSPOSEDWIDTH := positive := 2
)
port (
data0 : inout std_logic_vector(DATAWIDTH-1 downto 0);
data1 : inout std_logic_vector(DATAWIDTH-1 downto 0);
data2 : inout std_logic_vector(DATAWIDTH-1 downto 0);
data3 : inout std_logic_vector(DATAWIDTH-1 downto 0)
);
architecture arch of e1 is
component c1
generic
(
TRANSPOSEDWIDTH : positive := 2
);
port
(
data : inout std_logic_vector(TRANSPOSEDWIDTH-1 downto 0)
);
begin
end arch;
</code>
I want to do a transpose of the input data, giving me DATAWIDTH vectors
of 4-bits wide.
<code>
genTranspose : for i in DATAWIDTH-1 downto 0 generate
signal dataT : std_logic_vector(3 downto 0);
begin
-- ???? Can't do this without output enables ????
dataT <= data4(i) & data3(i) & data2(i) & data1(i);
c1_inst : c1
generic map
(
TRANSPOSEDWIDTH => TRANSPOSEDWIDTH
)
port map
(
-- ??????????
);
end generate genTranspose;
</code>
There are two trip-ups here:
1) can't assign the dataT signal in such a way due to the fact that
data4,3,2, and 1 are all INOUTs, and again, there are no output
enables.
2) how do I assign a subvector of dataT to the data input of component
c1 given that TRANSPOSEDWIDTH is a passed parameter? I can't
individually write out each port of c1, because I don't know how many
actually get assigned.
I've tried doing something like this:
<code>
...
port map
(
data => (0 => data0(i),
1 => data1(i),
2 => data2(i),
3 => data3(i))(TRANSPOSEWIDTH-1 downto 0),
);
...
</code>
where I try and aggregate all the signal assignments into the port
assignment (thereby eliminating the need for dataT) and then trying to
reference only a subvector of TRANSPOSEWIDTH width. However, Modelsim
didn't quite like my on-the-fly vector creation. Any ideas?