2015-06-30 13:32:05 +02:00
|
|
|
`include "elink_regmap.v"
|
2015-05-12 07:41:48 -04:00
|
|
|
module erx_arbiter (/*AUTOARG*/
|
2014-12-14 17:18:53 -05:00
|
|
|
// Outputs
|
2015-05-10 23:38:08 -04:00
|
|
|
rx_rd_wait, rx_wr_wait, edma_wait, ecfg_wait, rxwr_access,
|
2015-08-14 15:37:37 -04:00
|
|
|
rxwr_packet, rxrd_access, rxrd_packet, rxrr_access, rxrr_packet,
|
2014-12-14 17:18:53 -05:00
|
|
|
// Inputs
|
2015-08-14 15:37:37 -04:00
|
|
|
erx_rr_access, erx_packet, emmu_access, emmu_packet, edma_access,
|
2015-05-10 23:38:08 -04:00
|
|
|
edma_packet, ecfg_access, ecfg_packet, timeout, rxwr_wait,
|
|
|
|
rxrd_wait, rxrr_wait
|
2014-12-14 17:18:53 -05:00
|
|
|
);
|
|
|
|
|
2015-04-23 23:14:39 -04:00
|
|
|
parameter AW = 32;
|
|
|
|
parameter DW = 32;
|
|
|
|
parameter PW = 104;
|
|
|
|
parameter ID = 12'h800; //link id
|
2015-05-04 10:40:43 -04:00
|
|
|
parameter RFAW = 6;
|
2015-04-28 16:58:45 -04:00
|
|
|
|
|
|
|
|
2015-08-14 15:37:37 -04:00
|
|
|
//From IO (for rr)
|
|
|
|
input erx_rr_access;
|
2015-04-24 17:39:05 -04:00
|
|
|
input [PW-1:0] erx_packet;
|
2015-05-10 23:38:08 -04:00
|
|
|
output rx_rd_wait; //for IO
|
|
|
|
output rx_wr_wait; //for IO
|
2015-03-25 19:25:12 -04:00
|
|
|
|
2015-10-07 21:58:50 -04:00
|
|
|
|
2015-08-14 15:37:37 -04:00
|
|
|
//From EMMU (writes)
|
2015-04-23 18:03:10 -04:00
|
|
|
input emmu_access;
|
|
|
|
input [PW-1:0] emmu_packet;
|
2015-05-01 17:53:55 -04:00
|
|
|
|
2015-04-24 17:39:05 -04:00
|
|
|
//From DMA
|
2015-04-23 18:03:10 -04:00
|
|
|
input edma_access;
|
|
|
|
input [PW-1:0] edma_packet;
|
|
|
|
output edma_wait;
|
2015-05-01 17:53:55 -04:00
|
|
|
|
|
|
|
//From ETX
|
2015-05-04 10:40:43 -04:00
|
|
|
input ecfg_access;
|
|
|
|
input [PW-1:0] ecfg_packet;
|
|
|
|
output ecfg_wait;
|
2015-05-01 17:53:55 -04:00
|
|
|
|
|
|
|
//From timeout circuit
|
|
|
|
input timeout;
|
2015-04-23 18:03:10 -04:00
|
|
|
|
2015-04-24 17:39:05 -04:00
|
|
|
//To Master Write FIFO
|
2015-05-10 23:38:08 -04:00
|
|
|
output rxwr_access;
|
|
|
|
output [PW-1:0] rxwr_packet;
|
|
|
|
input rxwr_wait;
|
2014-12-14 17:18:53 -05:00
|
|
|
|
2015-04-24 17:39:05 -04:00
|
|
|
//To Master Read FIFO
|
2015-05-10 23:38:08 -04:00
|
|
|
output rxrd_access;
|
|
|
|
output [PW-1:0] rxrd_packet;
|
|
|
|
input rxrd_wait;
|
2014-12-14 17:18:53 -05:00
|
|
|
|
2015-04-24 17:39:05 -04:00
|
|
|
//To Slave Read Response FIFO
|
2015-05-10 23:38:08 -04:00
|
|
|
output rxrr_access;
|
|
|
|
output [PW-1:0] rxrr_packet;
|
|
|
|
input rxrr_wait;
|
2015-04-27 13:00:00 -04:00
|
|
|
|
2015-04-23 18:03:10 -04:00
|
|
|
//wires
|
|
|
|
wire emmu_write;
|
2015-04-23 18:57:55 -04:00
|
|
|
wire emmu_read;
|
2015-08-14 15:37:37 -04:00
|
|
|
|
2015-05-04 17:13:51 -04:00
|
|
|
wire [11:0] myid;
|
2015-08-14 15:37:37 -04:00
|
|
|
|
2015-04-24 17:39:05 -04:00
|
|
|
//####################################
|
|
|
|
//Splicing pakets
|
|
|
|
//####################################
|
2015-05-04 17:13:51 -04:00
|
|
|
assign myid[11:0] = ID;
|
2015-08-14 15:37:37 -04:00
|
|
|
|
2015-04-24 17:39:05 -04:00
|
|
|
//####################################
|
2015-08-14 15:37:37 -04:00
|
|
|
//Read response path (from IO or cfg)
|
2015-04-24 17:39:05 -04:00
|
|
|
//####################################
|
|
|
|
|
2015-08-14 15:37:37 -04:00
|
|
|
assign rxrr_access = erx_rr_access |
|
|
|
|
ecfg_access;
|
2015-05-04 10:40:43 -04:00
|
|
|
|
2015-05-19 23:51:17 -04:00
|
|
|
assign rxrr_packet[PW-1:0] = erx_rr_access ? erx_packet[PW-1:0] :
|
|
|
|
ecfg_packet[PW-1:0];
|
2015-05-04 10:40:43 -04:00
|
|
|
|
2015-08-14 15:37:37 -04:00
|
|
|
assign ecfg_wait = erx_rr_access;
|
2015-05-04 10:40:43 -04:00
|
|
|
|
2015-04-24 17:39:05 -04:00
|
|
|
//####################################
|
2015-11-02 20:51:35 -05:00
|
|
|
//Write Path (through MMU)
|
2015-04-24 17:39:05 -04:00
|
|
|
//####################################
|
2015-11-02 20:51:35 -05:00
|
|
|
assign emmu_write = emmu_packet[0];
|
2015-04-24 17:39:05 -04:00
|
|
|
|
2015-08-14 15:37:37 -04:00
|
|
|
assign rxwr_access = emmu_access & emmu_write;
|
|
|
|
|
2015-05-10 23:38:08 -04:00
|
|
|
assign rxwr_packet[PW-1:0] = emmu_packet[PW-1:0];
|
2015-04-24 17:39:05 -04:00
|
|
|
|
|
|
|
//####################################
|
2015-08-14 15:37:37 -04:00
|
|
|
//Read Request Path
|
2015-04-24 17:39:05 -04:00
|
|
|
//####################################
|
|
|
|
|
2015-08-14 15:37:37 -04:00
|
|
|
assign emmu_read = emmu_access & ~emmu_write;
|
2015-04-24 17:39:05 -04:00
|
|
|
|
2015-05-10 23:38:08 -04:00
|
|
|
assign rxrd_access = emmu_read | edma_access;
|
2015-04-24 17:39:05 -04:00
|
|
|
|
2015-05-10 23:38:08 -04:00
|
|
|
assign rxrd_packet[PW-1:0] = emmu_read ? emmu_packet[PW-1:0] :
|
2015-05-19 23:51:17 -04:00
|
|
|
edma_packet[PW-1:0];
|
2015-04-24 17:39:05 -04:00
|
|
|
|
|
|
|
//####################################
|
|
|
|
//Wait Signals
|
|
|
|
//####################################
|
2015-05-04 17:13:51 -04:00
|
|
|
|
2015-05-10 23:38:08 -04:00
|
|
|
assign rx_rd_wait = rxrd_wait;
|
|
|
|
assign rx_wr_wait = rxwr_wait | rxrr_wait;
|
|
|
|
assign edma_wait = rxrd_wait | emmu_read;
|
|
|
|
assign erx_cfg_wait = rxwr_wait | rxrr_wait;
|
2014-12-14 17:18:53 -05:00
|
|
|
|
2015-08-14 15:37:37 -04:00
|
|
|
endmodule // erx_arbiter
|
|
|
|
|
2015-04-23 18:03:10 -04:00
|
|
|
// Local Variables:
|
2015-04-24 17:39:05 -04:00
|
|
|
// verilog-library-directories:("." "../../common/hdl" "../../emmu/hdl")
|
2015-04-23 18:03:10 -04:00
|
|
|
// End:
|
2015-03-25 19:25:12 -04:00
|
|
|
|
2015-04-23 18:03:10 -04:00
|
|
|
//#############################################################################
|
2015-04-11 00:04:18 -04:00
|
|
|
/*
|
|
|
|
This file is part of the Parallella Project.
|
|
|
|
|
2015-08-14 15:37:37 -04:00
|
|
|
Copyright (C) 2015 Adapteva, Inc.
|
2015-04-11 00:04:18 -04:00
|
|
|
Contributed by Andreas Olofsson <andreas@adapteva.com>
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program (see the file COPYING). If not, see
|
|
|
|
<http://www.gnu.org/licenses/>.
|
|
|
|
*/
|