+18









Martin Braun
Alex Williams
Andrej Rode
Ashish Chaudhari
Ben Hilburn
Ciro Nishiguchi
Daniel Jepson
Derek Kozel
EJ Kreinar
Humberto Jimenez
Ian Buckley
Jörg Hofrichter
Jon Kiser
Josh Blum
Jonathon Pendlum
Matt Ettus
Michael West
Moritz Fischer
Nick Foster
Nicolas Cuervo
Paul Butler
Paul David
Ryan Marlow
Sugandha Gupta
Sylvain Munaut
Trung Tran
Vidush Vishwanath
Wade Fife
6b67702ad7
The FPGA codebase was removed from the UHD repository in 2014 to reduce the size of the repository. However, over the last half-decade, the split between the repositories has proven more burdensome than it has been helpful. By merging the FPGA code back, it will be possible to create atomic commits that touch both FPGA and UHD codebases. Continuous integration testing is also simplified by merging the repositories, because it was previously difficult to automatically derive the correct UHD branch when testing a feature branch on the FPGA repository. This commit also updates the license files and paths therein. We are therefore merging the repositories again. Future development for FPGA code will happen in the same repository as the UHD host code and MPM code. == Original Codebase and Rebasing == The original FPGA repository will be hosted for the foreseeable future at its original local location: https://github.com/EttusResearch/fpga/ It can be used for bisecting, reference, and a more detailed history. The final commit from said repository to be merged here is 05003794e2da61cabf64dd278c45685a7abad7ec. This commit is tagged as v4.0.0.0-pre-uhd-merge. If you have changes in the FPGA repository that you want to rebase onto the UHD repository, simply run the following commands: - Create a directory to store patches (this should be an empty directory): mkdir ~/patches - Now make sure that your FPGA codebase is based on the same state as the code that was merged: cd src/fpga # Or wherever your FPGA code is stored git rebase v4.0.0.0-pre-uhd-merge Note: The rebase command may look slightly different depending on what exactly you're trying to rebase. - Create a patch set for your changes versus v4.0.0.0-pre-uhd-merge: git format-patch v4.0.0.0-pre-uhd-merge -o ~/patches Note: Make sure that only patches are stored in your output directory. It should otherwise be empty. Make sure that you picked the correct range of commits, and only commits you wanted to rebase were exported as patch files. - Go to the UHD repository and apply the patches: cd src/uhd # Or wherever your UHD repository is stored git am --directory fpga ~/patches/* rm -rf ~/patches # This is for cleanup == Contributors == The following people have contributed mainly to these files (this list is not complete): Co-authored-by: Alex Williams <alex.williams@ni.com> Co-authored-by: Andrej Rode <andrej.rode@ettus.com> Co-authored-by: Ashish Chaudhari <ashish@ettus.com> Co-authored-by: Ben Hilburn <ben.hilburn@ettus.com> Co-authored-by: Ciro Nishiguchi <ciro.nishiguchi@ni.com> Co-authored-by: Daniel Jepson <daniel.jepson@ni.com> Co-authored-by: Derek Kozel <derek.kozel@ettus.com> Co-authored-by: EJ Kreinar <ej@he360.com> Co-authored-by: Humberto Jimenez <humberto.jimenez@ni.com> Co-authored-by: Ian Buckley <ian.buckley@gmail.com> Co-authored-by: Jörg Hofrichter <joerg.hofrichter@ni.com> Co-authored-by: Jon Kiser <jon.kiser@ni.com> Co-authored-by: Josh Blum <josh@joshknows.com> Co-authored-by: Jonathon Pendlum <jonathan.pendlum@ettus.com> Co-authored-by: Martin Braun <martin.braun@ettus.com> Co-authored-by: Matt Ettus <matt@ettus.com> Co-authored-by: Michael West <michael.west@ettus.com> Co-authored-by: Moritz Fischer <moritz.fischer@ettus.com> Co-authored-by: Nick Foster <nick@ettus.com> Co-authored-by: Nicolas Cuervo <nicolas.cuervo@ettus.com> Co-authored-by: Paul Butler <paul.butler@ni.com> Co-authored-by: Paul David <paul.david@ettus.com> Co-authored-by: Ryan Marlow <ryan.marlow@ettus.com> Co-authored-by: Sugandha Gupta <sugandha.gupta@ettus.com> Co-authored-by: Sylvain Munaut <tnt@246tNt.com> Co-authored-by: Trung Tran <trung.tran@ettus.com> Co-authored-by: Vidush Vishwanath <vidush.vishwanath@ettus.com> Co-authored-by: Wade Fife <wade.fife@ettus.com> Original-commit: bafa9d95453387814ef25e6b6256ba8db2df612f
135 lines
5.2 KiB
Verilog
135 lines
5.2 KiB
Verilog
//
|
|
// Copyright 2013 Ettus Research LLC
|
|
// Copyright 2018 Ettus Research, a National Instruments Company
|
|
//
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
//
|
|
|
|
|
|
module pcie_iop2_msg_arbiter #(
|
|
parameter E0_ADDR = 20'h0,
|
|
parameter E0_MASK = 20'h0,
|
|
parameter E1_ADDR = 20'h0,
|
|
parameter E1_MASK = 20'h0,
|
|
parameter E2_ADDR = 20'h0,
|
|
parameter E2_MASK = 20'h0,
|
|
parameter E3_ADDR = 20'h0,
|
|
parameter E3_MASK = 20'h0
|
|
) (
|
|
//Clocks and resets
|
|
input clk,
|
|
input reset,
|
|
|
|
input [63:0] regi_tdata,
|
|
input regi_tvalid,
|
|
output regi_tready,
|
|
output [63:0] rego_tdata,
|
|
output rego_tvalid,
|
|
input rego_tready,
|
|
|
|
output [63:0] e0_regi_tdata,
|
|
output e0_regi_tvalid,
|
|
input e0_regi_tready,
|
|
input [63:0] e0_rego_tdata,
|
|
input e0_rego_tvalid,
|
|
output e0_rego_tready,
|
|
|
|
output [63:0] e1_regi_tdata,
|
|
output e1_regi_tvalid,
|
|
input e1_regi_tready,
|
|
input [63:0] e1_rego_tdata,
|
|
input e1_rego_tvalid,
|
|
output e1_rego_tready,
|
|
|
|
output [63:0] e2_regi_tdata,
|
|
output e2_regi_tvalid,
|
|
input e2_regi_tready,
|
|
input [63:0] e2_rego_tdata,
|
|
input e2_rego_tvalid,
|
|
output e2_rego_tready,
|
|
|
|
output [63:0] e3_regi_tdata,
|
|
output e3_regi_tvalid,
|
|
input e3_regi_tready,
|
|
input [63:0] e3_rego_tdata,
|
|
input e3_rego_tvalid,
|
|
output e3_rego_tready
|
|
);
|
|
|
|
//*******************************************************************************
|
|
// PCIe output message arbiter
|
|
//
|
|
axi_mux4 #(.PRIO(0), .WIDTH(64), .BUFFER(0)) rego_arbiter_mux (
|
|
.clk(clk), .reset(reset), .clear(1'b0),
|
|
.i0_tdata(e0_rego_tdata), .i0_tlast(e0_rego_tvalid), .i0_tvalid(e0_rego_tvalid), .i0_tready(e0_rego_tready),
|
|
.i1_tdata(e1_rego_tdata), .i1_tlast(e1_rego_tvalid), .i1_tvalid(e1_rego_tvalid), .i1_tready(e1_rego_tready),
|
|
.i2_tdata(e2_rego_tdata), .i2_tlast(e2_rego_tvalid), .i2_tvalid(e2_rego_tvalid), .i2_tready(e2_rego_tready),
|
|
.i3_tdata(e3_rego_tdata), .i3_tlast(e3_rego_tvalid), .i3_tvalid(e3_rego_tvalid), .i3_tready(e3_rego_tready),
|
|
.o_tdata(rego_tdata), .o_tlast(), .o_tvalid(rego_tvalid), .o_tready(rego_tready)
|
|
);
|
|
//
|
|
//*******************************************************************************
|
|
|
|
//*******************************************************************************
|
|
// PCIe input message arbiter
|
|
//
|
|
wire [63:0] regi_msg;
|
|
wire regi_rc;
|
|
wire [19:0] regi_addr;
|
|
wire e0_rego_rd, e1_rego_rd, e2_rego_rd, e3_rego_rd;
|
|
|
|
ioport2_msg_decode e0_rego_decoder (.message(e0_rego_tdata), .rd_request(e0_rego_rd));
|
|
ioport2_msg_decode e1_rego_decoder (.message(e1_rego_tdata), .rd_request(e1_rego_rd));
|
|
ioport2_msg_decode e2_rego_decoder (.message(e2_rego_tdata), .rd_request(e2_rego_rd));
|
|
ioport2_msg_decode e3_rego_decoder (.message(e3_rego_tdata), .rd_request(e3_rego_rd));
|
|
|
|
localparam DEST_E0 = 2'd0;
|
|
localparam DEST_E1 = 2'd1;
|
|
localparam DEST_E2 = 2'd2;
|
|
localparam DEST_E3 = 2'd3;
|
|
|
|
reg [1:0] regi_resp_dest;
|
|
wire [1:0] regi_req_dest, regi_dest;
|
|
|
|
assign regi_req_dest =
|
|
((regi_addr & E0_MASK) == E0_ADDR) ? DEST_E0 : (
|
|
((regi_addr & E1_MASK) == E1_ADDR) ? DEST_E1 : (
|
|
((regi_addr & E2_MASK) == E2_ADDR) ? DEST_E2 : (
|
|
((regi_addr & E3_MASK) == E3_ADDR) ? DEST_E3 : (
|
|
DEST_E0))));
|
|
|
|
//A response must be routed to the port with the last read request
|
|
always @(posedge clk) begin
|
|
if (reset)
|
|
regi_resp_dest <= DEST_E0; //Default 0
|
|
else if (e0_rego_tvalid & e0_rego_tready & e0_rego_rd)
|
|
regi_resp_dest <= DEST_E0;
|
|
else if (e1_rego_tvalid & e1_rego_tready & e1_rego_rd)
|
|
regi_resp_dest <= DEST_E1;
|
|
else if (e2_rego_tvalid & e2_rego_tready & e2_rego_rd)
|
|
regi_resp_dest <= DEST_E2;
|
|
else if (e3_rego_tvalid & e3_rego_tready & e3_rego_rd)
|
|
regi_resp_dest <= DEST_E3;
|
|
end
|
|
|
|
ioport2_msg_decode regi_decoder (
|
|
.message(regi_msg), .rd_response(regi_rc), .address(regi_addr));
|
|
|
|
//If request, get destination from msg.
|
|
//If response, get destination from last read location.
|
|
assign regi_dest = regi_rc ? regi_resp_dest : regi_req_dest;
|
|
|
|
axi_demux4 #(.ACTIVE_CHAN(4'b1111), .WIDTH(64), .BUFFER(0)) regi_arbiter_demux (
|
|
.clk(clk), .reset(reset), .clear(1'b0),
|
|
.header(regi_msg), .dest(regi_dest),
|
|
.i_tdata(regi_tdata), .i_tlast(regi_tvalid), .i_tvalid(regi_tvalid), .i_tready(regi_tready),
|
|
.o0_tdata(e0_regi_tdata), .o0_tlast(), .o0_tvalid(e0_regi_tvalid), .o0_tready(e0_regi_tready),
|
|
.o1_tdata(e1_regi_tdata), .o1_tlast(), .o1_tvalid(e1_regi_tvalid), .o1_tready(e1_regi_tready),
|
|
.o2_tdata(e2_regi_tdata), .o2_tlast(), .o2_tvalid(e2_regi_tvalid), .o2_tready(e2_regi_tready),
|
|
.o3_tdata(e3_regi_tdata), .o3_tlast(), .o3_tvalid(e3_regi_tvalid), .o3_tready(e3_regi_tready)
|
|
);
|
|
//
|
|
//*******************************************************************************
|
|
|
|
endmodule
|