build/efinix/common.py: ClkInput: added ClockSignal support #2075
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
ClkInput
specials is currently only uses as PLL's clkin. The current approach is to uses a string forcreate_clkin
. This way is valid because bothClkInput
's o name and PLL'sclkin
must match at iface level and nothing is known in a generated verilog file. But when this specials is used for aClockDomain
this way is no more valid and it's requires to connect.o
to theClockSignal
.The first commit address this limitation by allowing the use of a
ClockSignal
, converted to a signal when the class contructor is called. In this situation, the constructor adopt the same approach done for PLL'screate_clkout
method. string is kept as backward compatibility to avoid breaking all existing code.Second commit address another issue: when a gpio out (ddio f.i.) is used through specials:
ClockSignal
is resolved and the Signal contains anname_override
attribute. But when this primitive is instanciated directly by a module, cd remains aClockSignal
and conversion between signal and name must be done in ifacewriter script. Also theClockSignal
only providesClockDomain
name (not resolved) so a first search for the name is done, but if no results are found: the_clk
suffix is added to the name.