Differences from Standard UVM ============================= IVL_UVM follows standard UVM wherever Icarus allows it. These are the differences today. .. list-table:: :header-rows: 1 :widths: 35 65 * - Standard UVM - In IVL_UVM * - The objection of a phase counts per object and per level of the hierarchy, and has a drain time. - The run phase keeps one total. There is no hierarchy, drain time or callbacks, and the object you pass is not recorded. See :doc:`phasing`. * - The global timeout is 9200 s by default, and ``+UVM_TIMEOUT=`` is in time units. - The default is 1 ms, and ```` is in milliseconds. * - ``uvm_top.find_all`` returns the matches in a queue. - It adds them, sorted by full name, to an ``ivl_uvm_string_list #(uvm_component)`` that you create, because Icarus has no queue of class handles. ``find`` returns the first match in that order. * - ``uvm_top.top_levels`` lists the top-level components. - Not available. They are the children of ``uvm_top`` (``get_first_child``, ``get_next_child``). * - The phases are objects in a phase graph. - The nine phases run in a fixed order, with one shared phase object. * - ``factory.set_type_override*`` and instance overrides - Not yet. * - ``uvm_config_db`` - Not yet. * - ``set_config_int("", "is_active", ...)`` makes an agent active or passive - There is no ``set_config_int`` or ``get_config_int``, so code that calls them does not compile. Assign ``is_active`` before the agent's ``build_phase`` runs, for example in the parent's ``build_phase`` right after creating the agent. * - A ``uvm_subscriber`` receives transactions through its ``analysis_export``. - It does: connect an analysis port, or an analysis export that leads to it, with ``connect``. The export is a ``uvm_analysis_imp`` named ``analysis_imp``. * - Ports and exports are resolved at the end of elaboration. A port may connect to the export of a child, within a minimum and maximum number of connections. - ``connect`` stores the provider at once, and ``write`` finds the imps the first time it is called after a ``connect``. A port connects to an imp, or to an export that leads to an imp; a null provider, a connection to itself, an export connected to a port, a second ``connect`` of a pull port and a provider of another item type are errors. A connection made after the end of elaboration is ignored with a warning, and an export that reaches no imp is reported at the end of elaboration. There is no ``resolve_bindings`` and no maximum number of connections. The ports are not derived from ``uvm_port_base``, so code that uses ``uvm_port_base``, ``uvm_port_component`` or ``uvm_sqr_if_base`` directly does not compile. There is no ``uvm_seq_item_pull_export``. A port with a null parent is not placed under ``uvm_top`` as in the BCL. * - Analysis ``write`` reaches every connection, and the other TLM 1 ports (``put``, ``get``, ``peek``, ``transport``) and ``uvm_tlm_fifo`` exist. - Only the analysis ports and the sequencer-driver ports are ported. ``ivl_uvm_tlm_mbx #(T)`` is the FIFO the sequencer uses. When several processes wait for the same mailbox, which of them is served first is not defined. There is no ``uvm_tlm_fifo`` or ``uvm_tlm_analysis_fifo``. * - ``seq_item_port`` and ``seq_item_export`` are TLM ports. - They are a ``uvm_seq_item_pull_port`` and a ``uvm_seq_item_pull_imp``, and both show in ``print_topology``. The sequencer holds one request at a time in a one-entry mailbox. Using a port that is not connected is a fatal error (``NOCONN``). The port offers no ``put_response``. * - The sequencer arbitrates between sequences, with priorities, ``lock`` and ``grab``. - One item is handled at a time, and the order in which waiting sequences are served is not defined. Priorities and ``set_arbitration`` are stored but have no effect, ``lock_request`` reports an error, and ``lock``, ``grab``, ``is_relevant`` and ``wait_for_relevant`` are not available. * - A driver can return a response. - Not yet. ``item_done`` with a response reports an error. There is no ``rsp_port``, ``put_response`` or ``get_response``, and ``response_handler`` is never called. * - ``get``, ``peek`` and ``try_next_item`` on ``seq_item_port`` - Available. ``try_next_item`` first waits until the sequences that are ready in the current time step have run, as ``wait_for_sequences`` does, and waits a few delta cycles for a sequence that has been granted but has not sent its item yet; after that it reports ``TRY_NEXT_BLOCKED`` and returns null. ``has_do_available`` returns 1 for an item in the sequencer or a sequence about to send one; call ``uvm_wait_for_nba_region`` before it when a sequence may act in the same time step. * - A sequence can be stopped: ``kill``, ``stop_sequences``. - Not yet, because Icarus has no ``process`` class. * - Starting a sequence on a phase: ``starting_phase`` and ``default_sequence`` - Not available, so code that uses ``starting_phase`` does not compile. Raise the objection in the test and call ``start`` there. * - The ``uvm_do`` macros and sequence libraries - Not yet. Use ``start_item`` and ``finish_item``. * - ``send_request`` can randomize the item again. - With ``rerandomize`` set it only reports the warning ``SQRSNDREQ``. * - Sequences and items are recorded as transactions. - Not recorded. * - Field macros for arrays, queues and associative arrays - Not ported yet. ``uvm_field_int``, ``uvm_field_string``, ``uvm_field_enum``, ``uvm_field_real`` and ``uvm_field_object`` work. * - Messages show the hierarchical name of the reporting component - Messages do not show it. Reporting uses the message ID and text only. * - ``reseed`` gives each object its own random seed - It has no effect: Icarus does not support random seeding of a class. * - Virtual interfaces in drivers and monitors - Icarus does not support virtual interfaces today, so code that reaches DUT signals through a ``virtual`` interface handle does not work. A module-based example is in test ``t7``. * - A component created after the build phase is an error - It is not an error. The component gets no ``build_phase``; it takes part in the phases that follow. * - The factory creates objects only on request - The factory also builds one prototype instance of every registered class at time 0 (with ``parent = null``). Simulator requirements ---------------------- IVL_UVM runs on a development build of Icarus Verilog. Several SystemVerilog features that the standard UVM source depends on are not supported by Icarus yet, for example associative arrays, queues and dynamic arrays of class handles, and virtual interfaces. IVL_UVM works around them where it can; where it cannot, the feature is listed above. Icarus behaviours to watch for in your own code: * Do not reach through two class handles, as in ``req.val`` inside a driver (the driver, then ``req``) or ``drv.seq_item_port.connect(...)`` inside an agent. Icarus reports ``Nested member path not yet supported`` or cannot find the method. Copy the first handle into a local variable and go through that. * Do not use ``++`` on a class property inside an expression, as in ``x = obj.count++;`` (the Icarus compiler crashes). Write the increment as a statement of its own. * A function cannot have ``output`` or ``inout`` arguments. Use ``ref``, or a task. * ``randomize()`` and ``constraint`` blocks of a class are not supported. Use ``$urandom``. * Calling an overridden virtual method through a base-class handle does nothing when the base method has an empty body. Put a ``return;`` in an empty base method that must be overridable. * Write ``this.`` in front of a call to an inherited method inside a method of a derived class (``this.get_name()``, not ``get_name()``). Without it Icarus may report that it cannot find the function, or, in a method defined outside the class body, call a different function with the same name. * Do not declare an ``event`` as a member of a class (Icarus reports a syntax error). Declare it in a package or a module and use it from the class methods. * Do not use ``wait (expr)`` where ``expr`` reads a class property (the Icarus compiler stops with an internal error). Loop on an event instead: ``while (cond) @(ev);``. * Do not put ``fork ... join_none`` inside a class task or an ``automatic`` task: ``vvp`` aborts when it runs. ``fork ... join`` works there. * ``disable fork`` stops only the threads that were forked in the same block. Threads that were forked inside a task you called are not stopped. Fork them in the block that calls ``disable fork`` and put that block in an outer ``fork begin ... end join``, so threads your own code forked earlier are left alone.