Klaus Falser schrieb:
>> Wie ist es möglich die
>> vorliegende Beschreibung noch weiter hinsichtlich Fläche zu optimieren?
> Warum nimmst Du an, dass dies viel Fläche benötigt?
Auf meinem Monitor sind das 84x47mm² = 3948mm². Das geht kleiner:
1 | process (...) begin
|
2 | next_data <= data;
|
3 | mask_data <= process_data;
|
4 | if mask_ctrl > 0 then
|
5 | next_data(mask_ctrl downto 0) <= (others=>'0');
|
6 | mask_data(mask_ctrl downto 0) <= (others=>'0');
|
7 | end if;
|
8 | end process;
|
Der vergleichbare Prozessinhalt ist auf knapp die Hälfte geschrumpft:
91x22mm² = 2002mm²
Aber hier mal der andere Ansatz: schöner... ;-)
1 | function maskiere(vect : std_logic_vector; mask : integer) return std_logic_vector is
|
2 | variable v: std_logic_vector(vect'length-1 downto 0) := vect;
|
3 | begin
|
4 | if mask>0 then v(mask downto 0) := (others=>'0'); end if;
|
5 | return v;
|
6 | end maskiere;
|
7 | :
|
8 | :
|
9 | next_data <= maskiere(data,mask_ctrl);
|
10 | mask_data <= maskiere(process_data,mask_ctrl);
|
Immer unter der Annahme natürlich, dass mask_ctrl ein Integer ist...