OpenCores
URL https://opencores.org/ocsvn/srdydrdy_lib/srdydrdy_lib/trunk

Subversion Repositories srdydrdy_lib

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /srdydrdy_lib/trunk/examples/bridge/env
    from Rev 12 to Rev 13
    Reverse comparison

Rev 12 → Rev 13

/tests/sample_test.v
0,0 → 1,29
module sample_test;
 
integer pcount;
`include "test_tasks.v"
initial
begin
wait (env_top.reset === 1'b0);
#200;
 
repeat (`FIB_ENTRIES)
@(posedge env_top.clk);
 
fork
env_top.driver0.send_packet (1, 2, 20);
env_top.driver1.send_packet (2, 3, 64);
env_top.driver2.send_packet (3, 4, 64);
env_top.driver3.send_packet (4, 1, 64);
join
 
#2000;
 
get_packet_count (pcount);
check_expected (9, pcount);
$display ("TEST: Received %d packets", pcount);
$finish;
end
endmodule // sample_test
/tests/overflow1.v
0,0 → 1,43
module sample_test;
 
integer pcount;
`include "test_tasks.v"
initial
begin
wait (env_top.reset === 1'b0);
#200;
 
repeat (`FIB_ENTRIES)
@(posedge env_top.clk);
 
fork
begin : drv0
repeat (600)
env_top.driver0.send_packet ($random, $random, 64);
end
 
begin : drv1
repeat (300)
env_top.driver1.send_packet ($random, $random, 128);
end
 
begin : drv2
repeat (450)
env_top.driver2.send_packet ($random, $random, 96);
end
begin : drv3
repeat (150)
env_top.driver3.send_packet ($random, $random, 256);
end
join
 
#10000;
 
get_packet_count (pcount);
check_expected (9, pcount);
$display ("TEST: Received %d packets", pcount);
$finish;
end
endmodule // sample_test
/run
1,11 → 1,14
#!/bin/bash
 
TESTNAME=$1
shift
 
which vcs &> /dev/null
if [ "$?" == "-1" ]; then
iverilog -f bridge.vf
iverilog -f bridge.vf tests/$TESTNAME.v $*
./a.out
else
vcs -full64 +v2k -R -I -f bridge.vf
vcs -full64 +v2k -R -I -f bridge.vf tests/$TESTNAME.v $*
#vcd2vpd env_top.vcd env_top.vpd
fi
 
/test_tasks.v
0,0 → 1,21
 
task get_packet_count;
output [31:0] pcount;
integer p;
begin
p = 0;
p = p + env_top.mon0.rxpkt_num;
p = p + env_top.mon1.rxpkt_num;
p = p + env_top.mon2.rxpkt_num;
p = p + env_top.mon3.rxpkt_num;
pcount = p;
end
endtask // get_packet_count
 
task check_expected;
input [31:0] exp_val, act_val;
begin
if (exp_val !== act_val)
$display ("%t: ERROR: Expected %x, Actual value %x", $time, exp_val, act_val);
end
endtask // check_expected
/env_top.v
21,22 → 21,9
reset = 1;
#200;
reset = 0;
#200;
end // initial begin
 
repeat (`FIB_ENTRIES)
@(posedge clk);
 
fork
driver0.send_packet (1, 2, 20);
driver1.send_packet (2, 3, 64);
driver2.send_packet (3, 4, 64);
driver3.send_packet (4, 1, 64);
join
 
#2000;
$finish;
end
 
/*AUTOWIRE*/
// Beginning of automatic wires (for undeclared instantiated-module outputs)
wire gmii_rx_clk_0; // From driver0 of gmii_driver.v

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.