Skip to content

Commit

Permalink
Another change to pipelined_mult to improve QoR (#2009)
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewb1999 authored Apr 22, 2024
1 parent 54b7e74 commit 26b2400
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
1 change: 0 additions & 1 deletion primitives/pipelined.futil
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ extern "pipelined.sv" {
// A latency-sensitive multiplier that takes 4 cycles to compute its result.
static<4> primitive pipelined_mult[WIDTH] (
@clk clk: 1,
@reset reset: 1,
left: WIDTH,
right: WIDTH
) -> (
Expand Down
19 changes: 5 additions & 14 deletions primitives/pipelined.sv
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ module pipelined_mult #(
parameter WIDTH = 32
) (
input wire clk,
input wire reset,
// inputs
input wire [WIDTH-1:0] left,
input wire [WIDTH-1:0] right,
Expand All @@ -19,19 +18,11 @@ assign out = buff2;
assign tmp_prod = tmp_left * tmp_right;

always_ff @(posedge clk) begin
if (reset) begin
buff0 <= 0;
buff1 <= 0;
buff2 <= 0;
tmp_left <= 0;
tmp_right <= 0;
end else begin
tmp_left <= left;
tmp_right <= right;
buff0 <= tmp_prod;
buff1 <= buff0;
buff2 <= buff1;
end
tmp_left <= left;
tmp_right <= right;
buff0 <= tmp_prod;
buff1 <= buff0;
buff2 <= buff1;
end

endmodule
Expand Down

0 comments on commit 26b2400

Please sign in to comment.