Easier UVM Example - EDA Playground
Warning! This exercise has been opened in another tab; autosave has been disabled. Close this tab or refresh to reactivate.

 Languages & Libraries

 Tools & Simulators

 Examples

204


45
 
1
2
DOULOS EASIER UVM CODE GENERATOR
3
------ ------ --- ---- ---------
4
5
By clicking on the Enable Easier UVM checkbox, you have enabled access to the Doulos Easier UVM Code Generator. The Easier UVM Code Generator enables you to generate UVM testbenches from simple control files and snippets of SystemVerilog code.
6
7
The control files specify the testbench. You will always need at least three control files:
8
9
 - a Common Template File, which is the master file for code generation,
10
 
11
 - at least one Interface Template File, one per interface, and
12
13
 - a pinlist file, which specifies which DUT pins are connected to which interface variables.
14
15
The snippets of SystemVerilog code allow you to customize the test bench to your specific requirements, e.g. to drive the pins of each interface to the design under test (DUT).
16
17
To get started, take a look at the examples listed in the Examples section on the left of the EDA Playground window. You can access the full set of reference documentation, tutorials, and videos by clicking on the blue i next to the Enable Easier UVM checkbox.
18
19
You can download the generated code by clicking on the Download files after run checkbox.
20
21
Easier UVM on EDA Playground is a great way to get started with UVM: you can generate and run working UVM testbench code quickly and easily on EDA Playground. Alternatively, you can download the Easier UVM Code Generator to run on your own computer by clicking on the blue i next to the Enable Easier UVM checkbox.
22
23
24
DIFFERENCES WHEN RUNNING THE CODE GENERATOR IN EDA PLAYGROUND
25
26
To get the Easier UVM Code Generator working in EDA Playground, we have had to make some changes. If you already use the Easier UVM Code Generator, here are some things you need to know:
27
28
 - Template files, the pinlist file, include files and any regmodel file have to be created as EDA Playground testbench tabs (on the left) 
29
30
 - DUT files have to be created as EDA Playground design tabs (on the right)
31
32
 - Template files must have the file extension .tpl, include files and DUT files must have the file extension .sv
33
34
 - The default design tab is named design.sv. This tab may contain DUT code or may be empty. Either way, you may add further design tabs.
35
36
 - Optionally, you can add an EDA Playground design tab named files.f that lists the other design tabs/files in the order they are to be compiled. If absent, all the design tabs will be compiled in alphabetical order.
37
38
 - It is not possible to pass command line arguments to the generator script, so the Common Template File must be named common.tpl, and the only way to specify a prefix is using the prefix setting in common.tpl
39
40
 - The dut_source_path and inc_path settings in common.tpl are unnecessary in EDA Playground (because the files are created as tabs and identified from their file extensions). If the settings are present, their values do not affect the generated code.
41
42
 - The dut_pfile setting in common.tpl must not include a hierarchical directory path (because the pinlist file is created as a tab). The default is dut_pfile = pinlist.
43
44
45
xxxxxxxxxx
1
14
 
1
// This needs to contain the top-level of the DUT
2
// or it can be left blank
3
4
module mydut (input logic bus_clk, 
5
              input bit  bus_cmd, 
6
              input byte bus_data, 
7
              input byte bus_addr);
8
9
always @(posedge bus_clk)
10
  $display("@%4d mydut bus_cmd = %s, bus_addr = %h, bus_data = %h", $time, (bus_cmd ? "W" : "R"), bus_addr, bus_data);
11
12
endmodule
13
14
4193 views and 2 likes     
 
'minimal_reg'

'minimal_reg'

110:0