| 1 |
213 |
diegovalve |
`include "aDefinitions.v"
|
| 2 |
|
|
|
| 3 |
|
|
/**********************************************************************************
|
| 4 |
|
|
Theia, Ray Cast Programable graphic Processing Unit.
|
| 5 |
|
|
Copyright (C) 2012 Diego Valverde (diego.valverde.g@gmail.com)
|
| 6 |
|
|
|
| 7 |
|
|
This program is free software; you can redistribute it and/or
|
| 8 |
|
|
modify it under the terms of the GNU General Public License
|
| 9 |
|
|
as published by the Free Software Foundation; either version 2
|
| 10 |
|
|
of the License, or (at your option) any later version.
|
| 11 |
|
|
|
| 12 |
|
|
This program is distributed in the hope that it will be useful,
|
| 13 |
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
| 14 |
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
| 15 |
|
|
GNU General Public License for more details.
|
| 16 |
|
|
|
| 17 |
|
|
You should have received a copy of the GNU General Public License
|
| 18 |
|
|
along with this program; if not, write to the Free Software
|
| 19 |
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
| 20 |
|
|
|
| 21 |
|
|
***********************************************************************************/
|
| 22 |
|
|
|
| 23 |
|
|
//`define ADDRESSING_MODES_DISABLED 1
|
| 24 |
|
|
//`define NO_STALL_ON_BRANCH_DEPS 1
|
| 25 |
|
|
|
| 26 |
|
|
`define II_STATE_AFTER_RESET 0
|
| 27 |
|
|
`define II_FETCH_INSTRUCTION 1
|
| 28 |
|
|
`define II_ISSUE_REQUEST_WITH_DATA_FWD 2
|
| 29 |
|
|
`define II_ISSUE_REQUEST 3
|
| 30 |
|
|
`define II_FIFO_UPDATE 4
|
| 31 |
|
|
`define II_ISSUE_BRANCH_OPERATION 5
|
| 32 |
|
|
`define II_UPDATE_PC_BRANCH_OPERATION 6
|
| 33 |
|
|
|
| 34 |
|
|
`define TAGMEM_OWNER_ISSUE 1'b0
|
| 35 |
|
|
`define TAGMEM_OWNER_FIFO 1'b1
|
| 36 |
|
|
|
| 37 |
|
|
module InstructionIssue
|
| 38 |
|
|
(
|
| 39 |
|
|
input wire Clock,
|
| 40 |
|
|
input wire Reset,
|
| 41 |
|
|
input wire iEnable,
|
| 42 |
|
|
input wire [`INSTRUCTION_WIDTH-1:0] iInstruction0, //Instruction fetched from IM
|
| 43 |
|
|
input wire [`INSTRUCTION_WIDTH-1:0] iInstruction1, //Branch taken instruction prefetch
|
| 44 |
|
|
input wire [`DATA_ROW_WIDTH-1:0] iSourceData0, //Source0 value from RF
|
| 45 |
|
|
input wire [`DATA_ROW_WIDTH-1:0] iSourceData1, //Source1 value from RF
|
| 46 |
|
|
input wire [`NUMBER_OF_RSVR_STATIONS-1:0] iRStationBusy,
|
| 47 |
|
|
input wire [`COMMIT_PACKET_SIZE-1:0] iResultBcast, //Contains DST and RsId from last commited operation
|
| 48 |
|
|
input wire iSignFlag,
|
| 49 |
|
|
input wire iZeroFlag,
|
| 50 |
|
|
input wire iMtEnabled,
|
| 51 |
|
|
input wire iIgnoreResultBcast,
|
| 52 |
|
|
output wire [`DATA_ADDRESS_WIDTH-1:0] oSourceAddress0,
|
| 53 |
|
|
output wire [`DATA_ADDRESS_WIDTH-1:0] oSourceAddress1,
|
| 54 |
|
|
output wire [`ISSUE_PACKET_SIZE-1:0] oIssueBcast,
|
| 55 |
|
|
input wire [`DATA_ADDRESS_WIDTH -1:0] iFrameOffset,iIndexRegister,
|
| 56 |
|
|
input wire [`INSTRUCTION_ADDR_WIDTH-1:0] iCodeOffset,
|
| 57 |
|
|
output wire [`INSTRUCTION_ADDR_WIDTH -1:0] oIP0,
|
| 58 |
|
|
output wire [`INSTRUCTION_ADDR_WIDTH -1:0] oIP1
|
| 59 |
|
|
|
| 60 |
|
|
);
|
| 61 |
|
|
|
| 62 |
|
|
|
| 63 |
|
|
parameter SB_ENTRY_WIDTH = 4;
|
| 64 |
|
|
|
| 65 |
|
|
wire[SB_ENTRY_WIDTH-1:0] wSource0_Station; //Reservation Station that is currently calculationg Source0, zero means none
|
| 66 |
|
|
wire[SB_ENTRY_WIDTH-1:0] wSource1_Station; //Reservation Station that is currently calculationg Source1, zero means none
|
| 67 |
|
|
wire[SB_ENTRY_WIDTH-1:0] wSource0_RsSb;
|
| 68 |
|
|
wire[`DATA_ADDRESS_WIDTH-1:0] wSBWriteAddress;
|
| 69 |
|
|
wire [SB_ENTRY_WIDTH-1:0] wSBWriteData;
|
| 70 |
|
|
wire wStall;
|
| 71 |
|
|
wire [`DATA_ROW_WIDTH-1:0] wSourceData0;
|
| 72 |
|
|
wire [`DATA_ROW_WIDTH-1:0] wSourceData1;
|
| 73 |
|
|
wire wFIFO_ReadEnable;
|
| 74 |
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] wFIFO_Dst;
|
| 75 |
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] wIssue_Dst;
|
| 76 |
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] wSource0Addr_Displaced,wSourceAddress0_Imm,wSource0Addr_Displaced_plus_Index;
|
| 77 |
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] wSource1Addr_Displaced,wSourceAddress1_Imm,wSource1Addr_Displaced_plus_Index;
|
| 78 |
|
|
wire wSBWriteEnable;
|
| 79 |
|
|
wire[`DATA_ROW_WIDTH-1:0] wSignedSourceData0;
|
| 80 |
|
|
wire[`DATA_ROW_WIDTH-1:0] wSignedSourceData1;
|
| 81 |
|
|
wire[`DATA_ROW_WIDTH-1:0] wSwizzledSourceData0;
|
| 82 |
|
|
wire[`DATA_ROW_WIDTH-1:0] wSwizzledSourceData1;
|
| 83 |
|
|
wire [`DATA_ROW_WIDTH-1:0] wResultData;
|
| 84 |
|
|
wire [`DATA_ROW_WIDTH-1:0] wSourceData1Temp;
|
| 85 |
|
|
wire [`DATA_ROW_WIDTH-1:0] wScaledSourceData0;
|
| 86 |
|
|
wire [`DATA_ROW_WIDTH-1:0] wScaledSourceData1;
|
| 87 |
|
|
wire [`DATA_ROW_WIDTH-1:0] wScaledSourceData0_Pre;
|
| 88 |
|
|
wire [`DATA_ROW_WIDTH-1:0] wScaledSourceData1_Pre;
|
| 89 |
|
|
wire [`DATA_ROW_WIDTH-1:0] wUnscaleSourceData0_Pre;
|
| 90 |
|
|
wire [`DATA_ROW_WIDTH-1:0] wUnscaleSourceData1_Pre;
|
| 91 |
|
|
wire [6:0] wOp;
|
| 92 |
|
|
wire wBranchTaken;
|
| 93 |
|
|
wire wCommitBusInputFifo_Empty;
|
| 94 |
|
|
wire wCommitBusDataAvailabe;
|
| 95 |
|
|
wire wReservationStationBusy;
|
| 96 |
|
|
wire [`COMMIT_PACKET_SIZE-1:0] wResultFifoData;
|
| 97 |
|
|
reg rTagMemoryWE,rTagMemOwner,rIssueNow,rIncrementPC,rPopFifo,rBypassFifo,rUseForwardedData;
|
| 98 |
|
|
reg rSetPCBranchTaken;
|
| 99 |
|
|
wire wBranchWithDependency;
|
| 100 |
|
|
|
| 101 |
|
|
wire wMtHasOnceMoreTimeSlot,wEnabled_Delay;
|
| 102 |
|
|
wire wIO_Operation;
|
| 103 |
|
|
assign wIO_Operation = (~wOp[0] & wOp[1] & wOp[2] & ~wOp[3]);
|
| 104 |
|
|
|
| 105 |
|
|
FFD_POSEDGE_SYNCRONOUS_RESET # ( 1 ) FFD123
|
| 106 |
|
|
( Clock, Reset, 1'b1 , iEnable , wEnabled_Delay );
|
| 107 |
|
|
|
| 108 |
|
|
assign wMtHasOnceMoreTimeSlot = ~wEnabled_Delay;
|
| 109 |
|
|
|
| 110 |
|
|
assign wStall = iInstruction0[`INST_EOF_RNG];
|
| 111 |
|
|
|
| 112 |
|
|
reg [4:0] rCurrentState, rNextState;
|
| 113 |
|
|
//Next states logic and Reset sequence
|
| 114 |
|
|
always @(posedge Clock )
|
| 115 |
|
|
begin
|
| 116 |
|
|
|
| 117 |
|
|
if (Reset )
|
| 118 |
|
|
rCurrentState <= `II_STATE_AFTER_RESET;
|
| 119 |
|
|
else
|
| 120 |
|
|
rCurrentState <= rNextState;
|
| 121 |
|
|
|
| 122 |
|
|
end
|
| 123 |
|
|
|
| 124 |
|
|
|
| 125 |
|
|
|
| 126 |
|
|
|
| 127 |
|
|
always @ ( * )
|
| 128 |
|
|
begin
|
| 129 |
|
|
case (rCurrentState)
|
| 130 |
|
|
//--------------------------------------
|
| 131 |
|
|
`II_STATE_AFTER_RESET:
|
| 132 |
|
|
begin
|
| 133 |
|
|
rTagMemoryWE = 1'b0;
|
| 134 |
|
|
rTagMemOwner = 1'b0;
|
| 135 |
|
|
rIssueNow = 1'b0;
|
| 136 |
|
|
rIncrementPC = 1'b0;
|
| 137 |
|
|
rPopFifo = 1'b0;
|
| 138 |
|
|
rBypassFifo = 1'b0;
|
| 139 |
|
|
rUseForwardedData = 1'b0;
|
| 140 |
|
|
rSetPCBranchTaken = 1'b0;
|
| 141 |
|
|
|
| 142 |
|
|
rNextState = `II_FETCH_INSTRUCTION;
|
| 143 |
|
|
end
|
| 144 |
|
|
//--------------------------------------
|
| 145 |
|
|
/*The PC will be incremented except for the scenario where we need to wait
|
| 146 |
|
|
for reservation stations to become available. If we increment the PC, then the
|
| 147 |
|
|
value of PC will get update the next clock cycle, and another clock cycle
|
| 148 |
|
|
after that the instruction will get updated.
|
| 149 |
|
|
1- If there is data waiting on the commit bus input port this cycle,
|
| 150 |
|
|
then do not queue this data into the FIFO but instead set
|
| 151 |
|
|
set the score board write enable to 1, set the wSBWriteAddress
|
| 152 |
|
|
to the CommitPacket Destination range and update the score board
|
| 153 |
|
|
bit to zero, so than in the next state the score board bit associated
|
| 154 |
|
|
to the commit data has been updated.
|
| 155 |
|
|
2 - If there is no data waiting on the commit bus this clock cycle, but there
|
| 156 |
|
|
is data that has been queued into the input FIFO, then go to a state where this
|
| 157 |
|
|
data status on the scoreboard gets updated.
|
| 158 |
|
|
3 - If there are no available reservation stations left to handle this
|
| 159 |
|
|
instruction (structural hazard) then just stay in these same state to wait for
|
| 160 |
|
|
a reservation station to become availabe.
|
| 161 |
|
|
*/
|
| 162 |
|
|
`II_FETCH_INSTRUCTION:
|
| 163 |
|
|
begin
|
| 164 |
|
|
rTagMemoryWE = wCommitBusDataAvailabe;
|
| 165 |
|
|
rTagMemOwner = `TAGMEM_OWNER_ISSUE;
|
| 166 |
|
|
rIssueNow = 1'b0;
|
| 167 |
|
|
rIncrementPC = (( ~wReservationStationBusy & ~iInstruction0[`INST_BRANCH_BIT] & wCommitBusInputFifo_Empty) | (~wReservationStationBusy & ~iInstruction0[`INST_BRANCH_BIT] & wCommitBusDataAvailabe));
|
| 168 |
|
|
rPopFifo = 1'b0;
|
| 169 |
|
|
rBypassFifo = wCommitBusDataAvailabe; //Write iCommitBus data directly into tag mem
|
| 170 |
|
|
rUseForwardedData = 1'b0;
|
| 171 |
|
|
rSetPCBranchTaken = 1'b0;
|
| 172 |
|
|
|
| 173 |
|
|
if (wCommitBusDataAvailabe & ~wReservationStationBusy /**/& (iMtEnabled & wMtHasOnceMoreTimeSlot | ~iMtEnabled)/**/)
|
| 174 |
|
|
rNextState = `II_ISSUE_REQUEST_WITH_DATA_FWD;
|
| 175 |
|
|
else if (~wCommitBusInputFifo_Empty)
|
| 176 |
|
|
rNextState = `II_FIFO_UPDATE;
|
| 177 |
|
|
else if ( wReservationStationBusy | (iMtEnabled & ~wMtHasOnceMoreTimeSlot))
|
| 178 |
|
|
rNextState = `II_FETCH_INSTRUCTION;
|
| 179 |
|
|
else
|
| 180 |
|
|
rNextState = `II_ISSUE_REQUEST;
|
| 181 |
|
|
|
| 182 |
|
|
end
|
| 183 |
|
|
//--------------------------------------
|
| 184 |
|
|
//TODO: If the reservation station is Busy (static hazard)
|
| 185 |
|
|
//Then we shall stall the machine...
|
| 186 |
|
|
`II_ISSUE_REQUEST:
|
| 187 |
|
|
begin
|
| 188 |
|
|
rTagMemoryWE = ~iInstruction0[`INST_BRANCH_BIT] & ~wIO_Operation;
|
| 189 |
|
|
rTagMemOwner = `TAGMEM_OWNER_ISSUE;
|
| 190 |
|
|
rIssueNow = iEnable;
|
| 191 |
|
|
rIncrementPC = (iInstruction0[`INST_BRANCH_BIT] & ~wBranchWithDependency & iEnable);
|
| 192 |
|
|
rPopFifo = 1'b0;
|
| 193 |
|
|
rBypassFifo = 1'b0;
|
| 194 |
|
|
rUseForwardedData = 1'b0;
|
| 195 |
|
|
rSetPCBranchTaken = 1'b0;
|
| 196 |
|
|
|
| 197 |
|
|
if (~iEnable & ~wCommitBusInputFifo_Empty)
|
| 198 |
|
|
rNextState = `II_FIFO_UPDATE;
|
| 199 |
|
|
else if (~iEnable & wCommitBusInputFifo_Empty)
|
| 200 |
|
|
rNextState = `II_ISSUE_REQUEST;///////////////////
|
| 201 |
|
|
else
|
| 202 |
|
|
if (iInstruction0[`INST_BRANCH_BIT])
|
| 203 |
|
|
rNextState = `II_UPDATE_PC_BRANCH_OPERATION;
|
| 204 |
|
|
else
|
| 205 |
|
|
rNextState = `II_FETCH_INSTRUCTION;
|
| 206 |
|
|
end
|
| 207 |
|
|
//--------------------------------------
|
| 208 |
|
|
/*
|
| 209 |
|
|
Here the instruction remains the same as in the
|
| 210 |
|
|
previous clock cycle.
|
| 211 |
|
|
*/
|
| 212 |
|
|
`II_ISSUE_REQUEST_WITH_DATA_FWD:
|
| 213 |
|
|
begin
|
| 214 |
|
|
rTagMemoryWE = ~iInstruction0[`INST_BRANCH_BIT] & ~wIO_Operation;
|
| 215 |
|
|
rTagMemOwner = `TAGMEM_OWNER_ISSUE;
|
| 216 |
|
|
rIssueNow = iEnable;
|
| 217 |
|
|
rIncrementPC = (iInstruction0[`INST_BRANCH_BIT] & ~wBranchWithDependency & iEnable);
|
| 218 |
|
|
rPopFifo = 1'b1;
|
| 219 |
|
|
rBypassFifo = 1'b0;
|
| 220 |
|
|
rUseForwardedData = 1'b1;
|
| 221 |
|
|
rSetPCBranchTaken = 1'b0;//wBranchTaken;
|
| 222 |
|
|
|
| 223 |
|
|
if (~iEnable & ~wCommitBusInputFifo_Empty)
|
| 224 |
|
|
rNextState = `II_FIFO_UPDATE;
|
| 225 |
|
|
else if (~iEnable & wCommitBusInputFifo_Empty)
|
| 226 |
|
|
rNextState = `II_ISSUE_REQUEST_WITH_DATA_FWD;
|
| 227 |
|
|
else
|
| 228 |
|
|
if (iInstruction0[`INST_BRANCH_BIT])
|
| 229 |
|
|
rNextState = `II_UPDATE_PC_BRANCH_OPERATION;
|
| 230 |
|
|
else
|
| 231 |
|
|
rNextState = `II_FETCH_INSTRUCTION;
|
| 232 |
|
|
end
|
| 233 |
|
|
//--------------------------------------
|
| 234 |
|
|
`II_FIFO_UPDATE:
|
| 235 |
|
|
begin
|
| 236 |
|
|
rTagMemoryWE = 1'b1;
|
| 237 |
|
|
rTagMemOwner = `TAGMEM_OWNER_FIFO;
|
| 238 |
|
|
rIssueNow = 1'b0;
|
| 239 |
|
|
rIncrementPC = (iMtEnabled & wMtHasOnceMoreTimeSlot /*| ~iMtEnabled*/) & ~wBranchWithDependency & (( ~wReservationStationBusy & ~iInstruction0[`INST_BRANCH_BIT]));//1'b0;
|
| 240 |
|
|
rPopFifo = 1'b1;
|
| 241 |
|
|
rBypassFifo = 1'b0;
|
| 242 |
|
|
rUseForwardedData = 1'b0;
|
| 243 |
|
|
rSetPCBranchTaken = 1'b0;
|
| 244 |
|
|
|
| 245 |
|
|
if (wBranchWithDependency & ~iMtEnabled)
|
| 246 |
|
|
rNextState = `II_UPDATE_PC_BRANCH_OPERATION;
|
| 247 |
|
|
else if ((~iMtEnabled | (iMtEnabled & wMtHasOnceMoreTimeSlot)) & ~wBranchWithDependency & (( ~wReservationStationBusy & ~iInstruction0[`INST_BRANCH_BIT])))
|
| 248 |
|
|
rNextState = `II_ISSUE_REQUEST;
|
| 249 |
|
|
else
|
| 250 |
|
|
rNextState = `II_FETCH_INSTRUCTION;
|
| 251 |
|
|
end
|
| 252 |
|
|
//--------------------------------------
|
| 253 |
|
|
//FIXME: You are assuming that the branch takes 1 cycle.
|
| 254 |
|
|
//This may noy always be the case..
|
| 255 |
|
|
`II_UPDATE_PC_BRANCH_OPERATION:
|
| 256 |
|
|
begin
|
| 257 |
|
|
rTagMemoryWE = 1'b0;
|
| 258 |
|
|
rTagMemOwner = `TAGMEM_OWNER_FIFO;
|
| 259 |
|
|
rIssueNow = 1'b0;
|
| 260 |
|
|
rIncrementPC = 1'b0;
|
| 261 |
|
|
rPopFifo = 1'b1;
|
| 262 |
|
|
rBypassFifo = 1'b0;
|
| 263 |
|
|
rUseForwardedData = 1'b0;
|
| 264 |
|
|
rSetPCBranchTaken = wBranchTaken;
|
| 265 |
|
|
|
| 266 |
|
|
`ifdef NO_STALL_ON_BRANCH_DEPS
|
| 267 |
|
|
rNextState = `II_FETCH_INSTRUCTION;
|
| 268 |
|
|
`else
|
| 269 |
|
|
if (~wBranchWithDependency)
|
| 270 |
|
|
rNextState = `II_FETCH_INSTRUCTION;
|
| 271 |
|
|
else if (~wCommitBusInputFifo_Empty)
|
| 272 |
|
|
rNextState = `II_FIFO_UPDATE;
|
| 273 |
|
|
else
|
| 274 |
|
|
rNextState = `II_UPDATE_PC_BRANCH_OPERATION;
|
| 275 |
|
|
`endif
|
| 276 |
|
|
|
| 277 |
|
|
|
| 278 |
|
|
end
|
| 279 |
|
|
//--------------------------------------
|
| 280 |
|
|
default:
|
| 281 |
|
|
begin
|
| 282 |
|
|
rTagMemOwner = `TAGMEM_OWNER_ISSUE;
|
| 283 |
|
|
rTagMemoryWE = 1'b0;
|
| 284 |
|
|
rIssueNow = 1'b0;
|
| 285 |
|
|
rIncrementPC = 1'b0;
|
| 286 |
|
|
rPopFifo = 1'b0;
|
| 287 |
|
|
rBypassFifo = 1'b0;
|
| 288 |
|
|
rUseForwardedData = 1'b0;
|
| 289 |
|
|
rSetPCBranchTaken = 1'b0;
|
| 290 |
|
|
|
| 291 |
|
|
rNextState = `II_STATE_AFTER_RESET;
|
| 292 |
|
|
end
|
| 293 |
|
|
//--------------------------------------
|
| 294 |
|
|
endcase
|
| 295 |
|
|
|
| 296 |
|
|
|
| 297 |
|
|
end
|
| 298 |
|
|
|
| 299 |
|
|
wire [2:0] wInstructionBranchSelection;
|
| 300 |
|
|
assign wInstructionBranchSelection = iInstruction0[`INST_BRANCH_OP_RNG];
|
| 301 |
|
|
wire wCommitFromPendingStation;
|
| 302 |
|
|
assign wCommitFromPendingStation = (iResultBcast[`COMMIT_RSID_RNG] == wReservationStation) ? 1'b1 : 1'b0;
|
| 303 |
|
|
|
| 304 |
|
|
assign wBranchTaken =
|
| 305 |
|
|
wCommitFromPendingStation &
|
| 306 |
|
|
iInstruction0[`INST_BRANCH_BIT] &
|
| 307 |
|
|
(
|
| 308 |
|
|
~wInstructionBranchSelection[2] & ~wInstructionBranchSelection[1] & ~wInstructionBranchSelection[0] | //inconditional BRANCH
|
| 309 |
|
|
~wInstructionBranchSelection[2] & ~wInstructionBranchSelection[1] & wInstructionBranchSelection[0] & iZeroFlag | //==
|
| 310 |
|
|
~wInstructionBranchSelection[2] & wInstructionBranchSelection[1] & ~wInstructionBranchSelection[0] & ~iZeroFlag | //!=
|
| 311 |
|
|
~wInstructionBranchSelection[2] & wInstructionBranchSelection[1] & wInstructionBranchSelection[0] & iSignFlag | //<
|
| 312 |
|
|
wInstructionBranchSelection[2] & ~wInstructionBranchSelection[1] & ~wInstructionBranchSelection[0] & (~iSignFlag & ~iZeroFlag)| //>
|
| 313 |
|
|
wInstructionBranchSelection[2] & ~wInstructionBranchSelection[1] & wInstructionBranchSelection[0] & (iSignFlag | iZeroFlag) | //<=
|
| 314 |
|
|
wInstructionBranchSelection[2] & wInstructionBranchSelection[1] & ~wInstructionBranchSelection[0] & (~iSignFlag | iZeroFlag) //>=
|
| 315 |
|
|
);
|
| 316 |
|
|
|
| 317 |
|
|
wire [`COMMIT_PACKET_SIZE-1:0] wCommitData_Latched;
|
| 318 |
|
|
FFD_POSEDGE_SYNCRONOUS_RESET # ( `COMMIT_PACKET_SIZE ) ICOMMIT_BYPASS_FFD
|
| 319 |
|
|
( Clock, Reset, 1'b1 ,iResultBcast , wCommitData_Latched );
|
| 320 |
|
|
|
| 321 |
|
|
|
| 322 |
|
|
//The Reservation Station scoreboard
|
| 323 |
|
|
wire [SB_ENTRY_WIDTH-1:0] wSBDataPort0;
|
| 324 |
|
|
wire [SB_ENTRY_WIDTH-1:0] wSBDataPort1;
|
| 325 |
|
|
wire[3:0] wReservationStation;
|
| 326 |
|
|
|
| 327 |
|
|
`ifdef ADDRESSING_MODES_DISABLED
|
| 328 |
|
|
|
| 329 |
|
|
assign wSBWriteAddress
|
| 330 |
|
|
= (rTagMemOwner == `TAGMEM_OWNER_ISSUE) ? ((rBypassFifo)?iResultBcast[`COMMIT_DST_RNG]:iInstruction0[`INST_DST_RNG])
|
| 331 |
|
|
: wResultFifoData[`COMMIT_DST_RNG];
|
| 332 |
|
|
|
| 333 |
|
|
`else
|
| 334 |
|
|
|
| 335 |
|
|
assign wSBWriteAddress
|
| 336 |
|
|
= (rTagMemOwner == `TAGMEM_OWNER_ISSUE) ? ((rBypassFifo)?iResultBcast[`COMMIT_DST_RNG]:wDestinationIndex)
|
| 337 |
|
|
: wResultFifoData[`COMMIT_DST_RNG];
|
| 338 |
|
|
`endif
|
| 339 |
|
|
|
| 340 |
|
|
assign wSBWriteData
|
| 341 |
|
|
= (rTagMemOwner == `TAGMEM_OWNER_ISSUE) ? ((rBypassFifo)?1'b0:wReservationStation) : 4'b0;
|
| 342 |
|
|
|
| 343 |
|
|
wire wTagMemoryWE;
|
| 344 |
|
|
assign wTagMemoryWE = rTagMemoryWE;//(rTagMemoryWE && (iInstruction0[`INST_CODE_RNG] != `OPERATION_OUT)); //Dont store dependencies for IO operations
|
| 345 |
|
|
|
| 346 |
|
|
RAM_DUAL_READ_PORT # ( SB_ENTRY_WIDTH, `DATA_ADDRESS_WIDTH ) SB
|
| 347 |
|
|
(
|
| 348 |
|
|
.Clock( Clock ),
|
| 349 |
|
|
.iWriteEnable( wTagMemoryWE ),
|
| 350 |
|
|
.iReadAddress0( oSourceAddress0 ),
|
| 351 |
|
|
.iReadAddress1( oSourceAddress1 ),
|
| 352 |
|
|
.iWriteAddress( wSBWriteAddress ),
|
| 353 |
|
|
.iDataIn( wSBWriteData ),
|
| 354 |
|
|
.oDataOut0( wSBDataPort0 ),
|
| 355 |
|
|
.oDataOut1( wSBDataPort1 )
|
| 356 |
|
|
);
|
| 357 |
|
|
|
| 358 |
|
|
|
| 359 |
|
|
wire [`INSTRUCTION_ADDR_WIDTH-1:0] wPCInitialValue;
|
| 360 |
|
|
wire [`INSTRUCTION_ADDR_WIDTH-1:0] wPCInitialTmp;
|
| 361 |
|
|
assign wPCInitialTmp = (iInstruction0[`INST_IMM])? wSourceData0[`SRC_RET_ADDR_RNG] : {2'b0,iInstruction0[`INST_DST_RNG]};
|
| 362 |
|
|
|
| 363 |
|
|
|
| 364 |
|
|
|
| 365 |
|
|
assign wPCInitialValue = (rSetPCBranchTaken & ~Reset) ? wPCInitialTmp : iCodeOffset;
|
| 366 |
|
|
|
| 367 |
|
|
|
| 368 |
|
|
|
| 369 |
|
|
//The program counter
|
| 370 |
|
|
UPCOUNTER_POSEDGE # (`INSTRUCTION_ADDR_WIDTH ) PC
|
| 371 |
|
|
(
|
| 372 |
|
|
.Clock( Clock ),
|
| 373 |
|
|
.Reset( Reset | rSetPCBranchTaken ),
|
| 374 |
|
|
.Enable( rIncrementPC & ~wStall ),
|
| 375 |
|
|
.Initial( wPCInitialValue ),
|
| 376 |
|
|
.Q( oIP0 )
|
| 377 |
|
|
);
|
| 378 |
|
|
|
| 379 |
|
|
assign oIP1 = iInstruction0[`INST_DST_RNG];
|
| 380 |
|
|
|
| 381 |
|
|
|
| 382 |
|
|
`ifdef ADDRESSING_MODES_DISABLED
|
| 383 |
|
|
assign oSourceAddress1 = iInstruction0[`INST_SCR1_ADDR_RNG];
|
| 384 |
|
|
|
| 385 |
|
|
|
| 386 |
|
|
`else
|
| 387 |
|
|
|
| 388 |
|
|
assign oSourceAddress1 = (iInstruction0[`INST_IMM]) ? wSourceAddress1_Imm :
|
| 389 |
|
|
((iInstruction0[`INST_SRC1_DISPLACED]) ? wSource1Addr_Displaced: iInstruction0[`INST_SCR1_ADDR_RNG]);
|
| 390 |
|
|
|
| 391 |
|
|
assign wSource1Addr_Displaced = iInstruction0[`INST_SCR1_ADDR_RNG] + iFrameOffset;
|
| 392 |
|
|
assign wSource1Addr_Displaced_plus_Index = wSource1Addr_Displaced + iIndexRegister;
|
| 393 |
|
|
|
| 394 |
|
|
MUXFULLPARALELL_3SEL_GENERIC # ( `DATA_ADDRESS_WIDTH ) SRC1ADDRMUX
|
| 395 |
|
|
(
|
| 396 |
|
|
.Sel(iInstruction0[`INST_ADDRMODE_RNG]),
|
| 397 |
|
|
.I1(`DATA_ADDRESS_WIDTH'b0),
|
| 398 |
|
|
.I2(`DATA_ADDRESS_WIDTH'b0),
|
| 399 |
|
|
.I3(iInstruction0[`INST_SCR1_ADDR_RNG]),
|
| 400 |
|
|
.I4(iInstruction0[`INST_SCR1_ADDR_RNG]),
|
| 401 |
|
|
.I5(`DATA_ADDRESS_WIDTH'b0),
|
| 402 |
|
|
.I6(`DATA_ADDRESS_WIDTH'b0),
|
| 403 |
|
|
.I7(wSource1Addr_Displaced_plus_Index),
|
| 404 |
|
|
.I8(wSource1Addr_Displaced_plus_Index),
|
| 405 |
|
|
.O1(wSourceAddress1_Imm)
|
| 406 |
|
|
);
|
| 407 |
|
|
`endif
|
| 408 |
|
|
|
| 409 |
|
|
|
| 410 |
|
|
`ifdef ADDRESSING_MODES_DISABLED
|
| 411 |
|
|
assign oSourceAddress0 = (iInstruction0[`INST_IMM] ) ? iInstruction0[`INST_DST_RNG] : iInstruction0[`INST_SRC0_ADDR_RNG];
|
| 412 |
|
|
`else
|
| 413 |
|
|
|
| 414 |
|
|
assign oSourceAddress0 = (iInstruction0[`INST_IMM]) ? wSourceAddress0_Imm :
|
| 415 |
|
|
((iInstruction0[`INST_SRC0_DISPLACED]) ? wSource0Addr_Displaced: iInstruction0[`INST_SRC0_ADDR_RNG]);
|
| 416 |
|
|
|
| 417 |
|
|
assign wSource0Addr_Displaced = iInstruction0[`INST_SRC0_ADDR_RNG] + iFrameOffset;
|
| 418 |
|
|
assign wSource0Addr_Displaced_plus_Index = wSource0Addr_Displaced + iIndexRegister;
|
| 419 |
|
|
|
| 420 |
|
|
MUXFULLPARALELL_2SEL_GENERIC # ( `DATA_ADDRESS_WIDTH ) SRC0ADDRMUX
|
| 421 |
|
|
(
|
| 422 |
|
|
.Sel({iInstruction0[`INST_SRC1_DISPLACED],iInstruction0[`INST_SRC0_DISPLACED]}),
|
| 423 |
|
|
.I1(iInstruction0[`INST_DST_RNG]),
|
| 424 |
|
|
.I2(iInstruction0[`INST_DST_RNG]),
|
| 425 |
|
|
.I3(wSource0Addr_Displaced_plus_Index),
|
| 426 |
|
|
.I4(wSource0Addr_Displaced),
|
| 427 |
|
|
.O1(wSourceAddress0_Imm)
|
| 428 |
|
|
);
|
| 429 |
|
|
|
| 430 |
|
|
`endif
|
| 431 |
|
|
|
| 432 |
|
|
|
| 433 |
|
|
assign wCommitBusDataAvailabe = ((iResultBcast[`COMMIT_RSID_RNG] != `OPERATION_NOP) && (~iIgnoreResultBcast));
|
| 434 |
|
|
|
| 435 |
|
|
|
| 436 |
|
|
sync_fifo # (`COMMIT_PACKET_SIZE,2 ) RESULT_IN_FIFO
|
| 437 |
|
|
(
|
| 438 |
|
|
.clk( Clock ),
|
| 439 |
|
|
.reset( Reset ),
|
| 440 |
|
|
.din( iResultBcast ),
|
| 441 |
|
|
.wr_en( wCommitBusDataAvailabe ),
|
| 442 |
|
|
.rd_en( rPopFifo ),
|
| 443 |
|
|
.dout( wResultFifoData ),
|
| 444 |
|
|
.empty( wCommitBusInputFifo_Empty )
|
| 445 |
|
|
|
| 446 |
|
|
);
|
| 447 |
|
|
|
| 448 |
|
|
|
| 449 |
|
|
|
| 450 |
|
|
|
| 451 |
|
|
|
| 452 |
|
|
//Source 1 for IMM values is really DST
|
| 453 |
|
|
|
| 454 |
|
|
//Reservation station for SRC0 when handling IMM values is zero
|
| 455 |
|
|
|
| 456 |
|
|
wire wSB0FromInCommit,wSB0ForwardDetected;
|
| 457 |
|
|
wire wSB1FromInCommit,wSB1ForwardDetected;
|
| 458 |
|
|
|
| 459 |
|
|
assign wSB0FromInCommit = 1'b0;//(rIssueNow && (iResultBcast[`COMMIT_DST_RNG] == oSourceAddress0)) ? 1'b1 : 1'b0;
|
| 460 |
|
|
assign wSB1FromInCommit = 1'b0;//(rIssueNow && (iResultBcast[`COMMIT_DST_RNG] == oSourceAddress1)) ? 1'b1 : 1'b0;
|
| 461 |
|
|
|
| 462 |
|
|
`ifdef ADDRESSING_MODES_DISABLED
|
| 463 |
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] wTmpAddr0;
|
| 464 |
|
|
assign wTmpAddr0 = (iInstruction0[`INST_IMM]) ? iInstruction0[`INST_DST_RNG] : iInstruction0[`INST_SRC0_ADDR_RNG];
|
| 465 |
|
|
|
| 466 |
|
|
assign wSB0ForwardDetected = (rUseForwardedData && (wCommitData_Latched[`COMMIT_DST_RNG] == wTmpAddr0) ) ? 1'b1 : 1'b0;
|
| 467 |
|
|
assign wSB1ForwardDetected = (rUseForwardedData && (wCommitData_Latched[`COMMIT_DST_RNG] == iInstruction0[`INST_SCR1_ADDR_RNG]) ) ? 1'b1 : 1'b0;
|
| 468 |
|
|
`else
|
| 469 |
|
|
wire [`DATA_ADDRESS_WIDTH-1:0] wTmpAddr0,wTmpAddr1;
|
| 470 |
|
|
assign wTmpAddr0 = oSourceAddress0;
|
| 471 |
|
|
assign wTmpAddr1 = oSourceAddress1;
|
| 472 |
|
|
|
| 473 |
|
|
assign wSB0ForwardDetected = (rUseForwardedData && (wCommitData_Latched[`COMMIT_DST_RNG] == wTmpAddr0) /*&& ( wSource0_Station == iResultBcast[`COMMIT_RSID_RNG])*/ ) ? 1'b1 : 1'b0;
|
| 474 |
|
|
assign wSB1ForwardDetected = (rUseForwardedData && (wCommitData_Latched[`COMMIT_DST_RNG] == wTmpAddr1) /*&& ( wSource1_Station == iResultBcast[`COMMIT_RSID_RNG])*/ ) ? 1'b1 : 1'b0;
|
| 475 |
|
|
`endif
|
| 476 |
|
|
|
| 477 |
|
|
//FIX!!! FIX!!! Use the table to know when dependencies for SRC0 and SRC1 are don't care
|
| 478 |
|
|
//Fix this should not be (iInstruction0[`INST_IMM] & iInstruction0[`INST_DEST_ZERO]) but isntead should use the table
|
| 479 |
|
|
assign wSource0_Station = (wSB0FromInCommit | wSB0ForwardDetected | (iInstruction0[`INST_IMM] & iInstruction0[`INST_DEST_ZERO])) ? 4'b0 : wSBDataPort0;
|
| 480 |
|
|
assign wSource1_Station = (iInstruction0[`INST_IMM] | wSB1FromInCommit | wSB1ForwardDetected) ? 4'b0: wSBDataPort1;
|
| 481 |
|
|
|
| 482 |
|
|
|
| 483 |
|
|
//Handle literal values for IMM. IMM is stored in SRC1.X
|
| 484 |
|
|
|
| 485 |
|
|
|
| 486 |
|
|
wire [`DATA_ROW_WIDTH-1:0] wImmValue,wSource1_Temp,wSource0_Temp,wSourceData1_Imm,wSourceData0_Imm;
|
| 487 |
|
|
assign wImmValue[`X_RNG] = (iInstruction0[`INST_WE_X]) ? iInstruction0[`INST_IMM_RNG] : `WIDTH'b0;
|
| 488 |
|
|
assign wImmValue[`Y_RNG] = (iInstruction0[`INST_WE_Y]) ? iInstruction0[`INST_IMM_RNG] : `WIDTH'b0;
|
| 489 |
|
|
assign wImmValue[`Z_RNG] = (iInstruction0[`INST_WE_Z]) ? iInstruction0[`INST_IMM_RNG] : `WIDTH'b0;
|
| 490 |
|
|
|
| 491 |
|
|
|
| 492 |
|
|
|
| 493 |
|
|
assign wSource1_Temp[`X_RNG] = (wSB1FromInCommit & iResultBcast[`COMMIT_WE_X]) ? iResultBcast[`COMMIT_X_RNG] :
|
| 494 |
|
|
( (wSB1ForwardDetected & wCommitData_Latched[`COMMIT_WE_X])? wCommitData_Latched[`X_RNG] : iSourceData1[`X_RNG]);
|
| 495 |
|
|
|
| 496 |
|
|
assign wSource1_Temp[`Y_RNG] = (wSB1FromInCommit & iResultBcast[`COMMIT_WE_Y]) ? iResultBcast[`COMMIT_Y_RNG] :
|
| 497 |
|
|
( (wSB1ForwardDetected & wCommitData_Latched[`COMMIT_WE_Y]) ? wCommitData_Latched[`Y_RNG] : iSourceData1[`Y_RNG]);
|
| 498 |
|
|
|
| 499 |
|
|
|
| 500 |
|
|
assign wSource1_Temp[`Z_RNG] = (wSB1FromInCommit & iResultBcast[`COMMIT_WE_Z]) ? iResultBcast[`COMMIT_Z_RNG] :
|
| 501 |
|
|
( (wSB1ForwardDetected & wCommitData_Latched[`COMMIT_WE_Z]) ? wCommitData_Latched[`Z_RNG] : iSourceData1[`Z_RNG]);
|
| 502 |
|
|
|
| 503 |
|
|
assign wSource0_Temp[`X_RNG] = (wSB0FromInCommit & iResultBcast[`COMMIT_WE_X]) ? iResultBcast[`COMMIT_X_RNG]:
|
| 504 |
|
|
( (wSB0ForwardDetected & & wCommitData_Latched[`COMMIT_WE_X] )? wCommitData_Latched[`X_RNG]:iSourceData0[`X_RNG]);
|
| 505 |
|
|
|
| 506 |
|
|
|
| 507 |
|
|
assign wSource0_Temp[`Y_RNG] = (wSB0FromInCommit & iResultBcast[`COMMIT_WE_Y]) ? iResultBcast[`COMMIT_Y_RNG]:
|
| 508 |
|
|
( (wSB0ForwardDetected & & wCommitData_Latched[`COMMIT_WE_Y])? wCommitData_Latched[`Y_RNG] : iSourceData0[`Y_RNG]);
|
| 509 |
|
|
|
| 510 |
|
|
assign wSource0_Temp[`Z_RNG] = (wSB0FromInCommit & iResultBcast[`COMMIT_WE_Z]) ? iResultBcast[`COMMIT_Z_RNG]:
|
| 511 |
|
|
( (wSB0ForwardDetected & & wCommitData_Latched[`COMMIT_WE_Z])? wCommitData_Latched[`Z_RNG] : iSourceData0[`Z_RNG]);
|
| 512 |
|
|
|
| 513 |
|
|
|
| 514 |
|
|
|
| 515 |
|
|
//If the data we are looking for just arrived at iResultBcast the use that
|
| 516 |
|
|
//other wise used the data from the Register file or the Immediate values
|
| 517 |
|
|
//assign wSourceData1 = (iInstruction0[`INST_IMM]) ? wImmValue : wSource1_Temp;
|
| 518 |
|
|
//assign wSourceData0 = (iInstruction0[`INST_IMM] && iInstruction0[`INST_DEST_ZERO]) ? `DATA_ROW_WIDTH'd0 : wSource0_Temp;
|
| 519 |
|
|
|
| 520 |
|
|
|
| 521 |
|
|
assign wSourceData1 = (iInstruction0[`INST_IMM]) ? wSourceData1_Imm : wSource1_Temp;
|
| 522 |
|
|
assign wSourceData0 = (iInstruction0[`INST_IMM]) ? wSourceData0_Imm : wSource0_Temp;
|
| 523 |
|
|
//assign wSourceData0 = (iInstruction0[`INST_IMM] && iInstruction0[`INST_DEST_ZERO]) ? `DATA_ROW_WIDTH'd0 : wSource0_Temp;
|
| 524 |
|
|
|
| 525 |
|
|
MUXFULLPARALELL_3SEL_GENERIC # ( `DATA_ROW_WIDTH ) SRC1MUX
|
| 526 |
|
|
(
|
| 527 |
|
|
.Sel({iInstruction0[`INST_DEST_ZERO],iInstruction0[`INST_SRC1_DISPLACED],iInstruction0[`INST_SRC0_DISPLACED]}),
|
| 528 |
|
|
.I1(wImmValue),
|
| 529 |
|
|
.I2(wImmValue),
|
| 530 |
|
|
.I3(wSource1_Temp),
|
| 531 |
|
|
.I4( `DATA_ROW_WIDTH'b0),
|
| 532 |
|
|
.I5( wImmValue ),
|
| 533 |
|
|
.I6( wImmValue ),
|
| 534 |
|
|
.I7( wSource1_Temp ),
|
| 535 |
|
|
.I8( wSource1_Temp ),
|
| 536 |
|
|
.O1(wSourceData1_Imm)
|
| 537 |
|
|
);
|
| 538 |
|
|
|
| 539 |
|
|
|
| 540 |
|
|
MUXFULLPARALELL_3SEL_GENERIC # ( `DATA_ROW_WIDTH ) SRC0MUX
|
| 541 |
|
|
(
|
| 542 |
|
|
.Sel({iInstruction0[`INST_DEST_ZERO],iInstruction0[`INST_SRC1_DISPLACED],iInstruction0[`INST_SRC0_DISPLACED]}),
|
| 543 |
|
|
.I1( wSource0_Temp ),
|
| 544 |
|
|
.I2( wSource0_Temp ),
|
| 545 |
|
|
.I3( wSource0_Temp ),
|
| 546 |
|
|
.I4( wSource0_Temp ),
|
| 547 |
|
|
.I5( `DATA_ROW_WIDTH'b0 ),
|
| 548 |
|
|
.I6( `DATA_ROW_WIDTH'b0 ),
|
| 549 |
|
|
.I7( `DATA_ROW_WIDTH'b0 ),
|
| 550 |
|
|
.I8( wSource0_Temp ),
|
| 551 |
|
|
.O1( wSourceData0_Imm )
|
| 552 |
|
|
);
|
| 553 |
|
|
|
| 554 |
|
|
|
| 555 |
|
|
assign wReservationStationBusy = (~iEnable) |
|
| 556 |
|
|
(
|
| 557 |
|
|
((iInstruction0[`INST_CODE_RNG] == `OPERATION_ADD ) && (iRStationBusy[ 0 ] && iRStationBusy[ 1 ])) ||
|
| 558 |
|
|
((iInstruction0[`INST_CODE_RNG] == `OPERATION_DIV ) && iRStationBusy[ 2 ]) ||
|
| 559 |
|
|
((iInstruction0[`INST_CODE_RNG] == `OPERATION_MUL ) && iRStationBusy[ 3 ]) ||
|
| 560 |
|
|
((iInstruction0[`INST_CODE_RNG] == `OPERATION_OUT ) && iRStationBusy[ 6 ])
|
| 561 |
|
|
);
|
| 562 |
|
|
|
| 563 |
|
|
assign wBranchWithDependency = (iInstruction0[`INST_BRANCH_BIT] && (wSource0_Station != 0 || wSource1_Station != 0));
|
| 564 |
|
|
|
| 565 |
|
|
|
| 566 |
|
|
assign wOp = iInstruction0[`INST_CODE_RNG];
|
| 567 |
|
|
|
| 568 |
|
|
assign wReservationStation[0] =
|
| 569 |
|
|
(wOp[0] & ~wOp[1] & ~wOp[2] & ~wOp[3] & ~iRStationBusy[ 0 ]) |
|
| 570 |
|
|
(~wOp[0] & wOp[1] & ~wOp[2] & ~wOp[3] & ~iRStationBusy[ 2 ]) |
|
| 571 |
|
|
(~wOp[0] & ~wOp[1] & wOp[2] & ~wOp[3] & ~iRStationBusy[ 4 ]) |
|
| 572 |
|
|
(~wOp[0] & wOp[1] & wOp[2] & ~wOp[3] & ~iRStationBusy[ 6 ]);
|
| 573 |
|
|
|
| 574 |
|
|
assign wReservationStation[1] =
|
| 575 |
|
|
(~wOp[0] & wOp[1] & wOp[2] & ~wOp[3] & ~iRStationBusy[ 6 ]) |
|
| 576 |
|
|
(wOp[0] & ~wOp[1] & wOp[2] & ~wOp[3] & ~iRStationBusy[5] ) |
|
| 577 |
|
|
(wOp[0] & ~wOp[1] & ~wOp[2] & ~wOp[3] & iRStationBusy[ 0 ] & ~iRStationBusy[1]) |
|
| 578 |
|
|
(~wOp[0] & wOp[1] & ~wOp[2] & ~wOp[3] & ~iRStationBusy[ 2 ]);
|
| 579 |
|
|
|
| 580 |
|
|
|
| 581 |
|
|
assign wReservationStation[2] =
|
| 582 |
|
|
(~wOp[0] & wOp[1] & wOp[2] & ~wOp[3] & ~iRStationBusy[ 6 ]) |
|
| 583 |
|
|
(wOp[0] & ~wOp[1] & wOp[2] & ~wOp[3] & ~iRStationBusy[5]) |
|
| 584 |
|
|
(wOp[0] & wOp[1] & ~wOp[2] & ~wOp[3] & ~iRStationBusy[3]) |
|
| 585 |
|
|
(~wOp[0] & ~wOp[1] & wOp[2] & ~wOp[3] & ~iRStationBusy[ 4 ]);
|
| 586 |
|
|
|
| 587 |
|
|
assign wReservationStation[3] = 1'b0;
|
| 588 |
|
|
|
| 589 |
|
|
//Sign control logic.
|
| 590 |
|
|
//Only works for non literal opeations (INST_IMM == 0)
|
| 591 |
|
|
wire [`ISSUE_SRCTAG_SIZE-1:0] wIssueTag0,wIssueTag1;
|
| 592 |
|
|
|
| 593 |
|
|
assign wIssueTag0 = (iInstruction0[`INST_IMM]) ? `ISSUE_SRCTAG_SIZE'b0 : {iInstruction0[`INST_SRC0_SIGN_RNG],iInstruction0[`INST_SRC0_SWZL_RNG] };
|
| 594 |
|
|
assign wIssueTag1 = (iInstruction0[`INST_IMM]) ? `ISSUE_SRCTAG_SIZE'b0 : {iInstruction0[`INST_SRC1_SIGN_RNG],iInstruction0[`INST_SCR1_SWZL_RNG] };
|
| 595 |
|
|
|
| 596 |
|
|
wire [`DATA_ADDRESS_WIDTH -1:0] wDestinationIndex;
|
| 597 |
|
|
|
| 598 |
|
|
|
| 599 |
|
|
`ifdef ADDRESSING_MODES_DISABLED
|
| 600 |
|
|
assign wDestinationIndex = iInstruction0[`INST_DST_RNG];
|
| 601 |
|
|
`else
|
| 602 |
|
|
|
| 603 |
|
|
wire [`DATA_ADDRESS_WIDTH -1:0] wDestIndexDisplaced,wDestinationIndex_NoIMM,wDestinationIndex_IMM;
|
| 604 |
|
|
|
| 605 |
|
|
assign wDestIndexDisplaced = (iInstruction0[`INST_DST_RNG] + iFrameOffset);
|
| 606 |
|
|
assign wDestinationIndex_NoIMM = (iInstruction0[`INST_DEST_ZERO]) ? wDestIndexDisplaced : iInstruction0[`INST_DST_RNG];
|
| 607 |
|
|
|
| 608 |
|
|
|
| 609 |
|
|
MUXFULLPARALELL_3SEL_GENERIC # ( `DATA_ADDRESS_WIDTH ) DSTMUX
|
| 610 |
|
|
(
|
| 611 |
|
|
.Sel({iInstruction0[`INST_DEST_ZERO],iInstruction0[`INST_SRC1_DISPLACED],iInstruction0[`INST_SRC0_DISPLACED]}),
|
| 612 |
|
|
.I1(iInstruction0[`INST_DST_RNG]),
|
| 613 |
|
|
.I2(wDestIndexDisplaced),
|
| 614 |
|
|
.I3(wDestIndexDisplaced),
|
| 615 |
|
|
.I4(wDestIndexDisplaced + wSource1_Temp[`X_RNG]),
|
| 616 |
|
|
.I5(iInstruction0[`INST_DST_RNG]),
|
| 617 |
|
|
.I6(wDestIndexDisplaced),
|
| 618 |
|
|
.I7(iInstruction0[`INST_DST_RNG]),
|
| 619 |
|
|
.I8(wDestIndexDisplaced),
|
| 620 |
|
|
.O1(wDestinationIndex_IMM)
|
| 621 |
|
|
);
|
| 622 |
|
|
|
| 623 |
|
|
|
| 624 |
|
|
assign wDestinationIndex = (iInstruction0[`INST_IMM]) ? wDestinationIndex_IMM : wDestinationIndex_NoIMM;
|
| 625 |
|
|
`endif
|
| 626 |
|
|
|
| 627 |
|
|
assign oIssueBcast = (Reset | ~rIssueNow | wStall ) ? `ISSUE_PACKET_SIZE'b0 :
|
| 628 |
|
|
{
|
| 629 |
|
|
wReservationStation,
|
| 630 |
|
|
wDestinationIndex,
|
| 631 |
|
|
iInstruction0[`INST_WE_RNG],
|
| 632 |
|
|
iInstruction0[`INST_SCOP_RNG],
|
| 633 |
|
|
wSource1_Station,
|
| 634 |
|
|
wIssueTag1,
|
| 635 |
|
|
wSourceData1,
|
| 636 |
|
|
wSource0_Station,
|
| 637 |
|
|
wIssueTag0,
|
| 638 |
|
|
wSourceData0
|
| 639 |
|
|
|
| 640 |
|
|
};
|
| 641 |
|
|
|
| 642 |
|
|
endmodule
|