comparison fpga/sniffer-basic/reset_detect.v @ 6:7db5fd6646df

fpga/sniffer-basic: initial version
author Mychaela Falconia <falcon@freecalypso.org>
date Mon, 21 Aug 2023 00:52:00 +0000
parents
children
comparison
equal deleted inserted replaced
5:07c5aac6e84f 6:7db5fd6646df
1 /*
2 * This Verilog module captures the logic that detects SIM_RST transitions
3 * in either direction.
4 */
5
6 module reset_detect (IntClk, SIM_RST_sync, SIM_RST_toggle);
7
8 input IntClk;
9 input SIM_RST_sync;
10 output SIM_RST_toggle;
11
12 reg prev_state;
13
14 always @(posedge IntClk)
15 prev_state <= SIM_RST_sync;
16
17 assign SIM_RST_toggle = SIM_RST_sync != prev_state;
18
19 endmodule