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

Subversion Repositories xulalx25soc

[/] [xulalx25soc/] [trunk/] [rtl/] [cpu/] [wbarbiter.v] - Diff between revs 21 and 117

Show entire file | Details | Blame | View Log

Rev 21 Rev 117
Line 54... Line 54...
//
//
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
//
//
`define WBA_ALTERNATING
`define WBA_ALTERNATING
module  wbarbiter(i_clk, i_rst,
module  wbarbiter(i_clk, i_rst,
        // Bus A
        // Bus A -- gets priority when not alternating
        i_a_adr, i_a_dat, i_a_we, i_a_stb, i_a_cyc, o_a_ack, o_a_stall, o_a_err,
        i_a_adr, i_a_dat, i_a_we, i_a_stb, i_a_cyc, o_a_ack, o_a_stall, o_a_err,
        // Bus B
        // Bus B
        i_b_adr, i_b_dat, i_b_we, i_b_stb, i_b_cyc, o_b_ack, o_b_stall, o_b_err,
        i_b_adr, i_b_dat, i_b_we, i_b_stb, i_b_cyc, o_b_ack, o_b_stall, o_b_err,
        // Both buses
        // Both buses
        o_adr, o_dat, o_we, o_stb, o_cyc, i_ack, i_stall, i_err);
        o_adr, o_dat, o_we, o_stb, o_cyc, i_ack, i_stall, i_err);
Line 112... Line 112...
        // first clock of the bus cycle
        // first clock of the bus cycle
        reg     r_a_owner, r_b_owner;
        reg     r_a_owner, r_b_owner;
        wire    w_a_owner, w_b_owner;
        wire    w_a_owner, w_b_owner;
`ifdef  WBA_ALTERNATING
`ifdef  WBA_ALTERNATING
        reg     r_a_last_owner;
        reg     r_a_last_owner;
        // Stall must be asserted on the same cycle the input master asserts
 
        // the bus, if the bus isn't granted to him.
 
        assign  o_a_stall = (w_a_owner) ? i_stall : 1'b1;
 
        assign  o_b_stall = (w_b_owner) ? i_stall : 1'b1;
 
 
 
`endif
`endif
        always @(posedge i_clk)
        always @(posedge i_clk)
                if (i_rst)
                if (i_rst)
                begin
                begin
Line 173... Line 169...
        // the master in question does not own the bus.  Hence we force it
        // the master in question does not own the bus.  Hence we force it
        // low if the particular master doesn't own the bus.
        // low if the particular master doesn't own the bus.
        assign  o_a_ack   = (w_a_owner) ? i_ack   : 1'b0;
        assign  o_a_ack   = (w_a_owner) ? i_ack   : 1'b0;
        assign  o_b_ack   = (w_b_owner) ? i_ack   : 1'b0;
        assign  o_b_ack   = (w_b_owner) ? i_ack   : 1'b0;
 
 
 
        // Stall must be asserted on the same cycle the input master asserts
 
        // the bus, if the bus isn't granted to him.
 
        assign  o_a_stall = (w_a_owner) ? i_stall : 1'b1;
 
        assign  o_b_stall = (w_b_owner) ? i_stall : 1'b1;
 
 
        //
        //
        //
        //
        assign  o_a_err = (w_a_owner) ? i_err : 1'b0;
        assign  o_a_err = (w_a_owner) ? i_err : 1'b0;
        assign  o_b_err = (w_b_owner) ? i_err : 1'b0;
        assign  o_b_err = (w_b_owner) ? i_err : 1'b0;
 
 

powered by: WebSVN 2.1.0

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