put imports into conditional blocks. makes core.py "safe" for litex upstream