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

Subversion Repositories instruction_list_pipelined_processor_with_peripherals

[/] [instruction_list_pipelined_processor_with_peripherals/] [trunk/] [hdl/] [pgmCounter.v] - Diff between revs 7 and 8

Go to most recent revision | Only display areas with differences | Details | Blame | View Log

Rev 7 Rev 8
 
 
`include "timescale.v"
`include "timescale.v"
`include "defines.v"
`include "defines.v"
 
 
 
 
module pgmCounter (clk, reset, branch, pcIn, pcOut);
module pgmCounter (clk, reset, branch, pcIn, pcOut);
 
 
        input clk, reset, branch;
        input clk, reset, branch;
        input [`instAddrLen-1:0] pcIn;
        input [`instAddrLen-1:0] pcIn;
 
 
        output [`instAddrLen-1:0] pcOut;
        output [`instAddrLen-1:0] pcOut;
 
 
        reg [`instAddrLen-1:0] pc = `instAddrLen'b0;
        reg [`instAddrLen-1:0] pc = `instAddrLen'b0;
 
 
        always @ (posedge clk or posedge reset)
        always @ (posedge clk or posedge reset)
        begin
        begin
 
 
                if (reset)
                if (reset)
                begin
                begin
                        pc = `instAddrLen'b0;
                        pc = `instAddrLen'b0;
                        $write ("       program counter module is reset. Starting at address 00h        ");
                        $write ("\nprogram counter module is reset. Starting at address 00h     ");
                end
                end
 
 
                else
                else
                begin
                begin
 
 
                        if(branch)
                        if(branch)
                        begin
                        begin
                                pc = pcIn;
                                pc = pcIn;
                                $write ("       branching at address %h", pcIn);
                                $write ("\nbranching at address %h", pcIn);
                        end
                        end
                        else
                        else
                        begin
                        begin
                                pc = pc + 1'b1;
                                pc = pc + 1'b1;
                        end
                        end
                end
                end
        end     // end always
        end     // end always
 
 
 
 
        assign pcOut = pc;
        assign pcOut = pc;
 
 
 
 
endmodule
endmodule
 
 

powered by: WebSVN 2.1.0

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