VHDL Typeconvertierung

OP (Firma: www.dossmatik.de) #3628459
Lesenswert?

1
  signal UDPchsum          : unsigned (16 downto 0):=(others=>'0');
2

3

4
        if wraddr(0)='1' or udp_state= chsumip4b then
5
          UDPchsum<=UDPchsum+UDPchsum(16);
6
          UDPChsum(16)<='0';
7
        end if;

ich habe eine CHecksumme, bei der das höchste Bit ein Übertrag ist und 
die ich als 1 dazuaddieren möchte. Bis jetzt werte ich es mit einer if 
Anweisung aus. Das gefällt mir nicht mehr.
Ich kann UDPchsum nicht nach integer konvertieren, das es kein Vector 
mehr ist. Gibt es hierfür eine Lösung?
OP (Firma: www.dossmatik.de) #3628748
Lesenswert?

Lothar Miller schrieb:
> René D. schrieb:
>> Ich kann UDPchsum nicht nach integer konvertieren, das es kein Vector
>> mehr ist.
> Das ist doch ein unsigned Vektor. Oder übersehe ich da was?
>
> Von einem unsigned geht die Umwandlung mit der numeric_std per
> to_integer()...

Das hatte ich auch gedacht, es ging aber nicht.
Muss nochmal heute abend schauen.
OP (Firma: www.dossmatik.de) #3629652
Lesenswert?

Geht nicht.

======================================================================== 
=
*                          HDL Parsing 
*
======================================================================== 
=
Parsing VHDL file 
"/home/red/Xilinx/ethernet/ethernetSP601/rtl/pkg_ether.vhd" into library 
work
Parsing package <pkg_ether>.
Parsing package body <pkg_ether>.
Parsing VHDL file 
"/home/red/Xilinx/ethernet/ethernetSP601/rtl/control/ether_UDP.vhd" into 
library work
Parsing entity <ether_UDP>.
Parsing architecture <Behavioral> of entity <ether_udp>.
ERROR:HDLCompiler:432 - 
"/home/red/Xilinx/ethernet/ethernetSP601/rtl/control/ether_UDP.vhd" Line 
378: Formal <arg> has no actual or default value.
INFO:HDLCompiler:1408 - 
"/build/xfndry10/P.58f/rtf/vhdl/xst/src/numeric_std.vhd" Line 701. arg 
is declared here
INFO:HDLCompiler:1408 - 
"/build/xfndry10/P.58f/rtf/vhdl/xst/src/numeric_std.vhd" Line 701. arg 
is declared here
ERROR:HDLCompiler:541 - 
"/home/red/Xilinx/ethernet/ethernetSP601/rtl/control/ether_UDP.vhd" Line 
378: Type integer is not an array type and cannot be indexed.
ERROR:HDLCompiler:854 - 
"/home/red/Xilinx/ethernet/ethernetSP601/rtl/control/ether_UDP.vhd" Line 
40: Unit <behavioral> ignored due to previous errors.
VHDL file 
/home/red/Xilinx/ethernet/ethernetSP601/rtl/control/ether_UDP.vhd 
ignored due to errors
-->


Total memory usage is 309140 kilobytes

Number of errors   :    3 (   0 filtered)
Number of warnings :    0 (   0 filtered)
Number of infos    :    0 (   0 filtered)
Gast #3631941
Lesenswert?

Nun weiss ich nicht, ob ich wirklich verstanden habe was Du machen 
willst, aber folgendes müsste gehen:

UDPchsum<=UDPchsum+UDPchsum(16 downto 16);

UDPchsum(16) ist wie Due bemerkt hast kein Vector, UDPchsum(16 downto 
16) aber schon. Ein ein-bit Vector halt.

Grüße,
Charles

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