FreeCalypso > hg > fc-sim-sniff
view fpga/sniffer-pps/clk_edge.v @ 36:f1c3dd2173d3
doc/Sniffing-hw-setup: document written
| author | Mychaela Falconia <falcon@freecalypso.org> |
|---|---|
| date | Wed, 30 Aug 2023 02:22:44 +0000 |
| parents | 0f74428c177c |
| children |
line wrap: on
line source
/* * This Verilog module captures the logic that detects rising edges of SIM_CLK * for the purpose of counting them. */ module clk_edge (IntClk, SIM_CLK_sync, SIM_CLK_edge); input IntClk; input SIM_CLK_sync; output SIM_CLK_edge; reg prev_state; always @(posedge IntClk) prev_state <= SIM_CLK_sync; assign SIM_CLK_edge = SIM_CLK_sync && !prev_state; endmodule
