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

Subversion Repositories rtcclock

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

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

Rev 4 Rev 5
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,
 
                //
 
                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;
        input   [2:0]    i_wb_addr;
        input   [2:0]    i_wb_addr;
        input   [31:0]   i_wb_data;
        input   [31:0]   i_wb_data;
        // input                i_btn;
        // input                i_btn;
        output  reg     [31:0]   o_data;
        output  reg     [31:0]   o_data;
        output  reg     [31:0]   o_sseg;
        output  reg     [31:0]   o_sseg;
        output  wire    [15:0]   o_led;
        output  wire    [15:0]   o_led;
        output  wire            o_interrupt;
        output  wire            o_interrupt, o_ppd;
        input                   i_hack;
        input                   i_hack;
 
 
        reg     [31:0]   clock, stopwatch, ckspeed;
        reg     [31:0]   clock, stopwatch, ckspeed;
        reg     [25:0]   timer;
        reg     [25:0]   timer;
 
 
Line 122... Line 124...
                                clock[21:20] <= clock[21:20] + 2'h1;
                                clock[21:20] <= clock[21:20] + 2'h1;
                        end else begin
                        end else begin
                                clock[19:16] <= clock[19:16] + 4'h1;
                                clock[19:16] <= clock[19:16] + 4'h1;
                        end
                        end
                end
                end
                // ppd <= (clock{15:8] == 8'h59);
                ck_ppd <= (clock[21:0] == 22'h235959);
 
 
 
 
                if ((ck_sel)&&(i_wb_we))
                if ((ck_sel)&&(i_wb_we))
                begin
                begin
                        if (8'hff != i_wb_data[7:0])
                        if (8'hff != i_wb_data[7:0])
                        begin
                        begin
Line 478... Line 481...
                                ledreg[10], ledreg[11], ledreg[12], ledreg[13],
                                ledreg[10], ledreg[11], ledreg[12], ledreg[13],
                                ledreg[14], ledreg[15], ledreg[16], ledreg[17] };
                                ledreg[14], ledreg[15], ledreg[16], ledreg[17] };
 
 
        assign  o_interrupt = tm_int || al_int;
        assign  o_interrupt = tm_int || al_int;
 
 
 
        // A once-per day strobe, on the last second of the day so that the
 
        // the next clock is the first clock of the day.  This is useful for
 
        // connecting this module to a year/month/date date/calendar module.
 
        assign  o_ppd = (ck_ppd)&&(ck_pps);
 
 
        always @(posedge i_clk)
        always @(posedge i_clk)
                case(i_wb_addr[2:0])
                case(i_wb_addr[2:0])
                3'b000: o_data <= { clock[31:22], ck_last_clock };
                3'b000: o_data <= { clock[31:22], ck_last_clock };
                3'b001: o_data <= { 6'h00, timer };
                3'b001: o_data <= { 6'h00, timer };
                3'b010: o_data <= stopwatch;
                3'b010: o_data <= stopwatch;

powered by: WebSVN 2.1.0

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