Line 95... |
Line 95... |
wire wReservationStationBusy;
|
wire wReservationStationBusy;
|
wire [`COMMIT_PACKET_SIZE-1:0] wResultFifoData;
|
wire [`COMMIT_PACKET_SIZE-1:0] wResultFifoData;
|
reg rTagMemoryWE,rTagMemOwner,rIssueNow,rIncrementPC,rPopFifo,rBypassFifo,rUseForwardedData;
|
reg rTagMemoryWE,rTagMemOwner,rIssueNow,rIncrementPC,rPopFifo,rBypassFifo,rUseForwardedData;
|
reg rSetPCBranchTaken;
|
reg rSetPCBranchTaken;
|
wire wBranchWithDependency;
|
wire wBranchWithDependency;
|
|
wire wIO_Operation_TMWRITE;
|
|
|
|
|
|
|
wire wMtHasOnceMoreTimeSlot,wEnabled_Delay;
|
wire wMtHasOnceMoreTimeSlot,wEnabled_Delay;
|
wire wIO_Operation;
|
wire wIO_Operation;
|
assign wIO_Operation = (~wOp[0] & wOp[1] & wOp[2] & ~wOp[3]);
|
assign wIO_Operation = (~wOp[0] & wOp[1] & wOp[2] & ~wOp[3]);
|
|
|
|
assign wIO_Operation_TMWRITE = wIO_Operation && (iInstruction0[`INST_SCOP_RNG] == `IO_OPERATION_OMWRITE);
|
|
|
FFD_POSEDGE_SYNCRONOUS_RESET # ( 1 ) FFD123
|
FFD_POSEDGE_SYNCRONOUS_RESET # ( 1 ) FFD123
|
( Clock, Reset, 1'b1 , iEnable , wEnabled_Delay );
|
( Clock, Reset, 1'b1 , iEnable , wEnabled_Delay );
|
|
|
assign wMtHasOnceMoreTimeSlot = ~wEnabled_Delay;
|
assign wMtHasOnceMoreTimeSlot = ~wEnabled_Delay;
|
|
|
Line 145... |
Line 150... |
/*The PC will be incremented except for the scenario where we need to wait
|
/*The PC will be incremented except for the scenario where we need to wait
|
for reservation stations to become available. If we increment the PC, then the
|
for reservation stations to become available. If we increment the PC, then the
|
value of PC will get update the next clock cycle, and another clock cycle
|
value of PC will get update the next clock cycle, and another clock cycle
|
after that the instruction will get updated.
|
after that the instruction will get updated.
|
1- If there is data waiting on the commit bus input port this cycle,
|
1- If there is data waiting on the commit bus input port this cycle,
|
then do not queue this data into the FIFO but instead set
|
then do not queue this data into the input FIFO but instead set
|
set the score board write enable to 1, set the wSBWriteAddress
|
set the score board write enable to 1, set the wSBWriteAddress
|
to the CommitPacket Destination range and update the score board
|
to the CommitPacket Destination range and update the score board
|
bit to zero, so than in the next state the score board bit associated
|
bit to zero, so than in the next state the score board bit associated
|
to the commit data has been updated.
|
to the commit data has been updated.
|
2 - If there is no data waiting on the commit bus this clock cycle, but there
|
2 - If there is no data waiting on the commit bus this clock cycle, but there
|
Line 172... |
Line 177... |
|
|
if (wCommitBusDataAvailabe & ~wReservationStationBusy /**/& (iMtEnabled & wMtHasOnceMoreTimeSlot | ~iMtEnabled)/**/)
|
if (wCommitBusDataAvailabe & ~wReservationStationBusy /**/& (iMtEnabled & wMtHasOnceMoreTimeSlot | ~iMtEnabled)/**/)
|
rNextState = `II_ISSUE_REQUEST_WITH_DATA_FWD;
|
rNextState = `II_ISSUE_REQUEST_WITH_DATA_FWD;
|
else if (~wCommitBusInputFifo_Empty)
|
else if (~wCommitBusInputFifo_Empty)
|
rNextState = `II_FIFO_UPDATE;
|
rNextState = `II_FIFO_UPDATE;
|
else if ( wReservationStationBusy | (iMtEnabled & ~wMtHasOnceMoreTimeSlot))
|
else if ( wReservationStationBusy | (iMtEnabled & ~wMtHasOnceMoreTimeSlot) /*| wIOWrite_Waiting_for_OMRead*/ )
|
rNextState = `II_FETCH_INSTRUCTION;
|
rNextState = `II_FETCH_INSTRUCTION;
|
else
|
else
|
rNextState = `II_ISSUE_REQUEST;
|
rNextState = `II_ISSUE_REQUEST;
|
|
|
end
|
end
|
//--------------------------------------
|
//--------------------------------------
|
//TODO: If the reservation station is Busy (static hazard)
|
//TODO: If the reservation station is Busy (static hazard)
|
//Then we shall stall the machine...
|
//Then we shall stall the machine...
|
`II_ISSUE_REQUEST:
|
`II_ISSUE_REQUEST:
|
begin
|
begin
|
rTagMemoryWE = ~iInstruction0[`INST_BRANCH_BIT] & ~wIO_Operation;
|
rTagMemoryWE = ~iInstruction0[`INST_BRANCH_BIT] & ~wIO_Operation_TMWRITE;
|
rTagMemOwner = `TAGMEM_OWNER_ISSUE;
|
rTagMemOwner = `TAGMEM_OWNER_ISSUE;
|
rIssueNow = iEnable;
|
rIssueNow = iEnable;
|
rIncrementPC = (iInstruction0[`INST_BRANCH_BIT] & ~wBranchWithDependency & iEnable);
|
rIncrementPC = (iInstruction0[`INST_BRANCH_BIT] & ~wBranchWithDependency & iEnable);
|
rPopFifo = 1'b0;
|
rPopFifo = 1'b0;
|
rBypassFifo = 1'b0;
|
rBypassFifo = 1'b0;
|
Line 209... |
Line 214... |
Here the instruction remains the same as in the
|
Here the instruction remains the same as in the
|
previous clock cycle.
|
previous clock cycle.
|
*/
|
*/
|
`II_ISSUE_REQUEST_WITH_DATA_FWD:
|
`II_ISSUE_REQUEST_WITH_DATA_FWD:
|
begin
|
begin
|
rTagMemoryWE = ~iInstruction0[`INST_BRANCH_BIT] & ~wIO_Operation;
|
rTagMemoryWE = ~iInstruction0[`INST_BRANCH_BIT] & ~wIO_Operation_TMWRITE;
|
rTagMemOwner = `TAGMEM_OWNER_ISSUE;
|
rTagMemOwner = `TAGMEM_OWNER_ISSUE;
|
rIssueNow = iEnable;
|
rIssueNow = iEnable;
|
rIncrementPC = (iInstruction0[`INST_BRANCH_BIT] & ~wBranchWithDependency & iEnable);
|
rIncrementPC = (iInstruction0[`INST_BRANCH_BIT] & ~wBranchWithDependency & iEnable);
|
rPopFifo = 1'b1;
|
rPopFifo = 1'b1;
|
rBypassFifo = 1'b0;
|
rBypassFifo = 1'b0;
|
Line 324... |
Line 329... |
wire [SB_ENTRY_WIDTH-1:0] wSBDataPort1;
|
wire [SB_ENTRY_WIDTH-1:0] wSBDataPort1;
|
wire[3:0] wReservationStation;
|
wire[3:0] wReservationStation;
|
|
|
`ifdef ADDRESSING_MODES_DISABLED
|
`ifdef ADDRESSING_MODES_DISABLED
|
|
|
|
//There a two possible ways to update the Score board. The SB can be update by the operation we just commited: iInstruction0
|
|
//or the SB can be updated by the value comming from the wResultFifoData
|
assign wSBWriteAddress
|
assign wSBWriteAddress
|
= (rTagMemOwner == `TAGMEM_OWNER_ISSUE) ? ((rBypassFifo)?iResultBcast[`COMMIT_DST_RNG]:iInstruction0[`INST_DST_RNG])
|
= (rTagMemOwner == `TAGMEM_OWNER_ISSUE) ? ((rBypassFifo)?iResultBcast[`COMMIT_DST_RNG]:iInstruction0[`INST_DST_RNG])
|
: wResultFifoData[`COMMIT_DST_RNG];
|
: wResultFifoData[`COMMIT_DST_RNG];
|
|
|
`else
|
`else
|
|
//There a two possible ways to update the Score board. The SB can be update by the operation we just commited: iInstruction0
|
|
//or the SB can be updated by the value comming from the wResultFifoData
|
assign wSBWriteAddress
|
assign wSBWriteAddress
|
= (rTagMemOwner == `TAGMEM_OWNER_ISSUE) ? ((rBypassFifo)?iResultBcast[`COMMIT_DST_RNG]:wDestinationIndex)
|
= (rTagMemOwner == `TAGMEM_OWNER_ISSUE) ? ((rBypassFifo)?iResultBcast[`COMMIT_DST_RNG]:wDestinationIndex)
|
: wResultFifoData[`COMMIT_DST_RNG];
|
: wResultFifoData[`COMMIT_DST_RNG];
|
`endif
|
`endif
|
|
|
Line 555... |
Line 563... |
assign wReservationStationBusy = (~iEnable) |
|
assign wReservationStationBusy = (~iEnable) |
|
(
|
(
|
((iInstruction0[`INST_CODE_RNG] == `OPERATION_ADD ) && (iRStationBusy[ 0 ] && iRStationBusy[ 1 ])) ||
|
((iInstruction0[`INST_CODE_RNG] == `OPERATION_ADD ) && (iRStationBusy[ 0 ] && iRStationBusy[ 1 ])) ||
|
((iInstruction0[`INST_CODE_RNG] == `OPERATION_DIV ) && iRStationBusy[ 2 ]) ||
|
((iInstruction0[`INST_CODE_RNG] == `OPERATION_DIV ) && iRStationBusy[ 2 ]) ||
|
((iInstruction0[`INST_CODE_RNG] == `OPERATION_MUL ) && iRStationBusy[ 3 ]) ||
|
((iInstruction0[`INST_CODE_RNG] == `OPERATION_MUL ) && iRStationBusy[ 3 ]) ||
|
((iInstruction0[`INST_CODE_RNG] == `OPERATION_OUT ) && iRStationBusy[ 6 ])
|
((iInstruction0[`INST_CODE_RNG] == `OPERATION_IO ) && iRStationBusy[ 6 ])
|
);
|
);
|
|
|
assign wBranchWithDependency = (iInstruction0[`INST_BRANCH_BIT] && (wSource0_Station != 0 || wSource1_Station != 0));
|
assign wBranchWithDependency = (iInstruction0[`INST_BRANCH_BIT] && (wSource0_Station != 0 || wSource1_Station != 0));
|
|
|
|
|
assign wOp = iInstruction0[`INST_CODE_RNG];
|
assign wOp = iInstruction0[`INST_CODE_RNG];
|
|
//The next equations calculate the reservations stations ID based on the current operation and the availability
|
|
//of the RS's (that is if a given statation is busy choose another suitable 1). To understand this equations
|
|
//please refer to the table TBD in the architecture specification document
|
|
|
assign wReservationStation[0] =
|
assign wReservationStation[0] =
|
(wOp[0] & ~wOp[1] & ~wOp[2] & ~wOp[3] & ~iRStationBusy[ 0 ]) |
|
(wOp[0] & ~wOp[1] & ~wOp[2] & ~wOp[3] & ~iRStationBusy[ 0 ]) |
|
(~wOp[0] & wOp[1] & ~wOp[2] & ~wOp[3] & ~iRStationBusy[ 2 ]) |
|
(~wOp[0] & wOp[1] & ~wOp[2] & ~wOp[3] & ~iRStationBusy[ 2 ]) |
|
(~wOp[0] & ~wOp[1] & wOp[2] & ~wOp[3] & ~iRStationBusy[ 4 ]) |
|
(~wOp[0] & ~wOp[1] & wOp[2] & ~wOp[3] & ~iRStationBusy[ 4 ]) |
|
Line 603... |
Line 614... |
wire [`DATA_ADDRESS_WIDTH -1:0] wDestIndexDisplaced,wDestinationIndex_NoIMM,wDestinationIndex_IMM;
|
wire [`DATA_ADDRESS_WIDTH -1:0] wDestIndexDisplaced,wDestinationIndex_NoIMM,wDestinationIndex_IMM;
|
|
|
assign wDestIndexDisplaced = (iInstruction0[`INST_DST_RNG] + iFrameOffset);
|
assign wDestIndexDisplaced = (iInstruction0[`INST_DST_RNG] + iFrameOffset);
|
assign wDestinationIndex_NoIMM = (iInstruction0[`INST_DEST_ZERO]) ? wDestIndexDisplaced : iInstruction0[`INST_DST_RNG];
|
assign wDestinationIndex_NoIMM = (iInstruction0[`INST_DEST_ZERO]) ? wDestIndexDisplaced : iInstruction0[`INST_DST_RNG];
|
|
|
|
wire [`WIDTH-1:0 ] wSource1_X;
|
|
assign wSource1_X = wSource1_Temp[`X_RNG];
|
|
|
MUXFULLPARALELL_3SEL_GENERIC # ( `DATA_ADDRESS_WIDTH ) DSTMUX
|
MUXFULLPARALELL_3SEL_GENERIC # ( `DATA_ADDRESS_WIDTH ) DSTMUX
|
(
|
(
|
.Sel({iInstruction0[`INST_DEST_ZERO],iInstruction0[`INST_SRC1_DISPLACED],iInstruction0[`INST_SRC0_DISPLACED]}),
|
.Sel({iInstruction0[`INST_DEST_ZERO],iInstruction0[`INST_SRC1_DISPLACED],iInstruction0[`INST_SRC0_DISPLACED]}),
|
.I1(iInstruction0[`INST_DST_RNG]),
|
.I1(iInstruction0[`INST_DST_RNG]),
|
.I2(wDestIndexDisplaced),
|
.I2(wDestIndexDisplaced),
|
.I3(wDestIndexDisplaced),
|
.I3(wDestIndexDisplaced),
|
.I4(wDestIndexDisplaced + wSource1_Temp[`X_RNG]),
|
.I4(wDestIndexDisplaced + wSource1_X[`DATA_ADDRESS_WIDTH-1:0]),
|
.I5(iInstruction0[`INST_DST_RNG]),
|
.I5(iInstruction0[`INST_DST_RNG]),
|
.I6(wDestIndexDisplaced),
|
.I6(wDestIndexDisplaced),
|
.I7(iInstruction0[`INST_DST_RNG]),
|
.I7(iInstruction0[`INST_DST_RNG]),
|
.I8(wDestIndexDisplaced),
|
.I8(wDestIndexDisplaced),
|
.O1(wDestinationIndex_IMM)
|
.O1(wDestinationIndex_IMM)
|