Skip to content

Commit 4201ce9

Browse files
committed
Fix OBI address truncation template for 1-byte datawidth case. #176
1 parent 61bffb7 commit 4201ce9

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/peakrdl_regblock/cpuif/obi/obi_tmpl.sv

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,11 @@ always_ff {{get_always_ff_event(cpuif.reset)}} begin
4444
is_active <= 1'b1;
4545
cpuif_req <= 1'b1;
4646
cpuif_req_is_wr <= {{cpuif.signal("we")}};
47+
{%- if cpuif.data_width_bytes == 1 %}
48+
cpuif_addr <= {{cpuif.signal("addr")}}[{{cpuif.addr_width-1}}:0];
49+
{%- else %}
4750
cpuif_addr <= { {{-cpuif.signal("addr")}}[{{cpuif.addr_width-1}}:{{clog2(cpuif.data_width_bytes)}}], {{clog2(cpuif.data_width_bytes)}}'b0};
51+
{%- endif %}
4852
cpuif_wr_data <= {{cpuif.signal("wdata")}};
4953
rid_q <= {{cpuif.signal("aid")}};
5054
for (int i = 0; i < {{cpuif.data_width_bytes}}; i++) begin

tests/test_read_fanin/testcase.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
from parameterized import parameterized_class
22

3+
from ..lib.cpuifs import ALL_CPUIF
34
from ..lib.sim_testcase import SimTestCase
45
from ..lib.test_params import get_permutation_class_name, get_permutations
56

67
PARAMS = get_permutations({
8+
"cpuif": ALL_CPUIF,
79
"regwidth" : [8, 16, 32, 64],
810
})
911
@parameterized_class(PARAMS, class_name_func=get_permutation_class_name)

0 commit comments

Comments
 (0)