OpenCores
URL https://opencores.org/ocsvn/rtcclock/rtcclock/trunk

Subversion Repositories rtcclock

[/] [rtcclock/] [trunk/] [rtl/] [rtcclock.v] - Diff between revs 5 and 6

Go to most recent revision | Show entire file | Details | Blame | View Log

Rev 5 Rev 6
Line 43... Line 43...
                // i_btn,
                // i_btn,
                // Output registers
                // Output registers
                o_data, // multiplexed based upon i_wb_addr
                o_data, // multiplexed based upon i_wb_addr
                // Output controls
                // Output controls
                o_sseg, o_led, o_interrupt,
                o_sseg, o_led, o_interrupt,
                //
                // A once-per-day strobe on the last clock of the day
                o_ppd,
                o_ppd,
                // Time setting hack(s)
                // Time setting hack(s)
                i_hack);
                i_hack);
        input   i_clk;
        input   i_clk;
        input   i_wb_cyc, i_wb_stb, i_wb_we;
        input   i_wb_cyc, i_wb_stb, i_wb_we;
Line 421... Line 421...
                        hack_time <= { clock[21:0], ck_sub };
                        hack_time <= { clock[21:0], ck_sub };
                        r_hack_carry <= 1'b0;
                        r_hack_carry <= 1'b0;
                end
                end
 
 
        reg     [15:0]   h_sseg;
        reg     [15:0]   h_sseg;
        reg     [3:0]    dmask;
        reg     [3:1]   dmask;
        always @(posedge i_clk)
        always @(posedge i_clk)
                case(clock[27:24])
                case(clock[27:24])
                4'h1: begin h_sseg <= timer[15:0];
                4'h1: begin h_sseg <= timer[15:0];
                        if (tm_alarm) dmask <= 4'hf;
                        if (tm_alarm) dmask <= 3'h7;
                        else begin
                        else begin
                                dmask[3] <= (12'h000 != timer[23:12]); // timer[15:12]
                                dmask[3] <= (12'h000 != timer[23:12]); // timer[15:12]
                                dmask[2] <= (16'h000 != timer[23: 8]); // timer[11: 8]
                                dmask[2] <= (16'h000 != timer[23: 8]); // timer[11: 8]
                                dmask[1] <= (20'h000 != timer[23: 4]); // timer[ 7: 4]
                                dmask[1] <= (20'h000 != timer[23: 4]); // timer[ 7: 4]
                                dmask[0] <= 1'b1; // Always on
                                // dmask[0] <= 1'b1; // Always on
                        end end
                        end end
                4'h2: begin h_sseg <= stopwatch[19:4];
                4'h2: begin h_sseg <= stopwatch[19:4];
                                dmask[3] <= (12'h00  != stopwatch[27:16]);
                                dmask[3] <= (12'h00  != stopwatch[27:16]);
                                dmask[2] <= (16'h000 != stopwatch[27:12]);
                                dmask[2] <= (16'h000 != stopwatch[27:12]);
                                dmask[1] <= 1'b1; // Always on, stopwatch[11:8]
                                dmask[1] <= 1'b1; // Always on, stopwatch[11:8]
                                dmask[0] <= 1'b1; // Always on, stopwatch[7:4]
                                // dmask[0] <= 1'b1; // Always on, stopwatch[7:4]
                        end
                        end
                4'h3: begin h_sseg <= ck_last_clock[15:0];
                4'h3: begin h_sseg <= ck_last_clock[15:0];
                                dmask[3:0] <= 4'hf;
                                dmask[3:1] <= 3'h7;
                        end
                        end
                default: begin // 4'h0
                default: begin // 4'h0
                        h_sseg <= { 2'b00, ck_last_clock[21:8] };
                        h_sseg <= { 2'b00, ck_last_clock[21:8] };
                        dmask[2:0] <= 3'hf;
                        dmask[2:1] <= 2'b11;
                        dmask[3] <= (2'b00 != ck_last_clock[21:20]);
                        dmask[3] <= (2'b00 != ck_last_clock[21:20]);
                        end
                        end
                endcase
                endcase
 
 
        wire    [31:0]   w_sseg;
        wire    [31:0]   w_sseg;
Line 466... Line 466...
                else
                else
                        o_sseg <= {
                        o_sseg <= {
                                (dmask[3])?w_sseg[31:24]:8'h00,
                                (dmask[3])?w_sseg[31:24]:8'h00,
                                (dmask[2])?w_sseg[23:16]:8'h00,
                                (dmask[2])?w_sseg[23:16]:8'h00,
                                (dmask[1])?w_sseg[15: 8]:8'h00,
                                (dmask[1])?w_sseg[15: 8]:8'h00,
                                (dmask[0])?w_sseg[ 7: 0]:8'h00 };
                                w_sseg[ 7: 0] };
 
 
        reg     [17:0]   ledreg;
        reg     [17:0]   ledreg;
        always @(posedge i_clk)
        always @(posedge i_clk)
                if ((ck_pps)&&(ck_ppm))
                if ((ck_pps)&&(ck_ppm))
                        ledreg <= 18'h00;
                        ledreg <= 18'h00;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.