2016-10-21 11 views
-1

VCS 신시사이저에서이 오류가 발생합니다. 나는 모든 것을 시도했지만 그것은 나에게 이해가 가지 않는다. VectorY [0], VectorY [1], VectorY [2], VectorY [3] 또는 직접 연결된 네트가 하나 이상의 소스에 의해 구동되고 적어도 하나의 소스가 상수 넷이라는 것을 이라고합니다. (ELAB-368)넷 'VectorY [0]'또는 직접 연결된 넷은 둘 이상의 소스에 의해 구동되며, 적어도 하나의 소스는 상수 넷입니다. (ELAB-368)

module control (clk, start, S1S2mux, newDist, CompStart, PEready, VectorX, VectorY, addressR, addressS1, addressS2,completed); 

    input clk; 
    input start; 
    output reg [15:0] S1S2mux; 
    output reg [15:0] newDist; 
    output CompStart; 
    output reg [15:0] PEready; 
    output reg [3:0] VectorX,VectorY; 
    output reg [7:0] AddressR; 
    output reg [9:0] AddressS1,AddressS2; 
    reg [12:0] count; 
    output reg completed; 
    integer i; 

    assign CompStart = start; 

    always @(posedge clk) begin 
     if(start==0) begin 
      count<= 12'b0; 
      completed<=0; 
      newDist<=0; 
      PEready<=0; 
      VectorX<=0; 
      VectorY<=0; 
     end 
     else if (completed==0) 
      count <= count+1'b1; 
    end 

    always @(count) begin 
     for (i = 0; i < 15; i = i+1) 
     begin 
      newDist [i] = (count [7:0] == i); 
      PEready [i] = (newDist [i] && !(count < 8'd256)); 
      S1S2mux [i] = (count [3:0] > i); 
     end 
     addressR = count [7:0]; 
     addressS1 = (count[11:8] + count[7:4] >> 4)*5'd32 + count [3:0]; 
     addressS2 = (count[11:8] + count[7:4] >> 4)*4'd16 + count [3:0]; 
     VectorX = count[3:0] - 4'd7; 
     VectorY = count[11:8] >> 4 - 4'd7; 
     completed = (count == 4'd16 * (8'd256 + 1)); 
    end 
endmodule 
+1

두 개 이상의 always 블록에서 동일한 변수 (예 : VectorY)에 할당하지 않아야합니다. – toolic

답변

0

당신은 아마 이런 식으로 할 수있는 ... SystemVerilog를

에서이

logic [3:0] VectorY_next; 

후 순차적 블록에, 할 변수 다른 논리를 만들 ..

always_ff begin 
     if(start==0) begin 
      count<= 12'b0; 
      completed<=0; 
      newDist<=0; 
      PEready<=0; 
      VectorX<=0; 
      VectorY<=0; 
     end 
     else if (completed==0) begin 
      count <= count+1'b1; 
      VectorY <= VectorY_next; 
     end 
end 

조합 블록에서 다음을 쓸 수 있습니다.

always_comb begin 
     VectorY_next = VectorY; 
     for (i = 0; i < 15; i = i+1) 
     begin 
      ..... 
     VectorY_next = count[11:8] >> 4 - 4'd7; 
     completed = (count == 4'd16 * (8'd256 + 1)); 
    end 
endmodule 

아마 다른 포트에서도 마찬가지입니다. systemverilog를 사용하여 실행하려면 명령 줄에서 -sv 옵션을 사용하십시오.