cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mbence76
Explorer
Explorer
502 Views
Registered: ‎01-18-2019

How to reset the DUT in the testbench code - to allow for independent tests in one go ?

Jump to solution

Hi,

I use Vitis HLS 2020.2  under Win10.

I would like to run multiple tests and reset the DUT (including static vars/arrays) between these tests. 

I understand that the IP-core will have an ap_rst input, but my top C++ function does not.

I have searched the Forum and the User Guides - without success so far.

There must be a way to reset the DUT code between individual tests in the testbench.

Thank you very much

Miklos

 

1 Solution

Accepted Solutions
dsakjl
Voyager
Voyager
400 Views
Registered: ‎07-20-2018

Hi @mbence76 ,

I think one way you can do that is by defining a global variable to reset your code, assert that when you want to reset the core and read it inside the HLS function only when "__SYNTHESIS__" is not defined. For example:

 

static int a = 0;
#ifndef __SYNTHESIS__
if (GLOB_RESET == 1)
    a = 0;
#endif

 

Regards.

View solution in original post

4 Replies
wave_rider
Visitor
Visitor
409 Views
Registered: ‎03-10-2021

I also wonder the same problem....

0 Kudos
dsakjl
Voyager
Voyager
401 Views
Registered: ‎07-20-2018

Hi @mbence76 ,

I think one way you can do that is by defining a global variable to reset your code, assert that when you want to reset the core and read it inside the HLS function only when "__SYNTHESIS__" is not defined. For example:

 

static int a = 0;
#ifndef __SYNTHESIS__
if (GLOB_RESET == 1)
    a = 0;
#endif

 

Regards.

View solution in original post

wave_rider
Visitor
Visitor
395 Views
Registered: ‎03-10-2021

that sounds like a good solution

thanks

0 Kudos
mbence76
Explorer
Explorer
393 Views
Registered: ‎01-18-2019

Good idea.  This way I will waste no HW resources.  Thank you.

0 Kudos