minor update

This commit is contained in:
Blaise Tine 2024-03-24 03:26:28 -07:00
parent 830c43517b
commit 459abdef21
4 changed files with 4 additions and 125 deletions

View file

@ -298,40 +298,6 @@
///////////////////////////////////////////////////////////////////////////////
`define SOA_TO_AOS(__nf__, __fw__, __ne__, __in__, __out__) \
generate begin \
localparam int __field_widths__[__nf__] = __fw__; \
localparam int __struct_width__ = $bits(__in__) / __ne__; \
VX_soa_to_aos #( \
.NUM_FIELDS(__nf__), \
.FIELD_WIDTHS(__field_widths__), \
.NUM_ELEMENTS(__ne__), \
.STRUCT_WIDTH(__struct_width__) \
) soa_to_aos ( \
.soa_in(__in__), \
.aos_out(__out__) \
); \
end \
endgenerate
`define AOS_TO_SOA(__nf__, __fw__, __ne__, __in__, __out__) \
generate begin \
localparam int __field_widths__[__nf__] = __fw__; \
localparam int __struct_width__ = $bits(__in__) / __ne__; \
VX_aos_to_soa #( \
.NUM_FIELDS(__nf__), \
.FIELD_WIDTHS(__field_widths__), \
.NUM_ELEMENTS(__ne__), \
.STRUCT_WIDTH(__struct_width__) \
) aos_to_soa ( \
.aos_in(__in__), \
.soa_out(__out__) \
); \
end \
endgenerate
///////////////////////////////////////////////////////////////////////////////
`define BUFFER_EX(dst, src, ena, latency) \
VX_pipe_register #( \
.DATAW ($bits(dst)), \

View file

@ -193,6 +193,9 @@ module VX_cache import VX_gpu_pkg::*; #(
wire [`CS_LINE_SEL_BITS-1:0] init_line_sel;
wire init_enable;
// this reset relay is required to sync with bank initialization
`RESET_RELAY (init_reset, reset);
VX_cache_init #(
.CACHE_SIZE (CACHE_SIZE),
.LINE_SIZE (LINE_SIZE),
@ -200,7 +203,7 @@ module VX_cache import VX_gpu_pkg::*; #(
.NUM_WAYS (NUM_WAYS)
) cache_init (
.clk (clk),
.reset (reset),
.reset (init_reset),
.addr_out (init_line_sel),
.valid_out (init_enable)
);

View file

@ -1,45 +0,0 @@
// 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
module VX_aos_to_soa #(
parameter int NUM_FIELDS = 1,
parameter int FIELD_WIDTHS[NUM_FIELDS] = '{1},
parameter int NUM_ELEMENTS = 100,
parameter int STRUCT_WIDTH = FIELD_WIDTHS[0]
) (
input wire [(NUM_ELEMENTS*STRUCT_WIDTH)-1:0] aos_in,
output wire [(NUM_ELEMENTS*STRUCT_WIDTH)-1:0] soa_out
);
int field_offsets[NUM_FIELDS];
initial begin
field_offsets[0] = 0;
for (int i = 1; i < NUM_FIELDS; i++) begin
field_offsets[i] = field_offsets[i-1] + FIELD_WIDTHS[i-1];
end
end
for (genvar i = 0; i < NUM_ELEMENTS; i++) begin : elems
for (genvar j = 0; j < NUM_FIELDS; j++) begin : fields
`IGNORE_UNUSED_BEGIN
int soa_offset = j * NUM_ELEMENTS * field_offsets[j] + i * FIELD_WIDTHS[j];
int aos_offset = i * STRUCT_WIDTH + field_offsets[j];
`IGNORE_UNUSED_END
assign soa_out[soa_offset +: FIELD_WIDTHS[j]] = aos_in[aos_offset +: FIELD_WIDTHS[j]];
end
end
endmodule
`TRACING_ON

View file

@ -1,45 +0,0 @@
// 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
module VX_soa_to_aos #(
parameter int NUM_FIELDS = 1,
parameter int FIELD_WIDTHS[NUM_FIELDS] = '{1},
parameter int NUM_ELEMENTS = 100,
parameter int STRUCT_WIDTH = FIELD_WIDTHS[0]
) (
input wire [(NUM_ELEMENTS*STRUCT_WIDTH)-1:0] soa_in,
output wire [(NUM_ELEMENTS*STRUCT_WIDTH)-1:0] aos_out
);
int field_offsets[NUM_FIELDS];
initial begin
field_offsets[0] = 0;
for (int i = 1; i < NUM_FIELDS; i++) begin
field_offsets[i] = field_offsets[i-1] + FIELD_WIDTHS[i-1];
end
end
for (genvar i = 0; i < NUM_ELEMENTS; i++) begin : elems
for (genvar j = 0; j < NUM_FIELDS; j++) begin : fields
`IGNORE_UNUSED_BEGIN
int soa_offset = j * NUM_ELEMENTS * field_offsets[j] + i * FIELD_WIDTHS[j];
int aos_offset = i * STRUCT_WIDTH + field_offsets[j];
`IGNORE_UNUSED_END
assign aos_out[aos_offset +: FIELD_WIDTHS[j]] = soa_in[soa_offset +: FIELD_WIDTHS[j]];
end
end
endmodule
`TRACING_ON