Top Banner
Automated Generation of RAL-based UVM Sequences 1 Satyajit Sinari Timothy McLean Benjamin Applequist Vijayakrishnan Rousseau Geddy Lallathin
26

Automated Generation of RAL-based UVM Sequences

Mar 31, 2023

Download

Documents

Khang Minh
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Automated Generation of RAL-based UVM Sequences

Automated Generation of RAL-based UVM Sequences

1

Satyajit SinariTimothy McLean

Benjamin ApplequistVijayakrishnan Rousseau

Geddy Lallathin

Page 2: Automated Generation of RAL-based UVM Sequences

Overview

2

• Original Validation Model using UVM• Problems with the Original model with complex designs• Proposed Scalable Automated Validation Model• Implementation with an example

Page 3: Automated Generation of RAL-based UVM Sequences

Original Validation Model

3

• Architectural master specifications

• Testbench using industry standard UVM architecture– Env, Agent, Driver,

Monitor, etc.– UVM sequences(manual)– RAL (Register

Automation Layer)

Page 4: Automated Generation of RAL-based UVM Sequences

Problems with the orig model

4

• Large and complex Hardware Designs1. Maintaining manually

generated components becomes hard

2. Issues during randomization

Page 5: Automated Generation of RAL-based UVM Sequences

Proposed Automated Val Model

5

• Solution1. RAL and UVM

sequences are auto-generated

2. Define DUT-based configuration objects with links to the RAL

Page 6: Automated Generation of RAL-based UVM Sequences

RAL, UVM Sequence Automation

6

• RAL and UVM sequences are auto-generated– "Parsing Spec and

Automation" Layer is added

Page 7: Automated Generation of RAL-based UVM Sequences

RAL, UVM Sequence Automation

7

• RAL and UVM sequences are auto-generated– A Sequence spec is

added alongside the existing Register spec• A sequence spec dictates

the register programming flow

• Written in a machine readable State Machine xml format

Page 8: Automated Generation of RAL-based UVM Sequences

Sequence spec to uvm_seq

8

• Sequence spec (State Machine DAGs) uvm_sequences

PARSER uvm_sequences

Page 9: Automated Generation of RAL-based UVM Sequences

RAL-linked config objects

9

• Define DUT-based configuration objects– DUT hierarchy is

determined through these config_objects

Page 10: Automated Generation of RAL-based UVM Sequences

RAL-linked config objects

10

• Define DUT-based configuration objects– Control knobs for DUT

specific sequences are defined.

Page 11: Automated Generation of RAL-based UVM Sequences

RAL-linked config objects

11

• Define DUT-based configuration objects– Define complex

constraints– DUT-specific

constraints– Interdependent

constraint resolving.– Control knob

constraints

Page 12: Automated Generation of RAL-based UVM Sequences

RAL-linked config objects

12

• Define DUT-based configuration objects– Define rand pointers to

registers used within the DUT• Selective RAL

randomization is achieved saving sim time

Page 13: Automated Generation of RAL-based UVM Sequences

Additional benefits

13

• Additional benefits– Easier test writing– Better control over DUT

sequences

Page 14: Automated Generation of RAL-based UVM Sequences

Test Writing

14

• Uvm_sequencesgenerated in a hierarchical fashion.

• Nested sequences are controlled using control knobs

Page 15: Automated Generation of RAL-based UVM Sequences

Test Writing

15

• Control knobs are defined within the DUT-based config objects

• Only start the top virtual sequence on a sequencer and use knobs to control child sequences

Page 16: Automated Generation of RAL-based UVM Sequences

Cons with the proposed Model

16

• Manually defined config objects– Manually updating RAL

handles – Manually updating

constraints

Page 17: Automated Generation of RAL-based UVM Sequences

Example Register Spec

17

Register FEATURE_CTLBitfields:

0:3 modeValid Values:

disabled 0x0minimum 0x1average 0xAfancy 0xF

end4:31 unused

end

Register SYS_CTLBitfields:

0:0 enable1:1 low power mode2:31 unused

end

Bit Width and Position

Basic ConstraintsRegister Name

Bitfield Name

Page 18: Automated Generation of RAL-based UVM Sequences

Generated Register Class Output

18

class system_ctl_reg extends uvm_reg;rand uvm_reg_field enable;rand uvm_reg_field low_power_mode;uvm_reg_field unused;`uvm_object_utils(system_ctl_reg)

endclass : system_ctl_reg

class feature_ctl_reg extends uvm_reg;rand uvm_reg_field mode;uvm_reg_field unused;`uvm_object_utils(feature_ctl_reg)

// Simple constraintconstraint feature_ctl_possible_values {

mode.value inside { 4’h0, 4’h3, 4’hA, 4’hF };}

endclass : feature_ctl_reg

Autogenerated Output from spec parsing script. Instances of these classes will be

members of the RAL class.

Page 19: Automated Generation of RAL-based UVM Sequences

Example Sequence Spec

19

<Sequence Name="FEATURE_ENABLE"><Task Name="Enable_System">

<Write Register="SYS_CTL"/> </Task><Task Name="Enable_Feature">

<Write Register="FEATURE_CTL"/></Task>

</Sequence>

• Very basic XML style spec• Easy to write• Can add other features, just

requires parser support: • Value constraints• Task order

randomization• Subsequence support

Page 20: Automated Generation of RAL-based UVM Sequences

Example Generated Sequence

20

class feature_enable_seq extends uvm_sequence;…task body();

super.body();ral_instance.feature_ctl.update(status);if(status != UVM_IS_OK)

//Report errorral_instance.sys_ctl.update(status);if(status != UVM_IS_OK)

//Report errorendtask

endclass

Update call writes the config randomized value to register.

RAL instance acquired from the UVM config database. It was

placed there by the test environment.

• Generated from spec parsing script.

• Sequences can be called from test

• Virtual sequences may also be autogenerated.

Page 21: Automated Generation of RAL-based UVM Sequences

Example Test

21

task run()cfg.randomize() with {

//Ensures the feature is enabledcfg.feature_ctl.mode.value != 1'b0;//Ensures the system is enabledcfg.sys_ctl.enable.value == 1'b1;

};

ftr_enable_seq.start(env.agent.sequencer);…

endtask

Randomizing config object randomizes the RAL's

register values

Starting the sequence sends register writes to the

system through the RAL

Page 22: Automated Generation of RAL-based UVM Sequences

Example Configuration Object Pt. 1

22

class sys_cfg extends uvm_object;rand feature_ctl_reg feature_ctl;rand sys_ctl_reg sys_ctl;`uvm_object_utils(sys_config)

constraint low_power_mode_nothing_fancy {if(sys_ctl.low_power.value == 1'b1)

feature_ctl.mode.value != 0xF;}…

endclass

Can be difficult to automatically add cross register constraints

from spec. These can be added to the config object.

Contains instances of all of the registers in this unit.

Page 23: Automated Generation of RAL-based UVM Sequences

Example Configuration Object Pt. 2

23

task connect();ral_class regs;if(

!uvm_config_db#(ral_class)::get(null, "*", "regs", regs))

begin`uvm_error("sys_cfg.connect()","Where's the RAL?")

end

this.sys_ctl = regs.sys_ctl;this.feature_ctl = regs.feature_ctl;

endtask

Links the configs registers to the RALs registers

Grabs the RAL from the UVM config db. It was

created in the environment

Page 24: Automated Generation of RAL-based UVM Sequences

Example Configuration Object Pt. 3

24

class top_cfg extends uvm_object;rand control_knob top_virtual_seq;rand control_knob child1_seq;rand control_knob child2_seq;`uvm_object_utils(sys_config)

constraint mutually_exclusive_sequences {if(child1_seq.signal == 1'b1)

child2_seq.signal == 1’b0;}…

endclass

Constraints defined to control specific sequences

Defining control knobs of hierarchical sequences.

Page 25: Automated Generation of RAL-based UVM Sequences

Example Test

25

task run()cfg.randomize() with {

//Sets the control knob for child sequencecfg.child1_seq == 1’b1;

};

top_virtual_seq.start(env.agent.sequencer);…

endtask

Controlling child sequences

Starting the top sequence

Page 26: Automated Generation of RAL-based UVM Sequences

Questions?

26