UVM初学篇 -(19)UVM sequence激励产生与交互执行机制(三)

UVM环境复位--stop_sequences() 在UVM验证环境中, stop_sequences是一个用于强制终止所有正在运行的 Sequence 的方法,通常用于动态控制激励生成流程。1.通过uvm_config_db传递事件和严格的同步机制,此方案符适用于复杂复位场景和动态测试控制。组件耦合:Driver 和 Sequence 不再直接依赖env,通过标准接口通信。竞争条件:确保 Driver 完成清理后再终止 Sequence。代码健壮性:使用非阻塞操作和事件监听,避免死锁。 阅读详情

一、 lock 和grab

lock和grab的作用是让一个sequence持续占有sequencer,直到这个sequence_item发送完transaction,再发送其他sequence的sequence_item。

1,lock: 多个sequence向sequencer发送一个请求,同时被放入sequencer的仲裁队列中。当有一个sequence调用lock()后, sequencer就开始响应这个lock请求,此后sequencer会一直连续发送此sequence的sequence_item,直到unlock操作被调用。

2,grab:  grab操作也用于暂时拥有sequencer的所有权,但是grab操作比lock操作优先级更高. lock请求是被插入sequencer仲裁队列的最后面,而grab请求则被放入sequencer仲裁队列的最前面。

在dadd_addr_5a5a_sequence中调用了lock()和grab()。

File:dadd_sequence.sv

Class:dadd_addr_5a5a_sequence

task body();

        if(starting_phase != null)

            starting_phase.raise_objection(this);

        repeat(5)

        begin

            `uvm_do_with(item,{

                item.addr == 32'h5a5a;

            })

        end

        `ifdef SQR_LOCK

        lock();

        $display("%t,dadd_addr_5a5a_sequence,lock!!!",$time);

        `endif //SQR_LOCK

        `ifdef SQR_GRAB

        grab();

        $display("%t,dadd_addr_5a5a_sequence,grab!!!",$time);

        `endif //SQR_GRAB

        repeat(20)

        begin

            `uvm_do_with(item,{

                item.addr == 32'h5a5a;

            })

        end

        `ifdef SQR_LOCK

        unlock();

        $display("%t,dadd_addr_5a5a_sequence,unlock!!!",$time);

        `endif //SQR_LOCK

        `ifdef SQR_GRAB

        ungrab();

        $display("%t,dadd_addr_5a5a_sequence,ungrab!!!",$time);

        `endif //SQR_GRAB

        if(starting_phase != null)

            starting_phase.drop_objection(this);

endtask : body

代码3.28 lock和grab的代码

在dadd_lock_grab_test中同时启动add_rand_sequence,dadd_addr_5a5a_sequence,dadd_addr_a5a5_sequence。

File:dadd_test.sv

Class:dadd_lock_grab_test

task          dadd_lock_grab_test :: main_phase(uvm_phase phase);

    super.main_phase(phase);

    phase.raise_objection(this);

    fork

    addr_5a5a_seq.start(env.iagt.sqr);

    addr_a5a5_seq.start(env.iagt.sqr);

    rand_seq.start(env.iagt.sqr);

    join

    phase.drop_objection(this);

endtask: main_phase

代码3.29 lock和grab实验中dadd_lock_grab_test代码

执行Makefile脚本:

make sqr_lock

或者:

uvm_declare_p_sequencer宏分析 格式 `uvm_declare_p_sequencer(SEQUENCER) 源码分析 `define uvm_declare_p_sequencer(SEQUENCER) \ SEQUENCER p_sequencer;\ virtual function void m_set_p_sequencer();\ super.m_set_p_sequencer(); \ if( !$cast(p_sequencer, m_sequencer)) \ `uvm_fata 阅读详情

相关推荐

UVM初学篇 -(17)UVM sequence激励产生与交互执行机制(一)

为了使激励的产生,发送和驱动分工更加的明确,分为了driver, sequencer和sequnce。而uvm中的sequence机制使得激励的产生和约束变得更加灵活。sequence机制是一种与sequencer,driver交互的过程,概括为:1,通过sequence发送层次化、随机化的激励。2,sequencer对sequence进行仲裁。3,driver接受sequencer传递来的sequence(req)并按照时序激励发送到DUT,而后driver等待从端口返回信号和状态。

u011164476的博客 3495

UVM——sequence机制(五)

sequence机制【上】一、sequence的执行流程二、sequence和item三、Sequence 和 Driver3.1.Driver有哪些操作3.2.Sequence有哪些操作3.3.使用get()和put()完成通信3.4.response机制:Driver->Sequence的反馈 一、sequence的执行流程 控制和产生一系列的激励,并通过sequencer将激励发送给driver的机制。如果按照交通道路的车流来打比方,sequence就是道路,sequence item是道路上行

思想开化的冰块博客 4853

【UVM源码】sequence机制使用方法和源代码解析

UVM机制sequence的使用方法介绍,UVM机制sequence机制相关的源代码解析。

飓风_数字IC验证的博客 7962

UVM_7:Sequence机制

根据sequence在使用过程中的问题,依次介绍它的关键点。 内容包含: 从driver中剥离激励产生功能 Sequence的启动与执行 Sequence的仲裁机制 在同一个sequencer中启动多个sequencesequencer的lock操作 sequencer的grab操作 sequence的有效性 Sequence相关宏及实现 Virtual sequence...

weixin_45159924的博客 1863

sequence和sequencer — UVM

文章目录简介1.sequence 和 item2.sequencer 和 driver1. 通信方式——TLM端口2.事务传输3. 通信时序3.sequence和sequencer1.常用方法和宏的定义2. sequencer仲裁特性4.sequence的层次化1. hierarchical sequence2. virtual sequence3. layering sequence 简介 发送item的过程: sequence是产生sequence item对象的地方,也可以产生sequence对象来

SummerXRT的博客 4166

UVM——sequence、sequencer、driver概述

sequence、sequencer、driver关系 三者的关系如上图所示: - sequence产生目标数量的sequence item,并通过随机化使每一个sequence item对象的数据内容不同 - sequence item经过sequencer流向driver - driver将每一个流入的item(req)进行数据解析,按照与DUT的接口协议写入,形成有效激励 - 如有需要,driver解析完一个item后,会将最后的状态信息写回item,再返回给sequencer(rsp),最终抵达s

weixin_42482170的博客 4181

SV/UVM 学习笔记12(sequence机制、激励的产生与驱动)

简述:为了贯彻单一职责性,在uvm里,将产生和发送激励这两件事拆分为三个部分:sequence,sequencer和driver其中只有后两者存在于component组件中。sequence唯一的作用就是产生item和trans。 sequence之所以不存在于组件中是因为其有生命周期,是一个动态的元素。当它内部所有元素全部发送完毕,该sequence的生命周期结束。 sequencer类似于一个管道,作为存在于sequence和driver的中间者,它的主要功能有仲裁和协调二者不同的处理速度,所以其内

Aniran的博客 2619

[UVM机制]sequence与driver

UVM源码——sequence

seuer0420的博客 1350

【UVM基础】m_sequencer 和 p_sequencer 概念与区别(面试常问)

【UVM基础】m_sequencer 和 p_sequencer

悟已往之不谏 知来者之可追 3419

UVM——sequence机制(数据激励的产生、配置方式)

文章目录一、激励的生成方式二、配置sequence方式 一、激励的生成方式 uvm_sequence继承自uvm_sequence_item; uvm_sequence_item:只能对数据进行封装,不存在自动执行的函数, uvm_sequence:具有可自动执行的函数,可通过body()函数进行可执行操作,产生数据激励。 二、配置sequence方式 ...

Mr.翟的博客 1万+

sequence机制(数据激励的产生、配置方式)——UVM

一、关于sequence机制 1.1 为什么使用sequence机制 sequence机制的目的是为了将激励的产生功能从driver中剥离出来。这样在不同的测试用例中,就可以将不同的sequence设置成sequencer的main_phase的default_sequence,当sequencer执行到main_phase时,发现有default_sequence,那么它就启动sequence。这样就可以在不改变driver的情况下完成不同的激励驱动。 1.2 如何理解sequence uvm_seq

weixin_42705678的博客 3569

Allegro File菜单实战指南:从导入网表到导出BOM的完整流程

PCB设计离不开对EDA软件菜单体系的深入理解。在Cadence Allegro中,File菜单是数据流转的中枢,它不仅是新建、打开、保存的基础入口,更是连接原理图与版图、设计与制造的关键桥梁。工程师常遇到的“导入网表报错”“导出BOM为空”“板框不闭合”等高频问题,大多源于对File菜单中Import与Export功能的理解不到位。从基础概念出发,先厘清Import(网表、DXF、IPC)与Export(BOM、ODB++、DXF)的工作原理,再结合版本兼容、封装库路径、单位设置等工程细节,即可构建完整的

weixin_32950759的博客 306

【汽车主动降噪】【ANC算法优化】基于深度学习的汽车主动噪声控制技术研究及Matlab实现

本文探讨了基于深度学习的汽车主动降噪(ANC)算法优化方案。针对传统FXLMS算法在应对复杂、非线性车内噪声时的局限性,文章详细解析了如何利用神经网络作为非线性建模器、深度滤波器或智能步长调节器来增强ANC系统性能,并提供了完整的Matlab仿真实战流程,展示了深度学习在提升降噪效果和收敛速度方面的潜力。

seed的博客 543

基于STM32与4G模组的远程OTA升级实战:从Bootloader设计到HTTP固件下载

本文详细介绍了基于STM32与4G模组的远程OTA升级实战,从Bootloader设计到HTTP固件下载的全流程。通过双备份Bootloader设计、AT指令优化、固件分包处理及安全校验等关键技术,实现高效稳定的远程升级方案,特别适用于物联网设备的批量维护与更新。

weixin_28716769的博客 149

WSL2不能上网,Failed to connect to github.com port 443问题解决方案

WSL2不能上网: 问题:ping外网无效 例如:ping www.baidu.com失败 解决方案: 在wsl: $sudo vi /etc/wsl.conf wsl.conf: [network] generateResolvConf = false 在PowerShell: $sudo vi /etc/etc/resolv.conf resolv.conf: # This file was automatically generated by WSL. To stop automatic gen

Jason_Chen__的博客 9529

杰理AC695N/AC696N/AC701N系列芯片在线调音教程

本教程详细介绍AC695N/AC696N/AC701N芯片在线音效调试方法,包括工具准备(需安装杰理包管理器)、程序修改(需关闭USB功能并启用在线调试宏)、连接方式(USB或串口)、音效调节步骤(EQ和混响参数调整)以及配置保存。注意事项包括版本匹配、连接检查和供电稳定等,并提供常见问题解决方案。适用于快速配置实时音效调试环境并保存最终配置。

qq_42014563的博客 1415

PentAGI自动渗透测试平台搭建与使用

但是PentAGI的缺陷也比较明显,一个是自动化程度高带来过程的介入困难,整个渗透的过程都交给AI自动决策,无法进行人工调整,耗时较长;从上述过程来看PentAGI似乎是一个比较“可用”的AI自动化渗透测试平台,但是在继续等待测试的过程中,PentAGI的一些缺点也暴露了出来,一个是测试的过程非常漫长,因为PentAGI是使用配置大模型API key的方式全自动运行,支持openai、deepseek等主流LLM大模型,过程中不需要人工介入,会不断自动调整,所以比较依赖于大模型本身的响应速度。

墨痕诉清风的博客 2449

科研生产力革命:手把手教你打造基于大模型的Research Agent(文献调研+论文写作+思路激发)

本文介绍了如何利用Research Agent(科研智能体)提升科研效率。Research Agent能自主完成文献检索、信息整合和报告生成全流程,省去50%以上的基础工作时间。文章详细讲解了搭建运行环境的方法,包括工具准备和MetaGPT配置,并提供了两种实战方案:基础版Search-O1和专业版MetaGPT Research Agent。此外,还介绍了如何为垂直领域定制Agent,以及优化检索效果、改善报告逻辑等技巧。最后列举了学术研究、行业分析、内容创作和个人学习四大应用场景,帮助用户将AI从聊天工

LXY_LOVE36的博客 271

win10 跳过U8环境检测的IE WebControls.rar

win10 安装u8的时候 提示IE WebControls 不通过,这个工具可以欺骗u8的检查。 跳过U8环境检测的IE WebControls。提示导入失败后,重新检测通过。

TMS_WebGMaps_1.9.8.0_Full_Source

TMS_WebGMaps_1.9.8.0_Full_Source 全源码 delphi cbuilder

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

LinePhone3.2.7(android端最新版本) sip客户端

SIP客户端For android:LinePhone3.2.7(最新版本),官网地址:http://www.linphone.org/

上一篇: UVM初学篇 -(18)UVM sequence激励产生与交互执行机制(二)
下一篇: UVM实验教程-从平台、脚本到方法学全代码解析-王建利
Brent_Wang_
博客等级 码龄13年 309粉丝 27原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址