mirror of
https://github.com/Silicon1602/srdl2sv.git
synced 2024-11-13 02:53:37 +00:00
Add default value to mux to prevent an inferred latch
This commit is contained in:
parent
ce4782c11d
commit
01a696c2b3
@ -176,19 +176,19 @@ class AddrMap(Component):
|
||||
AddrMap.templ_dict['read_mux'],
|
||||
{'list_of_cases':
|
||||
'\n'.join([
|
||||
AddrMap.templ_dict['list_of_mux_cases']['rtl']
|
||||
AddrMap.templ_dict['default_mux_case']['rtl'],
|
||||
*[AddrMap.templ_dict['list_of_mux_cases']['rtl']
|
||||
.format(x[0][1]+x[1][0],
|
||||
''.join(
|
||||
[x[0][0],
|
||||
x[1][1]])) for y in self.children.values() \
|
||||
for x in y.create_mux_string()
|
||||
])
|
||||
]
|
||||
])
|
||||
}
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
def __add_signal_instantiation(self):
|
||||
dict_list = [(key, value) for (key, value) in self.get_signals(True).items()]
|
||||
signal_width = min(max([len(value[0]) for (_, value) in dict_list]), 40)
|
||||
|
@ -58,6 +58,9 @@ read_mux:
|
||||
{list_of_cases}
|
||||
endcase
|
||||
end
|
||||
default_mux_case:
|
||||
rtl: |-
|
||||
default: sw_rd_bus = 0;
|
||||
list_of_mux_cases:
|
||||
rtl: |-
|
||||
32'd{}: sw_rd_bus = {};
|
||||
|
Loading…
Reference in New Issue
Block a user