summaryrefslogtreecommitdiffstats
path: root/usrp2/control_lib
diff options
context:
space:
mode:
authorMatt Ettus <matt@ettus.com>2010-05-12 16:13:32 -0700
committerMatt Ettus <matt@ettus.com>2010-05-12 16:13:32 -0700
commit4ca04dc4c373ea8c2fd62325e1122bb61bdb3920 (patch)
treefb9627fd00c4ccc59e16a04297300354fe53db23 /usrp2/control_lib
parent247e36dcbace9ef06763c2c537b44c8225a9d6a7 (diff)
parent9df5aa38bb1cd289e80ca817c4cd7412b1eb7e0c (diff)
downloaduhd-4ca04dc4c373ea8c2fd62325e1122bb61bdb3920.tar.gz
uhd-4ca04dc4c373ea8c2fd62325e1122bb61bdb3920.tar.bz2
uhd-4ca04dc4c373ea8c2fd62325e1122bb61bdb3920.zip
Merge branch 'master' into u1e
Diffstat (limited to 'usrp2/control_lib')
-rw-r--r--usrp2/control_lib/nsgpio.v2
-rw-r--r--usrp2/control_lib/settings_bus.v18
-rw-r--r--usrp2/control_lib/settings_bus_crossclock.v20
3 files changed, 26 insertions, 14 deletions
diff --git a/usrp2/control_lib/nsgpio.v b/usrp2/control_lib/nsgpio.v
index 937ea7020..26130cc8e 100644
--- a/usrp2/control_lib/nsgpio.v
+++ b/usrp2/control_lib/nsgpio.v
@@ -95,7 +95,7 @@ module nsgpio
integer n;
reg [31:0] igpio; // temporary internal signal
- always @(ctrl or line or debug_1 or debug_0 or atr)
+ always @(ctrl or line or debug_1 or debug_0 or atr or ddr)
for(n=0;n<32;n=n+1)
igpio[n] <= ddr[n] ? (ctrl[2*n+1] ? (ctrl[2*n] ? debug_1[n] : debug_0[n]) :
(ctrl[2*n] ? atr[n] : line[n]) )
diff --git a/usrp2/control_lib/settings_bus.v b/usrp2/control_lib/settings_bus.v
index d01a30ab4..aec179516 100644
--- a/usrp2/control_lib/settings_bus.v
+++ b/usrp2/control_lib/settings_bus.v
@@ -10,8 +10,7 @@ module settings_bus
input wb_stb_i,
input wb_we_i,
output reg wb_ack_o,
- input sys_clk,
- output strobe,
+ output reg strobe,
output reg [7:0] addr,
output reg [31:0] data);
@@ -20,18 +19,18 @@ module settings_bus
always @(posedge wb_clk)
if(wb_rst)
begin
- stb_int <= 1'b0;
+ strobe <= 1'b0;
addr <= 8'd0;
data <= 32'd0;
end
- else if(wb_we_i & wb_stb_i)
+ else if(wb_we_i & wb_stb_i & ~wb_ack_o)
begin
- stb_int <= 1'b1;
+ strobe <= 1'b1;
addr <= wb_adr_i[9:2];
data <= wb_dat_i;
end
else
- stb_int <= 1'b0;
+ strobe <= 1'b0;
always @(posedge wb_clk)
if(wb_rst)
@@ -39,11 +38,4 @@ module settings_bus
else
wb_ack_o <= wb_stb_i & ~wb_ack_o;
- always @(posedge wb_clk)
- stb_int_d1 <= stb_int;
-
- //assign strobe = stb_int & ~stb_int_d1;
- assign strobe = stb_int & wb_ack_o;
-
endmodule // settings_bus
-
diff --git a/usrp2/control_lib/settings_bus_crossclock.v b/usrp2/control_lib/settings_bus_crossclock.v
new file mode 100644
index 000000000..b043aa0ad
--- /dev/null
+++ b/usrp2/control_lib/settings_bus_crossclock.v
@@ -0,0 +1,20 @@
+
+
+// This module takes the settings bus on one clock domain and crosses it over to another domain
+// Typically it will be used with the input settings bus on the wishbone clock, and either
+// the system or dsp clock on the output side
+
+module settings_bus_crossclock
+ (input clk_i, input rst_i, input set_stb_i, input [7:0] set_addr_i, input [31:0] set_data_i,
+ input clk_o, input rst_o, output set_stb_o, output [7:0] set_addr_o, output [31:0] set_data_o);
+
+ wire full, empty;
+
+ fifo_xlnx_16x40_2clk settings_fifo
+ (.rst(rst_i),
+ .wr_clk(clk_i), .din({set_addr_i,set_data_i}), .wr_en(set_stb_i & ~full), .full(full),
+ .rd_clk(clk_o), .dout({set_addr_o,set_data_o}), .rd_en(~empty), .empty(empty));
+
+ assign set_stb_o = ~empty;
+
+endmodule // settings_bus_crossclock