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: DATENPFAD.v
|
// Filename: DATENPFAD.v
|
// Version: 1.1 bug fix
|
// Version: 2.0
|
// History: 1.0 first release of 30 Mai 2015
|
// History: 1.1 bug fix of 7 October 2015
|
// Date: 7 October 2015
|
// 1.0 first release of 30 Mai 2015
|
|
// Date: 14 August 2016
|
//
|
//
|
// Copyright (C) 2015 Udo Moeller
|
// Copyright (C) 2016 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
|
// removed from the file and that any derivative work contains
|
// removed from the file and that any derivative work contains
|
// the original copyright notice and the associated disclaimer.
|
// the original copyright notice and the associated disclaimer.
|
Line 105... |
Line 106... |
output [40:2] DBG_IN;
|
output [40:2] DBG_IN;
|
output COP_GO;
|
output COP_GO;
|
output [127:0] COP_OUT;
|
output [127:0] COP_OUT;
|
|
|
reg [31:0] high_dq;
|
reg [31:0] high_dq;
|
reg [31:0] OUT_I;
|
reg [31:0] IMMREG,MEMREG;
|
reg [31:0] BYDIN; // the bypass register
|
reg [31:0] BYDIN; // the bypass register
|
|
reg LDIMR;
|
|
|
wire [2:0] BITSEL;
|
wire [2:0] BITSEL;
|
wire [1:0] BWD;
|
wire [1:0] BWD;
|
wire CLR_LSB;
|
wire CLR_LSB;
|
wire [31:0] ERGEBNIS; // the result bus
|
wire [31:0] ERGEBNIS; // the result bus
|
Line 121... |
Line 123... |
wire SELI_A;
|
wire SELI_A;
|
wire SELI_B;
|
wire SELI_B;
|
wire [2:0] SP_CMP;
|
wire [2:0] SP_CMP;
|
wire [31:0] SRC1; // the bus for the Source 1 operand
|
wire [31:0] SRC1; // the bus for the Source 1 operand
|
wire [31:0] SRC2; // the bus for the Source 2 operand
|
wire [31:0] SRC2; // the bus for the Source 2 operand
|
|
wire [31:0] OUT_I;
|
wire [4:0] TT_DP;
|
wire [4:0] TT_DP;
|
wire TWREN; // active if FPU Trap occurs
|
wire TWREN; // active if FPU Trap occurs
|
wire UP_DP;
|
wire UP_DP;
|
wire WRADR_0;
|
wire WRADR_0;
|
wire WREN_L,WREN_LX;
|
wire WREN_L,WREN_LX;
|
Line 133... |
Line 136... |
wire [4:0] TT_SP;
|
wire [4:0] TT_SP;
|
wire [31:0] addr_i;
|
wire [31:0] addr_i;
|
wire [2:0] DP_CMP;
|
wire [2:0] DP_CMP;
|
wire [31:0] DP_OUT;
|
wire [31:0] DP_OUT;
|
wire [31:0] SFP_DAT;
|
wire [31:0] SFP_DAT;
|
wire ld_out_l;
|
|
wire [6:0] BMCODE;
|
wire [6:0] BMCODE;
|
wire [31:0] OUT_A,OUT_B;
|
wire [31:0] OUT_A,OUT_B;
|
wire SP_MUX;
|
wire SP_MUX;
|
wire [31:0] I_OUT;
|
wire [31:0] I_OUT;
|
wire [31:0] FP_OUT;
|
wire [31:0] FP_OUT;
|
Line 153... |
Line 155... |
assign BWD = OPER[9:8];
|
assign BWD = OPER[9:8];
|
assign OPCODE = OPER[7:0];
|
assign OPCODE = OPER[7:0];
|
|
|
assign ERGEBNIS = SP_MUX ? FP_OUT : I_OUT;
|
assign ERGEBNIS = SP_MUX ? FP_OUT : I_OUT;
|
|
|
assign WRADR_0 = WRADR[0] & ~CLR_LSB;
|
assign WRADR_0 = WRADR[0] ^ CLR_LSB;
|
assign ENWR = WREN_L | WREN;
|
assign ENWR = WREN_L | WREN;
|
assign DOWR = ENWR & TWREN;
|
assign DOWR = ENWR & TWREN;
|
|
|
assign WREN_L = WREN_LX & ~TRAPS[0];
|
assign WREN_L = WREN_LX & ~TRAPS[0];
|
|
|
Line 165... |
Line 167... |
|
|
assign PC_NEW = SRC1;
|
assign PC_NEW = SRC1;
|
|
|
always @(posedge BCLK) if (LD_OUT[1] || WREN) ACB_ZERO <= acb_zero_i;
|
always @(posedge BCLK) if (LD_OUT[1] || WREN) ACB_ZERO <= acb_zero_i;
|
|
|
always @(posedge BCLK) if (LD_OUT[1] || ld_out_l) high_dq <= ERGEBNIS;
|
always @(posedge BCLK) if (LD_OUT[1]) high_dq <= ERGEBNIS;
|
|
|
always @(posedge BCLK) if (LD_DIN) OUT_I <= LD_IMME ? IMME_Q : DIN;
|
always @(posedge BCLK)
|
|
if (LD_DIN)
|
|
begin
|
|
IMMREG <= IMME_Q;
|
|
MEMREG <= DIN;
|
|
LDIMR <= LD_IMME;
|
|
end
|
|
|
|
assign OUT_I = LDIMR ? IMMREG : MEMREG; // old solution had the multiplexor before the register
|
|
|
always @(posedge BCLK) if (RDAA[7]) BYDIN <= ERGEBNIS;
|
always @(posedge BCLK) if (RDAA[7]) BYDIN <= ERGEBNIS;
|
|
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
// Register Set 1 => SRC1
|
// Register Set 1 => SRC1
|
Line 337... |
Line 347... |
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
// ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
DP_FPU DOUBLE_U(
|
DP_FPU DOUBLE_U(
|
.BCLK(BCLK),
|
.BCLK(BCLK),
|
.FL(FL),
|
.FL(FL),
|
.BRESET(BRESET),
|
.BRESET(BRESET),
|
.LD_LDQ(LD_OUT[0]),
|
.LD_OUT(LD_OUT),
|
.WR_REG(WR_REG),
|
.WR_REG(WR_REG),
|
.BWD(BWD),
|
.BWD(BWD),
|
.FSR(FSR[8:3]),
|
.FSR(FSR[8:3]),
|
.OPCODE(OPCODE),
|
.OPCODE(OPCODE),
|
.SRC1(SRC1),
|
.SRC1(SRC1),
|
Line 349... |
Line 359... |
.START(START),
|
.START(START),
|
.DONE(DONE),
|
.DONE(DONE),
|
.UP_DP(UP_DP),
|
.UP_DP(UP_DP),
|
.WREN_L(WREN_LX),
|
.WREN_L(WREN_LX),
|
.CLR_LSB(CLR_LSB),
|
.CLR_LSB(CLR_LSB),
|
.LD_OUT_L(ld_out_l),
|
|
.DVZ_TRAP(TRAPS[1]),
|
.DVZ_TRAP(TRAPS[1]),
|
.DP_CMP(DP_CMP),
|
.DP_CMP(DP_CMP),
|
.DP_OUT(DP_OUT),
|
.DP_OUT(DP_OUT),
|
.DP_Q(DP_Q[31:0]),
|
.DP_Q(DP_Q[31:0]),
|
.TT_DP(TT_DP),
|
.TT_DP(TT_DP),
|
Line 381... |
Line 390... |
.SP_MUX(SP_MUX),
|
.SP_MUX(SP_MUX),
|
.UP_SP(UP_SP),
|
.UP_SP(UP_SP),
|
.FP_OUT(FP_OUT),
|
.FP_OUT(FP_OUT),
|
.I_OUT(SFP_DAT),
|
.I_OUT(SFP_DAT),
|
.SP_CMP(SP_CMP),
|
.SP_CMP(SP_CMP),
|
.TT_SP(TT_SP));
|
.TT_SP(TT_SP),
|
|
.START(START[1]) );
|
|
|
FP_STAT_REG FPS_REG(
|
FP_STAT_REG FPS_REG(
|
.BCLK(BCLK),
|
.BCLK(BCLK),
|
.BRESET(BRESET),
|
.BRESET(BRESET),
|
.LFSR(LD_FSR),
|
.LFSR(LD_FSR),
|
.WREN(ENWR),
|
.WREN(ENWR),
|
.WRADR(WRADR[5:4]),
|
.WRADR(WRADR[5:4]),
|
.UP_DP(UP_DP),
|
.UP_DP(UP_DP),
|
.UP_SP(UP_SP & LD_OUT[1]),
|
.UP_SP(UP_SP),
|
.DIN(SRC1[16:0]),
|
.DIN(SRC1[16:0]),
|
.TT_DP(TT_DP),
|
.TT_DP(TT_DP),
|
.TT_SP(TT_SP),
|
.TT_SP(TT_SP),
|
.FPU_TRAP(TRAPS[0]),
|
.FPU_TRAP(TRAPS[0]),
|
.TWREN(TWREN),
|
.TWREN(TWREN),
|