litex/migen/build/sim/platform.py

21 lines
768 B
Python
Raw Normal View History

2015-09-10 13:53:15 -04:00
from migen.build.generic_platform import GenericPlatform
from migen.build.sim import common, verilator
2015-04-13 14:45:35 -04:00
class SimPlatform(GenericPlatform):
def __init__(self, *args, toolchain="verilator", **kwargs):
GenericPlatform.__init__(self, *args, **kwargs)
if toolchain == "verilator":
self.toolchain = verilator.SimVerilatorToolchain()
else:
raise ValueError("Unknown toolchain")
def get_verilog(self, *args, special_overrides=dict(), **kwargs):
so = dict(common.sim_special_overrides)
so.update(special_overrides)
return GenericPlatform.get_verilog(self, *args, special_overrides=so, **kwargs)
def build(self, *args, **kwargs):
return self.toolchain.build(self, *args, **kwargs)