cores/cpu: add external cpu_type.
Allows fully pluggable CPUs where cpu_type is set to "external" and cpu_cls provided externally.
This commit is contained in:
parent
b9d3aab59d
commit
b3531cd2a8
|
@ -85,6 +85,9 @@ CPUS = {
|
|||
# None
|
||||
"None" : CPUNone,
|
||||
|
||||
# External (CPU class provided externally by design/user)
|
||||
"external" : None,
|
||||
|
||||
# LM32
|
||||
"lm32" : LM32,
|
||||
|
||||
|
|
|
@ -828,6 +828,11 @@ class SoC(Module):
|
|||
colorer(", ".join(cpu.CPUS.keys()))))
|
||||
raise
|
||||
# Add CPU
|
||||
if name == "external" and cls is None:
|
||||
self.logger.error("{} CPU requires {} to be specified.".format(
|
||||
colorer(name),
|
||||
colorer("cpu_cls", color="red")))
|
||||
raise
|
||||
cpu_cls = cls if cls is not None else cpu.CPUS[name]
|
||||
if variant not in cpu_cls.variants:
|
||||
self.logger.error("{} CPU variant {}, supporteds: {}.".format(
|
||||
|
|
Loading…
Reference in New Issue