view fpga/sniffer-basic/reset_detect.v @ 30:dc99c9962aed

fpga/sniffer-*: forgot to change SIM_RST to SIM_RST_in for LED5
author Mychaela Falconia <falcon@freecalypso.org>
date Tue, 29 Aug 2023 20:36:34 +0000
parents 7db5fd6646df
children
line wrap: on
line source

/*
 * This Verilog module captures the logic that detects SIM_RST transitions
 * in either direction.
 */

module reset_detect (IntClk, SIM_RST_sync, SIM_RST_toggle);

input IntClk;
input SIM_RST_sync;
output SIM_RST_toggle;

reg prev_state;

always @(posedge IntClk)
	prev_state <= SIM_RST_sync;

assign SIM_RST_toggle = SIM_RST_sync != prev_state;

endmodule