URL
https://opencores.org/ocsvn/gpio/gpio/trunk
Subversion Repositories gpio
Compare Revisions
- This comparison shows the changes necessary to convert path
/
- from Rev 17 to Rev 18
- ↔ Reverse comparison
Rev 17 → Rev 18
/trunk/bench/verilog/tb_defines.v
45,6 → 45,9
// CVS Revision History |
// |
// $Log: not supported by cvs2svn $ |
// Revision 1.2 2001/08/21 22:01:50 lampret |
// More intensive verification. |
// |
// Revision 1.1 2001/08/21 21:39:27 lampret |
// Changed directory structure, port names and drfines. |
// |
68,6 → 71,6
// means more loops of each subtest (e.g. for some subtests |
// 5 means 50 loops, for others 100 etc). Good numbers are from 1 |
// (very fast and very little verification) to 200 (slow but thorough). |
// Default is 20. |
// Default is 200. |
// |
`define GPIO_VERIF_INTENSITY 200 |
/trunk/bench/verilog/tb_tasks.v
44,6 → 44,9
// CVS Revision History |
// |
// $Log: not supported by cvs2svn $ |
// Revision 1.3 2001/09/18 16:37:55 lampret |
// Changed VCD output location. |
// |
// Revision 1.2 2001/09/18 15:43:27 lampret |
// Changed gpio top level into gpio_top. Changed defines.v into gpio_defines.v. |
// |
366,9 → 369,14
// |
task test_eclk; |
integer l1, l2, l3; |
integer r1, r2; |
integer r1, r2, r3; |
begin |
|
// Set external clock to low state |
tb_top.gpio_mon.set_gpioeclk(0); |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// |
// Phase 1 |
// |
383,7 → 391,8
setctrl(0); |
|
// Wait for time to advance |
#1000; |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Read GPIO_RGPIO_IN |
getin(l1); |
394,7 → 403,7
// GPIO uses external clock to latch gpio_in |
// |
|
// Set GPIO to use external clock |
// Set GPIO to use external clock, NEC bit cleared |
setctrl(1 << `GPIO_RGPIO_CTRL_ECLK); |
|
// Put something else on gpio_in pins |
401,27 → 410,41
random_gpio(r2); |
tb_top.gpio_mon.set_gpioin(r2); |
|
// Wait for time to advance |
#1000; |
// Make an external posedge clock pulse |
tb_top.gpio_mon.set_gpioeclk(0); |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
tb_top.gpio_mon.set_gpioeclk(1); |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Read GPIO_RGPIO_IN (should be the same as l1) |
// Read RGPIO_IN |
getin(l2); |
|
// Make an external clock |
tb_top.gpio_mon.set_gpioeclk(0); |
#10; |
tb_top.gpio_mon.set_gpioeclk(1); |
#10; |
// |
// Phase 3 |
// |
// Change GPIO inputs and WB clock but not external clock. |
// RGPIO_IN should not change. |
// |
|
// Read RGPIO_IN (should be different than l2) |
// Put something else on gpio_in pins |
random_gpio(r3); |
tb_top.gpio_mon.set_gpioin(r3); |
|
// Wait for WB clock |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Read RGPIO_IN |
getin(l3); |
|
// |
// Phase 3 |
// Phase 4 |
// |
// Compare phases |
// |
if (l1 == l2 && l2 == r1 && l3 == r2) |
if (l1 == r1 && l2 == r2 && l2 == l3) |
$write("."); |
else |
local_errs = local_errs + 1; |
433,7 → 456,7
// |
task test_nec; |
integer l1, l2; |
integer r2; |
integer r1, r2; |
begin |
// |
// Phase 1 |
441,35 → 464,50
// Compare RGPIO_IN before and after negative edge |
// |
|
// Clear GPIO_RGPIO_IN |
tb_top.gpio_mon.set_gpioin('d0); |
// Set external clock to low state |
tb_top.gpio_mon.set_gpioeclk(0); |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Set GPIO to use WB clock |
setctrl(0); |
|
// Advance time |
#1000; |
|
// Set GPIO to use external clock and set RGPIO_CTRL[NEC] |
setctrl(1 << `GPIO_RGPIO_CTRL_ECLK | 1 << `GPIO_RGPIO_CTRL_NEC); |
|
// Put random on gpio inputs |
random_gpio(r1); |
tb_top.gpio_mon.set_gpioin(r1); |
|
// Advance time by making an external negedge clock pulse |
tb_top.gpio_mon.set_gpioeclk(1); |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
tb_top.gpio_mon.set_gpioeclk(0); |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Put something on gpio_in pins |
random_gpio(r2); |
tb_top.gpio_mon.set_gpioin(r2); |
|
// Wait for time to advance |
#1000; |
// Make an external posedge clock pulse |
tb_top.gpio_mon.set_gpioeclk(0); |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
tb_top.gpio_mon.set_gpioeclk(1); |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Read RGPIO_IN |
// Read RGPIO_IN (should be the same as r1) |
getin(l1); |
|
// Make an external clock |
// Make an external negedge clock pulse |
tb_top.gpio_mon.set_gpioeclk(1); |
#10; |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
tb_top.gpio_mon.set_gpioeclk(0); |
#10; |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Read RGPIO_IN (should be different than l1) |
// Read RGPIO_IN (should be the same as r2) |
getin(l2); |
|
// |
477,7 → 515,8
// |
// Compare phases |
// |
if (!l1 && l2 == r2) |
// $display("l1 %h l2 %h r1 %h r2 %h", l1, l2, r1, r2); |
if (l1 == r1 && l2 == r2) |
$write("."); |
else |
local_errs = local_errs + 1; |
509,7 → 548,8
tb_top.gpio_mon.set_gpioin(l1); |
|
// Advance time |
#1000; |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Read GPIO_RGPIO_IN |
getin(l2); |
543,7 → 583,8
setout(l1); |
|
// Advance time |
#1000; |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Read gpio_out |
tb_top.gpio_mon.get_gpioout(l2); |
577,7 → 618,8
setoe(l1); |
|
// Advance time |
#1000; |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Read gpio_oen |
tb_top.gpio_mon.get_gpiooen(l2); |
619,7 → 661,8
setout(l3); |
|
// Advance time |
#1000; |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Read gpio_out |
tb_top.gpio_mon.get_gpioout(l4); |
652,7 → 695,7
integer r1; |
begin |
|
$write(" Testing control bis RGPIO_CTRL[INTE] and RGPIO_CTRL[INT] ..."); |
$write(" Testing control bit RGPIO_CTRL[INTE] and RGPIO_CTRL[INT] ..."); |
|
// |
// Phase 1 |
680,7 → 723,8
setinte(r1); |
|
// Advance time |
#100; |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Sample interrupt request. Should be zero. |
l1 = tb_top.gpio_top.wb_inta_o; |
689,7 → 733,8
tb_top.gpio_mon.set_gpioin(0); |
|
// Advance time |
#100; |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Sample interrupt request. Should be one. |
l2 = tb_top.gpio_top.wb_inta_o; |
698,7 → 743,8
setctrl(0); |
|
// Advance time |
#100; |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Sample interrupt request. Should be zero. |
l3 = tb_top.gpio_top.wb_inta_o; |
760,7 → 806,8
setinte(r1); |
|
// Advance time |
#100; |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Sample interrupt request. Should be zero. |
l1 = tb_top.gpio_top.wb_inta_o; |
769,7 → 816,8
tb_top.gpio_mon.set_gpioin('hffffffff); |
|
// Advance time |
#100; |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Sample interrupt request. Should be one. |
l2 = tb_top.gpio_top.wb_inta_o; |
778,7 → 826,8
setctrl(0); |
|
// Advance time |
#100; |
@(posedge tb_top.clk); |
@(posedge tb_top.clk); |
|
// Sample interrupt request. Should be zero. |
l3 = tb_top.gpio_top.wb_inta_o; |