aboutsummaryrefslogtreecommitdiffstats
path: root/fpga/usrp2/gpmc/edge_sync.v
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2010-10-27 11:36:57 -0700
committerJosh Blum <josh@joshknows.com>2010-10-27 11:36:57 -0700
commitcfde84d8a1f2e9fc76e9d5c80f8f4aa571fa04a7 (patch)
tree92e2c73cd37f4bde6dd6b4a0765e44c9586e7dcd /fpga/usrp2/gpmc/edge_sync.v
parent1289d051a1934e48d77be695059b1d23f8668d8a (diff)
parent1f77494788fa4fa8450aaf170055553bd0e5fe8e (diff)
downloaduhd-cfde84d8a1f2e9fc76e9d5c80f8f4aa571fa04a7.tar.gz
uhd-cfde84d8a1f2e9fc76e9d5c80f8f4aa571fa04a7.tar.bz2
uhd-cfde84d8a1f2e9fc76e9d5c80f8f4aa571fa04a7.zip
Merge branch 'ue1_rev2' into usrp_e_next
Diffstat (limited to 'fpga/usrp2/gpmc/edge_sync.v')
-rw-r--r--fpga/usrp2/gpmc/edge_sync.v22
1 files changed, 22 insertions, 0 deletions
diff --git a/fpga/usrp2/gpmc/edge_sync.v b/fpga/usrp2/gpmc/edge_sync.v
new file mode 100644
index 000000000..5d9417c08
--- /dev/null
+++ b/fpga/usrp2/gpmc/edge_sync.v
@@ -0,0 +1,22 @@
+
+
+module edge_sync
+ #(parameter POSEDGE = 1)
+ (input clk,
+ input rst,
+ input sig,
+ output trig);
+
+ reg [1:0] delay;
+
+ always @(posedge clk)
+ if(rst)
+ delay <= 2'b00;
+ else
+ delay <= {delay[0],sig};
+
+ assign trig = POSEDGE ? (delay==2'b01) : (delay==2'b10);
+
+endmodule // edge_sync
+
+