UVM Translation Tables

Your working vocabulary, mapped onto rustdv — whichever language you come from. These tables are Appendices B, C, and A of Rust for RTL Verification; the Chapter column points to where the book teaches each translation.

Python → Rust (for cocotb and pyuvm readers)

For readers coming from cocotb and pyuvm (and Python for RTL Verification): the working translations the book uses, gathered for reference. SystemVerilog readers want the next section, this table's twin. Legend: [C] cocotb, [P] pyuvm.

Language and runtime

PythonRustChapter
async def coroutine, resumed via send(None)async fnFuture, resumed via poll()15
@cocotb.test()#[rustdv::test]15, 21
exceptions fail the testResult<(), TestError>; panics = testbench bugs9, 18
cocotb.start_soon(coro)spawn(future) -> TaskHandle<T>16
await tasktask.awaitResult<T, TaskError>16
task.kill()handle.cancel() — the future is dropped; cleanup in Drop16
Combine(...) / First(...)join2/join! / first2/first!16
try/except QueueFulltry_putResult<(), T> (rejected item handed back)16, 31
decorator registration at import timelink-section registration at compile time21
metaclass class registrationnot needed — constructor injection21, 29
getattr(obj, name) dispatchpass the function/closure itself33
logging levels + handlerslog:: levels, set_level_for(prefix), log_to_file26

cocotb layer

Python (cocotb)Rust (rustdv-sim)Chapter
Timer(2, units="ns")Timer::ns(2).await15
RisingEdge(sig) / FallingEdge(sig)sig.rising_edge().await / sig.falling_edge().await17
ClockCycles(clk, n)for _ in 0..n { clk.rising_edge().await; }17
dut.sig attribute magicdut.signal("sig")?Result<LogicHandle, _>17
sig.value = x / int(sig.value)sig.set_u64(x) / sig.get_u64()?17
Clock(dut.clk, 10, units="ns").start()Clock::new(&clk, SimDuration::ns(10)).start()17
cocotb.queue.Queue(maxsize=1)Queue::new(Some(1)); Queue::unbounded()16
Event / Locksim::Event / sim::Lock (FIFO-fair, RAII guard)16

pyuvm layer

Python (pyuvm)Rust (rustdv)Chapter
@pyuvm.test() on a class, uvm_test_top#[rustdv::test] on a struct; the root is named after your test23
raise_objection()/drop_objection()ctx.raise_objection(..) → RAII ObjectionGuard; drop releases23
uvm_component(name, parent) treechildren are struct fields; #[derive(Component)]; paths derived24
the nine phases, pyuvm's traversal orderthe nine phases, same order: build, connect, ... final_phase24
self.logger, [uvm_test_top.comp]ctx.info(..), same bracket format, path supplied by the walk26
ConfigDB().set/get, wildcards, globalsConfigDb::set/get — same paths, same globs, Result answers25, 27
except UVMConfigItemNotFoundmatch on ConfigError::NotFound { .. }28
metaclass registration + create()#[derive(Component)] registers; Foo::create_comp()21, 29
set_type_override_by_typeFactory::set_type_override::<A, B>() (also by name, by instance)29, 30
TLM-1 put/get/peek port classesPutPort/GetPort/PeekPort, wired export-to-port through a TlmFifo31
UVMTLMConnectionError (lazy, at first use)elaboration sweep names every unwired port before run31
uvm_analysis_port.write()PublishPort<T>::write(&T) through an AnalysisBus hub32
uvm_subscriber (one write per class)a Subscriber<T> impl per stream — two streams, two impls32, 34
uvm_tlm_analysis_fifoabsent — the subscriber owns its storage32
uvm_object do_copy/do_compare/__str__#[derive(Clone, PartialEq, Debug)] + hand-written Display35
copy(other) / clone()clone_from(&mut self, src) / clone()35
uvm_sequence.body()impl Sequencetype Req/type Rsp, async fn body(ctx)36
start_item/finish_itemctx.start_item(&mut req) / ctx.finish_item(req) → ticket36
seq_item_port.get_next_item()port.get_next_item().awaitSeqItem<REQ>36
item_done() / item_done(rsp) + set_id_infoitem_done(None) / item_done(Some(rsp)) — auto-tagged36, 38
get_response()get_response(Some(ticket)) / try_get_response — in order or by ticket37, 38
(no pyuvm counterpart) try_next_itemtry_next_item()Option — the UVM's non-blocking accept, kept37
seq.start(seqr) / start(None) for virtualseq.start(&seqr) / start_virtual()36, 39
is_active int from ConfigDBActive enum from the ConfigDb; a passive env skips building the driver40

SystemVerilog-UVM → rustdv

For readers coming from SystemVerilog UVM (and The UVM Primer): where each piece of your working vocabulary went. Python readers want the previous section, this table's twin.

Language level

SystemVerilogRustChapter
byte, shortint, intu8/i8, u16/i16, u32/i32 — no silent truncation3
logic four-state valuesLogic enum / LogicArray — no x in arithmetic7, 17
typedef enum (an int in disguise)enum — a real type; exhaustively matched7
case + default (+ unique warnings)match — missing cases are compile errors4
class ... extends, virtual, super.new()traits, default methods, composition + delegation10
pure virtual function in a virtual classa required trait method, checked at the impl10
parameterized class #(type T = int)generics <T: Bound>, checked at definition11
class ... #(type REQ, type RSP = REQ)SeqItemPort<REQ, RSP = REQ> — same convention11
local / protectedprivate-by-default, pub to export14
null handle, $castOption<T>, exhaustive match — no null, no cast9
status flags and sentinel returnsResult<T, E> + ? — failure in the signature9
$sformatfformat!8
fork / join_none / disablespawn(future)TaskHandle; handle.cancel()16
foreverloop (an expression — it can break with a value)4
mailbox #(T), try_put/try_getsim::Queue<T> — same names, Result/Option answers16
named event, ->done, @(done)sim::Eventset() / wait().await16
semaphore (one key)sim::Lock — FIFO-fair, RAII guard16
@(posedge clk), #2nsclk.rising_edge().await, Timer::ns(2).await15, 17
`define-style codegen (`uvm_*_utils)attribute + derive macros — syntax trees, not text21
package + .f file + vendor tarballcrate + Cargo.toml + crates.io14
(no equivalent)cargo test — unit tests with no simulator14

Methodology level

SystemVerilog UVMrustdvChapter
class my_test extends uvm_test + run_test()#[rustdv::test] on a struct; the runner drives its phases23
phase.raise_objection(this) / drop_objectionctx.raise_objection(..) → RAII ObjectionGuard; drop releases23
uvm_component(name, parent) treechildren are struct fields; #[derive(Component)]; paths derived by the walk24
build_phase (top-down) / connect_phase (bottom-up)fn build(&mut self, ctx) / fn connect(&mut self, ctx) — real phases, same directions24
run_phase (objection-gated task)async fn run — concurrent across the tree; ends when objections drain24, 31
elaboration + post-run phasessame names; top-down, where SV runs them bottom-up24
`uvm_info(id, msg, verbosity)ctx.info(..) — same time/level/[path] line format26
set_report_verbosity_level_hier()ctx.set_logging_level_hier(..)26
uvm_config_db#(T)::set/get, wildcardsConfigDb::set(ctx, glob, key, v) / getResult — one key, no type in the address25, 27
virtual interface via config databaseRc<TinyAluBfm> in the ConfigDb25
a failed get() (silent return 0)ConfigError naming which failure; #[must_use]27, 28
print_config() / +UVM_CONFIG_DB_TRACEConfigDb::print() / ConfigDb::set_tracing(true)28
`uvm_component_utils registration#[derive(Component)] registers by name, universally21, 29
type_id::create("name", this)Foo::create_comp() — overridable (new_comp() = new, fixed)29
set_type_override_by_type / _by_name / instanceFactory::set_type_override::<A, B>() / _by_name / set_inst_override29, 30
uvm_factory::get().print()Factory::print()29
TLM-1 put/get/peek port + export + connect()PutPort/GetPort/PeekPort + fifo.put_export().connect(comp, PORT_NAME)31
uvm_tlm_fifo (with built-in taps)TlmFifo<T> (with put_ap()/get_ap())31
try_put() returns a bittry_put(T)Result<(), T> — a refused item comes back31
unconnected port found at first useelaboration sweep names every unwired port before run31
uvm_analysis_port.write()PublishPort<T>::write(&T), brokered by an AnalysisBus hub32
uvm_subscriber (one write per class)a Subscriber<T> impl per stream — two streams, two impls, no imp_decl32, 34
uvm_tlm_analysis_fifo in scoreboardsabsent — the subscriber owns its storage32
uvm_agent + is_activeenv reads Active from the ConfigDb; a passive env leaves the driver slot empty40
do_copy / do_compare / convert2string#[derive(Clone, PartialEq, Debug)] + hand-written Display10, 35
copy(other) / clone()clone_from(&mut self, src) / clone()35
uvm_field_* macros (runtime field walking)derive — the same generation, at compile time21, 35
uvm_sequence #(REQ, RSP), body()impl Sequencetype Req/type Rsp, async fn body(ctx)36
start_item(req) / finish_item(req)ctx.start_item(&mut req) / ctx.finish_item(req) → ticket36
seq_item_port.get_next_item() / item_done()same names; item_done(Some(rsp)) answers36, 38
try_next_item() (absent from pyuvm)try_next_item()Option<SeqItem<REQ>>37
rsp.set_id_info(req) + get_response()auto-tagged; get_response(Some(ticket)) / try_get_response37, 38
seq.start(seqr) / virtual sequence with no sequencerseq.start(&seqr) / start_virtual()36, 39
sequencer grab/lock/priority arbitrationunported (FIFO arbitration only) — a recorded gap36
assert (prints, simulation continues)assert! (panic = test fails, on the spot)9
uvm_error vs uvm_fatal (convention)CheckSink::error = DUT check; panic! = testbench bug9, 24

Chapter map to the earlier books

Two books precede Rust for RTL Verification, and either prepares you for it: The UVM Primer (SystemVerilog) and Python for RTL Verification (Python/cocotb/pyuvm). This table maps every chapter to its companion chapters in both, for readers who want to compare treatments — or to lend the right book to a colleague. A dash means the topic has no mirror in that book.

Rust for RTL VerificationThe UVM PrimerPython for RTL Verification
Ch. 1: Why Rust?Ch. 1: IntroductionWhy Python and why UVM?
Ch. 2: Rust ConceptsPython concepts
Ch. 3: Rust BasicsPython basics
Ch. 4: Conditions, Loops, and matchConditions and loops / Ranges
Ch. 5: Ownership(no mirror — GC did this silently)(no mirror)
Ch. 6: Borrowing and References(no mirror)(no mirror)
Ch. 7: Structs, Enums, and MethodsCh. 4: OOP; Ch. 7: Static MethodsClasses
Ch. 8: CollectionsPython sequences / Lists / Strings / Dictionaries
Ch. 9: Result, Option, and the End of ExceptionsExceptions
Ch. 10: TraitsCh. 5: Classes and Extension; Ch. 6: PolymorphismInheritance / super() / protocols
Ch. 11: GenericsCh. 8: Parameterized Class Definitions(duck typing, throughout)
Ch. 12: Closures and IteratorsGenerators / comprehensions
Ch. 13: Smart PointersProtecting attributes
Ch. 14: Modules, Crates, and CargoModules
Interlude: The Complete TinyALU Testbench(the destination, previewed)(testbench 8.0, previewed)
Ch. 15: async/await and the Executor(the simulator's scheduler, opened up)Coroutines
Ch. 16: Tasks, Channels, and Sim-Aware QueuesCh. 17: Interthread Communicationcocotb Queue
Ch. 17: Simulating with rustdv-simSimulating with cocotb
Ch. 18: Basic Testbench: 1.0Ch. 2: A Conventional TestbenchBasic testbench: 1.0
Ch. 19: TinyAluBfmCh. 3: Interfaces and BFMsTinyAluBfm
Ch. 20: Struct-Based Testbench: 2.0Ch. 10: An Object-Oriented TestbenchClass-based testbench: 2.0
Ch. 21: Macros(the `uvm_*_utils macros, demystified)(decorators; design patterns)
Ch. 22: Why UVM?Ch. 1: IntroductionWhy UVM?
Ch. 23: uvm_test Testbench: 3.0Ch. 11: UVM Testsuvm_test testbench: 3.0
Ch. 24: ComponentsCh. 12: UVM Componentsuvm_component
Ch. 25: uvm_env Testbench: 4.0Ch. 13: UVM Environmentsuvm_env testbench: 4.0
Ch. 26: LoggingCh. 19: UVM ReportingLogging
Ch. 27: Configuration(uvm_config_db, in passing)ConfigDB()
Ch. 28: Configuration DebuggingDebugging the ConfigDB()
Ch. 29: The FactoryCh. 9: The Factory PatternThe UVM factory
Ch. 30: Variation-Point Testbench: 5.0UVM factory testbench: 5.0
Ch. 31: Component CommunicationsCh. 14: A New Paradigm; Ch. 18: Put and Get PortsComponent communications
Ch. 32: Analysis PortsCh. 15: Talking to Multiple ObjectsAnalysis ports
Ch. 33: Components in Testbench 6.0Ch. 16: Analysis Ports in a TestbenchComponents in testbench 6.0
Ch. 34: Connections in Testbench 6.0Ch. 18: Put and Get in Action; Ch. 22: UVM AgentsConnections in testbench 6.0
Ch. 35: TransactionsCh. 20: Deep Operations; Ch. 21: UVM Transactionsuvm_object in Python
Ch. 36: Sequence Testbench: 7.0Ch. 23: UVM SequencesSequence testbench: 7.0
Ch. 37: Out-of-Order Transactions: Testbench 7.1Ch. 23: UVM SequencesFibonacci testbench: 7.1 / get_response() testbench: 7.2
Ch. 38: Fibonacci Testbench: 7.2Ch. 23: UVM SequencesFibonacci testbench: 7.1
Ch. 39: Virtual Sequence Testbench: 8.0Ch. 23: UVM SequencesVirtual sequence testbench: 8.0
Ch. 40: The Complete TinyALU Testbench(no mirror)(no mirror)