码农知识堂 - 1000bd
  •   Python
  •   PHP
  •   JS/TS
  •   JAVA
  •   C/C++
  •   C#
  •   GO
  •   Kotlin
  •   Swift
  • Pass cfg from cmd to test


    Pass cfg from cmd to test

    • 1 Pass cfg from sh to case
    • 1.1 v a l u e value valueplusargs()`
    • 1.2 uvm_config_int::get()<--->uvm_set_config_int/string/

    The article’s purpose is to solve the flexity; you can pass cfg to test by cmd directly; this is convinent for you to control or constraint the case;
    Now,there are two common ways to do it;

    1 Pass cfg from sh to case

    1.1 v a l u e value valueplusargs()`

    In any compenent,you use the usage;

            function void base_test:build_phase();
                    super.build_phase(phase);
                    if(!$value$plusargs("mask_mode=%0d",mask_mode)) begin
                            `uvm_error("base_test","mask_mode is set to default");
                    end
            endfunction:build_phase
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
            #在末尾添加参数run_opt;
            -run_opt  +mask_mode=9
    
    • 1
    • 2

    1.2 uvm_config_int::get()<—>uvm_set_config_int/string/

    In any component,you should code in it; Principle: It will creats a diction,then put it in pool; you will use get it at any time;
    you can put the code anywhere;

            function void base_test:build_phase();
                    super.build_phase(phase);
                    if(!uvm_config_int::get(this,"","mask_mode",mask_mode)) begin
                            `uvm_error("base_test","mask_mode is set to default");
                    end
            endfunction:build_phase 
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    #末尾添加参数
    -run_opt  +uvm_set_config_int="uvm_test_top,mask_mode,12" &
    
    • 1
    • 2

    Note the difference between the two ways;
    Advantage: you can use it even under regression;

    # Add in the regression.txt
    TESTS += xx_test;+uvm_set_config_int="uvm_test_top,mask_mode,12"
    
    • 1
    • 2
  • 相关阅读:
    【Linux】基本的指令(三)
    Java项目——表白墙(前后端连接+数据库存储)
    Python 断言的使用
    Pro_07丨波动率因子3.0与斜率因子
    Redis:报错Creating Server TCP listening socket *:6379: bind: No error
    建构居住安全生态,鹿客科技2023秋季发布会圆满举办
    MySQL高级篇知识点——其它数据库日志
    Typescript 学习笔记(二)高级类型一
    中国电信天翼云进入4.0阶段,打造一朵无处不在的分布式云
    关于Facebook营销的十个常见问题,一次性讲清楚!
  • 原文地址:https://blog.csdn.net/li_kin/article/details/134317254
  • 最新文章
  • 【JVM】编译执行与解释执行的区别是什么?JVM 使用哪种方式?
    用 Hashids 优雅解决 C 端自增 ID 暴露问题
    V8引擎 精品漫游指南--Ignition篇(上) 指令 栈帧 槽位 调用约定 内存布局 基础内容
    LLVM Pass快速入门(四):代码插桩
    milkup:桌面端 markdown AI续写和即时渲染
    基于项目工程构建SBOM(软件物料清单)的研究
    鸿蒙应用开发UI基础第二节:鸿蒙应用程序框架核心解析与实操
    .NET 中如何快速实现 List 集合去重?
    扣子Coze实战:从0到1打造抖音+小红书热点监控智能体
    浅谈数据访问层
  • 热门文章
  • 十款代码表白小特效 一个比一个浪漫 赶紧收藏起来吧!!!
    奉劝各位学弟学妹们,该打造你的技术影响力了!
    五年了,我在 CSDN 的两个一百万。
    Java俄罗斯方块,老程序员花了一个周末,连接中学年代!
    面试官都震惊,你这网络基础可以啊!
    你真的会用百度吗?我不信 — 那些不为人知的搜索引擎语法
    心情不好的时候,用 Python 画棵樱花树送给自己吧
    通宵一晚做出来的一款类似CS的第一人称射击游戏Demo!原来做游戏也不是很难,连憨憨学妹都学会了!
    13 万字 C 语言从入门到精通保姆级教程2021 年版
    10行代码集2000张美女图,Python爬虫120例,再上征途
小工具 小游戏
Copyright © 2022 侵权请联系2656653265@qq.com    京ICP备2022015340号-1

京公网安备 11010502049817号