8.3 KiB
Migen and nMigen compatibility summary
nMigen intends to provide as close to 100% compatibility to Migen as possible without compromising its other goals. However, Migen widely uses * imports, tends to expose implementation details, and in general does not have a well-defined interface. This document attempts to elucidate a well-defined Migen API surface (including, when necessary, private items that have been used downstream), and describes the intended nMigen replacements and their implementation status.
API change legend:
- id: identical
- obs: removed or incompatibly changed with compatibility stub provided
- obs →n: removed or incompatibly changed with compatibility stub provided, use n instead
- brk: removed or incompatibly changed with no replacement provided
- brk →n: removed or incompatibly changed with no replacement provided, use n instead
- →n: renamed to n
- ⇒m: merged into m
- a=→b=: parameter a renamed to b
- a=∼: parameter a removed
- .a=→.b: attribute a renamed to b
- .a=∼: attribute a removed
- ?: no decision made yet
When describing renames or replacements, mod refers to a 3rd-party package mod (no nMigen implementation provided), .mod.item refers to nmigen.mod.item, and "(import .item)" means that, while item is provided under nmigen.mod.item, it is aliased to, and should be imported from a shorter path for readability.
Status legend:
- (−) No decision yet, or no replacement implemented
- (+) Implemented replacement (the API and/or compatibility shim are provided)
- (⊕) Verified replacement and/or compatibility shim (the compatibility shim is manually reviewed and/or has 100% test coverage)
- (⊙) No direct replacement or compatibility shim is provided
Compatibility summary
- (−)
fhdl→.hdl- (⊕)
bitcontainer⇒.tools- (⊕)
log2_intid - (⊕)
bits_forid - (⊕)
value_bits_sign→Value.shape
- (⊕)
- (⊕)
conv_outputobs - (⊕)
decorators⇒.hdl.xfrm
Note:transform_*methods not considered part of public API.- (⊙)
ModuleTransformerbrk - (⊙)
ControlInserterbrk - (⊕)
CEInserter→EnableInserter - (⊕)
ResetInserterid - (⊕)
ClockDomainsRenamer→DomainRenamer,cd_remapping=→domain_map=
- (⊙)
- (⊙)
edifbrk - (⊕)
moduleobs →.hdl.dsl
Note: any class inheriting fromModulein oMigen should inherit fromElaboratablein nMigen and use an nMigenModulein its.elaborate()method.- (⊕)
FinalizeErrorobs - (⊕)
Moduleobs →.hdl.dsl.Module
- (⊕)
- (⊙)
namerbrk - (⊙)
simplifybrk - (⊕)
specialsobs- (⊙)
Specialbrk - (⊕)
Tristateobs - (⊕)
TSTripleobs →.lib.io.Pin - (⊕)
Instance→.hdl.ir.Instance - (⊕)
Memoryid
Note: nMigen memories should not be added as submodules.- (⊕)
.get_portobs →.read_port()+.write_port()
- (⊕)
- (⊕)
_MemoryPortobs →.hdl.mem.ReadPort+.hdl.mem.WritePort - (⊕)
READ_FIRST/WRITE_FIRSTobs
Note:READ_FIRSTcorresponds tomem.read_port(transparent=False), andWRITE_FIRSTtomem.read_port(transparent=True). - (⊙)
NO_CHANGEbrk
Note: in designs usingNO_CHANGE, replace it with logic implementing required semantics explicitly, or with a different mode.
- (⊙)
- (⊕)
structure→.hdl.ast- (⊕)
DUIDid - (⊕)
_Value→Value
Note: values no longer valid as keys indictandset; useValueDictandValueSetinstead. - (⊕)
wrap→Value.cast - (⊕)
_Operator→Operator,op=→operator=,.op→.operator - (⊕)
Muxid - (⊕)
_Slice→Sliceid - (⊕)
_Part→Partid - (⊕)
Catid,.l→.parts - (⊕)
Replicate→Repl,v=→value=,n=→count=,.v→.value,.n→.count - (⊕)
Constant→Const,bits_sign=→shape=,.nbits→.width - (⊕)
Signalid,bits_sign=→shape=,attr=→attrs=,name_override=∼,related=,variable=∼,.nbits→.width - (⊕)
ClockSignalid,cd=→domain=,.cd→.domain - (⊕)
ResetSignalid,cd=→domain=,.cd→.domain - (⊕)
_Statement→Statement - (⊕)
_Assign→Assign,l=→lhs=,r=→rhs= - (⊕)
_check_statementobs →Statement.cast - (⊕)
Ifobs →.hdl.dsl.Module.If - (⊕)
Caseobs →.hdl.dsl.Module.Switch - (⊕)
_ArrayProxy→.hdl.ast.ArrayProxy,choices=→elems=,key=→index= - (⊕)
Arrayid - (⊕)
ClockDomain→.hdl.cd.ClockDomain - (⊙)
_ClockDomainListbrk - (⊙)
SPECIAL_INPUT/SPECIAL_OUTPUT/SPECIAL_INOUTbrk - (⊙)
_Fragmentbrk →.hdl.ir.Fragment
- (⊕)
- (⊙)
toolsbrk- (⊙)
insert_resetsbrk →.hdl.xfrm.ResetInserter - (⊙)
rename_clock_domainbrk →.hdl.xfrm.DomainRenamer
- (⊙)
- (⊙)
tracerbrk- (⊕)
get_var_name→.tracer.get_var_name - (⊙)
remove_underscorebrk - (⊙)
get_obj_var_namebrk - (⊙)
index_idbrk - (⊙)
trace_backbrk
- (⊕)
- (⊙)
verilog- (⊙)
DummyAttrTranslate? - (⊕)
convertobs →.back.verilog.convert
- (⊙)
- (⊙)
visitbrk →.hdl.xfrm- (⊙)
NodeVisitorbrk - (⊙)
NodeTransformerbrk →.hdl.xfrm.ValueTransformer/.hdl.xfrm.StatementTransformer
- (⊙)
- (⊕)
- (−)
genlib→.lib- (−)
cdc?- (⊙)
MultiRegImplbrk - (⊕)
MultiReg→.lib.cdc.FFSynchronizer - (−)
PulseSynchronizer? - (−)
BusSynchronizer? - (⊕)
GrayCounterobs →.lib.coding.GrayEncoder - (⊕)
GrayDecoderobs →.lib.coding.GrayDecoder
Note:.lib.coding.GrayEncoderand.lib.coding.GrayDecoderare purely combinatorial. - (−)
ElasticBuffer? - (−)
lcm? - (−)
Gearbox?
- (⊙)
- (⊕)
codingid- (⊕)
Encoderid - (⊕)
PriorityEncoderid - (⊕)
Decoderid - (⊕)
PriorityDecoderid
- (⊕)
- (−)
divider?- (−)
Divider?
- (−)
- (⊕)
fifo→.lib.fifo- (⊕)
_FIFOInterface→FIFOInterface - (⊕)
SyncFIFOid,.replace=∼ - (⊕)
SyncFIFOBufferedid,.fifo=∼ - (⊕)
AsyncFIFO? - (⊕)
AsyncFIFOBuffered,.fifo=∼
- (⊕)
- (⊕)
fsmobs
Note: FSMs are a part of core nMigen DSL; however, not all functionality is provided. The compatibility shim is a complete port of Migen FSM module. - (⊙)
iobrk
Note: all functionality in this module is a part of nMigen platform system. - (−)
misc?- (−)
split? - (−)
displacer? - (−)
chooser? - (−)
timeline? - (−)
WaitTimer? - (−)
BitSlip?
- (−)
- (⊕)
recordobs →.hdl.rec.Record
Note: nMigen uses aLayoutobject to represent record layouts.- (⊕)
DIR_NONEid - (⊕)
DIR_M_TO_S→DIR_FANOUT - (⊕)
DIR_S_TO_M→DIR_FANIN - (⊕)
Recordid - (⊙)
set_layout_parametersbrk - (⊙)
layout_lenbrk - (⊙)
layout_getbrk - (⊙)
layout_partialbrk
- (⊕)
- (⊕)
resetsyncobs- (⊕)
AsyncResetSynchronizerobs →.lib.cdc.ResetSynchronizer
- (⊕)
- (−)
roundrobin?- (−)
SP_WITHDRAW/SP_CE? - (−)
RoundRobin?
- (−)
- (−)
sort?- (−)
BitonicSort?
- (−)
- (−)
- (⊕)
simobs →.back.pysim
Note: only items directly undernmigen.compat.sim, not submodules, are provided.- (⊙)
corebrk - (⊙)
vcdbrk →vcd - (⊙)
Simulatorbrk - (⊕)
run_simulationobs →.back.pysim.Simulator - (⊕)
passiveobs →.hdl.ast.Passive
- (⊙)
- (⊙)
buildbrk
Note: the build system has been completely redesigned in nMigen. - (⊙)
utilbrk