Hallo,
ich bin grad dabei, einen Umsetzer zu bauen. Der soll einen 20 bit
breiten Vector, der 5 Integerzahlen enthält, in einen 40 bit breiten
Vector, der diese Zahlen als Ascii Code enthält, umsetzen. Dieser soll
dann als Datenlieferant für ein Textdisplay dienen.
Ich habe folgenden Code unten geschrieben, der syntaktisch dorch
richtig sein sollte, oder? Trotzdem kommt bei der Synthese mit dem
Webpack immer:
ERROR:HDLParsers:839 - ".../LCD_TREIBER/lcd_dec_int_to_ascii.vhd"
Line 20. Selector (Slice name of type std_logic_vector) is an
unconstrained array.
Liegt das daran, dass bei der select-Anweisung kein statischer Wert
drin steht? Oder dass er nicht weiss, ob ich überhaupt die Länge von
data_in einhalte? Eigentlich müsste es ja funzen... Vielleicht hat ja
jemand eine Idee. Habe keine Lust, die case Anweisung 5 mal zu
schreiben, das würde zwar das Probelm wohl lösen, aber das kanns ja
wohl nicht sein.
1 | entity lcd_dec_int_to_ascii is
|
2 | Port (data_in: in std_logic_vector(19 downto 0);
|
3 | data_out: out std_logic_vector(39 downto 0));
|
4 | end lcd_dec_int_to_ascii;
|
5 |
|
6 | architecture Verhalten of lcd_dec_int_to_ascii is
|
7 | begin
|
8 |
|
9 | LUT: process(data_in)
|
10 | begin
|
11 | for index in 1 to 5 loop
|
12 | case data_in(4*index-1 downto 4*index-4) is
|
13 | when x"1" => data_out(8*index-1 downto 8*index-8) <= x"31";
|
14 | when x"2" => data_out(8*index-1 downto 8*index-8) <= x"32";
|
15 | when x"3" => data_out(8*index-1 downto 8*index-8) <= x"33";
|
16 | when x"4" => data_out(8*index-1 downto 8*index-8) <= x"34";
|
17 | when x"5" => data_out(8*index-1 downto 8*index-8) <= x"35";
|
18 | when x"6" => data_out(8*index-1 downto 8*index-8) <= x"36";
|
19 | when x"7" => data_out(8*index-1 downto 8*index-8) <= x"37";
|
20 | when x"8" => data_out(8*index-1 downto 8*index-8) <= x"38";
|
21 | when x"9" => data_out(8*index-1 downto 8*index-8) <= x"39";
|
22 | when others => data_out(8*index-1 downto 8*index-8) <= x"30";
|
23 | end case;
|
24 | end loop;
|
25 | end process;
|
26 |
|
27 | end Verhalten;
|
Danke schonmal.
T.M.