start splitting out common code from nmigen_add_experiment.py