ipv4: Change syntax to make Synplify happy
This commit is contained in:
parent
6de8d24537
commit
0db98483dc
@ -143,10 +143,17 @@ begin
|
|||||||
|
|
||||||
signal full_length : ipv4_length;
|
signal full_length : ipv4_length;
|
||||||
|
|
||||||
|
signal sr : byte_vector(0 to 19);
|
||||||
|
signal byte_cnt : integer range 0 to sr'length - 1;
|
||||||
|
signal alt_byte : std_logic;
|
||||||
|
signal checksum : unsigned(20 downto 0); -- 20 Header fields -> 19 chances for carry -> 5 additional bits
|
||||||
|
signal checksum_ones : unsigned(15 downto 0);
|
||||||
|
|
||||||
constant TTL : byte := x"40";
|
constant TTL : byte := x"40";
|
||||||
impure function get_header(checksum : std_logic_vector(15 downto 0)) return byte_vector is
|
impure function get_header(checksum : std_logic_vector(15 downto 0)) return byte_vector is
|
||||||
|
variable ret : byte_vector(sr'range);
|
||||||
begin
|
begin
|
||||||
return --
|
ret := --
|
||||||
byte_vector'(
|
byte_vector'(
|
||||||
x"45", x"00", byte(full_length(15 downto 8)), byte(full_length(7 downto 0)), -- Ver/IHL, DSCP/ECN, Len
|
x"45", x"00", byte(full_length(15 downto 8)), byte(full_length(7 downto 0)), -- Ver/IHL, DSCP/ECN, Len
|
||||||
x"00", x"00", x"00", x"00" -- Identification, Flags/FragOffset
|
x"00", x"00", x"00", x"00" -- Identification, Flags/FragOffset
|
||||||
@ -154,16 +161,10 @@ begin
|
|||||||
ipv4_config.ip_address & -- Source IP
|
ipv4_config.ip_address & -- Source IP
|
||||||
ipv4_in.tx_ip_address -- Destination IP
|
ipv4_in.tx_ip_address -- Destination IP
|
||||||
;
|
;
|
||||||
|
return ret;
|
||||||
end function get_header;
|
end function get_header;
|
||||||
|
|
||||||
constant PSEUDO_HEADER : byte_vector := get_header(x"0000");
|
|
||||||
signal sr : byte_vector(PSEUDO_HEADER'range);
|
|
||||||
signal byte_cnt : integer range 0 to sr'length - 1;
|
|
||||||
signal alt_byte : std_logic;
|
|
||||||
signal checksum : unsigned(20 downto 0); -- 20 Header fields -> 19 chances for carry -> 5 additional bits
|
|
||||||
signal checksum_ones : unsigned(15 downto 0);
|
|
||||||
begin
|
begin
|
||||||
full_length <= PSEUDO_HEADER'length + ipv4_in.tx_length;
|
full_length <= sr'length + ipv4_in.tx_length;
|
||||||
checksum_ones <= checksum(15 downto 0) + checksum(checksum'high downto 16);
|
checksum_ones <= checksum(15 downto 0) + checksum(checksum'high downto 16);
|
||||||
|
|
||||||
tx_fsm : process(clk, rst) is
|
tx_fsm : process(clk, rst) is
|
||||||
|
Loading…
Reference in New Issue
Block a user