Hi:
I would like to ask two questions about the following code.
First, why does the line of code “way1” generate an error? (Variable input ports cannot be driven)
Second, what is the difference between “way2” and “way3”?
module my_module (
input logic in1,
input logic in2,
input logic clk,
output logic out
);
always @(posedge clk) begin
out <= in1 & in2;
end
endmodule
interface inta(input clk);
logic test;
endinterface
module top_module;
logic clk_s = 0;
my_module u_my_module();
inta u_inta(clk_s);
//assign u_my_module.in1 = u_inta.test; //way1
initial begin
force u_my_module.in1 = u_inta.test; //way2
force my_module.in1 = u_inta.test; //way3
end
endmodule
Thank you in advance.