mirror of
https://github.com/YosysHQ/yosys
synced 2025-04-27 10:55:51 +00:00
initial import
This commit is contained in:
commit
7764d0ba1d
481 changed files with 54634 additions and 0 deletions
62
tests/asicworld/code_hdl_models_arbiter_tb.v
Normal file
62
tests/asicworld/code_hdl_models_arbiter_tb.v
Normal file
|
@ -0,0 +1,62 @@
|
|||
module testbench ();
|
||||
|
||||
reg clk;
|
||||
reg rst;
|
||||
reg req3;
|
||||
reg req2;
|
||||
reg req1;
|
||||
reg req0;
|
||||
wire gnt3;
|
||||
wire gnt2;
|
||||
wire gnt1;
|
||||
wire gnt0;
|
||||
|
||||
// Clock generator
|
||||
always #1 clk = ~clk;
|
||||
|
||||
initial begin
|
||||
$dumpfile ("arbiter.vcd");
|
||||
$dumpvars();
|
||||
clk = 0;
|
||||
rst = 1;
|
||||
req0 = 0;
|
||||
req1 = 0;
|
||||
req2 = 0;
|
||||
req3 = 0;
|
||||
#10 rst = 0;
|
||||
repeat (1) @ (posedge clk);
|
||||
req0 <= 1;
|
||||
repeat (1) @ (posedge clk);
|
||||
req0 <= 0;
|
||||
repeat (1) @ (posedge clk);
|
||||
req0 <= 1;
|
||||
req1 <= 1;
|
||||
repeat (1) @ (posedge clk);
|
||||
req2 <= 1;
|
||||
req1 <= 0;
|
||||
repeat (1) @ (posedge clk);
|
||||
req3 <= 1;
|
||||
req2 <= 0;
|
||||
repeat (1) @ (posedge clk);
|
||||
req3 <= 0;
|
||||
repeat (1) @ (posedge clk);
|
||||
req0 <= 0;
|
||||
repeat (1) @ (posedge clk);
|
||||
#10 $finish;
|
||||
end
|
||||
|
||||
// Connect the DUT
|
||||
arbiter U (
|
||||
clk,
|
||||
rst,
|
||||
req3,
|
||||
req2,
|
||||
req1,
|
||||
req0,
|
||||
gnt3,
|
||||
gnt2,
|
||||
gnt1,
|
||||
gnt0
|
||||
);
|
||||
|
||||
endmodule
|
Loading…
Add table
Add a link
Reference in a new issue