Line 2... |
Line 2... |
//
|
//
|
// This file is part of the M32632 project
|
// This file is part of the M32632 project
|
// http://opencores.org/project,m32632
|
// http://opencores.org/project,m32632
|
//
|
//
|
// Filename: I_PFAD.v
|
// Filename: I_PFAD.v
|
// Version: 1.0
|
// Version: 1.1 bug fix
|
// Date: 30 May 2015
|
// History: 1.0 first release of 30 Mai 2015
|
|
// Date: 7 November 2015
|
//
|
//
|
// Copyright (C) 2015 Udo Moeller
|
// Copyright (C) 2015 Udo Moeller
|
//
|
//
|
// This source file may be used and distributed without
|
// This source file may be used and distributed without
|
// restriction provided that this copyright statement is not
|
// restriction provided that this copyright statement is not
|
Line 615... |
Line 616... |
// ++++++++++++++ Format 5 Opcodes : Strings MOVS , CMPS und SKPS +++++++++++++++++++++++++++++++
|
// ++++++++++++++ Format 5 Opcodes : Strings MOVS , CMPS und SKPS +++++++++++++++++++++++++++++++
|
|
|
reg [11:0] spointer,dpointer;
|
reg [11:0] spointer,dpointer;
|
reg [9:0] todo;
|
reg [9:0] todo;
|
reg [9:4] todo_reg;
|
reg [9:4] todo_reg;
|
wire [3:0] abzug;
|
reg dis_opt;
|
|
wire [31:0] diff_poi;
|
wire mehr,weiter,op_str,no_opt;
|
wire mehr,weiter,op_str,no_opt;
|
|
|
assign op_str = (OPCODE[7:3] == 5'b0101_0);
|
assign op_str = (OPCODE[7:3] == 5'b0101_0);
|
|
|
|
assign diff_poi = SRC2 - SRC1; // Special Case
|
|
|
|
always @(posedge BCLK) if (op_str && OPCODE[2]) dis_opt <= (diff_poi[31:3] == 29'd0);
|
|
|
// This logic is for detection if an accelerated MOVS/MOVM inside a page is possible - Backward is not possible
|
// This logic is for detection if an accelerated MOVS/MOVM inside a page is possible - Backward is not possible
|
always @(posedge BCLK)
|
always @(posedge BCLK)
|
if (op_str)
|
if (op_str)
|
begin
|
begin
|
spointer <= OPCODE[2] ? SRC1[11:0] : (spointer + {8'h00,todo[3:0]}); // Source
|
spointer <= OPCODE[2] ? SRC1[11:0] : (spointer + {8'h00,todo[3:0]}); // Source
|
dpointer <= OPCODE[2] ? SRC2[11:0] : (dpointer + {8'h00,todo[3:0]}); // Destination
|
dpointer <= OPCODE[2] ? SRC2[11:0] : (dpointer + {8'h00,todo[3:0]}); // Destination
|
end
|
end
|
|
|
assign no_opt = OPCODE[1] | ((spointer[11:3] == 9'h1FF) & (spointer[2:0] != 3'b000))
|
assign no_opt = OPCODE[1] | ((spointer[11:3] == 9'h1FF) & (spointer[2:0] != 3'b000))
|
| kill_opt | ((dpointer[11:3] == 9'h1FF) & (dpointer[2:0] != 3'b000));
|
| kill_opt | ((dpointer[11:3] == 9'h1FF) & (dpointer[2:0] != 3'b000))
|
|
| dis_opt;
|
assign abzug = OPCODE[0] ? todo_reg[7:4] : 4'h0 ;
|
|
|
|
assign pfad_5 = SRC1 - {28'h0,abzug};
|
assign pfad_5 = SRC1 - {28'h0,todo_reg[7:4]};
|
|
|
assign mehr = (pfad_5[31:4] != 28'h0);
|
assign mehr = (pfad_5[31:4] != 28'h0);
|
|
|
always @(no_opt or BWD or mehr or pfad_5)
|
always @(no_opt or BWD or mehr or pfad_5)
|
casex ({no_opt,BWD,mehr,pfad_5[3:0]})
|
casex ({no_opt,BWD,mehr,pfad_5[3:0]})
|
Line 663... |
Line 668... |
8'b101_xxxxx : todo = 10'h112;
|
8'b101_xxxxx : todo = 10'h112;
|
8'b11x_xxxxx : todo = 10'h214;
|
8'b11x_xxxxx : todo = 10'h214;
|
default : todo = 10'hxxx;
|
default : todo = 10'hxxx;
|
endcase
|
endcase
|
|
|
always @(posedge BCLK) if (op_str) todo_reg <= todo[9:4]; // store for next phase 51
|
always @(posedge BCLK) if (op_str) todo_reg <= {todo[9:8],(OPCODE[2] ? 4'd0 : todo[7:4])}; // store for next phase 51
|
|
|
assign weiter = mehr | (pfad_5[3:0] != 4'h0);
|
assign weiter = mehr | (pfad_5[3:0] != 4'h0);
|
|
|
assign STRING = {1'b0,ACB_ZERO,weiter,( op_str ? todo[9:8] : todo_reg[9:8] )}; // ACB_ZERO is delayed 1 cycle extern
|
assign STRING = {1'b0,ACB_ZERO,weiter,( op_str ? todo[9:8] : todo_reg[9:8] )}; // ACB_ZERO is delayed 1 cycle extern
|
|
|