[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Commit-gnuradio] [gnuradio] 106/148: proper time sync to pps
From: |
git |
Subject: |
[Commit-gnuradio] [gnuradio] 106/148: proper time sync to pps |
Date: |
Mon, 15 Aug 2016 00:47:31 +0000 (UTC) |
This is an automated email from the git hooks/post-receive script.
nwest pushed a commit to annotated tag old_usrp_devel_udp
in repository gnuradio.
commit fa925366c2e1ad89dfb774a5a318b229a8ccc3bb
Author: Matt Ettus <address@hidden>
Date: Tue Dec 22 10:03:13 2009 -0800
proper time sync to pps
---
usrp2/fpga/timing/time_64bit.v | 33 +++++++++++++++++++++++++++++----
usrp2/fpga/top/u2_core/u2_core.v | 2 +-
2 files changed, 30 insertions(+), 5 deletions(-)
diff --git a/usrp2/fpga/timing/time_64bit.v b/usrp2/fpga/timing/time_64bit.v
index ab0c12b..84f7964 100644
--- a/usrp2/fpga/timing/time_64bit.v
+++ b/usrp2/fpga/timing/time_64bit.v
@@ -6,11 +6,13 @@ module time_64bit
(input clk, input rst,
input set_stb, input [7:0] set_addr, input [31:0] set_data,
input pps,
- output [63:0] vita_time
+ output [63:0] vita_time, output pps_int
);
- localparam NEXT_TICKS = 1;
localparam NEXT_SECS = 0;
+ localparam NEXT_TICKS = 1;
+ localparam PPS_POL = 2;
+
localparam ROLLOVER = TICKS_PER_SEC - 1;
reg [31:0] seconds;
@@ -22,6 +24,7 @@ module time_64bit
wire [31:0] next_seconds_preset;
wire set_on_pps_trig;
reg set_on_next_pps;
+ wire pps_polarity;
setting_reg #(.my_addr(BASE+NEXT_TICKS)) sr_next_ticks
(.clk(clk),.rst(rst),.strobe(set_stb),.addr(set_addr),
@@ -30,13 +33,33 @@ module time_64bit
setting_reg #(.my_addr(BASE+NEXT_SECS)) sr_next_secs
(.clk(clk),.rst(rst),.strobe(set_stb),.addr(set_addr),
.in(set_data),.out(next_seconds_preset),.changed(set_on_pps_trig));
+
+ setting_reg #(.my_addr(BASE+PPS_POL)) sr_pps_pol
+ (.clk(clk),.rst(rst),.strobe(set_stb),.addr(set_addr),
+ .in(set_data),.out(pps_polarity),.changed());
+
+ reg [1:0] pps_del;
+ reg pps_reg_p, pps_reg_n, pps_reg;
+ wire pps_edge;
+
+ always @(posedge clk) pps_reg_p <= pps;
+ always @(negedge clk) pps_reg_n <= pps;
+ always @* pps_reg <= pps_polarity ? pps_reg_p : pps_reg_n;
+
+ always @(posedge clk)
+ if(rst)
+ pps_del <= 2'b00;
+ else
+ pps_del <= {pps_del[0],pps_reg};
+
+ assign pps_edge = pps_del[0] & ~pps_del[1];
always @(posedge clk)
if(rst)
set_on_next_pps <= 0;
else if(set_on_pps_trig)
set_on_next_pps <= 1;
- else if(pps)
+ else if(pps_edge)
set_on_next_pps <= 0;
always @(posedge clk)
@@ -45,7 +68,7 @@ module time_64bit
seconds <= 32'd0;
ticks <= 32'd0;
end
- else if(pps & set_on_next_pps)
+ else if(pps_edge & set_on_next_pps)
begin
seconds <= next_seconds_preset;
ticks <= next_ticks_preset;
@@ -57,5 +80,7 @@ module time_64bit
end
else
ticks <= ticks + 1;
+
+ assign pps_int = pps_edge;
endmodule // time_64bit
diff --git a/usrp2/fpga/top/u2_core/u2_core.v b/usrp2/fpga/top/u2_core/u2_core.v
index f9ac07a..2fa490d 100644
--- a/usrp2/fpga/top/u2_core/u2_core.v
+++ b/usrp2/fpga/top/u2_core/u2_core.v
@@ -678,7 +678,7 @@ module u2_core
time_64bit #(.TICKS_PER_SEC(32'd100000000),.BASE(SR_TIME64)) time_64bit
(.clk(dsp_clk), .rst(dsp_rst), .set_stb(set_stb), .set_addr(set_addr),
.set_data(set_data),
- .pps(pps_o), .vita_time(vita_time));
+ .pps(pps_o), .vita_time(vita_time), .pps_int());
//
/////////////////////////////////////////////////////////////////////////////////////////
// Debug Pins
- [Commit-gnuradio] [gnuradio] 82/148: Merge branch 'merge_usrp2' into wip/usrp2, (continued)
- [Commit-gnuradio] [gnuradio] 82/148: Merge branch 'merge_usrp2' into wip/usrp2, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 91/148: Added time spec to the start streaming command. One can do a start streaming at by specifiying a time spec, or leave the parameter off for stream now mode., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 97/148: removed the usrp2_bytesex header since it only imported from gruel, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 100/148: Made some gruel changes to get it compiling on this system., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 101/148: flattened usrp2 hierarchy `, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 87/148: Removed references to channel numbers in usrp2 and gr usrp2. Removed the sample handler and replaced it with the vrt packet handler. Fixed the build systems to require vrt for usrp., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 117/148: typo fix, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 111/148: Merge branch 'master' of address@hidden:jblum into wip/usrp2, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 104/148: barebones udp support. Compiles, but untested., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 130/148: should fix the endless packet bug, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 106/148: proper time sync to pps,
git <=
- [Commit-gnuradio] [gnuradio] 119/148: better debug pins, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 114/148: Merge branch 'wip/usrp2' of http://gnuradio.org/git/matt into wip/usrp2, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 116/148: actually connect the ports -- why this isn't flagged as an error I'll never know, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 134/148: remove time_sync and master_timer., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 136/148: Added set time and set time at next pps. Removed the old sync pps commands, they dont make sense to use anymore., git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 107/148: added missing vrt includes and libs to makefiles, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 129/148: yet another typo, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 110/148: bug fix for waterfall plotter, it seems that numpy choose changed, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 138/148: speed up timing by ignoring the too_early error. We'll need to FIXME this later, git, 2016/08/14
- [Commit-gnuradio] [gnuradio] 126/148: add debug pins to find the problem with lost eof in the udp core, git, 2016/08/14