Clocks can be extracted from GPS satellite signals, or locally generated with MEMS oscillators, SAW resonators, quartz crystal (XTAL, XO) or piezo resonators, often set in “ovens” (TCXO, OCXO), derived from atomic properties (like Cesium Beam, Hydrogen Maser, Rubidium, Strontium or Ytterbium), or obtained in another way.
They differ in Absolute Accuracy, Long-term Frequency Stability (e.g. due to aging), Short-term Frequency Stability (due to temperature changes), Phase Noise (aka Jitter), physical size, complexity, immunity to external interference (due to physical vibrations, humidity, EMP, EW), power consumption, cost, etc. These differences are categorized as “Clock Strata”, whereby a clock source must meet a standardized set of requirements for each Stratum level.
This work is about researching and exploiting the properties of multi-mode crystal oscillators in order to achieve stability comparable to a Stratum 2 Rubidium clock, all at a fraction of the total cost of ownership. We plan on collecting large empirical datasets, constructing experimental prototypes, and using DSP / numerical methods to mitigate (1) temperature variations, (2) dynamic acceleration and (3) static gravity effects. The project aims for XTAL frequency stability by means of numerous mathematical calculations performed in FPGA, using open-source tools, including CflexHDL+PipelineC HLS flow.
This is a Proof-of-Concept (PoC) and stepping stone for future applied research projects on this theme, possibly extending into the field of Artificial Intelligence. In addition to a working prototype (PCBs, FPGA Gateware and Embedded Firmware), the project will deliver a series of scientific papers.
- Physics Package -- Full-custom Analog Board with multi-mode Quartz Crystal
- Design, manufacture and debug the "Physics Package" card.
- Procure and distribute FPGA, ADC and DAC cards.
- Familiarize with ALINX boards.
- Toggle LEDs
- Write RTL for interfaces to ADC and DAC chips
- Write RTL to test their operation
- Perform this testing. Debug and fix the problems as they arise
- Create CPU hardware subsystem based on an open-source RISC-V core, memories, UART and debug port.
- Create a bare-metal software skeleton, as the foundation for writing future DSP applications. Create and test software build flow.
- Test operation of CPU subsystem. Profile its performance.
- Map ADCs and DACs into CPU memory space and test SW communication with them.
- Model quartz crystal and DSP datapath in C or Python.
- Create Theory of Operation document with explanation of concepts, tradeoffs and criteria used to devise solutions.
- Post the Executive Summary here.
- Bring up the complete system with digital and analog card connected to each other.
- Perform manual characterization of individual crystals.
- Develop a semi or fully automated crystal characterization procedure.
- Implement HW side of DSP algorithm on FPGA.
- Implement SW side of DSP algorithm in the RISC-V CPU.
- Integrate DSP hardware and software into a complete system.
- Test the DSP together with crystal.
- we need a reliable reference clock source for this, preferably Stratum 0
- with a good Spectrum Analyzer
- Fine-tune DSP algorithm based on the obtained measurements.
- Conducting additional experiments with the corrected DSP algorithm (in simulation and on hardware).
- CPU + UART + integrated RAM builds and routes end-to-end with openXC7 (Yosys + nextpnr-xilinx + prjxray), no Vivado involved.
-
--with-uberclock(the DSP core) does not build cleanly under openXC7 yet: it hits upstream nextpnr-xilinx placement-legality bugs. See Building with openXC7 below. -
--with-uberddr3,--with-ethernet,--with-hdmiare not expected to work under openXC7 regardless (Vivado-only I/O constraints and primitives); untested.
In addition to Vivado, this project can be built with
openXC7 -- a fully open-source
Yosys → nextpnr-xilinx → prjxray flow -- for the Alinx AX7203
(xc7a200tfbg484-2). LiteX already supports this via its
XilinxYosysNextpnrToolchain; no RTL changes were needed for the CPU-only
configuration below, beyond a few pre-existing bugs (unrelated to the
toolchain choice) that had to be fixed first -- see
docs/openxc7_port/main.tex for the full,
chronological debugging log, root causes, and fixes.
RISC-V CPU + UART + 64 KiB integrated RAM builds and routes to a working
.bit file, fully through the open flow:
cd 3.build
make build-board TOOLCHAIN=openxc7 \
OPTIONS='--integrated-main-ram-size=0x10000 --nextpnr-seed=42'This requires an openXC7 install (tested with the toolchain-installer layout
under /opt/openxc7) and a pre-generated chip database for
xc7a200tfbg484. Run 2.soc/setup_dev.sh --with-openxc7 once to also install
fasm2frames (from f4pga/prjxray), which the openXC7 packer stage needs but
which the toolchain-installer binary install does not ship.
The 64 KiB RAM size is a required workaround, not a free choice: the default 256 KiB integrated RAM makes Yosys infer a depth-cascaded BRAM pair, and nextpnr-xilinx does not enforce the cascade pair's column-adjacency constraint, producing an unroutable placement. 64 KiB avoids BRAM cascading entirely.
--with-uberclock (the 11-channel DSP core) does not build cleanly under
openXC7. Synthesis completes (after disabling LiteX's default -flatten
before optimization, and switching to Yosys's abc9 LUT mapper to stay
within LUT capacity), but placement then hits a genuine, reproducible
nextpnr-xilinx placement-legality bug: its placer cannot legalize a
CARRY4 chain shape produced by Yosys abc9's ALU-extraction pass for the
CORDIC pipeline's adders. Every placer/option combination tried (heap;
heap with -nocarry; sa) hits an independent variant of this bug class,
with one signature reproduced on two unrelated netlists. This is a toolchain
maturity gap, not something fixable from this project's RTL or LiteX
integration -- see docs/openxc7_port/main.tex for the full bisection and
the three distinct bug signatures found.
--with-uberddr3, --with-ethernet, and --with-hdmi are expected to need
Vivado regardless of the above: LiteX silently drops the Vivado-only I/O
properties UberDDR3's PHY needs (INTERNAL_VREF, etc.) under this toolchain,
and XilinxYosysNextpnrToolchain has no real static timing analysis or false-
path support, so a 400 MHz DDR3 PHY domain would be effectively unconstrained.
Until the upstream nextpnr-xilinx bugs are fixed, use Vivado for any build
that includes --with-uberclock, --with-uberddr3, --with-ethernet, or
--with-hdmi. openXC7 is solid for the CPU-only bring-up case above, and
for any future peripheral-free RTL work where a fully open flow matters.
- WIP
- WIP
- WIP
- WIP
- WIP
This repository uses multiple licenses. Text and documentation are licensed under CC-BY-SA-4.0. LiteX integration code is licensed under BSD-2-Clause. Other original code is licensed under GPL-3.0-or-later. Existing third-party or separately licensed files keep their own licenses, including BSD-3-Clause, Apache-2.0 for ZipCPU/WB2AXIP code, and ISC for PicoRV32. See LICENSE for the full license texts.
We are grateful to NLnet Foundation for their sponsorship of this development activity.
This project was funded through the NGI0 Commons Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101135429. Additional funding is made available by the Swiss State Secretariat for Education, Research and Innovation (SERI).






