@@ -45,7 +45,7 @@ module snitch_icache_lookup_serial #(
4545 input sram_cfg_tag_t sram_cfg_tag_i
4646);
4747
48- localparam int unsigned DataAddrWidth = $clog2 (CFG .SET_COUNT ) + CFG .COUNT_ALIGN ;
48+ localparam int unsigned DataAddrWidth = $clog2 (CFG .WAY_COUNT ) + CFG .COUNT_ALIGN ;
4949
5050`ifndef SYNTHESIS
5151 initial assert (CFG != '0 );
@@ -85,8 +85,8 @@ module snitch_icache_lookup_serial #(
8585 logic req_handshake;
8686
8787 logic [CFG .COUNT_ALIGN - 1 : 0 ] tag_addr;
88- logic [CFG .SET_COUNT - 1 : 0 ] tag_enable;
89- logic [CFG .TAG_WIDTH + 1 : 0 ] tag_wdata, tag_rdata [CFG .SET_COUNT ];
88+ logic [CFG .WAY_COUNT - 1 : 0 ] tag_enable;
89+ logic [CFG .TAG_WIDTH + 1 : 0 ] tag_wdata, tag_rdata [CFG .WAY_COUNT ];
9090 logic tag_write;
9191
9292 tag_req_t tag_req_d, tag_req_q;
@@ -95,7 +95,7 @@ module snitch_icache_lookup_serial #(
9595 logic tag_handshake;
9696
9797 logic [CFG .TAG_WIDTH - 1 : 0 ] required_tag;
98- logic [CFG .SET_COUNT - 1 : 0 ] line_hit;
98+ logic [CFG .WAY_COUNT - 1 : 0 ] line_hit;
9999
100100 logic [DataAddrWidth- 1 : 0 ] lookup_addr;
101101 logic [DataAddrWidth- 1 : 0 ] write_addr;
@@ -137,7 +137,7 @@ module snitch_icache_lookup_serial #(
137137
138138 // Instantiate the tag sets.
139139 if (CFG .L1_TAG_SCM ) begin : gen_scm
140- for (genvar i = 0 ; i < CFG .SET_COUNT ; i++ ) begin : g_sets
140+ for (genvar i = 0 ; i < CFG .WAY_COUNT ; i++ ) begin : g_sets
141141 register_file_1r_1w # (
142142 .ADDR_WIDTH ($clog2 (CFG .LINE_COUNT )),
143143 .DATA_WIDTH (CFG .TAG_WIDTH + 2 )
@@ -161,12 +161,12 @@ module snitch_icache_lookup_serial #(
161161 );
162162 end
163163 end else begin : gen_sram
164- logic [CFG .SET_COUNT * (CFG .TAG_WIDTH + 2 )- 1 : 0 ] tag_rdata_flat;
165- for (genvar i = 0 ; i < CFG .SET_COUNT ; i++ ) begin : g_sets_rdata
164+ logic [CFG .WAY_COUNT * (CFG .TAG_WIDTH + 2 )- 1 : 0 ] tag_rdata_flat;
165+ for (genvar i = 0 ; i < CFG .WAY_COUNT ; i++ ) begin : g_sets_rdata
166166 assign tag_rdata[i] = tag_rdata_flat[i* (CFG .TAG_WIDTH + 2 )+ : CFG .TAG_WIDTH + 2 ];
167167 end
168168 tc_sram_impl # (
169- .DataWidth ( (CFG .TAG_WIDTH + 2 ) * CFG .SET_COUNT ),
169+ .DataWidth ( (CFG .TAG_WIDTH + 2 ) * CFG .WAY_COUNT ),
170170 .ByteWidth ( CFG .TAG_WIDTH + 2 ),
171171 .NumWords ( CFG .LINE_COUNT ),
172172 .NumPorts ( 1 ),
@@ -179,24 +179,24 @@ module snitch_icache_lookup_serial #(
179179 .req_i ( | tag_enable ),
180180 .we_i ( tag_write ),
181181 .addr_i ( tag_addr ),
182- .wdata_i ( { CFG .SET_COUNT { tag_wdata}} ),
182+ .wdata_i ( { CFG .WAY_COUNT { tag_wdata}} ),
183183 .be_i ( tag_enable ),
184184 .rdata_o ( tag_rdata_flat )
185185 );
186186 end
187187
188188 // Determine which set hit
189- logic [CFG .SET_COUNT - 1 : 0 ] errors;
189+ logic [CFG .WAY_COUNT - 1 : 0 ] errors;
190190 assign required_tag = tag_req_q.addr[CFG .FETCH_AW - 1 : CFG .LINE_ALIGN + CFG .COUNT_ALIGN ];
191- for (genvar i = 0 ; i < CFG .SET_COUNT ; i++ ) begin : gen_line_hit
191+ for (genvar i = 0 ; i < CFG .WAY_COUNT ; i++ ) begin : gen_line_hit
192192 assign line_hit[i] = tag_rdata[i][CFG .TAG_WIDTH + 1 ] &&
193193 tag_rdata[i][CFG .TAG_WIDTH - 1 : 0 ] == required_tag; // check valid bit and tag
194194 assign errors[i] = tag_rdata[i][CFG .TAG_WIDTH ] && line_hit[i]; // check error bit
195195 end
196196 assign tag_rsp_s.hit = | line_hit;
197197 assign tag_rsp_s.error = | errors;
198198
199- lzc # (.WIDTH (CFG .SET_COUNT )) i_lzc (
199+ lzc # (.WIDTH (CFG .WAY_COUNT )) i_lzc (
200200 .in_i ( line_hit ),
201201 .cnt_o ( tag_rsp_s.cset ),
202202 .empty_o ( )
@@ -282,7 +282,7 @@ module snitch_icache_lookup_serial #(
282282
283283 tc_sram_impl # (
284284 .DataWidth ( CFG .LINE_WIDTH ),
285- .NumWords ( CFG .LINE_COUNT * CFG .SET_COUNT ),
285+ .NumWords ( CFG .LINE_COUNT * CFG .WAY_COUNT ),
286286 .NumPorts ( 1 ),
287287 .impl_in_t ( sram_cfg_data_t )
288288 ) i_data (
0 commit comments