OpenCores
URL https://opencores.org/ocsvn/spacewire_light/spacewire_light/trunk

Subversion Repositories spacewire_light

[/] [spacewire_light/] [trunk/] [rtl/] [vhdl/] [spwstream.vhd] - Diff between revs 4 and 5

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 4 Rev 5
Line 400... Line 400...
        end if;
        end if;
        if linko.txack = '1' then
        if linko.txack = '1' then
            -- send character
            -- send character
            v.txpacket  := not s_txfifo_rdata(8);
            v.txpacket  := not s_txfifo_rdata(8);
        end if;
        end if;
        if linko.running = '0' then
 
            -- not connected
 
            v.rxpacket  := '0';
 
            v.txpacket  := '0';
 
        end if;
 
 
 
        -- Clear the discard flag when the link is explicitly disabled.
 
        if linkdis = '1' then
 
            v.txdiscard := '0';
 
        end if;
 
 
 
        -- Update RX fifo pointers.
        -- Update RX fifo pointers.
        if (rxread = '1') and (r.rxfifo_rvalid = '1') then
        if (rxread = '1') and (r.rxfifo_rvalid = '1') then
            -- read from fifo
            -- read from fifo
            v.rxfifo_raddr  := std_logic_vector(unsigned(r.rxfifo_raddr) + 1);
            v.rxfifo_raddr  := std_logic_vector(unsigned(r.rxfifo_raddr) + 1);
Line 460... Line 450...
        -- Update room in TX fifo (use new value of txfifo_waddr).
        -- Update room in TX fifo (use new value of txfifo_waddr).
        v_tmptxroom := unsigned(r.txfifo_raddr) - unsigned(v.txfifo_waddr) - 1;
        v_tmptxroom := unsigned(r.txfifo_raddr) - unsigned(v.txfifo_waddr) - 1;
        v.txfull    := bool_to_logic(v_tmptxroom = 0);
        v.txfull    := bool_to_logic(v_tmptxroom = 0);
        v.txhalff   := not v_tmptxroom(v_tmptxroom'high);
        v.txhalff   := not v_tmptxroom(v_tmptxroom'high);
 
 
        -- If an error occurs, set a flag to discard the current packet.
        -- If the link is lost, set a flag to discard the current packet.
        if (linko.errdisc or linko.errpar or
        if linko.running = '0' then
            linko.erresc or linko.errcred) = '1' then
 
            v.rxeep     := v.rxeep or v.rxpacket;       -- use new value of rxpacket
            v.rxeep     := v.rxeep or v.rxpacket;       -- use new value of rxpacket
            v.txdiscard := v.txdiscard or v.txpacket;   -- use new value of txpacket
            v.txdiscard := v.txdiscard or v.txpacket;   -- use new value of txpacket
            v.rxpacket  := '0';
            v.rxpacket  := '0';
            v.txpacket  := '0';
            v.txpacket  := '0';
        end if;
        end if;
 
 
 
        -- Clear the discard flag when the link is explicitly disabled.
 
        if linkdis = '1' then
 
            v.txdiscard := '0';
 
        end if;
 
 
        -- Drive control signals to RX fifo.
        -- Drive control signals to RX fifo.
        s_rxfifo_raddr  <= v.rxfifo_raddr;  -- using new value of rxfifo_raddr
        s_rxfifo_raddr  <= v.rxfifo_raddr;  -- using new value of rxfifo_raddr
        s_rxfifo_wen    <= (not r.rxfull) and (linko.rxchar or r.rxeep);
        s_rxfifo_wen    <= (not r.rxfull) and (linko.rxchar or r.rxeep);
        s_rxfifo_waddr  <= r.rxfifo_waddr;
        s_rxfifo_waddr  <= r.rxfifo_waddr;
        if r.rxeep = '1' then
        if r.rxeep = '1' then

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.