core-v-verif系列之lib<53>

UVM环境介绍
HEAD commitID: 1f968ef

// Copyright 2020 OpenHW Group
// Copyright 2020 Datum Technology Corporation
// Copyright 2020 Silicon Labs, Inc.
//
// Licensed under the Solderpad Hardware Licence, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://solderpad.org/licenses/
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


`ifndef __UVMA_FENCEI_CNTXT_SV__
`define __UVMA_FENCEI_CNTXT_SV__

/**
 * Object encapsulating all state variables for all Fencei agent
 * (uvma_fencei_agent_c) components.
 */
class uvma_fencei_cntxt_c extends uvm_object;

   // Handle to fetch interface
   virtual uvma_fencei_if  fencei_vif;

   // Events
   uvm_event sample_cfg_e;
   uvm_event sample_cntxt_e;

   // Integrals
   uvma_fencei_reset_state_enum  reset_state        = UVMA_FENCEI_RESET_STATE_PRE_RESET;

   `uvm_object_utils_begin(uvma_fencei_cntxt_c)
      `uvm_field_enum(uvma_fencei_reset_state_enum, reset_state, UVM_DEFAULT)
      `uvm_field_event(                             sample_cfg_e  , UVM_DEFAULT)
      `uvm_field_event(                             sample_cntxt_e, UVM_DEFAULT)
   `uvm_object_utils_end

   /**
    * Builds events.
    */
   extern function new(string name="uvma_fencei_cntxt");

   /**
    * TODO Describe uvma_fencei_cntxt_c::reset()
    */
   extern function void reset();

endclass : uvma_fencei_cntxt_c


`pragma protect begin


function uvma_fencei_cntxt_c::new(string name="uvma_fencei_cntxt");

   super.new(name);

   sample_cfg_e   = new("sample_cfg_e"  );
   sample_cntxt_e = new("sample_cntxt_e");

endfunction : new

function void uvma_fencei_cntxt_c::reset();


endfunction : reset


`pragma protect end


`endif // __UVMA_FENCEI_CNTXT_SV__

lib/uvm_agents/uvma_fencei/uvma_fencei_cntxt.sv

1. 简要介绍

该文件是Fencei验证环境的上下文类实现,主要功能包括:

  1. 管理验证环境的运行时状态
  2. 存储虚拟接口句柄
  3. 提供事件通知机制
  4. 支持复位操作

2. 接口介绍

2.1 类定义
class uvma_fencei_cntxt_c extends uvm_object;
  • 代码介绍:定义上下文类,继承自UVM基础对象类
  • 功能:作为验证环境的运行时状态容器
2.2 虚拟接口
virtual uvma_fencei_if fencei_vif;
  • 代码介绍:定义虚拟接口句柄
  • 用途:连接DUT接口

3. 参数介绍

3.1 复位状态
uvma_fencei_reset_state_enum reset_state = UVMA_FENCEI_RESET_STATE_PRE_RESET;
  • 参数说明:存储当前复位状态
  • 初始值:预设为复位前状态
3.2 事件对象
uvm_event sample_cfg_e;
uvm_event sample_cntxt_e;
  • 参数说明:UVM事件对象
  • 用途
    • sample_cfg_e:配置采样事件
    • sample_cntxt_e:上下文采样事件

4. 模块实现介绍

4.1 构造函数
function uvma_fencei_cntxt_c::new(string name="uvma_fencei_cntxt");
   super.new(name);
   sample_cfg_e = new("sample_cfg_e");
   sample_cntxt_e = new("sample_cntxt_e");
endfunction
  • 代码分析
    1. 调用父类构造函数
    2. 初始化事件对象
  • 关键点:确保事件对象在构造时创建
4.2 复位函数
function void uvma_fencei_cntxt_c::reset();
   // TODO Implement reset logic
endfunction
  • 代码分析:预留复位功能实现
  • 设计特点:待扩展的复位逻辑

5. 总结

该上下文类具有以下特点:

  1. 完整的UVM标准实现
  2. 清晰的接口管理
  3. 灵活的事件机制
  4. 可扩展的设计架构

作为验证环境的核心组件,它为Fencei验证提供了必要的运行时状态管理能力,确保验证过程能够正确执行和监控。

//
// Copyright 2021 OpenHW Group
// Copyright 2021 Silicon Labs
// SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1
//
// Licensed under the Solderpad Hardware License v 2.1 (the "License"); you may
// not use this file except in compliance with the License, or, at your option,
// the Apache License version 2.0. You may obtain a copy of the License at
//
//     https://solderpad.org/licenses/SHL-2.1/
//
// Unless required by applicable law or agreed to in writing, any work
// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
// License for the specific language governing permissions and limitations
// under the License.
//


`ifndef __UVMA_FENCEI_DRV_SV__
`define __UVMA_FENCEI_DRV_SV__


/**
 * Component driving a Open Bus Interface virtual interface (uvma_obi_if).
 * @note The req & rsp's roles are switched when this driver is in 'slv' mode.
 * @todo Move implementation to a sequence-based approach
 */
class uvma_fencei_drv_c extends uvm_driver#(
   .REQ(uvma_fencei_seq_item_c),
   .RSP(uvma_fencei_seq_item_c      )
);

   // Objects
   uvma_fencei_cfg_c    cfg;
   uvma_fencei_cntxt_c  cntxt;

   `uvm_component_utils_begin(uvma_fencei_drv_c)
      `uvm_field_object(cfg  , UVM_DEFAULT)
      `uvm_field_object(cntxt, UVM_DEFAULT)
   `uvm_component_utils_end

   /**
    * Default constructor.
    */
   extern function new(string name="uvma_fencei_drv", uvm_component parent=null);

   /**
    * 1. Ensures cfg & cntxt handles are not null.
    * 2. Builds ap.
    */
   extern virtual function void build_phase(uvm_phase phase);

   /**
    * Oversees driving, depending on the reset state, by calling drv_<pre|in|post>_reset() tasks.
    */
   extern virtual task run_phase(uvm_phase phase);

   /**
    * Called by run_phase() while agent is in pre-reset state.
    */
   extern task drv_pre_reset();

   /**
    * Called by run_phase() while agent is in reset state.
    */
   extern task drv_in_reset();

   /**
    * Called by run_phase() while agent is in post-reset state.
    */
   extern task drv_post_reset();

   /**
    * Drives the 'flush_ack' signal in response to 'flush_req' being asserted.
    */
   extern task drv_slv_flush_ack();

endclass : uvma_fencei_drv_c


function uvma_fencei_drv_c::new(string name="uvma_fencei_drv", uvm_component parent=null
校园失物招领微信小程序源码, 失物招领小程序主要为解决大学生时常丢失物品而且很难找回以及归还过程繁琐不方便的问题, 与传统的失物招领方式不同,该款校园失误招领小程序拥有快捷发布寻物启事和失误找领功能, 快速查找、极速归还、高效沟通、防误领冒领等功能, 在开发校园失物招领小程序前与用户访谈发现有近40的同学校园内频繁丢失物品、证件、校园卡等, 数码产品、日用品等,丢失区域主要发生在教学楼、图书馆和食堂。 拾领校园失物招领小程序继承了寻物启事和失物招领,丢失物品或拾取物品都可发布帖子, 首页的横幅滚动公告展示通知公告等,banner图片化的方式更具有视觉吸引力, 最新信息可显示最近发布的招领信息或寻物信息,更加方便快捷的展示信息, 用户可通过首页的发布按钮发布帖子,发布者只需填写物品的相关信息,类别、地点等相关信息, 并且可以填写手机号开启认领验证,并可以一键生成二维码分享或分享至群聊和朋友圈。 列表内可以筛选物品类别或精确搜索,物品详情里可展示物品的相关信息, 确认是自己的物品后可点击认领,然后验证信息,需填写物品的关键信息以作辨认, 防止冒领误领,物品详情页可生成二维码海报分享,还有即时的消息联系功能以提高沟通效率, 发布者还可选择放置在代收处,双方还可以通过拨打电话紧急联系,用于紧急情况,让失物找到主人, 个人中心可以管理发布的物品帖子,管理个人信息,包括昵称、默认学校、手机号的修改、 编辑发布的物品帖子、获取帮助等。帮助用户流畅的使用该小程序。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值