HM2 Clocking

29 views
Skip to first unread message

Cameron McQuinn

unread,
Jul 18, 2020, 7:06:45 PM7/18/20
to Machinekit
Hi all,

I am looking to gain a better understanding of how the clocking for the Hostmot2 firmware works in mksocfpga. In the Vivado block diagram, the hostmot2_ip_wrap module has 3 clock ports: clklow, clkmed, and clkhigh. The TCL scripts to generate the Vivado projects all connect clklow and clkmed together. Clkmed and clklow connect to a 100MHz clock, and clkhigh connects to a 200MHz clock. Where did these numbers come from?

Also, in the PIN_XXXXX file for each configuration, each module has an associated clock tag. For instance, in PIN_ULTR_36.vhd, the PWM module has the ClockHighTag (https://github.com/machinekit/mksocfpga/blob/master/HW/VivadoProjects/avnet/ultra96/const/PIN_ULTR_36.vhd#L83). Is there some place in the HM2 code that defines what clock tag each module should have?

Thanks,
Cameron

pcwcol

unread,
Jul 19, 2020, 2:14:46 PM7/19/20
to Machinekit
Not sure about mksocfpga but in general the clocking setup is pretty simple, the top level (card specific) file generates the various clocks from the
clock source ( via DCM, PLL etc  depending on hardware) These are simple fixed hardwired frequencies for a given card. Card specific constants
(on IDROMConst.vhd) are used to simply pass the fixed hardware clock frequencies to the hm2 driver for its frequency based calculations

The clock tags that specify which clock a module uses (for determining I/O frequencies) is in the module ID section of the pinout file:PINXXXX. vhd

Charles Steinkuehler

unread,
Jul 20, 2020, 3:04:12 PM7/20/20
to machi...@googlegroups.com
I believe the determination as to which clock frequency to use for a
specific hardware module would be made based on the requirements for
that specific module and the available clock frequencies. This is less
of an issue in today's world than it used to be...with all the PLLs
available on modern FPGAs designs aren't really limited to the one or
two clock frequencies being generated by on-board oscillators.

As for the specific frequencies and such used in the mksocfpga
configurations, this mostly came about as a more-or-less direct clone of
the 5i25 configuration (but with twice as many available I/O
connectors). If you need something different, it should be pretty
straight-forward to migrate one of the other Mesa board configurations
but you might need to update the PLL configuration (which is at the top
level and outside the HM2 stuff).
--
Charles Steinkuehler
cha...@steinkuehler.net
Reply all
Reply to author
Forward
0 new messages