简体   繁体   中英

Verilog - Calling a module inside a case statement

我对Verilog不太熟悉,但是在case语句中可以调用另一个模块吗?

You cannot call a module just as you do in C language, since it's not a function, you instantiate it. If you want to instantiate a module, you should use generate .

Edit: An example of using generate with a case statement can be found here .

2nd edit: If you just wanted to call a section of code in a case-statement then you can create a task or a function . More information here . (credit goes to Hida )

您不能在case语句中调用模块,但是可以创建函数,然后再调用case语句(任务无法合成)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM