aboutsummaryrefslogtreecommitdiffstats
path: root/usrp2/gpmc/edge_sync.v
diff options
context:
space:
mode:
authorMatt Ettus <matt@ettus.com>2010-02-25 18:38:07 -0800
committerMatt Ettus <matt@ettus.com>2010-02-25 18:38:07 -0800
commit2f9b93f32ed8e561a0e92e2e32af03707475011c (patch)
tree8364826d99b925f5f7f6b248d025737d57e4ac12 /usrp2/gpmc/edge_sync.v
parent17dd91290bfba1d2a3cf66666e634ddf00e3b34e (diff)
downloaduhd-2f9b93f32ed8e561a0e92e2e32af03707475011c.tar.gz
uhd-2f9b93f32ed8e561a0e92e2e32af03707475011c.tar.bz2
uhd-2f9b93f32ed8e561a0e92e2e32af03707475011c.zip
edge sync on done signals so we only fill/empty one buffer
Diffstat (limited to 'usrp2/gpmc/edge_sync.v')
-rw-r--r--usrp2/gpmc/edge_sync.v22
1 files changed, 22 insertions, 0 deletions
diff --git a/usrp2/gpmc/edge_sync.v b/usrp2/gpmc/edge_sync.v
new file mode 100644
index 000000000..5d9417c08
--- /dev/null
+++ b/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
+
+