//top.v
module top(
input clk,
input reset,
output reg [7:0] bar,
output wire aux_out
);
reg sprobe_me1;
reg sprobe_me2;
always @(posedge clk) begin
if(reset) begin
sprobe_me1 <= 1'b0;
sprobe_me2 <= 1'b0;
end else begin
sprobe_me1 <= bar[1] & bar[2];
sprobe_me2 <= bar[7] ^ bar[5];
end
end
always @(posedge clk) begin
if(reset) begin
bar <= 8'b00000000;
end else begin
bar <= bar + 1'b1;
end
end
wire sub_aux;
sub sub_inst(.clk(clk), .reset(reset), .i1(bar[4]), .i2(bar[3]), .aux_out(sub_aux));
assign aux_out = (sprobe_me1 | sprobe_me2) ^ (!sub_aux);
endmodule
module sub(
input clk,
input reset,
input i1, i2,
output wire aux_out,
output wire sp1,
output wire sp2
);
reg sprobe_me1;
reg sprobe_me2;
always @(posedge clk) begin
if(reset) begin
sprobe_me1 <= 1'b1;
sprobe_me2 <= 1'b0;
end else begin
sprobe_me1 <= i1 | i2;
sprobe_me2 <= i1 ^ i2;
end
end
assign aux_out = sprobe_me1 & sprobe_me2;
assign sp1 = sprobe_me1;
assign sp2 = sprobe_me2;
endmodule |