sporniket / the-cradle-colorlight-i9-ecp5-amaranth-hdl

An implementation of "the cradle" for the ECP5-based colorlight i9 written with the Amaranth HDL
GNU Lesser General Public License v3.0
0 stars 0 forks source link

Port ecppll into a helper function to generate the parameters map for Ehxplll #4

Open sporniket opened 1 year ago

sporniket commented 1 year ago

Technical details

Ehxplll.computeParameters(inputFrequency:int, outputFrequencies:List[int])->Dict

Typical invocation :

m.submodule.pll = pll = Ehxplll(Ehxplll.computeParameters(25, [270, 108, 27, 31]))

Automated test

Typical call

When calling Ehxplll.computeParameters(25, [270, 108, 27, 31])

Then then it returns the following dictionnary :

{
    "p_PLLRST_ENA":"DISABLED",
    "p_INTFB_WAKE":"DISABLED",
    "p_STDBY_ENABLE":"DISABLED",
    "p_DPHASE_SOURCE":"DISABLED",
    "p_OUTDIVIDER_MUXA":"DIVA",
    "p_OUTDIVIDER_MUXB":"DIVB",
    "p_OUTDIVIDER_MUXC":"DIVC",
    "p_OUTDIVIDER_MUXD":"DIVD",
    "p_CLKI_DIV":5,
    "p_CLKOP_ENABLE":"ENABLED",
    "p_CLKOP_DIV":2,
    "p_CLKOP_CPHASE":1,
    "p_CLKOP_FPHASE":0,
    "p_CLKOS_ENABLE":"ENABLED",
    "p_CLKOS_DIV":5,
    "p_CLKOS_CPHASE":1,
    "p_CLKOS_FPHASE":0,
    "p_CLKOS2_ENABLE":"ENABLED",
    "p_CLKOS2_DIV":20,
    "p_CLKOS2_CPHASE":1,
    "p_CLKOS2_FPHASE":0,
    "p_CLKOS3_ENABLE":"ENABLED",
    "p_CLKOS3_DIV":17,
    "p_CLKOS3_CPHASE":1,
    "p_CLKOS3_FPHASE":0,
    "p_CLKFB_DIV":54,
    "i_RST":0,
    "i_STDBY":0,
    "i_PHASESEL0":0,
    "i_PHASESEL1":0,
    "i_PHASEDIR":1,
    "i_PHASESTEP":1,
    "i_PHASELOADREG":1,
    "i_PLLWAKESYNC":0,
    "i_ENCLKOP":0
}

Not using the 4 output clocks

TODO