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

Subversion Repositories mips789

[/] [mips789/] [branches/] [avendor/] [rtl/] [verilog/] [ctl_fsm.v] - Diff between revs 15 and 35

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

Rev 15 Rev 35
Line 1... Line 1...
`include "include.h"
/******************************************************************
 
 *                                                                *
 
 *    Author: Liwei                                               *
 
 *                                                                *
 
 *    This file is part of the "mips789" project.                 *
 
 *    Downloaded from:                                            *
 
 *    http://www.opencores.org/pdownloads.cgi/list/mips789        *
 
 *                                                                *
 
 *    If you encountered any problem, please contact me via       *
 
 *    Email:mcupro@opencores.org  or mcupro@163.com               *
 
 *                                                                *
 
 ******************************************************************/
 
 
 
`include "mips789_defs.v"
module ctl_FSM (
module ctl_FSM (
        clk, iack, id2ra_ctl_clr, id2ra_ctl_cls,
        clk, iack, id2ra_ctl_clr, id2ra_ctl_cls,
        id2ra_ins_clr, id2ra_ins_cls, id_cmd, irq,
        id2ra_ins_clr, id2ra_ins_cls, id_cmd, irq,
        pc_prectl, ra2exec_ctl_clr, rst    ,zz_is_nop
        pc_prectl, ra2exec_ctl_clr, rst    ,zz_is_nop
    );
    );
Line 46... Line 59...
    wire    rst;
    wire    rst;
    reg riack;
    reg riack;
 
 
    reg  [5:0]delay_counter_Sreg0, next_delay_counter_Sreg0;
    reg  [5:0]delay_counter_Sreg0, next_delay_counter_Sreg0;
 
 
 
 
    reg [3:0] CurrState_Sreg0;
    reg [3:0] CurrState_Sreg0;
    reg [3:0] NextState_Sreg0;
    reg [3:0] NextState_Sreg0;
 
 
 
 
    always @ (*)
    always @ (*)
    begin : Sreg0_NextState
    begin : Sreg0_NextState
        case (CurrState_Sreg0) // synopsys parallel_case full_case
        case (CurrState_Sreg0)
            `IDLE:
            `IDLE:
            begin
            begin
                id2ra_ins_clr=ZERO;
                id2ra_ins_clr=ZERO;
                id2ra_ins_cls=ZERO;
                id2ra_ins_cls=ZERO;
                id2ra_ctl_clr=ZERO;
                id2ra_ctl_clr=ZERO;
Line 164... Line 175...
                riack=ZERO;
                riack=ZERO;
                if (~rst)
                if (~rst)
                NextState_Sreg0 = `RST;
                NextState_Sreg0 = `RST;
                else
                else
                NextState_Sreg0 = `IDLE;
                NextState_Sreg0 = `IDLE;
 
 
            end
            end
            `LD:
            `LD:
            begin
            begin
                id2ra_ins_clr=ONE;
                id2ra_ins_clr=ONE;
                id2ra_ins_cls=ZERO;
                id2ra_ins_cls=ZERO;
Line 225... Line 235...
                if (delay_counter_Sreg0 == 0)
                if (delay_counter_Sreg0 == 0)
                    NextState_Sreg0 = `IDLE;
                    NextState_Sreg0 = `IDLE;
                else
                else
                begin
                begin
                    NextState_Sreg0 = `D2_MUL_DLY;
                    NextState_Sreg0 = `D2_MUL_DLY;
                    if (delay_counter_Sreg0 != 0)
                      //  if (delay_counter_Sreg0 != 0)
                        next_delay_counter_Sreg0 = delay_counter_Sreg0 - 1;
                        next_delay_counter_Sreg0 = delay_counter_Sreg0 - 1;
                end
                end
            end
            end
 
 
            default :     //the same as RST
            default :     //the same as RST
Line 250... Line 260...
            end
            end
 
 
        endcase
        endcase
    end
    end
 
 
    always @ (posedge clk/* or negedge rst*/)
    always @ (posedge clk)
    begin : Sreg0_CurrentState
    begin : Sreg0_CurrentState
        if (~rst)
        if (~rst)
            CurrState_Sreg0 <= `RST;
            CurrState_Sreg0 <= `RST;
        else
        else
            CurrState_Sreg0 <= NextState_Sreg0;
            CurrState_Sreg0 <= NextState_Sreg0;
    end
    end
 
 
    always @ (posedge clk /*or negedge rst*/)
    always @ (posedge clk )
    begin : Sreg0_RegOutput
    begin : Sreg0_RegOutput
        if (~rst)
        if (~rst)
        begin
        begin
            delay_counter_Sreg0 <= 40   ;       // Initialization in the reset state or default value required!!
            delay_counter_Sreg0 <= 40   ;       // Initialization in the reset state or default value required!!
        end
        end

powered by: WebSVN 2.1.0

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