Guest
Hi,
I have an issue with how to model a module connected to a number of
similar interfaces. Can somebody tell me what I have misunderstood
about systemverilog. The problem apparently is the looping through the
10 interfaces, where the index has tro be constant according to VCS.
Any help in how to solve this is highly appreciated.
interface my_if;
bit req;
bit gnt;
endinterface // my_if
module arbiter(clients);
my_if clients[0:9];
always begin
int winner=0;
for (int p=0; p<10; p++) begin
if (clients[p].req) winner=p;
end
for (int p=0; p<10; p++) clients[p].gnt=(winner==p);
end
endmodule // arbiter
module top;
my_if all_ifs[0:9]();
always begin
for (int p=0; p<10; p++) all_ifs[p].req=(p==4);
end
arbiter my_arb(all_ifs);
endmodule // top
I have an issue with how to model a module connected to a number of
similar interfaces. Can somebody tell me what I have misunderstood
about systemverilog. The problem apparently is the looping through the
10 interfaces, where the index has tro be constant according to VCS.
Any help in how to solve this is highly appreciated.
interface my_if;
bit req;
bit gnt;
endinterface // my_if
module arbiter(clients);
my_if clients[0:9];
always begin
int winner=0;
for (int p=0; p<10; p++) begin
if (clients[p].req) winner=p;
end
for (int p=0; p<10; p++) clients[p].gnt=(winner==p);
end
endmodule // arbiter
module top;
my_if all_ifs[0:9]();
always begin
for (int p=0; p<10; p++) all_ifs[p].req=(p==4);
end
arbiter my_arb(all_ifs);
endmodule // top