getCombinationalPaths method Null safety
Returns a mapping of purely combinational paths from each input port to all downstream output ports.
Each key of the returned Map is an input of this Module. Each
value of the Map is a List
of outputs of this Module which may
change combinationally (no sequential logic in-between) as a result
of the corresponding key input changing.
The default behavior of this function is to search through from all
inputs to all potential outputs. If a Module implements custom behavior
internally (e.g. a custom gate or a cosimulated module), then it makes
sense to override this function to give an accurate picture. If the
default behavior doesn't work (because no visible connectivity exists
inside the Module), then the return value will end up with all empty
List
s in the values of the Map.
The result of this function is intended to be stored at build time, and it should be called at build time. The result is primarily used for calculating valid and complete sensitivity lists for Combinational execution.
Implementation
@override
Map<Logic, List<Logic>> getCombinationalPaths() {
// combinational gates are all combinational paths
final allOutputs = outputs.values.toList();
return Map.fromEntries(
inputs.values.map((inputPort) => MapEntry(inputPort, allOutputs)));
}