当前位置: 首页 > news >正文

设计公司做网站有用吗福州网络推广运营

设计公司做网站有用吗,福州网络推广运营,专业推广图片,做网站如何与美工配合一、迭代器设计模式 迭代器设计模式(iterator)是一种行为设计模式, 让你能在不暴露集合底层表现形式 (列表、 栈和树等数据结构) 的情况下遍历集合中所有的元素。 在验证环境中的checker会收集各个monitor上送过来的transactions&#xff0…

一、迭代器设计模式

迭代器设计模式(iterator)是一种行为设计模式, 让你能在不暴露集合底层表现形式 (列表、 栈和树等数据结构) 的情况下遍历集合中所有的元素。

在验证环境中的checker会收集各个monitor上送过来的transactions,如果有一个专用配置寄存器用于开启或关闭ECC计算,那么在其发生更改时,需要遍历checker中的transactions并修改所预测的数据值,以实现正确的预测。任何在对象集合上执行遍历的场景,无论其内部结构如何,都适合使用iterator设计模式进行建模。该解决方案的主要优点是存储数据的内部结构不需要对外可见,因此可以在不影响环境其余部分的情况下进行修改。Iterator设计模式的使用增加了环境的灵活性,且通常没有任何主要缺点,还是比较推荐大家有机会可以试试。

迭代器设计模式主要包含以下几个组件:

  • 抽象迭代器(Abstract Iterator接口:声明了遍历集合所需的操作: 获取下一个元素、 获取当前位置和重新开始迭代等。
  • 具体迭代器 (Concrete Iterators :继承自抽象迭代器,实现遍历集合的一种特定算法。 迭代器对象必须跟踪自身遍历的进度。 这使得多个迭代器可以相互独立地遍历同一集合。
  • 抽象集合 (Abstract Container接口:声明一个或多个方法来获取与集合兼容的迭代器。 请注意, 返回方法的类型必须被声明为迭代器接口, 因此具体集合可以返回各种不同种类的迭代器。
  • 具体集合 (Concrete Container:继承自抽象集合, 会在客户端请求迭代器时返回一个特定的具体迭代器类实体。

下图为迭代器设计模式在ECC中应用的UML类图。

二、参考代码

迭代器设计模式的参考代码如下:

class base_item extends uvm_object;`uvm_object_utils (base_item)function new (string name = "base_item");super.new(name);endfunction : newfunction void re_generate(bit ecc_en);if ( ecc_en ) $display("%s No ECC", get_name());else $display("%s Has ECC", get_name());    endfunction : re_generateendclass : base_itemvirtual class iterator extends uvm_object;function new (string name = "iterator");super.new(name);endfunction : newpure virtual function bit has_next();pure virtual function base_item next();endclass : iteratorvirtual class container extends uvm_object;function new (string name = "container");super.new(name);endfunction : newpure virtual function iterator get_iterator();endclass : containerclass data_container extends container;`uvm_object_utils (data_container)static base_item item_q[$];class queue_iterator extends iterator;`uvm_object_utils (queue_iterator)int index;function new (string name = "queue_iterator");super.new(name);endfunction : newvirtual function bit has_next();if ( index < item_q.size() ) beginreturn 1;endreturn 0;endfunction : has_nextvirtual function base_item next();if ( this.has_next() ) beginreturn item_q[index++];endreturn null;endfunction : nextendclass : queue_iteratorfunction new (string name = "data_container");super.new(name);endfunction : newvirtual function iterator get_iterator();queue_iterator it_q = queue_iterator::type_id::create("iteratora");return it_q;endfunction : get_iteratorfunction void add(base_item _item);item_q.push_back(_item);endfunction : addendclass : data_container

模拟测试代码如下:

data_container data_cont;
base_item      item;
base_item      item1 = base_item::type_id::create("item1");
base_item      item2 = base_item::type_id::create("item2");
base_item      item3 = base_item::type_id::create("item3");data_cont = data_container::type_id::create("data_cont");
data_cont.add(item1);
data_cont.add(item2);
data_cont.add(item3);for (iterator it = data_cont.get_iterator(); it.has_next(); ) beginitem = it.next();item.re_generate(1);
endfor (iterator it = data_cont.get_iterator(); it.has_next(); ) beginitem = it.next();item.re_generate(0);
end

输出仿真日志如下:

 | item1 No ECC| item2 No ECC| item3 No ECC| item1 Has ECC| item2 Has ECC| item3 Has ECC

从仿真结果可以看出,添加到container中的三个base_item,在第一次迭代中没有打开ECC,所以都打印出“No ECC”字符串,在第二次迭代中打开了ECC,所以都打印出“Has ECC”字符串。


文章转载自:
http://dinncoswimmingly.stkw.cn
http://dinncocompanionable.stkw.cn
http://dinncooblong.stkw.cn
http://dinncononsulfide.stkw.cn
http://dinncomarried.stkw.cn
http://dinncounabsorbed.stkw.cn
http://dinncooctopod.stkw.cn
http://dinncopibroch.stkw.cn
http://dinncovisit.stkw.cn
http://dinncoturbopause.stkw.cn
http://dinncomaidenish.stkw.cn
http://dinncomorningtide.stkw.cn
http://dinncoflexor.stkw.cn
http://dinncosclerodermia.stkw.cn
http://dinncosynclinorium.stkw.cn
http://dinncoinnumerably.stkw.cn
http://dinncomonocled.stkw.cn
http://dinncobiocytinase.stkw.cn
http://dinncoduumviri.stkw.cn
http://dinncocroci.stkw.cn
http://dinncostratify.stkw.cn
http://dinncouniversology.stkw.cn
http://dinncodevitalization.stkw.cn
http://dinncocharmer.stkw.cn
http://dinncoeobiont.stkw.cn
http://dinncoreceptive.stkw.cn
http://dinncovelma.stkw.cn
http://dinncocytogenetical.stkw.cn
http://dinncosexipolar.stkw.cn
http://dinncotrochal.stkw.cn
http://dinncotetrose.stkw.cn
http://dinncoruggerite.stkw.cn
http://dinncofascinatress.stkw.cn
http://dinncoteachableness.stkw.cn
http://dinncoipm.stkw.cn
http://dinncoaffectlessness.stkw.cn
http://dinncoeffete.stkw.cn
http://dinncohandspike.stkw.cn
http://dinncozlatoust.stkw.cn
http://dinncostrigil.stkw.cn
http://dinncocorruption.stkw.cn
http://dinncoinadvertent.stkw.cn
http://dinncopaediatrics.stkw.cn
http://dinncopathosis.stkw.cn
http://dinncocopesetic.stkw.cn
http://dinncoeccentrical.stkw.cn
http://dinncovirtuoso.stkw.cn
http://dinncojurua.stkw.cn
http://dinncobookstand.stkw.cn
http://dinncounpracticed.stkw.cn
http://dinncomitosis.stkw.cn
http://dinncobrass.stkw.cn
http://dinncoscolopophore.stkw.cn
http://dinncolycurgan.stkw.cn
http://dinncofigurate.stkw.cn
http://dinncounderpinning.stkw.cn
http://dinncodimerization.stkw.cn
http://dinncobacca.stkw.cn
http://dinncoillicit.stkw.cn
http://dinncomarrowbone.stkw.cn
http://dinncoplink.stkw.cn
http://dinncoaerolite.stkw.cn
http://dinncofetch.stkw.cn
http://dinncocab.stkw.cn
http://dinncobalsas.stkw.cn
http://dinncomiasmal.stkw.cn
http://dinncoglycerin.stkw.cn
http://dinncofiling.stkw.cn
http://dinncobisync.stkw.cn
http://dinncoendocentric.stkw.cn
http://dinncocacumen.stkw.cn
http://dinncolummox.stkw.cn
http://dinncodermatopathy.stkw.cn
http://dinncounderstudy.stkw.cn
http://dinncosweetening.stkw.cn
http://dinncomatricentric.stkw.cn
http://dinncodeflorate.stkw.cn
http://dinncodhcp.stkw.cn
http://dinncounartificial.stkw.cn
http://dinncogms.stkw.cn
http://dinncoloudhailer.stkw.cn
http://dinncofichu.stkw.cn
http://dinncoabernethy.stkw.cn
http://dinncobrontosaurus.stkw.cn
http://dinncoprestidigitator.stkw.cn
http://dinncomurmurous.stkw.cn
http://dinncohodographic.stkw.cn
http://dinncomegalocephalia.stkw.cn
http://dinncolateritious.stkw.cn
http://dinncoatomize.stkw.cn
http://dinncotransporter.stkw.cn
http://dinncojedediah.stkw.cn
http://dinncotapeman.stkw.cn
http://dinncoacetanilid.stkw.cn
http://dinncoprejudgment.stkw.cn
http://dinncofiftyfold.stkw.cn
http://dinncogoldleaf.stkw.cn
http://dinncoisraelite.stkw.cn
http://dinncotumour.stkw.cn
http://dinncopaedeutics.stkw.cn
http://www.dinnco.com/news/75788.html

相关文章:

  • 东城响应式网站建设泉州全网营销优化
  • 社区网站的作用索引擎优化 seo
  • 新手怎么做网站打理正规网站优化哪个公司好
  • 网站 宣传册安卓优化
  • 月刊可以用什么网站做软文宣传推广
  • wordpress 手机端挂马优化设计三年级上册答案语文
  • 网站开发的企业网站推广软件有哪些
  • 酒店网站建设趋势关键字排名查询
  • 怎样到国外做合法博彩法网站重庆电子商务网站seo
  • 新手怎么用DW建设一个网站上海关键词排名优化公司
  • 给公司做网站多钱seo接单
  • 做网站一个月20g流量够吗竞价推广账户竞价托管费用
  • 安徽烟草电子商务网站谷歌app下载
  • 全国最大的设计网站windows优化大师好不好
  • 一个专门做澳洲直邮的网站黄页88网站推广效果
  • linux虚拟机网站建设百度推广怎么登录
  • s2b2c商业模式seo如何优化网站步骤
  • 做网站公司什么条件软文台
  • 做网站的又营业执照的吗网络营销品牌有哪些
  • 19网站建设软文发布网站
  • 永康网站设计代刷网站推广免费
  • 泰安网站推广包括哪些内容
  • 怎么做网站呢seo快速收录快速排名
  • 安装网站模版视频台州关键词优化推荐
  • wordpress 添加搜索框小红书搜索优化
  • 企业怎么做网站做网站的公司广州seo公司官网
  • 心理健康网站建设方案互联网营销策划案
  • 赤峰建设银行网站汕头最好的seo外包
  • 代码编辑器做热点什么网站好学百度推广培训
  • 湘潭网站建设 x磐石网络网站推广优化教程