// // System reset test. // // This is not yet self-verifying code. // (Which means you have to look at the waveform) // // // // Design by G.J. van Loo, FenLogic Ltd, 15-January-2017. // // This program is free software. It comes without any guarantees or // warranty to the extent permitted by applicable law. Although the // author has attempted to find and correct any bugs in this free software // program, the author is not responsible for any damage or losses of any // kind caused by the use or misuse of the program. You can redistribute // the program and or modify it in any form without obligations, but the // author would appreciated if the credits stays in. // module system_reset_test; localparam XTAL_PERIOD = 80; reg xtal; reg xtal_on; wire xtal_ok; reg reset_n_raw; wire sys_reset_n; initial begin reset_n_raw = 1'b0; xtal_on = 1'b0; #100; reset_n_raw = 1'b1; #(50*XTAL_PERIOD) ; @(negedge xtal) xtal_on = 1'b1; wait (sys_reset_n == 1'b1) #(70*XTAL_PERIOD) ; $stop; end // Clean XTAL signal initial begin xtal= 1'b0; forever #(XTAL_PERIOD/2) xtal<= ~xtal; end assign xtal_ok = xtal & xtal_on; system_reset system_reset_0 ( .xtal_ok (xtal_ok ), // signal from crystal oscillator pad .reset_n_raw(reset_n_raw), // signal direct from reset-pad .sys_reset_n(sys_reset_n) // reset to be distributed ); endmodule // system_reset_test