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

Subversion Repositories 8051

[/] [8051/] [trunk/] [rtl/] [verilog/] [oc8051_decoder.v] - Diff between revs 149 and 179

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

Rev 149 Rev 179
Line 43... Line 43...
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
//
//
// CVS Revision History
// CVS Revision History
//
//
// $Log: not supported by cvs2svn $
// $Log: not supported by cvs2svn $
 
// Revision 1.21  2003/06/03 17:09:57  simont
 
// pipelined acces to axternal instruction interface added.
 
//
// Revision 1.20  2003/05/06 11:10:38  simont
// Revision 1.20  2003/05/06 11:10:38  simont
// optimize state machine.
// optimize state machine.
//
//
// Revision 1.19  2003/05/06 09:41:35  simont
// Revision 1.19  2003/05/06 09:41:35  simont
// remove define OC8051_AS2_PCL, chane signal src_sel2 to 2 bit wide.
// remove define OC8051_AS2_PCL, chane signal src_sel2 to 2 bit wide.
Line 163... Line 166...
//
//
// main block
// main block
// unregisterd outputs
// unregisterd outputs
always @(op_cur or eq or state_dec or mem_wait)
always @(op_cur or eq or state_dec or mem_wait)
begin
begin
    case (state_dec)
    case (state_dec) /* synopsys full_case parallel_case */
      2'b01: begin
      2'b01: begin
        casex (op_cur)
        casex (op_cur) /* synopsys parallel_case */
          `OC8051_DIV : begin
          `OC8051_DIV : begin
              ram_rd_sel = `OC8051_RRS_B;
              ram_rd_sel = `OC8051_RRS_B;
            end
            end
          `OC8051_MUL : begin
          `OC8051_MUL : begin
              ram_rd_sel = `OC8051_RRS_B;
              ram_rd_sel = `OC8051_RRS_B;
Line 184... Line 187...
        pc_sel = `OC8051_PIS_DC;
        pc_sel = `OC8051_PIS_DC;
        comp_sel =  `OC8051_CSS_DC;
        comp_sel =  `OC8051_CSS_DC;
        rmw = `OC8051_RMW_N;
        rmw = `OC8051_RMW_N;
      end
      end
      2'b10: begin
      2'b10: begin
        casex (op_cur)
        casex (op_cur) /* synopsys parallel_case */
          `OC8051_SJMP : begin
          `OC8051_SJMP : begin
              ram_rd_sel = `OC8051_RRS_DC;
              ram_rd_sel = `OC8051_RRS_DC;
              pc_wr = `OC8051_PCW_Y;
              pc_wr = `OC8051_PCW_Y;
              pc_sel = `OC8051_PIS_SO1;
              pc_sel = `OC8051_PIS_SO1;
              comp_sel =  `OC8051_CSS_DC;
              comp_sel =  `OC8051_CSS_DC;
Line 331... Line 334...
        endcase
        endcase
        rmw = `OC8051_RMW_N;
        rmw = `OC8051_RMW_N;
        stb_i = 1'b1;
        stb_i = 1'b1;
      end
      end
      2'b11: begin
      2'b11: begin
        casex (op_cur)
        casex (op_cur) /* synopsys parallel_case */
          `OC8051_CJNE_R : begin
          `OC8051_CJNE_R : begin
              ram_rd_sel = `OC8051_RRS_DC;
              ram_rd_sel = `OC8051_RRS_DC;
              pc_wr = `OC8051_PCW_N;
              pc_wr = `OC8051_PCW_N;
              pc_sel = `OC8051_PIS_DC;
              pc_sel = `OC8051_PIS_DC;
            end
            end
Line 393... Line 396...
        comp_sel =  `OC8051_CSS_DC;
        comp_sel =  `OC8051_CSS_DC;
        rmw = `OC8051_RMW_N;
        rmw = `OC8051_RMW_N;
        stb_i = 1'b1;
        stb_i = 1'b1;
        bit_addr = 1'b0;
        bit_addr = 1'b0;
      end
      end
      default: begin
      2'b00: begin
        casex (op_cur)
        casex (op_cur) /* synopsys parallel_case */
          `OC8051_ACALL :begin
          `OC8051_ACALL :begin
              ram_rd_sel = `OC8051_RRS_DC;
              ram_rd_sel = `OC8051_RRS_DC;
              pc_wr = `OC8051_PCW_Y;
              pc_wr = `OC8051_PCW_Y;
              pc_sel = `OC8051_PIS_I11;
              pc_sel = `OC8051_PIS_I11;
              comp_sel =  `OC8051_CSS_DC;
              comp_sel =  `OC8051_CSS_DC;
Line 1196... Line 1199...
    psw_set <= #1 `OC8051_PS_NOT;
    psw_set <= #1 `OC8051_PS_NOT;
    cy_sel <= #1 `OC8051_CY_0;
    cy_sel <= #1 `OC8051_CY_0;
    src_sel3 <= #1 `OC8051_AS3_DC;
    src_sel3 <= #1 `OC8051_AS3_DC;
    wr_sfr <= #1 `OC8051_WRS_N;
    wr_sfr <= #1 `OC8051_WRS_N;
  end else if (!wait_data) begin
  end else if (!wait_data) begin
    case (state_dec)
    case (state_dec) /* synopsys parallel_case */
      2'b01: begin
      2'b01: begin
        casex (op_cur)
        casex (op_cur) /* synopsys parallel_case */
          `OC8051_MOVC_DP :begin
          `OC8051_MOVC_DP :begin
              ram_wr_sel <= #1 `OC8051_RWS_DC;
              ram_wr_sel <= #1 `OC8051_RWS_DC;
              src_sel1 <= #1 `OC8051_AS1_OP1;
              src_sel1 <= #1 `OC8051_AS1_OP1;
              src_sel2 <= #1 `OC8051_AS2_DC;
              src_sel2 <= #1 `OC8051_AS2_DC;
              alu_op <= #1 `OC8051_ALU_NOP;
              alu_op <= #1 `OC8051_ALU_NOP;
Line 1294... Line 1297...
        endcase
        endcase
        cy_sel <= #1 `OC8051_CY_0;
        cy_sel <= #1 `OC8051_CY_0;
        src_sel3 <= #1 `OC8051_AS3_DC;
        src_sel3 <= #1 `OC8051_AS3_DC;
      end
      end
      2'b10: begin
      2'b10: begin
        casex (op_cur)
        casex (op_cur) /* synopsys parallel_case */
          `OC8051_ACALL :begin
          `OC8051_ACALL :begin
              ram_wr_sel <= #1 `OC8051_RWS_SP;
              ram_wr_sel <= #1 `OC8051_RWS_SP;
              src_sel1 <= #1 `OC8051_AS1_PCH;
              src_sel1 <= #1 `OC8051_AS1_PCH;
              src_sel2 <= #1 `OC8051_AS2_DC;
              src_sel2 <= #1 `OC8051_AS2_DC;
              alu_op <= #1 `OC8051_ALU_NOP;
              alu_op <= #1 `OC8051_ALU_NOP;
Line 1350... Line 1353...
        src_sel3 <= #1 `OC8051_AS3_DC;
        src_sel3 <= #1 `OC8051_AS3_DC;
        wr_sfr <= #1 `OC8051_WRS_N;
        wr_sfr <= #1 `OC8051_WRS_N;
      end
      end
 
 
      2'b11: begin
      2'b11: begin
        casex (op_cur)
        casex (op_cur) /* synopsys parallel_case */
          `OC8051_RET : begin
          `OC8051_RET : begin
              src_sel1 <= #1 `OC8051_AS1_RAM;
              src_sel1 <= #1 `OC8051_AS1_RAM;
              src_sel2 <= #1 `OC8051_AS2_DC;
              src_sel2 <= #1 `OC8051_AS2_DC;
              alu_op <= #1 `OC8051_ALU_NOP;
              alu_op <= #1 `OC8051_ALU_NOP;
              psw_set <= #1 `OC8051_PS_NOT;
              psw_set <= #1 `OC8051_PS_NOT;
Line 1389... Line 1392...
        cy_sel <= #1 `OC8051_CY_0;
        cy_sel <= #1 `OC8051_CY_0;
        src_sel3 <= #1 `OC8051_AS3_DC;
        src_sel3 <= #1 `OC8051_AS3_DC;
        wr_sfr <= #1 `OC8051_WRS_N;
        wr_sfr <= #1 `OC8051_WRS_N;
      end
      end
      default: begin
      default: begin
        casex (op_cur)
        casex (op_cur) /* synopsys parallel_case */
          `OC8051_ACALL :begin
          `OC8051_ACALL :begin
              ram_wr_sel <= #1 `OC8051_RWS_SP;
              ram_wr_sel <= #1 `OC8051_RWS_SP;
              src_sel1 <= #1 `OC8051_AS1_PCL;
              src_sel1 <= #1 `OC8051_AS1_PCL;
              src_sel2 <= #1 `OC8051_AS2_DC;
              src_sel2 <= #1 `OC8051_AS2_DC;
              alu_op <= #1 `OC8051_ALU_NOP;
              alu_op <= #1 `OC8051_ALU_NOP;
Line 2635... Line 2638...
always @(posedge clk or posedge rst)
always @(posedge clk or posedge rst)
begin
begin
  if (rst)
  if (rst)
    state <= #1 2'b11;
    state <= #1 2'b11;
  else if  (!mem_wait & !wait_data) begin
  else if  (!mem_wait & !wait_data) begin
    case (state)
    case (state) /* synopsys parallel_case */
      2'b10: state <= #1 2'b01;
      2'b10: state <= #1 2'b01;
      2'b11: state <= #1 2'b10;
      2'b11: state <= #1 2'b10;
      2'b00:
      2'b00:
          casex (op_in)
          casex (op_in) /* synopsys full_case parallel_case */
            `OC8051_ACALL   : state <= #1 2'b10;
            `OC8051_ACALL   : state <= #1 2'b10;
            `OC8051_AJMP    : state <= #1 2'b10;
            `OC8051_AJMP    : state <= #1 2'b10;
            `OC8051_CJNE_R  : state <= #1 2'b10;
            `OC8051_CJNE_R  : state <= #1 2'b10;
            `OC8051_CJNE_I  : state <= #1 2'b10;
            `OC8051_CJNE_I  : state <= #1 2'b10;
            `OC8051_CJNE_D  : state <= #1 2'b10;
            `OC8051_CJNE_D  : state <= #1 2'b10;
Line 2669... Line 2672...
            `OC8051_JNB     : state <= #1 2'b10;
            `OC8051_JNB     : state <= #1 2'b10;
            `OC8051_JNZ     : state <= #1 2'b10;
            `OC8051_JNZ     : state <= #1 2'b10;
            `OC8051_JZ      : state <= #1 2'b10;
            `OC8051_JZ      : state <= #1 2'b10;
            `OC8051_DIV     : state <= #1 2'b11;
            `OC8051_DIV     : state <= #1 2'b11;
            `OC8051_MUL     : state <= #1 2'b11;
            `OC8051_MUL     : state <= #1 2'b11;
            default         : state <= #1 2'b00;
//            default         : state <= #1 2'b00;
          endcase
          endcase
      default: state <= #1 2'b00;
      default: state <= #1 2'b00;
    endcase
    endcase
  end
  end
end
end
Line 2686... Line 2689...
  if (rst) begin
  if (rst) begin
    mem_act <= #1 `OC8051_MAS_NO;
    mem_act <= #1 `OC8051_MAS_NO;
  end else if (!rd) begin
  end else if (!rd) begin
    mem_act <= #1 `OC8051_MAS_NO;
    mem_act <= #1 `OC8051_MAS_NO;
  end else
  end else
    casex (op_cur)
    casex (op_cur) /* synopsys parallel_case */
      `OC8051_MOVX_AI : mem_act <= #1 `OC8051_MAS_RI_W;
      `OC8051_MOVX_AI : mem_act <= #1 `OC8051_MAS_RI_W;
      `OC8051_MOVX_AP : mem_act <= #1 `OC8051_MAS_DPTR_W;
      `OC8051_MOVX_AP : mem_act <= #1 `OC8051_MAS_DPTR_W;
      `OC8051_MOVX_IA : mem_act <= #1 `OC8051_MAS_RI_R;
      `OC8051_MOVX_IA : mem_act <= #1 `OC8051_MAS_RI_R;
      `OC8051_MOVX_PA : mem_act <= #1 `OC8051_MAS_DPTR_R;
      `OC8051_MOVX_PA : mem_act <= #1 `OC8051_MAS_DPTR_R;
      `OC8051_MOVC_DP : mem_act <= #1 `OC8051_MAS_CODE;
      `OC8051_MOVC_DP : mem_act <= #1 `OC8051_MAS_CODE;

powered by: WebSVN 2.1.0

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