Vortex 2.0 changes:
+ Microarchitecture optimizations + 64-bit support + Xilinx FPGA support + LLVM-16 support + Refactoring and quality control fixes
This commit is contained in:
@@ -1,3 +1,16 @@
|
||||
// Copyright © 2019-2023
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
`include "VX_platform.vh"
|
||||
|
||||
`TRACING_OFF
|
||||
@@ -14,7 +27,7 @@ module VX_priority_encoder #(
|
||||
);
|
||||
wire [N-1:0] reversed;
|
||||
|
||||
if (REVERSE) begin
|
||||
if (REVERSE != 0) begin
|
||||
for (genvar i = 0; i < N; ++i) begin
|
||||
assign reversed[N-i-1] = data_in[i];
|
||||
end
|
||||
@@ -25,7 +38,7 @@ module VX_priority_encoder #(
|
||||
if (N == 1) begin
|
||||
|
||||
assign onehot = reversed;
|
||||
assign index = 0;
|
||||
assign index = '0;
|
||||
assign valid_out = reversed;
|
||||
|
||||
end else if (N == 2) begin
|
||||
@@ -47,11 +60,12 @@ module VX_priority_encoder #(
|
||||
);
|
||||
|
||||
VX_lzc #(
|
||||
.N (N)
|
||||
.N (N),
|
||||
.REVERSE (1)
|
||||
) lzc (
|
||||
.in_i (reversed),
|
||||
.cnt_o (index),
|
||||
`UNUSED_PIN (valid_o)
|
||||
.data_in (reversed),
|
||||
.data_out (index),
|
||||
`UNUSED_PIN (valid_out)
|
||||
);
|
||||
|
||||
assign onehot = scan_lo & {(~scan_lo[N-2:0]), 1'b1};
|
||||
@@ -67,23 +81,25 @@ module VX_priority_encoder #(
|
||||
assign onehot[N-1:0] = reversed[N-1:0] & ~higher_pri_regs[N-1:0];
|
||||
|
||||
VX_lzc #(
|
||||
.N (N)
|
||||
.N (N),
|
||||
.REVERSE (1)
|
||||
) lzc (
|
||||
.in_i (reversed),
|
||||
.cnt_o (index),
|
||||
.valid_o (valid_out)
|
||||
.data_in (reversed),
|
||||
.data_out (index),
|
||||
.valid_out (valid_out)
|
||||
);
|
||||
|
||||
end else if (MODEL == 3) begin
|
||||
|
||||
assign onehot = reversed & ~(reversed-1);
|
||||
assign onehot = reversed & -reversed;
|
||||
|
||||
VX_lzc #(
|
||||
.N (N)
|
||||
.N (N),
|
||||
.REVERSE (1)
|
||||
) lzc (
|
||||
.in_i (reversed),
|
||||
.cnt_o (index),
|
||||
.valid_o (valid_out)
|
||||
.data_in (reversed),
|
||||
.data_out (index),
|
||||
.valid_out (valid_out)
|
||||
);
|
||||
|
||||
end else begin
|
||||
@@ -97,7 +113,7 @@ module VX_priority_encoder #(
|
||||
for (integer i = N-1; i >= 0; --i) begin
|
||||
if (reversed[i]) begin
|
||||
index_r = LN'(i);
|
||||
onehot_r = 0;
|
||||
onehot_r = '0;
|
||||
onehot_r[i] = 1'b1;
|
||||
end
|
||||
end
|
||||
@@ -110,4 +126,4 @@ module VX_priority_encoder #(
|
||||
end
|
||||
|
||||
endmodule
|
||||
`TRACING_ON
|
||||
`TRACING_ON
|
||||
|
||||
Reference in New Issue
Block a user