Zuweisung zund zusammensetzen

Gast #2435654
Lesenswert?

Ich musste die zwei Zeilen auskommentieren. Diese kommen nicht durch. 
ICh habe mir ersteinmal mit dem Operator & geholfen. Es gibt aber diese 
Schreibweise. Leider ist mir der Fachbegriff entwichen um nachzuschauen.

Das ist trivial, ich weiss. Stehe gerade nur auf dem Schlauch.
1
mem_data_r<= (others=>'Z')    when uart_select='0'   else
2
             "ZZZZZZZZZZZZZZZZZZZZZZZZ"& receive_data when mem_address(2)='0'
3
--        ((7 downto 0)=> receive_data,others=>'Z') when mem_address(2)='0'
4
--        else(0=>send_busy,8=>receive_empty,others=>'0');
5
        else "ZZZZZZZZZZZZZZZZZZZZZZZZ" & send_busy & "ZZZZZZ" & receive_empty;
Gast #2436000
Lesenswert?

else vergessen?
mem_data_r<= (others=>'Z')    when uart_select='0'
   else "ZZZZZZZZZZZZZZZZZZZZZZZZ"& receive_data when mem_address(2)='0'
   else ((7 downto 0)=> receive_data,others=>'Z') when 
mem_address(2)='0'
   else (0=>send_busy,8=>receive_empty,others=>'0');
Moderator (Firma: Titel) Persönliche Seite #2436773
Lesenswert?

dose schrieb:
> Ich musste die zwei Zeilen auskommentieren.
Warum?
Welche Fehlermeldung bekommst du?

Diese beidne Zeilen sind funktional unterschiedlich:
1
--        else(0=>send_busy,8=>receive_empty,others=>'0');
2
        else "ZZZZZZZZZZZZZZZZZZZZZZZZ" & send_busy & "ZZZZZZ" & receive_empty;

Ich halte es für kritisch, Busse partiell hochohimg zu schalten. Wofür 
soll das gut sein? Treiben da andere Komponenten auf diese hochohmigen 
Signale?
(Firma: www.dossmatik.de) #2437134
Lesenswert?

> Welche Fehlermeldung bekommst du?

Das weiss ich nicht mehr. Die Meldung hatte "Primery.........
Ich hatte vermutet ISE kommt mit (7 downto 0) nicht klar.

Die Z habe ich schon auf 0 umgestellt. Eigentlich ist der Zustand der 
restlichen Leitungen mir egal. Da könnte ich auch X nehmen. Doch dann 
ist in der Simulation alles rot und man findet die eigentlichen Fehler 
nicht mehr.
(Firma: www.dossmatik.de) #2438200
Lesenswert?

Zu den genauen Fehlermeldungen aus ISE und GHDL.
Da beide einen Fehler ausspucken, scheint als wäre etwas nicht 
semantisch. Sofern wäre es interessant zu wissen.

1
mem_data_r<= (others=>'Z')    when uart_select='0'   else
2
 --            X"000000"& receive_data when mem_address(2)='0' 
3
        ((7 downto 0)=> receive_data,(others=>'0')) when mem_address(2)='0'
4
        else(0=>send_busy,8=>receive_empty,(others=>'0'));
5
--      else X"000000" & send_busy & "000000" & receive_empty;
6

7

8
mem_data_r<= (others=>'Z')    when uart_select='0'   else
9
 --            X"000000"& receive_data when mem_address(2)='0' 
10
        ((7 downto 0)=> receive_data,(others=>'0')) when mem_address(2)='0'  --zeile 109
11
        else(0=>send_busy,8=>receive_empty,(others=>'0'));
12
--      else X"000000" & send_busy & "000000" & receive_empty;

 Fehlermeldung in ISE

Parsing architecture <logic> of entity <uart>.
ERROR:HDLCompiler:806 - 
"/home/red/projekt/mips/LM_CPU/rtl/device/uart/uart.vhd" Line 109: 
Syntax error near ")".
ERROR:HDLCompiler:720 - 
"/home/red/projekt/mips/LM_CPU/rtl/device/uart/uart.vhd" Line 109: 
Positional association cannot follow named association
ERROR:HDLCompiler:720 - 
"/home/red/projekt/mips/LM_CPU/rtl/device/uart/uart.vhd" Line 110: 
Positional association cannot follow named association
ERROR:HDLCompiler:1699 - 
"/home/red/projekt/mips/LM_CPU/rtl/device/uart/uart.vhd" Line 109: Type 
error near receive_data ; current type std_logic_vector; expected type 
std_ulogic
ERROR:HDLCompiler:845 - 
"/home/red/projekt/mips/LM_CPU/rtl/device/uart/uart.vhd" Line 109: Type 
of aggregate cannot be determined without context ; 0 visible types 
match here
ERROR:HDLCompiler:845 - 
"/home/red/projekt/mips/LM_CPU/rtl/device/uart/uart.vhd" Line 110: Type 
of aggregate cannot be determined without context ; 0 visible types 
match here
ERROR:HDLCompiler:854 - 
"/home/red/projekt/mips/LM_CPU/rtl/device/uart/uart.vhd" Line 53: Unit 
<logic> ignored due to previous errors.
VHDL file /home/red/projekt/mips/LM_CPU/rtl/device/uart/uart.vhd ignored 
due to errors
-->

Fehlermeldung in ghdl
../rtl/device/uart/uart.vhd:109:38: '=>' is expected instead of ')'
ghdl: compilation error



Weitere Variation
1
mem_data_r<= (others=>'Z')    when uart_select='0'   else
2
             X"000000"& receive_data when mem_address(2)='0' 
3
--        ((7 downto 0)=> receive_data,(others=>'0')) when mem_address(2)='0'
4
        else(0=>send_busy,8=>receive_empty,(others=>'0'));
5
--      else X"000000" & send_busy & "000000" & receive_empty;
ISE
Parsing architecture <logic> of entity <uart>.
ERROR:HDLCompiler:720 - 
"/home/red/projekt/mips/LM_CPU/rtl/device/uart/uart.vhd" Line 110: 
Positional association cannot follow named association
ERROR:HDLCompiler:845 - 
"/home/red/projekt/mips/LM_CPU/rtl/device/uart/uart.vhd" Line 110: Type 
of aggregate cannot be determined without context ; 0 visible types 
match here
ERROR:HDLCompiler:854 - 
"/home/red/projekt/mips/LM_CPU/rtl/device/uart/uart.vhd" Line 53: Unit 
<logic> ignored due to previous errors.
VHDL file /home/red/projekt/mips/LM_CPU/rtl/device/uart/uart.vhd ignored 
due to errors

GHDL
../rtl/device/uart/uart.vhd:110:31: element associations must be all 
positional or all named
ghdl: compilation error
make: *** [all] Error 1

Antwort schreiben

Bitte melde dich an, um einen Beitrag zu schreiben.

oder

Mit Google-Account einloggen

Die Registrierung ist kostenlos und dauert nur eine Minute.

Jetzt registrieren