在编译是老是报:Error (10028): Can't resolve multiple constant drivers for net "cout1" at div7.v(19) Error (10029): Constant driver at div7.v(33) Error: Can't elaborate top-level user hierarchy Error: Quartus II Analysis & Synthesis was unsuccessful. 3 errors, 4 warnings Error: Processing ended: Sun Apr 12 22:54:01 2009 Error: Elapsed time: 00:00:00 我是新手问一下,我定义的不是常量啊!!
module div7(clkin,reset,clkout); input clkin,reset; output clkout; reg[2:0] m,n; reg cout1,cout2; assign clkout=cout1|cout2; always @(posedge clkin) begin if(!reset) begin cout1<=0; m<=0; end else if(reset) begin if(m==6) begin m<=0;end else m<=m+1; if(m==2) cout1=~cout1; else if(m==5) cout1=~cout1; end end always @(negedge clkin) begin if(!reset) begin cout2<=0; n<=0; end else if(reset) begin if(n==6) begin n<=0;end else n<=n+1; if(n==2) cout1=~cout1; else if(n==5) cout1=~cout1; end end endmodule |