【发布时间】:2015-08-05 00:40:38
【问题描述】:
我正在尝试编写可重复使用的模块,但遇到了问题。代码如下:
35 always @(BTN) begin
36 case (BTN)
37 4'b0001:
38 begin
39 digit1 <= digit1 + 1;
40 sevensegcase digi1 ( // the module i'm trying to reuse
41 .SEG_SEL_IN(n2B0[1:0], // n2B0 is a defined constant
42 .BIN_IN(digit1[3:0]),
43 .DOT_IN(n1B1), // another constant
44 .SEG_SEL_OUT(AN[3:0]), // Send digit selection to the anodes
45 .HEX_OUT(A_TO_G[7:0])); // Select appropriate segments
46 end
......
......
......
当我保存模块时,它编译时出现错误。
当我合成我得到的模块时:
ERROR:HDLCompliers:26 - "Seven_Seg.v" line 40 unexpected token 'sevensegcase'
如果我将实例化放在 always 块之外,我会得到同样的错误。
【问题讨论】:
标签: verilog