+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
165 lines
4.0 KiB
Verilog
165 lines
4.0 KiB
Verilog
//
|
|
// Copyright 2016 Ettus Research
|
|
// Copyright 2018 Ettus Research, a National Instruments Company
|
|
//
|
|
// SPDX-License-Identifier: LGPL-3.0-or-later
|
|
//
|
|
// AXI4lite to NI Register Port interface
|
|
//
|
|
|
|
module axil_to_ni_regport #(
|
|
parameter RP_AWIDTH = 16,
|
|
parameter RP_DWIDTH = 32,
|
|
parameter TIMEOUT = 512
|
|
)(
|
|
input s_axi_aclk,
|
|
input s_axi_areset,
|
|
|
|
// AXI4lite interface
|
|
input [31:0] s_axi_awaddr,
|
|
input s_axi_awvalid,
|
|
output s_axi_awready,
|
|
input [31:0] s_axi_wdata,
|
|
input [3:0] s_axi_wstrb,
|
|
input s_axi_wvalid,
|
|
output s_axi_wready,
|
|
output [1:0] s_axi_bresp,
|
|
output s_axi_bvalid,
|
|
input s_axi_bready,
|
|
input [31:0] s_axi_araddr,
|
|
input s_axi_arvalid,
|
|
output s_axi_arready,
|
|
output [31:0] s_axi_rdata,
|
|
output [1:0] s_axi_rresp,
|
|
output s_axi_rvalid,
|
|
input s_axi_rready,
|
|
|
|
// RegPort interface, the out vs in
|
|
// is seen from the slave device
|
|
// hooked up to the regport
|
|
output reg_port_in_rd,
|
|
output reg_port_in_wt,
|
|
output [RP_AWIDTH-1:0] reg_port_in_addr,
|
|
output [RP_DWIDTH-1:0] reg_port_in_data,
|
|
input [RP_DWIDTH-1:0] reg_port_out_data,
|
|
input reg_port_out_ready
|
|
);
|
|
|
|
localparam IDLE = 3'd0;
|
|
localparam READ_INIT = 3'd1;
|
|
localparam WRITE_INIT = 3'd2;
|
|
localparam READ_IN_PROGRESS = 3'd3;
|
|
localparam WRITE_IN_PROGRESS = 3'd4;
|
|
localparam WRITE_DONE = 3'd5;
|
|
localparam READ_DONE = 3'd6;
|
|
|
|
reg [RP_AWIDTH-1:0] addr;
|
|
reg [RP_DWIDTH-1:0] rb_data;
|
|
reg [RP_DWIDTH-1:0] wr_data;
|
|
reg [2:0] state;
|
|
reg [9:0] count;
|
|
reg [1:0] rresp;
|
|
reg [1:0] bresp;
|
|
|
|
always @ (posedge s_axi_aclk) begin
|
|
if (s_axi_areset) begin
|
|
state <= IDLE;
|
|
addr <= 'd0;
|
|
rb_data <= 'd0;
|
|
wr_data <= 'd0;
|
|
|
|
count <= 10'd0;
|
|
rresp <= 2'd0;
|
|
bresp <= 2'd0;
|
|
end
|
|
else case (state)
|
|
|
|
IDLE: begin
|
|
if (s_axi_arvalid) begin
|
|
state <= READ_INIT;
|
|
addr <= s_axi_araddr[RP_AWIDTH-1:0];
|
|
end
|
|
else if (s_axi_awvalid) begin
|
|
state <= WRITE_INIT;
|
|
addr <= s_axi_awaddr[RP_AWIDTH-1:0];
|
|
end
|
|
end
|
|
|
|
READ_INIT: begin
|
|
state <= READ_IN_PROGRESS;
|
|
count <= 10'd0;
|
|
rresp <= 2'b00;
|
|
end
|
|
|
|
READ_IN_PROGRESS: begin
|
|
if (reg_port_out_ready) begin
|
|
rb_data <= reg_port_out_data;
|
|
state <= READ_DONE;
|
|
end
|
|
else if (count >= TIMEOUT) begin
|
|
state <= READ_DONE;
|
|
rresp <= 2'b10;
|
|
end
|
|
else begin
|
|
count <= count + 1'b1;
|
|
end
|
|
end
|
|
|
|
READ_DONE: begin
|
|
if (s_axi_rready) begin
|
|
state <= IDLE;
|
|
end
|
|
end
|
|
|
|
WRITE_INIT: begin
|
|
if (s_axi_wvalid) begin
|
|
wr_data <= s_axi_wdata[RP_DWIDTH-1:0];
|
|
state <= WRITE_IN_PROGRESS;
|
|
count <= 10'd0;
|
|
bresp <= 2'b00;
|
|
end
|
|
end
|
|
|
|
WRITE_IN_PROGRESS: begin
|
|
if (reg_port_out_ready) begin
|
|
state <= WRITE_DONE;
|
|
end
|
|
else if (count >= TIMEOUT) begin
|
|
state <= READ_DONE;
|
|
bresp <= 2'b10;
|
|
end
|
|
else begin
|
|
count <= count + 1'b1;
|
|
end
|
|
end
|
|
|
|
WRITE_DONE: begin
|
|
if (s_axi_bready)
|
|
state <= IDLE;
|
|
end
|
|
|
|
default: begin
|
|
state <= IDLE;
|
|
end
|
|
|
|
endcase
|
|
end
|
|
|
|
assign s_axi_awready = (state == IDLE);
|
|
assign s_axi_wready = (state == WRITE_INIT);
|
|
assign s_axi_bvalid = (state == WRITE_DONE);
|
|
assign s_axi_bresp = bresp;
|
|
|
|
assign s_axi_arready = (state == IDLE);
|
|
assign s_axi_rdata = rb_data;
|
|
assign s_axi_rvalid = (state == READ_DONE);
|
|
assign s_axi_rresp = rresp;
|
|
|
|
assign reg_port_in_wt = (state == WRITE_INIT) & s_axi_wvalid;
|
|
assign reg_port_in_data = (state == WRITE_INIT) ? s_axi_wdata : wr_data;
|
|
assign reg_port_in_addr = addr;
|
|
|
|
assign reg_port_in_rd = (state == READ_INIT);
|
|
|
|
endmodule
|