annotate fpga/sniffer-pps/clk_check.v @ 57:eb4274e7f4da

simsniff-dec: decode SELECT file IDs
author Mychaela Falconia <falcon@freecalypso.org>
date Wed, 04 Oct 2023 03:54:00 +0000
parents 737579209153
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
53
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
1 /*
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
2 * The logic implemented in this module detects if SIM_CLK is running or not,
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
3 * for the purpose of visual indication on a LED.
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
4 */
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
5
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
6 module clk_check (IntClk, SIM_CLK_sync, SIM_CLK_running);
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
7
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
8 input IntClk;
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
9 input SIM_CLK_sync;
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
10 output SIM_CLK_running;
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
11
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
12 reg [11:0] shift_reg;
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
13
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
14 always @(posedge IntClk)
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
15 shift_reg <= {shift_reg[10:0],SIM_CLK_sync};
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
16
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
17 assign SIM_CLK_running = (shift_reg != 12'h000) && (shift_reg != 12'hFFF);
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
18
737579209153 fpga/sniffer-pps: add LED indication of running SIM CLK
Mychaela Falconia <falcon@freecalypso.org>
parents:
diff changeset
19 endmodule