summaryrefslogtreecommitdiffstats
path: root/usrp2/timing/simple_timer.v
diff options
context:
space:
mode:
authorMatt Ettus <matt@ettus.com>2010-05-27 17:31:46 -0700
committerMatt Ettus <matt@ettus.com>2010-05-27 17:31:46 -0700
commit3d06fb26c5a59451b26680b6096fca7ee37e8018 (patch)
treece172a14304474b2a46854bea6b47c2ed1f8380b /usrp2/timing/simple_timer.v
parent621ad7cc9e68b4e304b616d8f840d3a03a047c8b (diff)
parentb38d2424b1ac3242146fc9305d9e4ae80e21dede (diff)
downloaduhd-3d06fb26c5a59451b26680b6096fca7ee37e8018.tar.gz
uhd-3d06fb26c5a59451b26680b6096fca7ee37e8018.tar.bz2
uhd-3d06fb26c5a59451b26680b6096fca7ee37e8018.zip
Merge branch 'udp' into master_merge_take2
* udp: (67 commits) better test program for just the tx side fix typo, no functionality difference ignores move dsp settings regs to reclocked setting bus. Works, gets us to within 18ps of passing timing reverting logic clean up which should have made timing better, but made it worse instead moved fifos around, now easier to see where they are and how big bigger fifo on UDP TX path, to possibly fix overruns on decim=4 Xilinx ISE is incorrectly parsing the verilog case statement, this is a workaround pps and vita time debug pins ignore emacs backup files more debug for fixing E's better debug pins for going after cascading E's copy in wrong place copied over from quad radio just debug pin changes typo caused the tx udp chain to be disconnected moved into subdir speed up timing by ignoring the too_early error. We'll need to FIXME this later Added set time and set time at next pps. Removed the old sync pps commands, they dont make sense to use anymore. moved around regs, added a bit to allow for alternate PPS source ...
Diffstat (limited to 'usrp2/timing/simple_timer.v')
-rw-r--r--usrp2/timing/simple_timer.v60
1 files changed, 60 insertions, 0 deletions
diff --git a/usrp2/timing/simple_timer.v b/usrp2/timing/simple_timer.v
new file mode 100644
index 000000000..17c7f1c36
--- /dev/null
+++ b/usrp2/timing/simple_timer.v
@@ -0,0 +1,60 @@
+
+
+module simple_timer
+ #(parameter BASE=0)
+ (input clk, input reset,
+ input set_stb, input [7:0] set_addr, input [31:0] set_data,
+ output reg onetime_int, output reg periodic_int);
+
+ reg [31:0] onetime_ctr;
+ always @(posedge clk)
+ if(reset)
+ begin
+ onetime_int <= 0;
+ onetime_ctr <= 0;
+ end
+ else
+ if(set_stb & (set_addr == BASE))
+ begin
+ onetime_int <= 0;
+ onetime_ctr <= set_data;
+ end
+ else
+ begin
+ if(onetime_ctr == 1)
+ onetime_int <= 1;
+ if(onetime_ctr != 0)
+ onetime_ctr <= onetime_ctr - 1;
+ else
+ onetime_int <= 0;
+ end // else: !if(set_stb & (set_addr == BASE))
+
+ reg [31:0] periodic_ctr, period;
+ always @(posedge clk)
+ if(reset)
+ begin
+ periodic_int <= 0;
+ periodic_ctr <= 0;
+ period <= 0;
+ end
+ else
+ if(set_stb & (set_addr == (BASE+1)))
+ begin
+ periodic_int <= 0;
+ periodic_ctr <= set_data;
+ period <= set_data;
+ end
+ else
+ if(periodic_ctr == 1)
+ begin
+ periodic_int <= 1;
+ periodic_ctr <= period;
+ end
+ else
+ if(periodic_ctr != 0)
+ begin
+ periodic_int <= 0;
+ periodic_ctr <= periodic_ctr - 1;
+ end
+
+endmodule // simple_timer