cve2/vendor/lowrisc_ip/util/uvmdvgen
Prajwala Puttappa 15da12dfd6 Update lowrisc_ip to lowRISC/opentitan@7c4f8b3fd
Update code from upstream repository
https://github.com/lowRISC/opentitan to revision
7c4f8b3fde4bb625ac3330ff52d3f66507190fe5

* Revert "[dv] Allow using memutil_dpi_scrambled even without
  prim_ram_1p_scr" (Rupert Swarbrick)
* [dv] Fix some signed/unsigned comparison warnings (Rupert Swarbrick)
* [dv] Make an implicit up-conversion explicit (Rupert Swarbrick)
* [dv] Remove an unused array variable in prince_ref.h (Rupert
  Swarbrick)
* [prim/security] Improve the code for prim_sparse_fsm security check
  (Cindy Chen)
* [dv] Apply VCS option `-xprop=mmsopt` only when wave dump is off
  (Weicai Yang)
* [all] variety of minor lint fixes (Timothy Chen)
* [dv] Add options to improve VCS runtime (Weicai Yang)
* [rv_dm] CSR test fixes (Srikrishna Iyer)
* [dvsim] Fix pass/fail status for synthesis regression (Michael
  Schaffner)
* [prim] Minor lint fixes for unused clocks / resets (Timothy Chen)
* [dv] Flag illegal ENUMASSIGN warnings as errors (Michael Schaffner)
* [flash_ctrl] Correct erase suspend interface behavior (Timothy Chen)
* [rstmgr] Address several d2s review items (Timothy Chen)
* [fpv/sec] Add some workaround logic for $cast keyword (Cindy Chen)
* [dv] CSR seq lib - support for adapter-less RAL (Srikrishna Iyer)
* [dv] Prepare codebase for UVM REG changes (Srikrishna Iyer)
* [dv] Print computed CSR stuff in RAL (Srikrishna Iyer)
* [dv] Allow CSR tests to run on custom RALs (Srikrishna Iyer)
* [fpv/rom_ctrl] Check connectivity for alerts in rom_ctrl (Cindy
  Chen)
* [prim] Add prim_and2 primitive (Pirmin Vogel)
* [prim_dom_and_2share] Remove EnNegedge parameter (Pirmin Vogel)
* [prim_dom_and_2share] Use prim_xor2 and prim_flop_en primitives
  (Pirmin Vogel)
* [prim_dom_and_2share] Switch to single randomness input (Pirmin
  Vogel)
* [util/dvsim] Fix confusing error message (Guillermo Maturana)
* [dvsim] Minor changes to SynCfg results reporting (Michael
  Schaffner)
* [fpv] V2S formal support (Cindy Chen)
* [tools/xcelium] updated common coverage exclusions to exclude single
  bit correctly (Rasmus Madsen)
* [dv] Clean up enable_reg_testplan (Weicai Yang)
* [top] Hook-up flash/otp control and observation bus to ast (Timothy
  Chen)
* [lint] Increase the unroll count (Eunchan Kim)
* [entropy_src] Document & Implement THRESHOLD_SCOPE (Martin Lueker-
  Boden)
* [AST] USB Observe, Clocks & POR_NI logic update (Jacob Levy)
* [prim] Add new assertion macro for generating static lint errors
  (Pirmin Vogel)
* [dv] csr_seq_lib fixes (Srikrishna Iyer)
* [dv] dv_base_reg_block - Add special knobs (Srikrishna Iyer)
* [dv] dv_base_mem - add special knobs (Srikrishna Iyer)
* [prim] Move sec_cm assertion to an include file in prim_assert
  (Weicai Yang)
* [flash_ctrl] Fixes for erase suspend (Timothy Chen)
* [dv] exclude d_user.rsp_intg[6] for xcelium (Weicai Yang)
* [prim_flop_en] Dependency fix (Michael Schaffner)
* [dv] add mubi coverage for CSR and update reggen (Weicai Yang)
* [prim] Add option for secure buffers in prim_mubi (Timothy Chen)
* [prim] Add option for hand instantiated buffers for prim_flop_en
  (Timothy Chen)
* [dv/shadow_reg] Move shadow_reg to V2S (Cindy Chen)
* [prim_count] Updated comments to reflect all changes in
  lowRISC/opentitan#10378 (Michael Tempelmeier)
* [dv] Teach ECC32 flavours of mem_area to write with integrity bits
  (Rupert Swarbrick)
* [dv/shadow_reg] update milestone for shadow reg tests (Cindy Chen)
* [checklists] Update V2S checklists (Srikrishna Iyer)
* [tools/xcelium] updated xcelium flow to vcs for coverage test
  grading (Rasmus Madsen)
* [prim] Add stub flops to remove lint warnings (Timothy Chen)
* [dv] Add automatic covergroup for all regwen CSRs (Weicai Yang)
* [dvsim] Add support for tags in testplan (Srikrishna Iyer)
* [dv] Enable xcelium to include X for toggle coverage (Weicai Yang)
* [dv] Clean up mem_bkdr_util__sram (Weicai Yang)
* [util, testplan] Allow relative testplan imports (Srikrishna Iyer)
* [prim] Add phase output to shadow register primitive (Pirmin Vogel)
* [dv] Add assertion to check double_lfsr err triggers an alert
  (Weicai Yang)
* [dv] Fix foundary failure (Weicai Yang)
* [prim] update prim_count comment (Timothy Chen)
* [prim_flop_2sync] Make the prim a standard non-generated prim
  (Michael Schaffner)
* [dv/prim_max_tree] Fix xcelium compile error (Cindy Chen)
* [dv] Fixes to enable foundry database pwrmgr_smoketest (Timothy
  Chen)
* [dv] Add countermeasure verification for double_lfsr (Weicai Yang)
* [dv] Update countermeasure verification (Weicai Yang)
* [doc] Update V2S items (Weicai Yang)
* [prim_max_tree] Remove dedicated FPV TB since all SVAs are embedded
  (Michael Schaffner)
* [prim_max_tree/fpv] Add a simple formal testbench (Michael
  Schaffner)
* [prim_max_tree] Create a primitive that calculates maxima (Michael
  Schaffner)
* [dv] CSR / RAL model fixes (Srikrishna Iyer)
* [uvmdvgen] bug fix (Srikrishna Iyer)
* [dv] Fix some Xcelium warnings (Srikrishna Iyer)
* [dv] Disable some benign warnings (Srikrishna Iyer)
* [prim_mubi*_sender] Add option to omit sender flops (Michael
  Schaffner)
* [dv, mem_bkdr_util] Fix ECC-computed backdoor WRs (Srikrishna Iyer)
* [keymgr] sparsify the data control fsm (Timothy Chen)
* [prim_lc_sender] Add AsyncOn parameter (Michael Schaffner)
* [prim] Update behavior of prim_count (Timothy Chen)
* [flash_ctrl] Minor fixes to flash foundry failure (Timothy Chen)
* [sw,tests,pwrmgr] Improve synchronization (Guillermo Maturana)
* [sw,tests] SRAM execution test DV integration (Dave Williams)
* [dv] Update common_cov_excl to exclude d_user.rsp_intg[6] (Weicai
  Yang)
* [otbn, dv] Added otbn_passthru_mem_tl_intg_err testcase (Prajwala
  Puttappa)
* [rom_ctrl, dv] Fixes regression failures in
  rom_ctrl_passthru_mem_tl_intg_err (Prajwala Puttappa)
* [dv/chip] Add jtag_csr_rw seq (Cindy Chen)
* [chip dv] Remove xcelium build opt (Srikrishna Iyer)
* [doc] Reorder D2S checklist items (Michael Schaffner)
* [reggen] Add support for validation of RTL CM annotation (Michael
  Schaffner)
* [all] various simple lint fixes (Timothy Chen)
* [mem_bkdr,dv] Add missing type to otp_write_lc_partition_cnt (Rupert
  Swarbrick)
* [dv/csr_utils_pkg] Clone ral map with top-level submaps (Cindy Chen)
* [clkmgr] various spec and parameter updates (Timothy Chen)
* [dv] Add ASSERT_NET to check net value (Weicai Yang)
* [dv] revert lowRISC/opentitan#9050 and lowRISC/opentitan#9934
  (Weicai Yang)
* [primgen] Update AscentLint waiver in generated abstract prim
  wrappers (Pirmin Vogel)
* [prim_generic] Fix lint errors (Pirmin Vogel)
* [prim_count] Fix lint warnings (Pirmin Vogel)
* [prim_alert_receiver] Fix ping during init sequence bug (Michael
  Schaffner)
* [rom_ctrl, dv] Added passthru mem test (Prajwala Puttappa)
* [prim_assert,dv] Use if condition in assert_init (Srikrishna Iyer)
* [prim_filter_cnt] Make threshold runtime programmable (Michael
  Schaffner)
* [prim_filter*] Optionally instantiate a 2-stage sync in prim_filter*
  (Michael Schaffner)
* [dv] intg_err test cleanup and change passthru_mem_tl_intg_err to
  V2S (Weicai Yang)
* [prim_xilinx] Replace KEEP with DONT_TOUCH attributes (Pirmin Vogel)
* [sram/dv] Enable the integrity test for passthru (Weicai Yang)
* [dv] Add integrity test for passthru mem (Weicai Yang)
* [dv/tools] Fix alert ping exclusion (Cindy Chen)
* [dv/mem_bkdr_util] added backdoor write of LC counter into LC
  partition in OTP (Dror Kabely)
* [prim_pad_wrapper] Add dual pad wrapper for USB (Michael Schaffner)
* [prim_clock_mux] Model generic mux with boolean ops (Michael
  Schaffner)
* [prim_buf] Ensure generic primitives contain a logic cell (Michael
  Schaffner)
* [prim_count] improved documentation and style (Michael Tempelmeier)
* Revert "[dv] Replace fileset_partner flag with fileset_ast flag"
  (Michael Schaffner)
* [dv] Replace fileset_partner flag with fileset_ast flag (Sharon
  Topaz)
* [dv] Pass data_intg_passthru to dv_base_mem (Weicai Yang)
* [dv/prim_alert] Add V3 item to testplan (Cindy Chen)
* [dv/prim_count] Add an assertion to check max count stable (Cindy
  Chen)
* [dv] Fix typo in uvmdvgen comment (Rupert Swarbrick)
* [mem_bkdr_util] Use inverted integrity in rom_encrypt_write32_integ
  (Rupert Swarbrick)
* [doc/checklist] Template fix (Cindy Chen)
* [mem_bkdr_util,rom_ctrl] Fix how we call encrypt_sram_data (Rupert
  Swarbrick)
* [rom/ram/xbar/otbn] Switch end-end bus integrity to inverted ECC
  codes (Michael Schaffner)
* [dv/prim_alert_tb] Modify the seq to ensure alert always sends
  (Cindy Chen)
* [dv,xcelium] Fix lowRISC/opentitan#4230: Xcelium compile error.
  (Timothy Trippel)
* [dv/prim_alert] Add randomization in ping request sequence (Cindy
  Chen)
* [prim_alert_receiver] Only check for ping requests after
  initialization (Michael Schaffner)
* [doc] Update D2S checklist template and description (Michael
  Schaffner)
* [prim_esc_receiver] Switch to standardized prim_count (Michael
  Schaffner)
* [prim_count] Add option to disable the connection SVA (Michael
  Schaffner)
* [otbn, rtl] Lint fixes (Greg Chadwick)
* [sram/dv] Better support partial write in scb (Weicai Yang)
* [dv/mem_bkdr_util] Fix ECC width error in OTP foundary test (Cindy
  Chen)
* [secded/lint] Fix lint errors (Michael Schaffner)
* [dv/prim_esc] Add more stimulus to reach coverage goal (Cindy Chen)
* [alert_handler] Switch to sparse fsm primitive (Michael Schaffner)
* [prim_sparse_fsm_flop] Add a parameter to disable SVA (Michael
  Schaffner)

Signed-off-by: Prajwala Puttappa <prajwalaputtappa@lowrisc.org>
2022-03-10 14:15:03 +00:00
..
__init__.py Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
agent.core.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
agent.sv.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
agent_cfg.sv.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
agent_cov.sv.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
agent_pkg.sv.tpl Update lowrisc_ip to lowRISC/opentitan@e619fc60 2020-11-28 12:12:27 +00:00
base_seq.sv.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
base_test.sv.tpl Update lowrisc_ip to lowRISC/opentitan@3a672eb36 2021-11-29 17:25:30 +00:00
base_vseq.sv.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
bind.sv.tpl Update lowrisc_ip to lowRISC/opentitan@f29a0f7a7 2021-04-06 12:49:51 +01:00
checklist.md.tpl Update lowrisc_ip to lowRISC/opentitan@7c4f8b3fd 2022-03-10 14:15:03 +00:00
common_vseq.sv.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
cov_excl.el.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
device_driver.sv.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
driver.sv.tpl Update lowrisc_ip to lowRISC/opentitan@e619fc60 2020-11-28 12:12:27 +00:00
env.core.tpl Update lowrisc_ip to lowRISC/opentitan@e619fc60 2020-11-28 12:12:27 +00:00
env.sv.tpl Update lowrisc_ip to lowRISC/opentitan@6cc5c164b 2021-03-04 09:56:36 +00:00
env_cfg.sv.tpl Update lowrisc_ip to lowRISC/opentitan@3a672eb36 2021-11-29 17:25:30 +00:00
env_cov.sv.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
env_pkg.sv.tpl Update lowrisc_ip to lowRISC/opentitan@6cc5c164b 2021-03-04 09:56:36 +00:00
gen_agent.py Update lowrisc_ip to lowRISC/opentitan@1ae03937f 2021-03-12 16:15:22 +00:00
gen_env.py Update lowrisc_ip to lowRISC/opentitan@3a672eb36 2021-11-29 17:25:30 +00:00
host_driver.sv.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
if.sv.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
index.md.tpl Update lowrisc_ip to lowRISC/opentitan@7c4f8b3fd 2022-03-10 14:15:03 +00:00
item.sv.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
monitor.sv.tpl Update lowrisc_ip to lowRISC/opentitan@7c4f8b3fd 2022-03-10 14:15:03 +00:00
README.md Update lowrisc_ip to lowRISC/opentitan@ad629e3e6 2021-11-16 10:49:23 +00:00
README.md.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
scoreboard.sv.tpl Update lowrisc_ip to lowRISC/opentitan@3a672eb36 2021-11-29 17:25:30 +00:00
seq_list.sv.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
sim.core.tpl Update lowrisc_ip to lowRISC/opentitan@e619fc60 2020-11-28 12:12:27 +00:00
sim_cfg.hjson.tpl Update lowrisc_ip to lowRISC/opentitan@c277e3a8 2021-01-07 18:03:44 +00:00
smoke_vseq.sv.tpl Update lowrisc_ip to lowRISC/opentitan@e619fc60 2020-11-28 12:12:27 +00:00
sva.core.tpl Update lowrisc_ip to lowRISC/opentitan@f29a0f7a7 2021-04-06 12:49:51 +01:00
tb.sv.tpl Update lowrisc_ip to lowRISC/opentitan@3a672eb36 2021-11-29 17:25:30 +00:00
test.core.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
test_pkg.sv.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
testplan.hjson.tpl Update lowrisc_ip to lowRISC/opentitan@da3ac7c4e 2021-07-20 13:44:11 +01:00
uvmdvgen.py Update lowrisc_ip to lowRISC/opentitan@7c4f8b3fd 2022-03-10 14:15:03 +00:00
virtual_sequencer.sv.tpl Update paths for vendored DV code 2020-11-28 12:12:27 +00:00
vseq_list.sv.tpl Update lowrisc_ip to lowRISC/opentitan@e619fc60 2020-11-28 12:12:27 +00:00

title
Uvmdvgen: Initial testbench auto-generation tool

uvmdvgen is a Python based tool to generate the boilerplate code for a UVM agent as well as the complete UVM testbench for a given DUT. The tool generates all the relevant UVM-based classes including the package and the fusesoc core file to make it quickly plug-and-playable. The packages import the standard utility and library packages wherever applicable, to conform to our existing methodology and style.

When starting with a new DV effort, the user typically goes through a copy-paste exercise to replicate an existing UVM testbench code to the current one and has to go through several debug cycles to get it working. This tool aims to eliminate that. Also, as a part of our [DV methodology]({{< relref "doc/ug/dv_methodology#code-reuse" >}}), we provide utilities and base class structures that contain several pieces of common code which can be reused when setting up a new DV environment.

Help switch (-h)

Running the tool with -h switch provides a brief description of all available switches.

$ util/uvmdvgen/uvmdvgen.py -h
usage: uvmdvgen.py [-h] [-a] [-s] [-e] [-c] [-hr] [-hi] [-ha]
                   [-ea agt1 agt2 [agt1 agt2 ...]] [-ao [hw/dv/sv]]
                   [-eo [hw/ip/<ip>]] [-v VENDOR]
                   [ip/block name]

Command-line tool to autogenerate boilerplate DV testbench code extended from
dv_lib / cip_lib

positional arguments:
  [ip/block name]       Name of the ip/block for which the UVM TB is being
                        auto-generated

optional arguments:
  -h, --help            show this help message and exit
  -a, --gen-agent       Generate UVM agent code extended from DV library
  -s, --has-separate-host-device-driver
                        IP / block agent creates a separate driver for host
                        and device modes. (ignored if -a switch is not passed)
  -e, --gen-env         Generate testbench UVM env code
  -c, --is-cip          Is comportable IP - this will result in code being
                        extended from CIP library. If switch is not passed,
                        then the code will be extended from DV library
                        instead. (ignored if -e switch is not passed)
  -hr, --has-ral        Specify whether the DUT has CSRs and thus needs a UVM
                        RAL model. This option is required if either --is_cip
                        or --has_interrupts are enabled.
  -hi, --has-interrupts
                        CIP has interrupts. Create interrupts interface in tb
  -ha, --has-alerts     CIP has alerts. Create alerts interface in tb
  -ea agt1 agt2 [agt1 agt2 ...], --env-agents agt1 agt2 [agt1 agt2 ...]
                        Env creates an interface agent specified here. They
                        are assumed to already exist. Note that the list is
                        space-separated, and not comma-separated. (ignored if
                        -e switch is not passed)
  -ao [hw/dv/sv], --agent-outdir [hw/dv/sv]
                        Path to place the agent code. A directory called
                        <name>_agent is created at this location. (default set
                        to './<name>')
  -eo [hw/ip/<ip>], --env-outdir [hw/ip/<ip>]
                        Path to place the full tetsbench code. It creates 3
                        directories - dv, data and doc. The DV document and the
                        testplan Hjson files are placed in the doc and data
                        directories respectively. These are to be merged into
                        the IP's root directory (with the existing data and
                        doc directories). Under dv, it creates 3 sub-
                        directories - env, tb and tests to place all of the
                        testbench sources. (default set to './<name>')
  -v VENDOR, --vendor VENDOR
                        Name of the vendor / entity developing the testbench.
                        This is used to set the VLNV of the FuesSoC core
                        files.

Generating UVM agent

The boilerplate code for a UVM agent for an interface can be generated using the -a switch. This results in the generation of complete agent with classes that extend from the [DV library]({{< relref "hw/dv/sv/dv_lib/README.md" >}}). Please see that description for more details.

The tool generates an interface, item, cfg, cov, monitor, driver and sequence library classes. Let's take jtag as the argument passed for the name of the IP. The following describes their contents in each source generated:

  • jtag_if

    This is an empty shell of an interface. User is required to add content.

  • jtag_item

    This is an empty transaction packet extended from uvm_sequence_item.

  • jtag_agent_cfg

    This is the agent configuration object, it contains the virtual interface handle for jtag_if and is called vif.

  • jtag_agent_cov

    This is a coverage component extended from dv_base_agent_cov.

  • jtag_monitor

    This is the monitor component extended from dv_base_monitor. It provides the following items:

    • virtual protected task collect_trans(uvm_phase phase)

      This is a shell task within which user is required to add logic to detect an event, sample the interface and create a transaction object and write to the analysis port. This task is called in dv_base_monitor::run_phase.

  • jtag_driver

    This is the monitor component extended from jtag_driver which is typedef'ed in the pkg to dv_base_driver with the right parameter set. It provides the following items:

    • virtual task reset_signals()

      This task is for resetting the initial value of the vif signals.

    • virtual task get_and_drive()

      This task is used to get the next item from the sequencer, apply it to the interface and return the response back. This is again, an empty task at the moment.

    If the -s switch is passed, the tool creates jtag_host_driver and jtag_device_driver instead, and their contents are exactly the same.

  • seq_lib/jtag_base_seq

    This is extended from dv_base_seq.

  • seq_lib/jtag_seq_list

    This is a list of sequences included in one place.

  • jtag_agent_pkg

    This is the package file that includes all of the above sources and the imports the dependent packages.

  • jtag_agent.core

    This is the fusesoc core file that is used to generate the filelist for the build.

The tool does not create jtag_sequencer or jtag_agent classes separately. Instead, it typedef's the dv_base_sequencer and dv_base_agent respectively with the right type-parameters in the pkg. The reason for this is having a dedicated sequencer and agent is not required since the dv_base_agent already has all the sub-component instantiations and connections; and dv_base_sequencer already has a handle to the agent cfg object and nothing more is typically needed.

Generating UVM environment & testbench

The boilerplate code for a UVM environment and the testbench for a DUT can be generated using the -e switch. This results in the generation of classes that extend from [DV base library]({{< relref "hw/dv/sv/dv_lib/README.md" >}}). If the -c switch is passed, it extends from [CIP base library]({{< relref "hw/dv/sv/cip_lib/doc" >}}). With -ea switch, user can provide a list of downstream agents to create within the environment. Please see description for more details.

The tool generates not only the UVM environment, but also the base test, testbench, top level fusesoc core file with sim target, Makefile that already includes the smoke and CSR test suite and more. With just a few tweaks, this enables the user to reach the V1 milestone much quicker. Let's take i2c_host as the argument passed for the name of the IP. The following is the list of files generated with a brief description of their contents:

Switches to indicate whether the CIP DUT contains interrupts or alerts are provided by -hi and -ha respectively. By default, these are set to 'False' (don't create interrupts or alerts). When set, it will create intr_if and alerts_if in the testbench and set them into uvm_config_db for the cip_base_env to pick up.

  • env/i2c_host_env_cfg

    This is the env cfg object. It creates the downstream agent cfg objects that were passed using the -ea switch in the initialize() function which is called in the dv_base_test::build_phase(). Since the cfg handle is passed to all env components, those downstream agent cfg objects can be hierarchically referenced.

  • env/i2c_host_env_cov

    This is the coverage component class. A handle of this class is passed to the scoreboard and the virtual sequencer so that covergroups can be sampled in the scoreboard as well as sequences.

  • env/i2c_host_reg_block

    This is the UVM reg based RAL model. This is created for completeness. The actual RAL model needs to be generated prior to running simulations using the [regtool]({{< relref "util/reggen/README.md" >}}).

  • env/i2c_host_scoreboard

    This is the scoreboard component that already creates the analysis fifos and queues for the agents passed via -ea switch. It adds starter tasks for processing each fifo in a forever loop and invokes them in the run_phase using fork-join statement. If the -c switch is passed, it also adds a process_tl_access task that is extended from cip_base_scoreboard. This task provides a tilelink access packet for further processing.

  • env/i2c_host_virtual_sequencer

    This is the virtual sequencer used by all test sequences to run the traffic. It adds handles to downstream agent sequencers passed via -ea switch. Sub-sequences can be started on them via the p_sequencer handle.

  • env/seq_lib/i2c_host_base_vseq

    This is the base virtual sequence that user can use to add common tasks, functions and variables that other extended test sequences can reuse. For starters, it provides the i2c_host_init() task and do_i2c_host_init knob for controllability.

  • env/seq_lib/i2c_host_smoke_vseq

    This is the smoke test sequence that user needs to develop as the first test sequence. It extends from i2c_host_base_vseq.

  • env/seq_lib/i2c_host_csr_vseq

    This is the test sequence for the entire CSR suite of tests. It calls dv_base_vseq::run_csr_vseq_wrapper() task which is a complete test sequence. All the user needs to do is run the CSR tests and add exclusions if needed using the add_csr_exclusions() function provided.

  • env/seq_lib/i2c_host_vseq_list

    This is a list of test sequences included in one place.

  • env/i2c_host_env

    This is the env class that creates the downstream agents passed via -ea switch. It sets their correspodnding cfg objects (which are members of env cfg object) into the uvm_config_db. It also makes the analysis port connections in the connect_phase and sets the sequencer handles in the virtual sequencer.

  • env/i2c_host_env_pkg

    This is the env pkg file which includes all env classes and imports the dependent packages.

  • env/i2c_host_env.core

    This is the fusesoc core file for the env pkg compile unit.

  • tests/i2c_host_base_test

    This is the base test class. The base test class it extends from already creates the env and cfg objects, which are available for manipulation in UVM phases. This class's name would be supplied to UVM_TESTNAME plusarg to run tests using the UVM methodology.

  • tests/i2c_host_test_pkg

    This is the test pkg file which includes all test classes and imports the dependent packages.

  • tests/i2c_host_test.core

    This is the fusesoc core file for the test pkg compile unit.

  • tb/i2c_host_bind

    This is the assertion bind file that is compiled along with the testbench in a multi-top architecture. If the -c switch is passed, it adds the tlul_assert module bind to the i2c_host DUT.

  • tb/tb

    This is the top level testbench module that instantiates the DUT along with some of the interfaces that are required to be instantiated and connected and passed on the the uvm_config_db since the base DV/CIP library classes retrieve them. The user needs to look through the RTL and make additional connections as needed.

  • i2c_host_sim.core

    This is the top level fusesoc core file with the sim target. It adds the RTL and DV dependencies to construct the complete filelist to pass to simulator's build step.

  • i2c_host_dv_doc.md

    This is the initial DV document that will describe the entire testbench. This is equivalent to the template available here.

The VLNV name in the generated FuseSoC core files is set using the --vendor switch for the 'vendor' field. By default, it is set to "lowrisc". It can be overridden by supplying the --vendor <vendor-name> switch on the command line.

Examples

$ util/uvmdvgen/uvmdvgen.py i2c -a

This will create ./i2c/i2c_agent and place all sources there.

$ util/uvmdvgen/uvmdvgen.py jtag -a -ao hw/dv/sv

This will create hw/dv/sv/jtag_agent directory and place all the sources there.

$ util/uvmdvgen/uvmdvgen.py i2c -a -s -ao hw/dv/sv

This will create the I2C agent with separate 'host' mode and 'device' mode drivers.

$ util/uvmdvgen/uvmdvgen.py i2c -e -c -hi -eo hw/ip/i2c/dv

This is an illegal command, it is not allowed to specify that an IP testbench extends from CIP lib or has interrupts without specifying that it should support a RAL model using the -hr flag.

$ util/uvmdvgen/uvmdvgen.py i2c_host -e -c -hi -hr -ea i2c -eo hw/ip/i2c_host/dv

This will create the complete i2c_host DV testbench extended from CIP lib and will instantiate i2c_agent. It will also create and hook up the interrupt interface in the testbench.

$ util/uvmdvgen/uvmdvgen.py foo -e -c -hi -ha -hr -ea foo -eo hw/ip/i2c_host/dv

This will create the complete foo DV testbench extended from CIP lib and will instantiate foo_agent. It will also create and hook up the interrupt interface as well as alerts interface in the testbench.

$ util/uvmdvgen/uvmdvgen.py aes -e -c -hr -ea i2c -eo hw/ip/i2c_host/dv

This will create the complete i2c_host DV testbench extended from CIP lib and will instantiate i2c_agent.

$ util/uvmdvgen/uvmdvgen.py dma -e -eo hw/ip/dma/dv

This will create the complete dma DV testbench extended from DV lib. It does not instantiate any downstream agents due to absence of -ea switch.

$ util/uvmdvgen/uvmdvgen.py chip -e -ea uart i2c jtag -eo hw/top_earlgrey/dv

This will create the complete chip testbench DV lib and will instantiate uart_agent, i2c_agent and jtag_agent in the env.