Verilog 如何修复此错误“未知模块类型”?

Verilog 如何修复此错误“未知模块类型”?,verilog,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

我的顶级模特:

 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;
致:

这使用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标准1800-2017第23.2.2节端口声明

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)].