summaryrefslogtreecommitdiffstats
path: root/usrp2/control_lib
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2012-03-09 16:53:11 -0800
committerJosh Blum <josh@joshknows.com>2012-03-16 11:29:18 -0700
commitfdf98d12a58548a929ce44a860d8981c707f3ec7 (patch)
tree09bcfb1a67f14f9fcaba4642380f07f1c2c702ae /usrp2/control_lib
parentf031d37713d47c5478e65587f7c095bd62ed9870 (diff)
downloaduhd-fdf98d12a58548a929ce44a860d8981c707f3ec7.tar.gz
uhd-fdf98d12a58548a929ce44a860d8981c707f3ec7.tar.bz2
uhd-fdf98d12a58548a929ce44a860d8981c707f3ec7.zip
fifo ctrl: minor fixes for spi core, swap time define
Diffstat (limited to 'usrp2/control_lib')
-rw-r--r--usrp2/control_lib/settings_readback_bus_fifo_ctrl.v2
-rw-r--r--usrp2/control_lib/simple_spi_core.v12
2 files changed, 7 insertions, 7 deletions
diff --git a/usrp2/control_lib/settings_readback_bus_fifo_ctrl.v b/usrp2/control_lib/settings_readback_bus_fifo_ctrl.v
index f99d3969d..d5fed4726 100644
--- a/usrp2/control_lib/settings_readback_bus_fifo_ctrl.v
+++ b/usrp2/control_lib/settings_readback_bus_fifo_ctrl.v
@@ -237,7 +237,7 @@ module settings_readback_bus_fifo_ctrl
reg [31:0] command_data_reg;
wire now, early, late, too_early;
- `ifdef FIFO_CTRL_USE_TIME
+ `ifndef FIFO_CTRL_NO_TIME
time_compare time_compare(
.time_now(vita_time), .trigger_time(command_ticks_reg),
.now(now), .early(early), .late(late), .too_early(too_early));
diff --git a/usrp2/control_lib/simple_spi_core.v b/usrp2/control_lib/simple_spi_core.v
index 31bc26f95..208fceb23 100644
--- a/usrp2/control_lib/simple_spi_core.v
+++ b/usrp2/control_lib/simple_spi_core.v
@@ -166,9 +166,9 @@ module simple_spi_core
CLK_REG: begin
if (sclk_counter_done) begin
state <= CLK_INV;
- if (datain_edge != CLK_IDLE) datain_reg <= datain_next;
- if (dataout_edge != CLK_IDLE) dataout_reg <= dataout_next;
- sclk_reg <= ~CLK_IDLE;
+ if (datain_edge != CLK_IDLE) datain_reg <= datain_next;
+ if (dataout_edge != CLK_IDLE && bit_counter != 0) dataout_reg <= dataout_next;
+ sclk_reg <= ~CLK_IDLE; //transition to rising when CLK_IDLE == 0
end
sclk_counter <= sclk_counter_next;
end
@@ -177,9 +177,9 @@ module simple_spi_core
if (sclk_counter_done) begin
state <= (bit_counter_done)? POST_IDLE : CLK_REG;
bit_counter <= bit_counter_next;
- if (datain_edge == CLK_IDLE) datain_reg <= datain_next;
- if (dataout_edge == CLK_IDLE) dataout_reg <= dataout_next;
- sclk_reg <= CLK_IDLE;
+ if (datain_edge == CLK_IDLE) datain_reg <= datain_next;
+ if (dataout_edge == CLK_IDLE && ~bit_counter_done) dataout_reg <= dataout_next;
+ sclk_reg <= CLK_IDLE; //transition to falling when CLK_IDLE == 0
end
sclk_counter <= sclk_counter_next;
end