-
Notifications
You must be signed in to change notification settings - Fork 896
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add torture test for (* nowrshmsk *) stride optimization
- Loading branch information
Showing
2 changed files
with
38 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
tests/various/dynamic_part_select/forloop_select_nowrshmsk.v
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
`default_nettype none | ||
module forloop_select #(parameter WIDTH=16, SELW=4, CTRLW=$clog2(WIDTH), DINW=2**SELW) | ||
(input wire clk, | ||
input wire [CTRLW-1:0] ctrl, | ||
input wire [DINW-1:0] din, | ||
input wire en, | ||
(* nowrshmsk *) | ||
output reg [WIDTH-1:0] dout); | ||
|
||
reg [SELW:0] sel; | ||
localparam SLICE = WIDTH/(SELW**2); | ||
|
||
always @(posedge clk) | ||
begin | ||
if (en) begin | ||
for (sel = 0; sel <= 4'hf; sel=sel+1'b1) | ||
dout[(ctrl*sel)+:SLICE] <= din; | ||
end | ||
end | ||
endmodule |