phy/model: fix case when not converting init data width
This commit is contained in:
parent
a903c87872
commit
4c86235048
|
@ -127,15 +127,14 @@ class SDRAMPHYModel(Module):
|
||||||
if len(init)%data_width_bytes != 0:
|
if len(init)%data_width_bytes != 0:
|
||||||
init.extend([0]*(data_width_bytes-len(init)%data_width_bytes))
|
init.extend([0]*(data_width_bytes-len(init)%data_width_bytes))
|
||||||
|
|
||||||
new_init = [0]*(len(init)//model_data_ratio)
|
|
||||||
|
|
||||||
# Convert init data width from 32-bit to data_width if needed
|
# Convert init data width from 32-bit to data_width if needed
|
||||||
if model_data_ratio > 1:
|
if model_data_ratio > 1:
|
||||||
|
new_init = [0]*(len(init)//model_data_ratio)
|
||||||
for i in range(0, len(init), model_data_ratio):
|
for i in range(0, len(init), model_data_ratio):
|
||||||
ints = init[i:i+model_data_ratio]
|
ints = init[i:i+model_data_ratio]
|
||||||
strs = ''.join('{:08x}'.format(x) for x in reversed(ints))
|
strs = ''.join('{:08x}'.format(x) for x in reversed(ints))
|
||||||
new_init[i//model_data_ratio] = int(strs, 16)
|
new_init[i//model_data_ratio] = int(strs, 16)
|
||||||
|
|
||||||
init = new_init
|
init = new_init
|
||||||
|
|
||||||
if address_mapping == "ROW_BANK_COL":
|
if address_mapping == "ROW_BANK_COL":
|
||||||
|
|
Loading…
Reference in New Issue