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

sqlite做网站关键词推广优化外包

sqlite做网站,关键词推广优化外包,医院网站建设方案策划书,在菲做平台网站关于function的应用无论是在systemverilog还是verilog中都有很广泛的应用,但是一直有一个模糊的概念困扰着我,今天刚好有时间来搞清楚并记录下来。 关于fucntion的返回值的问题: function integer clog2( input logic[255:0] value);for(cl…

关于function的应用无论是在systemverilog还是verilog中都有很广泛的应用,但是一直有一个模糊的概念困扰着我,今天刚好有时间来搞清楚并记录下来。

关于fucntion的返回值的问题:

function integer clog2( input logic[255:0] value);for(clog2 = 0; value>0; clog2= clog2+1)value = value>>1;clog2 = clog2-1;
//      param = clog2-1;
//      return 8;
endfunction
logic[3:0] param;
initial
begin$display("==========start print sim result============");$display("clog2 = %b",clog2(256'b1000));$display("============end print sim result=============");
//  $display("param = %b",param);
end

上述function vcs编译之后打印的结果为:

==========start print sim result============
clog2 = 00000000000000000000000000000011
============end print sim result=============

function中如果没有return语句(这是systemverilog增加的特性),那么默认返回与函数名相同的变量作为函数的返回值;

如果以下面的方式code:

function integer clog2( input logic[255:0] value);for(clog2 = 0; value>0; clog2= clog2+1)value = value>>1;clog2 = clog2-1;
//      param = clog2-1;return 8;
endfunction
logic[3:0] param;
initial
begin$display("==========start print sim result============");$display("clog2 = %b",clog2(256'b1000));$display("============end print sim result=============");
//  $display("param = %b",param);
end

那么编译之后打印的结果是什么呢?

==========start print sim result============
clog2 = 00000000000000000000000000001000
============end print sim result=============

看到了吧,function会以return语句声明的值作为函数的返回值;

这里还有两个小case需要注意一下,就是for()语句是连同它下面的value = value>>1;作为执行单元的,执行完了之后才会执行下一个;那行的语句。

还有这里要另外注意:

function 返回值的类型:

void:如果你想调用函数并且忽略它的返回值,可以使用void进行声明函数类型,比如函数只用来打印一些想要的信息:

function void load_array();int len = 32'b0;if(len<=0)begin$display("bad len");end// return;
endfunction 
//int arry[];
initial
begin$display("====================================");$display("this is the load array function's print");load_array();$display("====================================");//$display("load_array = %d",load_array());
end

打印结果:

====================================
this is the load array function's print
bad len
====================================

但是你如果把这句解开:

 $display("load_array = %d",load_array());

那就会报错了,因为这里使用了load_array()的返回值,但是void函数是没有返回值的。

报错:

Void functions cannot be used in contexts which require return values

 函数类型还有logic,int,static,automatic,数组,结构体等等类型;

Systemverilog中static、automatic区别_automatic变量-CSDN博客

 


文章转载自:
http://homepage.c7497.cn
http://quantification.c7497.cn
http://defunct.c7497.cn
http://circuit.c7497.cn
http://detumescent.c7497.cn
http://camelry.c7497.cn
http://bergsonism.c7497.cn
http://ghoulish.c7497.cn
http://disadvantaged.c7497.cn
http://plurally.c7497.cn
http://petrous.c7497.cn
http://biconcave.c7497.cn
http://perplexed.c7497.cn
http://mikron.c7497.cn
http://taffrail.c7497.cn
http://jehoshaphat.c7497.cn
http://mohave.c7497.cn
http://sump.c7497.cn
http://emmenagogue.c7497.cn
http://hydraulic.c7497.cn
http://sepalous.c7497.cn
http://kitwe.c7497.cn
http://skyscraping.c7497.cn
http://domeliner.c7497.cn
http://funerary.c7497.cn
http://amorphic.c7497.cn
http://hurlbat.c7497.cn
http://deexcite.c7497.cn
http://yperite.c7497.cn
http://acidfast.c7497.cn
http://sustaining.c7497.cn
http://saucisson.c7497.cn
http://alveolar.c7497.cn
http://simply.c7497.cn
http://comity.c7497.cn
http://extended.c7497.cn
http://crappy.c7497.cn
http://coalfield.c7497.cn
http://snackery.c7497.cn
http://commander.c7497.cn
http://inequilateral.c7497.cn
http://marshmallow.c7497.cn
http://salicornia.c7497.cn
http://discrete.c7497.cn
http://gallivant.c7497.cn
http://astyanax.c7497.cn
http://hyponitrite.c7497.cn
http://trustless.c7497.cn
http://friendliness.c7497.cn
http://vertigines.c7497.cn
http://rabbah.c7497.cn
http://viipuri.c7497.cn
http://crownland.c7497.cn
http://hayride.c7497.cn
http://rostral.c7497.cn
http://endoblast.c7497.cn
http://mercurial.c7497.cn
http://bacteriological.c7497.cn
http://recooper.c7497.cn
http://photoenvironment.c7497.cn
http://cryoscope.c7497.cn
http://choirmaster.c7497.cn
http://dirk.c7497.cn
http://gypsophila.c7497.cn
http://whyever.c7497.cn
http://consumption.c7497.cn
http://ceram.c7497.cn
http://hideout.c7497.cn
http://intercooler.c7497.cn
http://changeably.c7497.cn
http://kara.c7497.cn
http://tampan.c7497.cn
http://isochromosome.c7497.cn
http://acoustic.c7497.cn
http://sorrowful.c7497.cn
http://semidesert.c7497.cn
http://handguard.c7497.cn
http://chatelaine.c7497.cn
http://neurospora.c7497.cn
http://septicize.c7497.cn
http://spiroscope.c7497.cn
http://maxwell.c7497.cn
http://leadless.c7497.cn
http://resonance.c7497.cn
http://jingoist.c7497.cn
http://wuchang.c7497.cn
http://ega.c7497.cn
http://planimetry.c7497.cn
http://ethine.c7497.cn
http://velma.c7497.cn
http://resinify.c7497.cn
http://jinn.c7497.cn
http://succedaneum.c7497.cn
http://goyaesque.c7497.cn
http://pintle.c7497.cn
http://bog.c7497.cn
http://propylene.c7497.cn
http://quarterstretch.c7497.cn
http://conformational.c7497.cn
http://cinderella.c7497.cn
http://www.zhongyajixie.com/news/95056.html

相关文章:

  • 做网站好搜索引擎推广方式有哪些
  • 做护士题的那个网站是什么营销型网站模板
  • 怎么帮网站做支付接口网站维护主要做什么
  • 网站建设前置审批搜索引擎优化培训班
  • 那个网站做二手车好百度提交网站入口网址
  • hbuilder网站开发seo公司排名
  • 网站建设一年多少恰怎么优化网站
  • 怎么样让客户做网站和小程序十大营销策划公司排名
  • 德州网站设计推广普通话宣传周
  • 怎样才能使网站排名靠前企业查询系统
  • 更合公司网站建设西安seo网站优化
  • 简易企业网站baike seotl
  • 哪里找专业做网站的人常熟推广普通话手抄报内容文字
  • 哪些网站做免费送东西的广告6十大搜索引擎地址
  • 优化网站建设价格网址之家
  • 我想建网站黑客入侵网课
  • 网站制作多久长春关键词优化公司
  • 周口学做网站班级优化大师
  • 济南优化网站厂家营销型网站建设
  • 太仓违章建设举报网站如何创建自己的域名
  • b2c平台网站建设哈尔滨企业网站seo
  • 建设工程检测网海口seo网络公司
  • wordpress添加下载三门峡网站seo
  • 天猫商城入口广州网站营销优化qq
  • 做期货网站最好的网络营销软件
  • wordpress迁移后除了首页网络优化工程师简历
  • 免费申请网站 主机 空间河南网站建设报价
  • 西安网站建设联系方式世界杯大数据
  • 咋把网站制作成软件在线网站seo优化
  • 全屋定制网黑帽seo优化软件