URL
https://opencores.org/ocsvn/theia_gpu/theia_gpu/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 43 |
Rev 58 |
`timescale 1ns / 1ps
|
`timescale 1ns / 1ps
|
`include "aDefinitions.v"
|
`include "aDefinitions.v"
|
|
|
|
|
//-----------------------------------------------------------
|
//-----------------------------------------------------------
|
module FixedAddSub
|
module FixedAddSub
|
(
|
(
|
input wire Clock,
|
input wire Clock,
|
input wire Reset,
|
input wire Reset,
|
input wire[`LONG_WIDTH-1:0] A,
|
input wire[`LONG_WIDTH-1:0] A,
|
input wire[`LONG_WIDTH-1:0] B,
|
input wire[`LONG_WIDTH-1:0] B,
|
output reg[`LONG_WIDTH-1:0] R,
|
output reg[`LONG_WIDTH-1:0] R,
|
input wire iOperation,
|
input wire iOperation,
|
input wire iInputReady, //Is the input data valid?
|
input wire iInputReady, //Is the input data valid?
|
output wire OutputReady //Our output data is ready!
|
output wire OutputReady //Our output data is ready!
|
);
|
);
|
|
|
reg MyOutputReady = 0;
|
reg MyOutputReady = 0;
|
|
|
wire [`LONG_WIDTH-1:0] wB;
|
wire [`LONG_WIDTH-1:0] wB;
|
|
|
assign wB = ( iOperation ) ? ~B + 1'b1 : B;
|
assign wB = ( iOperation ) ? ~B + 1'b1 : B;
|
|
|
//Output ready just take 1 cycle
|
//Output ready just take 1 cycle
|
//assign OutputReady = iInputReady;
|
//assign OutputReady = iInputReady;
|
|
|
FFD_POSEDGE_ASYNC_RESET #(1) FFOutputReadyDelay2
|
FFD_POSEDGE_ASYNC_RESET #(1) FFOutputReadyDelay2
|
(
|
(
|
.Clock( Clock ),
|
.Clock( Clock ),
|
.Clear( Reset ),
|
.Clear( Reset ),
|
.D( iInputReady ),
|
.D( iInputReady ),
|
.Q( OutputReady )
|
.Q( OutputReady )
|
);
|
);
|
|
|
|
|
//-------------------------------
|
//-------------------------------
|
always @ (posedge Clock)
|
always @ (posedge Clock)
|
begin
|
begin
|
|
|
if (iInputReady == 1)
|
if (iInputReady == 1)
|
begin
|
begin
|
R = ( A + wB );
|
R = ( A + wB );
|
end
|
end
|
else
|
else
|
begin
|
begin
|
R = 64'hFFFFFFFF;
|
R = 64'hFFFFFFFF;
|
|
|
end
|
end
|
|
|
end // always
|
end // always
|
|
|
endmodule
|
endmodule
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.