verilog - 如何修复此错误“未知模块类型”?
问题描述
我的顶级模特:
module top (G1, Y1, R1, G2, Y2, R2, BT1, BT2, clk, rst);
input BT1, BT2, clk, rst;
output G1, Y1, R1, G2, Y2, R2;
wire En1, En2, En3, CNT_RES, FF_RES, TC_30, TC_5, GE_15, B1, B2, request;
Controll_Unit c1(G1, Y1, R1, G2, Y2, R2, CNT_RES, FF_RES, B1, B2, BT1, BT2, clk, rst, En1, En2, En3);
Counter t1(TC_30, TC_5, GE_15, CNT_RES, FF_RES, rst, clk);
dff_sr q1(GE_15, clk, request);
assign En1=TC_30||GE_15&&B1;
assign En2=TC_30||GE_15&&B2;
assign En3=TC_5;
assign request = BT1||BT2;
endmodule
我的 dff 模型:
module dff_sr(output GE_15 ,input clk, request);
reg GE_15;
always @(posedge clk)
begin
if(request)
GE_15<=1;
end
endmodule
为什么我的dff_sr
代码有这个未知错误?我想尽快解决这个问题。
解决方案
您混淆了 ANSI 和非 ANSI 模块端口声明。改变:
module dff_sr(output GE_15 ,input clk, request);
reg GE_15;
至:
module dff_sr(output reg GE_15 ,input clk, request);
这使用 ANSI 样式。我没有收到与您相同的错误,但我确实在 Cadence 上收到了此编译警告:
reg GE_15;
| xmvlog: *W,ILLPDX : Multiple declarations for a port not allowed
in module with ANSI list of port declarations (port 'GE_15') [12.3.4(IEEE-2001)].
请参阅 IEEE Std 1800-2017,第 23.2.2 节端口声明。
推荐阅读
- python - OpenCV - Python
- r - 循环遍历 Dataframe 中的列以在 R 中构建重复测量线性模型 lme
- android - Android:点击ListView FooterView上的EditText,使键盘开合,开合
- python - 如何在 Python for 循环中使用多个变量?
- c# - 序列化/反序列化设置和处理不断变化的模型
- r - 获取数据框中特定分类变量的计数
- javascript - 根据数组列表更改 div 背景颜色
- python - Python - 迭代和更改 Excel 工作簿中的所有“工作表名称”
- javascript - 我不断收到以下错误:“错误:找不到模块'./framer'”
- python - 我正在制作一个不和谐的机器人,但我不断收到此错误