Нет.Вы не можете иметь назначения для сети из нескольких блоков всегда.
Вот результат синтеза 2-х реализаций в Synopsys Design Compiler
НАЗНАЧЕНИЯ ИЗ НЕСКОЛЬКИХ ВСЕГДА БЛОКА.
module temp(clk, rst, x, y, op);
input logic clk, rst;
logic [1:0] count;
input logic x, y;
output logic [1:0] op;
assign op = count;
always @ (posedge clk) begin
if (x) begin
count <= count + 2'd1;
end
end
always @ (posedge clk) begin
if (y) begin
count <= count - 2'd2;
end
end
always @ (negedge clk) begin
if (x) begin
count <= count - 2'd1;
end
end
endmodule
// Synthesis Result of elaborate command -
Error: /afs/asu.edu/users/k/m/s/kmshah4/temp/a.sv:16: Net 'count[1]' or a directly connected net is driven by more than one source, and not all drivers are three-state. (ELAB-366)
Error: /afs/asu.edu/users/k/m/s/kmshah4/temp/a.sv:16: Net 'count[0]' or a directly connected net is driven by more than one source, and not all drivers are three-state. (ELAB-366)
НАЗНАЧЕНИЯ С ОДНОМ ВСЕГДА БЛОКОМ.
module temp(clk, rst, x, y, op);
input logic clk, rst;
logic [1:0] count;
input logic x, y;
output logic [1:0] op;
assign op = count;
always @ (clk)
begin
if (clk)
begin
case ({x, y})
2'b01 : count <= count - 2'd2;
2'b10 : count <= count + 2'd1;
default : count <= count;
endcase
end
else
begin
count <= (x) ? (count - 2'd1) : count;
end
end
endmodule
// Synthesis Result of elaborate command -
Elaborated 1 design.
Current design is now 'temp'.
1