URL
https://opencores.org/ocsvn/ulpi_wrapper/ulpi_wrapper/trunk
[/] [ulpi_wrapper/] [trunk/] [testbench/] [ulpi_wrapper_tb.cpp] - Diff between revs 3 and 4
Show entire file |
Details |
Blame |
View Log
Rev 3 |
Rev 4 |
Line 43... |
Line 43... |
ulpi_rst_i.write(true);
|
ulpi_rst_i.write(true);
|
wait(5);
|
wait(5);
|
ulpi_rst_i.write(false);
|
ulpi_rst_i.write(false);
|
wait(1);
|
wait(1);
|
|
|
m_reg.write(ULPI_REG_SCRATCH, last_wr);
|
|
|
|
int cycles = 0;
|
int cycles = 0;
|
while (true)
|
while (true)
|
{
|
{
|
// Random delay
|
// Random delay
|
int wait_len = rand() % 10;
|
int wait_len = rand() % 10;
|
if (wait_len)
|
if (wait_len)
|
wait(wait_len);
|
wait(wait_len);
|
|
|
// Random register write
|
|
if (rand() & 1)
|
|
{
|
|
last_wr = rand();
|
|
m_reg.write(ULPI_REG_SCRATCH, last_wr);
|
|
}
|
|
// Random register read
|
|
else
|
|
{
|
|
sc_assert(m_reg.read(ULPI_REG_SCRATCH) == last_wr);
|
|
}
|
|
|
|
if (!(rand() % 32))
|
if (!(rand() % 32))
|
{
|
{
|
if (rand() & 1)
|
if (rand() & 1)
|
utmi_opmode_i.write(rand());
|
utmi_opmode_i.write(rand());
|
else
|
else
|
© copyright 1999-2025
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.