EITRA IPC Assignment
EITRA IPC Assignment
1. Write a logic that will wait for AWVALID to be asserted and remains
same until AWREADY asserts. Shout a protocol violation error if
AWREADY does not asserts in 20 clock cycles.
2. Write a logic to sample WDATA, WVALID and WLAST; Samples
AWVALID and AWADDR and send it to another component using
mailbox once address and data both are sampled.
3. As given below in figure, Two controllers are connected to same
memory.
Controller 1 Controller 2
Bounded
mailbox
Memory
Both are trying to access the memory at the same time. (Parallel
threads). Use a semaphore to regularized the memory operation
and allow only one controller at a time.
4. List the output of below code:
module fork_join_none();
initial begin
for (int i = 0;i < 5;i++) begin
fork
thread(i); // here thread is any subroutine ,which display the value of i.
join_none
end
wait fork;
end
Page 1 of 5
Here, thread is expected to be called with all indexes (0 to 4). Do
necessary changes in code to serve the purpose.
5. States the output of below code:
module top();
initial begin
fork
begin
// Extra logic
thread1();
end
begin
// Extra logic
thread2();
end
join_any
$display(“Anyone of the thread 1 or 2 is completed”);
fork
begin
// Extra logic
thread3();
end
begin
// Extra logic
thread4();
end
join_any
$display(“Anyone of the thread 3 or 4 is completed”);
disable fork;
$display(“Remaining thread should be killed from 3 and 4”);
#50;
end
task thread1();
#5;
$display(“thread 1 is completed”);
endtask
task thread2();
#35;
$display(“thread 2 is completed”);
endtask
task thread3();
#10;
$display(“thread 3 is completed”);
endtask
task thread4();
#20;
$display(“thread 4 is completed”);
endtask
endmodule
Page 2 of 5
Here, Expected that, Disable fork should not disable any of thead1
or thread2, it should run in background. Change your code to serve
the purpose.
6. Use disable label is prohibited in exercise 5 and serve the purpose.
7. States the output of below code:
class signal_monitor;
bit intr;
string type_name;
task run();
fork : l1
begin
wait(intr == 1);
$display("%0s : intrrupt is asserted", type_name);
end
begin
#10;
$error("%0s : intrrupt is not asserted in 10 time steps",type_name);
end
join
disable l1;
$display("%0s disable l1 is called",type_name);
endtask
endclass
module tb_top;
signal_monitor mon1, mon2;
initial begin
mon1 = new("mon1");
mon2 = new("mon2");
fork
begin
mon1.run();
end
begin
mon2.run();
end
join_none
#4;
mon1.intr = 1;
#100;
$finish;
end
endmodule
Page 3 of 5
8. States the output of following codes and list the difference:
A.
module tb_top;
event e;
initial begin
fork
begin // Process 1
#3;
->e;
$display("%0t, Event triggered",$time);
end
begin // Process 2
#2; @e;
$display("%0t, Wait event is unblocked",$time);
end
join
end
endmodule
B.
module tb_top;
event e;
initial begin
fork
begin // Process 1
#2;
->e;
$display("%0t, Event triggered",$time);
end
begin // Process 2
#2; wait(e.triggered);
$display("%0t, Wait event is unblocked",$time);
end
join
end
endmodule
C.
module tb_top;
event e;
initial begin
fork
begin // Process 1
#2;
->e;
$display("%0t, Event triggered",$time);
end
begin // Process 2
#2; @e;
$display("%0t, Wait event is unblocked",$time);
end
join
end
endmodule
Page 4 of 5
D.
module tb_top;
event e;
initial begin
fork
begin // Process 1
#1;
->e;
$display("%0t, Event triggered",$time);
end
begin // Process 2
#2; wait(e.triggered);
$display("%0t, Wait event is unblocked",$time);
end
join
end
endmodule
E.
module tb_top;
event e;
initial begin
fork
begin // Process 1
#1;
->e;
$display("%0t, Event triggered",$time);
end
begin // Process 2
#2; @e;
$display("%0t, Wait event is unblocked",$time);
end
join
end
endmodule
Page 5 of 5