还有其他方法可以在Verilog中初始化模块吗?
我是Verilog的新手。在我的预定义的处理器设计中,控制模块被定义为:
module control(in,regdest,alusrc,memtoreg,regwrite,memread,memwrite,branch,funct,branch_cont0,branch_cont1,branch_cont2,aluop0,aluop1,aluop2);
但是在处理器模块的后面,它是这样初始化的:
//Control unit
control cont(instruc[31:26],regdest,alusrc,memtoreg,regwrite,memread,memwrite,branch,
aluop1,aluop0);
前8个评估看起来正确,但是在分支参数之后,还有一些其他参数需要设置。
我的问题是:Verilog中还有其他模块的实现吗?因为此代码正常工作。我可以正确获得信号。(为了我的理解,控制模块初始化时需要15个参数。)
I am new to verilog. In my predefined processor design, control module is defined as:
module control(in,regdest,alusrc,memtoreg,regwrite,memread,memwrite,branch,funct,branch_cont0,branch_cont1,branch_cont2,aluop0,aluop1,aluop2);
but later in the processor module it is initialized like this:
//Control unit
control cont(instruc[31:26],regdest,alusrc,memtoreg,regwrite,memread,memwrite,branch,
aluop1,aluop0);
First 8 assigments seem correct but after branch parameter, there are some other parameters that need to be set.
My question is : is there any other implementation of modules in verilog? Because this code works correctly. I can get signals correctly.(For my understanding control module needs 15 parameters when it is initialized.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您的意思是实例化一个模块。
有两种实例化模块的方法。通过逐订单(您拥有的)和按名称连接。
如果启用了SystemVerilog,则端口名称和信号名称与您可以使用
.portName
(ex:.in(instruc [31:26])),.regdest,.alusrc
)。或。*
,将推断连接到匹配的端口和信号。I think you mean instantiate a module.
There are two ways to instantiate a module. By connect-by-order (which you have) and connect-by-name.
If you have SystemVerilog enabled then and the port name and signal name are the same you can use
.portname
(ex:.in(instruc[31:26]), .regdest, .alusrc
). Or.*
which will infer connections to matching ports and signal.